{-# 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.CognitoIdentityProvider.GetUICustomization
(
GetUICustomization (..),
newGetUICustomization,
getUICustomization_clientId,
getUICustomization_userPoolId,
GetUICustomizationResponse (..),
newGetUICustomizationResponse,
getUICustomizationResponse_httpStatus,
getUICustomizationResponse_uICustomization,
)
where
import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetUICustomization = GetUICustomization'
{
GetUICustomization -> Maybe (Sensitive Text)
clientId :: Prelude.Maybe (Data.Sensitive Prelude.Text),
GetUICustomization -> Text
userPoolId :: Prelude.Text
}
deriving (GetUICustomization -> GetUICustomization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUICustomization -> GetUICustomization -> Bool
$c/= :: GetUICustomization -> GetUICustomization -> Bool
== :: GetUICustomization -> GetUICustomization -> Bool
$c== :: GetUICustomization -> GetUICustomization -> Bool
Prelude.Eq, Int -> GetUICustomization -> ShowS
[GetUICustomization] -> ShowS
GetUICustomization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUICustomization] -> ShowS
$cshowList :: [GetUICustomization] -> ShowS
show :: GetUICustomization -> String
$cshow :: GetUICustomization -> String
showsPrec :: Int -> GetUICustomization -> ShowS
$cshowsPrec :: Int -> GetUICustomization -> ShowS
Prelude.Show, forall x. Rep GetUICustomization x -> GetUICustomization
forall x. GetUICustomization -> Rep GetUICustomization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUICustomization x -> GetUICustomization
$cfrom :: forall x. GetUICustomization -> Rep GetUICustomization x
Prelude.Generic)
newGetUICustomization ::
Prelude.Text ->
GetUICustomization
newGetUICustomization :: Text -> GetUICustomization
newGetUICustomization Text
pUserPoolId_ =
GetUICustomization'
{ $sel:clientId:GetUICustomization' :: Maybe (Sensitive Text)
clientId = forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:GetUICustomization' :: Text
userPoolId = Text
pUserPoolId_
}
getUICustomization_clientId :: Lens.Lens' GetUICustomization (Prelude.Maybe Prelude.Text)
getUICustomization_clientId :: Lens' GetUICustomization (Maybe Text)
getUICustomization_clientId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUICustomization' {Maybe (Sensitive Text)
clientId :: Maybe (Sensitive Text)
$sel:clientId:GetUICustomization' :: GetUICustomization -> Maybe (Sensitive Text)
clientId} -> Maybe (Sensitive Text)
clientId) (\s :: GetUICustomization
s@GetUICustomization' {} Maybe (Sensitive Text)
a -> GetUICustomization
s {$sel:clientId:GetUICustomization' :: Maybe (Sensitive Text)
clientId = Maybe (Sensitive Text)
a} :: GetUICustomization) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
getUICustomization_userPoolId :: Lens.Lens' GetUICustomization Prelude.Text
getUICustomization_userPoolId :: Lens' GetUICustomization Text
getUICustomization_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUICustomization' {Text
userPoolId :: Text
$sel:userPoolId:GetUICustomization' :: GetUICustomization -> Text
userPoolId} -> Text
userPoolId) (\s :: GetUICustomization
s@GetUICustomization' {} Text
a -> GetUICustomization
s {$sel:userPoolId:GetUICustomization' :: Text
userPoolId = Text
a} :: GetUICustomization)
instance Core.AWSRequest GetUICustomization where
type
AWSResponse GetUICustomization =
GetUICustomizationResponse
request :: (Service -> Service)
-> GetUICustomization -> Request GetUICustomization
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetUICustomization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetUICustomization)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> UICustomizationType -> GetUICustomizationResponse
GetUICustomizationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"UICustomization")
)
instance Prelude.Hashable GetUICustomization where
hashWithSalt :: Int -> GetUICustomization -> Int
hashWithSalt Int
_salt GetUICustomization' {Maybe (Sensitive Text)
Text
userPoolId :: Text
clientId :: Maybe (Sensitive Text)
$sel:userPoolId:GetUICustomization' :: GetUICustomization -> Text
$sel:clientId:GetUICustomization' :: GetUICustomization -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
clientId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
instance Prelude.NFData GetUICustomization where
rnf :: GetUICustomization -> ()
rnf GetUICustomization' {Maybe (Sensitive Text)
Text
userPoolId :: Text
clientId :: Maybe (Sensitive Text)
$sel:userPoolId:GetUICustomization' :: GetUICustomization -> Text
$sel:clientId:GetUICustomization' :: GetUICustomization -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
clientId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
instance Data.ToHeaders GetUICustomization where
toHeaders :: GetUICustomization -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSCognitoIdentityProviderService.GetUICustomization" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetUICustomization where
toJSON :: GetUICustomization -> Value
toJSON GetUICustomization' {Maybe (Sensitive Text)
Text
userPoolId :: Text
clientId :: Maybe (Sensitive Text)
$sel:userPoolId:GetUICustomization' :: GetUICustomization -> Text
$sel:clientId:GetUICustomization' :: GetUICustomization -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClientId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
clientId,
forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId)
]
)
instance Data.ToPath GetUICustomization where
toPath :: GetUICustomization -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetUICustomization where
toQuery :: GetUICustomization -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetUICustomizationResponse = GetUICustomizationResponse'
{
GetUICustomizationResponse -> Int
httpStatus :: Prelude.Int,
GetUICustomizationResponse -> UICustomizationType
uICustomization :: UICustomizationType
}
deriving (GetUICustomizationResponse -> GetUICustomizationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUICustomizationResponse -> GetUICustomizationResponse -> Bool
$c/= :: GetUICustomizationResponse -> GetUICustomizationResponse -> Bool
== :: GetUICustomizationResponse -> GetUICustomizationResponse -> Bool
$c== :: GetUICustomizationResponse -> GetUICustomizationResponse -> Bool
Prelude.Eq, Int -> GetUICustomizationResponse -> ShowS
[GetUICustomizationResponse] -> ShowS
GetUICustomizationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUICustomizationResponse] -> ShowS
$cshowList :: [GetUICustomizationResponse] -> ShowS
show :: GetUICustomizationResponse -> String
$cshow :: GetUICustomizationResponse -> String
showsPrec :: Int -> GetUICustomizationResponse -> ShowS
$cshowsPrec :: Int -> GetUICustomizationResponse -> ShowS
Prelude.Show, forall x.
Rep GetUICustomizationResponse x -> GetUICustomizationResponse
forall x.
GetUICustomizationResponse -> Rep GetUICustomizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUICustomizationResponse x -> GetUICustomizationResponse
$cfrom :: forall x.
GetUICustomizationResponse -> Rep GetUICustomizationResponse x
Prelude.Generic)
newGetUICustomizationResponse ::
Prelude.Int ->
UICustomizationType ->
GetUICustomizationResponse
newGetUICustomizationResponse :: Int -> UICustomizationType -> GetUICustomizationResponse
newGetUICustomizationResponse
Int
pHttpStatus_
UICustomizationType
pUICustomization_ =
GetUICustomizationResponse'
{ $sel:httpStatus:GetUICustomizationResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:uICustomization:GetUICustomizationResponse' :: UICustomizationType
uICustomization = UICustomizationType
pUICustomization_
}
getUICustomizationResponse_httpStatus :: Lens.Lens' GetUICustomizationResponse Prelude.Int
getUICustomizationResponse_httpStatus :: Lens' GetUICustomizationResponse Int
getUICustomizationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUICustomizationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetUICustomizationResponse' :: GetUICustomizationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetUICustomizationResponse
s@GetUICustomizationResponse' {} Int
a -> GetUICustomizationResponse
s {$sel:httpStatus:GetUICustomizationResponse' :: Int
httpStatus = Int
a} :: GetUICustomizationResponse)
getUICustomizationResponse_uICustomization :: Lens.Lens' GetUICustomizationResponse UICustomizationType
getUICustomizationResponse_uICustomization :: Lens' GetUICustomizationResponse UICustomizationType
getUICustomizationResponse_uICustomization = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUICustomizationResponse' {UICustomizationType
uICustomization :: UICustomizationType
$sel:uICustomization:GetUICustomizationResponse' :: GetUICustomizationResponse -> UICustomizationType
uICustomization} -> UICustomizationType
uICustomization) (\s :: GetUICustomizationResponse
s@GetUICustomizationResponse' {} UICustomizationType
a -> GetUICustomizationResponse
s {$sel:uICustomization:GetUICustomizationResponse' :: UICustomizationType
uICustomization = UICustomizationType
a} :: GetUICustomizationResponse)
instance Prelude.NFData GetUICustomizationResponse where
rnf :: GetUICustomizationResponse -> ()
rnf GetUICustomizationResponse' {Int
UICustomizationType
uICustomization :: UICustomizationType
httpStatus :: Int
$sel:uICustomization:GetUICustomizationResponse' :: GetUICustomizationResponse -> UICustomizationType
$sel:httpStatus:GetUICustomizationResponse' :: GetUICustomizationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UICustomizationType
uICustomization