{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.OpsWorks.DescribeMyUserProfile
(
DescribeMyUserProfile (..),
newDescribeMyUserProfile,
DescribeMyUserProfileResponse (..),
newDescribeMyUserProfileResponse,
describeMyUserProfileResponse_userProfile,
describeMyUserProfileResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeMyUserProfile = DescribeMyUserProfile'
{
}
deriving (DescribeMyUserProfile -> DescribeMyUserProfile -> Bool
(DescribeMyUserProfile -> DescribeMyUserProfile -> Bool)
-> (DescribeMyUserProfile -> DescribeMyUserProfile -> Bool)
-> Eq DescribeMyUserProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMyUserProfile -> DescribeMyUserProfile -> Bool
$c/= :: DescribeMyUserProfile -> DescribeMyUserProfile -> Bool
== :: DescribeMyUserProfile -> DescribeMyUserProfile -> Bool
$c== :: DescribeMyUserProfile -> DescribeMyUserProfile -> Bool
Prelude.Eq, ReadPrec [DescribeMyUserProfile]
ReadPrec DescribeMyUserProfile
Int -> ReadS DescribeMyUserProfile
ReadS [DescribeMyUserProfile]
(Int -> ReadS DescribeMyUserProfile)
-> ReadS [DescribeMyUserProfile]
-> ReadPrec DescribeMyUserProfile
-> ReadPrec [DescribeMyUserProfile]
-> Read DescribeMyUserProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMyUserProfile]
$creadListPrec :: ReadPrec [DescribeMyUserProfile]
readPrec :: ReadPrec DescribeMyUserProfile
$creadPrec :: ReadPrec DescribeMyUserProfile
readList :: ReadS [DescribeMyUserProfile]
$creadList :: ReadS [DescribeMyUserProfile]
readsPrec :: Int -> ReadS DescribeMyUserProfile
$creadsPrec :: Int -> ReadS DescribeMyUserProfile
Prelude.Read, Int -> DescribeMyUserProfile -> ShowS
[DescribeMyUserProfile] -> ShowS
DescribeMyUserProfile -> String
(Int -> DescribeMyUserProfile -> ShowS)
-> (DescribeMyUserProfile -> String)
-> ([DescribeMyUserProfile] -> ShowS)
-> Show DescribeMyUserProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMyUserProfile] -> ShowS
$cshowList :: [DescribeMyUserProfile] -> ShowS
show :: DescribeMyUserProfile -> String
$cshow :: DescribeMyUserProfile -> String
showsPrec :: Int -> DescribeMyUserProfile -> ShowS
$cshowsPrec :: Int -> DescribeMyUserProfile -> ShowS
Prelude.Show, (forall x. DescribeMyUserProfile -> Rep DescribeMyUserProfile x)
-> (forall x. Rep DescribeMyUserProfile x -> DescribeMyUserProfile)
-> Generic DescribeMyUserProfile
forall x. Rep DescribeMyUserProfile x -> DescribeMyUserProfile
forall x. DescribeMyUserProfile -> Rep DescribeMyUserProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMyUserProfile x -> DescribeMyUserProfile
$cfrom :: forall x. DescribeMyUserProfile -> Rep DescribeMyUserProfile x
Prelude.Generic)
newDescribeMyUserProfile ::
DescribeMyUserProfile
newDescribeMyUserProfile :: DescribeMyUserProfile
newDescribeMyUserProfile = DescribeMyUserProfile
DescribeMyUserProfile'
instance Core.AWSRequest DescribeMyUserProfile where
type
AWSResponse DescribeMyUserProfile =
DescribeMyUserProfileResponse
request :: DescribeMyUserProfile -> Request DescribeMyUserProfile
request = Service -> DescribeMyUserProfile -> Request DescribeMyUserProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeMyUserProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeMyUserProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeMyUserProfile))
-> Logger
-> Service
-> Proxy DescribeMyUserProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeMyUserProfile)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SelfUserProfile -> Int -> DescribeMyUserProfileResponse
DescribeMyUserProfileResponse'
(Maybe SelfUserProfile -> Int -> DescribeMyUserProfileResponse)
-> Either String (Maybe SelfUserProfile)
-> Either String (Int -> DescribeMyUserProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe SelfUserProfile)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"UserProfile")
Either String (Int -> DescribeMyUserProfileResponse)
-> Either String Int -> Either String DescribeMyUserProfileResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeMyUserProfile
instance Prelude.NFData DescribeMyUserProfile
instance Core.ToHeaders DescribeMyUserProfile where
toHeaders :: DescribeMyUserProfile -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeMyUserProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OpsWorks_20130218.DescribeMyUserProfile" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeMyUserProfile where
toJSON :: DescribeMyUserProfile -> Value
toJSON = Value -> DescribeMyUserProfile -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeMyUserProfile where
toPath :: DescribeMyUserProfile -> ByteString
toPath = ByteString -> DescribeMyUserProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeMyUserProfile where
toQuery :: DescribeMyUserProfile -> QueryString
toQuery = QueryString -> DescribeMyUserProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeMyUserProfileResponse = DescribeMyUserProfileResponse'
{
DescribeMyUserProfileResponse -> Maybe SelfUserProfile
userProfile :: Prelude.Maybe SelfUserProfile,
DescribeMyUserProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool
(DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool)
-> (DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool)
-> Eq DescribeMyUserProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool
$c/= :: DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool
== :: DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool
$c== :: DescribeMyUserProfileResponse
-> DescribeMyUserProfileResponse -> Bool
Prelude.Eq, ReadPrec [DescribeMyUserProfileResponse]
ReadPrec DescribeMyUserProfileResponse
Int -> ReadS DescribeMyUserProfileResponse
ReadS [DescribeMyUserProfileResponse]
(Int -> ReadS DescribeMyUserProfileResponse)
-> ReadS [DescribeMyUserProfileResponse]
-> ReadPrec DescribeMyUserProfileResponse
-> ReadPrec [DescribeMyUserProfileResponse]
-> Read DescribeMyUserProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMyUserProfileResponse]
$creadListPrec :: ReadPrec [DescribeMyUserProfileResponse]
readPrec :: ReadPrec DescribeMyUserProfileResponse
$creadPrec :: ReadPrec DescribeMyUserProfileResponse
readList :: ReadS [DescribeMyUserProfileResponse]
$creadList :: ReadS [DescribeMyUserProfileResponse]
readsPrec :: Int -> ReadS DescribeMyUserProfileResponse
$creadsPrec :: Int -> ReadS DescribeMyUserProfileResponse
Prelude.Read, Int -> DescribeMyUserProfileResponse -> ShowS
[DescribeMyUserProfileResponse] -> ShowS
DescribeMyUserProfileResponse -> String
(Int -> DescribeMyUserProfileResponse -> ShowS)
-> (DescribeMyUserProfileResponse -> String)
-> ([DescribeMyUserProfileResponse] -> ShowS)
-> Show DescribeMyUserProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMyUserProfileResponse] -> ShowS
$cshowList :: [DescribeMyUserProfileResponse] -> ShowS
show :: DescribeMyUserProfileResponse -> String
$cshow :: DescribeMyUserProfileResponse -> String
showsPrec :: Int -> DescribeMyUserProfileResponse -> ShowS
$cshowsPrec :: Int -> DescribeMyUserProfileResponse -> ShowS
Prelude.Show, (forall x.
DescribeMyUserProfileResponse
-> Rep DescribeMyUserProfileResponse x)
-> (forall x.
Rep DescribeMyUserProfileResponse x
-> DescribeMyUserProfileResponse)
-> Generic DescribeMyUserProfileResponse
forall x.
Rep DescribeMyUserProfileResponse x
-> DescribeMyUserProfileResponse
forall x.
DescribeMyUserProfileResponse
-> Rep DescribeMyUserProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeMyUserProfileResponse x
-> DescribeMyUserProfileResponse
$cfrom :: forall x.
DescribeMyUserProfileResponse
-> Rep DescribeMyUserProfileResponse x
Prelude.Generic)
newDescribeMyUserProfileResponse ::
Prelude.Int ->
DescribeMyUserProfileResponse
newDescribeMyUserProfileResponse :: Int -> DescribeMyUserProfileResponse
newDescribeMyUserProfileResponse Int
pHttpStatus_ =
DescribeMyUserProfileResponse' :: Maybe SelfUserProfile -> Int -> DescribeMyUserProfileResponse
DescribeMyUserProfileResponse'
{ $sel:userProfile:DescribeMyUserProfileResponse' :: Maybe SelfUserProfile
userProfile =
Maybe SelfUserProfile
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeMyUserProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeMyUserProfileResponse_userProfile :: Lens.Lens' DescribeMyUserProfileResponse (Prelude.Maybe SelfUserProfile)
describeMyUserProfileResponse_userProfile :: (Maybe SelfUserProfile -> f (Maybe SelfUserProfile))
-> DescribeMyUserProfileResponse -> f DescribeMyUserProfileResponse
describeMyUserProfileResponse_userProfile = (DescribeMyUserProfileResponse -> Maybe SelfUserProfile)
-> (DescribeMyUserProfileResponse
-> Maybe SelfUserProfile -> DescribeMyUserProfileResponse)
-> Lens
DescribeMyUserProfileResponse
DescribeMyUserProfileResponse
(Maybe SelfUserProfile)
(Maybe SelfUserProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMyUserProfileResponse' {Maybe SelfUserProfile
userProfile :: Maybe SelfUserProfile
$sel:userProfile:DescribeMyUserProfileResponse' :: DescribeMyUserProfileResponse -> Maybe SelfUserProfile
userProfile} -> Maybe SelfUserProfile
userProfile) (\s :: DescribeMyUserProfileResponse
s@DescribeMyUserProfileResponse' {} Maybe SelfUserProfile
a -> DescribeMyUserProfileResponse
s {$sel:userProfile:DescribeMyUserProfileResponse' :: Maybe SelfUserProfile
userProfile = Maybe SelfUserProfile
a} :: DescribeMyUserProfileResponse)
describeMyUserProfileResponse_httpStatus :: Lens.Lens' DescribeMyUserProfileResponse Prelude.Int
describeMyUserProfileResponse_httpStatus :: (Int -> f Int)
-> DescribeMyUserProfileResponse -> f DescribeMyUserProfileResponse
describeMyUserProfileResponse_httpStatus = (DescribeMyUserProfileResponse -> Int)
-> (DescribeMyUserProfileResponse
-> Int -> DescribeMyUserProfileResponse)
-> Lens
DescribeMyUserProfileResponse DescribeMyUserProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMyUserProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeMyUserProfileResponse' :: DescribeMyUserProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeMyUserProfileResponse
s@DescribeMyUserProfileResponse' {} Int
a -> DescribeMyUserProfileResponse
s {$sel:httpStatus:DescribeMyUserProfileResponse' :: Int
httpStatus = Int
a} :: DescribeMyUserProfileResponse)
instance Prelude.NFData DescribeMyUserProfileResponse