{-# 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.UpdateUserPoolDomain
(
UpdateUserPoolDomain (..),
newUpdateUserPoolDomain,
updateUserPoolDomain_domain,
updateUserPoolDomain_userPoolId,
updateUserPoolDomain_customDomainConfig,
UpdateUserPoolDomainResponse (..),
newUpdateUserPoolDomainResponse,
updateUserPoolDomainResponse_cloudFrontDomain,
updateUserPoolDomainResponse_httpStatus,
)
where
import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateUserPoolDomain = UpdateUserPoolDomain'
{
UpdateUserPoolDomain -> Text
domain :: Prelude.Text,
UpdateUserPoolDomain -> Text
userPoolId :: Prelude.Text,
UpdateUserPoolDomain -> CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
}
deriving (UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
(UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool)
-> (UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool)
-> Eq UpdateUserPoolDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
$c/= :: UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
== :: UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
$c== :: UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
Prelude.Eq, ReadPrec [UpdateUserPoolDomain]
ReadPrec UpdateUserPoolDomain
Int -> ReadS UpdateUserPoolDomain
ReadS [UpdateUserPoolDomain]
(Int -> ReadS UpdateUserPoolDomain)
-> ReadS [UpdateUserPoolDomain]
-> ReadPrec UpdateUserPoolDomain
-> ReadPrec [UpdateUserPoolDomain]
-> Read UpdateUserPoolDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPoolDomain]
$creadListPrec :: ReadPrec [UpdateUserPoolDomain]
readPrec :: ReadPrec UpdateUserPoolDomain
$creadPrec :: ReadPrec UpdateUserPoolDomain
readList :: ReadS [UpdateUserPoolDomain]
$creadList :: ReadS [UpdateUserPoolDomain]
readsPrec :: Int -> ReadS UpdateUserPoolDomain
$creadsPrec :: Int -> ReadS UpdateUserPoolDomain
Prelude.Read, Int -> UpdateUserPoolDomain -> ShowS
[UpdateUserPoolDomain] -> ShowS
UpdateUserPoolDomain -> String
(Int -> UpdateUserPoolDomain -> ShowS)
-> (UpdateUserPoolDomain -> String)
-> ([UpdateUserPoolDomain] -> ShowS)
-> Show UpdateUserPoolDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPoolDomain] -> ShowS
$cshowList :: [UpdateUserPoolDomain] -> ShowS
show :: UpdateUserPoolDomain -> String
$cshow :: UpdateUserPoolDomain -> String
showsPrec :: Int -> UpdateUserPoolDomain -> ShowS
$cshowsPrec :: Int -> UpdateUserPoolDomain -> ShowS
Prelude.Show, (forall x. UpdateUserPoolDomain -> Rep UpdateUserPoolDomain x)
-> (forall x. Rep UpdateUserPoolDomain x -> UpdateUserPoolDomain)
-> Generic UpdateUserPoolDomain
forall x. Rep UpdateUserPoolDomain x -> UpdateUserPoolDomain
forall x. UpdateUserPoolDomain -> Rep UpdateUserPoolDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserPoolDomain x -> UpdateUserPoolDomain
$cfrom :: forall x. UpdateUserPoolDomain -> Rep UpdateUserPoolDomain x
Prelude.Generic)
newUpdateUserPoolDomain ::
Prelude.Text ->
Prelude.Text ->
CustomDomainConfigType ->
UpdateUserPoolDomain
newUpdateUserPoolDomain :: Text -> Text -> CustomDomainConfigType -> UpdateUserPoolDomain
newUpdateUserPoolDomain
Text
pDomain_
Text
pUserPoolId_
CustomDomainConfigType
pCustomDomainConfig_ =
UpdateUserPoolDomain' :: Text -> Text -> CustomDomainConfigType -> UpdateUserPoolDomain
UpdateUserPoolDomain'
{ $sel:domain:UpdateUserPoolDomain' :: Text
domain = Text
pDomain_,
$sel:userPoolId:UpdateUserPoolDomain' :: Text
userPoolId = Text
pUserPoolId_,
$sel:customDomainConfig:UpdateUserPoolDomain' :: CustomDomainConfigType
customDomainConfig = CustomDomainConfigType
pCustomDomainConfig_
}
updateUserPoolDomain_domain :: Lens.Lens' UpdateUserPoolDomain Prelude.Text
updateUserPoolDomain_domain :: (Text -> f Text) -> UpdateUserPoolDomain -> f UpdateUserPoolDomain
updateUserPoolDomain_domain = (UpdateUserPoolDomain -> Text)
-> (UpdateUserPoolDomain -> Text -> UpdateUserPoolDomain)
-> Lens UpdateUserPoolDomain UpdateUserPoolDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolDomain' {Text
domain :: Text
$sel:domain:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
domain} -> Text
domain) (\s :: UpdateUserPoolDomain
s@UpdateUserPoolDomain' {} Text
a -> UpdateUserPoolDomain
s {$sel:domain:UpdateUserPoolDomain' :: Text
domain = Text
a} :: UpdateUserPoolDomain)
updateUserPoolDomain_userPoolId :: Lens.Lens' UpdateUserPoolDomain Prelude.Text
updateUserPoolDomain_userPoolId :: (Text -> f Text) -> UpdateUserPoolDomain -> f UpdateUserPoolDomain
updateUserPoolDomain_userPoolId = (UpdateUserPoolDomain -> Text)
-> (UpdateUserPoolDomain -> Text -> UpdateUserPoolDomain)
-> Lens UpdateUserPoolDomain UpdateUserPoolDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolDomain' {Text
userPoolId :: Text
$sel:userPoolId:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
userPoolId} -> Text
userPoolId) (\s :: UpdateUserPoolDomain
s@UpdateUserPoolDomain' {} Text
a -> UpdateUserPoolDomain
s {$sel:userPoolId:UpdateUserPoolDomain' :: Text
userPoolId = Text
a} :: UpdateUserPoolDomain)
updateUserPoolDomain_customDomainConfig :: Lens.Lens' UpdateUserPoolDomain CustomDomainConfigType
updateUserPoolDomain_customDomainConfig :: (CustomDomainConfigType -> f CustomDomainConfigType)
-> UpdateUserPoolDomain -> f UpdateUserPoolDomain
updateUserPoolDomain_customDomainConfig = (UpdateUserPoolDomain -> CustomDomainConfigType)
-> (UpdateUserPoolDomain
-> CustomDomainConfigType -> UpdateUserPoolDomain)
-> Lens
UpdateUserPoolDomain
UpdateUserPoolDomain
CustomDomainConfigType
CustomDomainConfigType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolDomain' {CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
$sel:customDomainConfig:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> CustomDomainConfigType
customDomainConfig} -> CustomDomainConfigType
customDomainConfig) (\s :: UpdateUserPoolDomain
s@UpdateUserPoolDomain' {} CustomDomainConfigType
a -> UpdateUserPoolDomain
s {$sel:customDomainConfig:UpdateUserPoolDomain' :: CustomDomainConfigType
customDomainConfig = CustomDomainConfigType
a} :: UpdateUserPoolDomain)
instance Core.AWSRequest UpdateUserPoolDomain where
type
AWSResponse UpdateUserPoolDomain =
UpdateUserPoolDomainResponse
request :: UpdateUserPoolDomain -> Request UpdateUserPoolDomain
request = Service -> UpdateUserPoolDomain -> Request UpdateUserPoolDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserPoolDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateUserPoolDomain))
-> Logger
-> Service
-> Proxy UpdateUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserPoolDomain)))
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 Text -> Int -> UpdateUserPoolDomainResponse
UpdateUserPoolDomainResponse'
(Maybe Text -> Int -> UpdateUserPoolDomainResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateUserPoolDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CloudFrontDomain")
Either String (Int -> UpdateUserPoolDomainResponse)
-> Either String Int -> Either String UpdateUserPoolDomainResponse
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 UpdateUserPoolDomain
instance Prelude.NFData UpdateUserPoolDomain
instance Core.ToHeaders UpdateUserPoolDomain where
toHeaders :: UpdateUserPoolDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateUserPoolDomain -> 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
"AWSCognitoIdentityProviderService.UpdateUserPoolDomain" ::
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 UpdateUserPoolDomain where
toJSON :: UpdateUserPoolDomain -> Value
toJSON UpdateUserPoolDomain' {Text
CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
userPoolId :: Text
domain :: Text
$sel:customDomainConfig:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> CustomDomainConfigType
$sel:userPoolId:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
$sel:domain:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Domain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domain),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CustomDomainConfig" Text -> CustomDomainConfigType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CustomDomainConfigType
customDomainConfig)
]
)
instance Core.ToPath UpdateUserPoolDomain where
toPath :: UpdateUserPoolDomain -> ByteString
toPath = ByteString -> UpdateUserPoolDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateUserPoolDomain where
toQuery :: UpdateUserPoolDomain -> QueryString
toQuery = QueryString -> UpdateUserPoolDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateUserPoolDomainResponse = UpdateUserPoolDomainResponse'
{
UpdateUserPoolDomainResponse -> Maybe Text
cloudFrontDomain :: Prelude.Maybe Prelude.Text,
UpdateUserPoolDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool
(UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool)
-> (UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool)
-> Eq UpdateUserPoolDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool
$c/= :: UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool
== :: UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool
$c== :: UpdateUserPoolDomainResponse
-> UpdateUserPoolDomainResponse -> Bool
Prelude.Eq, ReadPrec [UpdateUserPoolDomainResponse]
ReadPrec UpdateUserPoolDomainResponse
Int -> ReadS UpdateUserPoolDomainResponse
ReadS [UpdateUserPoolDomainResponse]
(Int -> ReadS UpdateUserPoolDomainResponse)
-> ReadS [UpdateUserPoolDomainResponse]
-> ReadPrec UpdateUserPoolDomainResponse
-> ReadPrec [UpdateUserPoolDomainResponse]
-> Read UpdateUserPoolDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPoolDomainResponse]
$creadListPrec :: ReadPrec [UpdateUserPoolDomainResponse]
readPrec :: ReadPrec UpdateUserPoolDomainResponse
$creadPrec :: ReadPrec UpdateUserPoolDomainResponse
readList :: ReadS [UpdateUserPoolDomainResponse]
$creadList :: ReadS [UpdateUserPoolDomainResponse]
readsPrec :: Int -> ReadS UpdateUserPoolDomainResponse
$creadsPrec :: Int -> ReadS UpdateUserPoolDomainResponse
Prelude.Read, Int -> UpdateUserPoolDomainResponse -> ShowS
[UpdateUserPoolDomainResponse] -> ShowS
UpdateUserPoolDomainResponse -> String
(Int -> UpdateUserPoolDomainResponse -> ShowS)
-> (UpdateUserPoolDomainResponse -> String)
-> ([UpdateUserPoolDomainResponse] -> ShowS)
-> Show UpdateUserPoolDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPoolDomainResponse] -> ShowS
$cshowList :: [UpdateUserPoolDomainResponse] -> ShowS
show :: UpdateUserPoolDomainResponse -> String
$cshow :: UpdateUserPoolDomainResponse -> String
showsPrec :: Int -> UpdateUserPoolDomainResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserPoolDomainResponse -> ShowS
Prelude.Show, (forall x.
UpdateUserPoolDomainResponse -> Rep UpdateUserPoolDomainResponse x)
-> (forall x.
Rep UpdateUserPoolDomainResponse x -> UpdateUserPoolDomainResponse)
-> Generic UpdateUserPoolDomainResponse
forall x.
Rep UpdateUserPoolDomainResponse x -> UpdateUserPoolDomainResponse
forall x.
UpdateUserPoolDomainResponse -> Rep UpdateUserPoolDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserPoolDomainResponse x -> UpdateUserPoolDomainResponse
$cfrom :: forall x.
UpdateUserPoolDomainResponse -> Rep UpdateUserPoolDomainResponse x
Prelude.Generic)
newUpdateUserPoolDomainResponse ::
Prelude.Int ->
UpdateUserPoolDomainResponse
newUpdateUserPoolDomainResponse :: Int -> UpdateUserPoolDomainResponse
newUpdateUserPoolDomainResponse Int
pHttpStatus_ =
UpdateUserPoolDomainResponse' :: Maybe Text -> Int -> UpdateUserPoolDomainResponse
UpdateUserPoolDomainResponse'
{ $sel:cloudFrontDomain:UpdateUserPoolDomainResponse' :: Maybe Text
cloudFrontDomain =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateUserPoolDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateUserPoolDomainResponse_cloudFrontDomain :: Lens.Lens' UpdateUserPoolDomainResponse (Prelude.Maybe Prelude.Text)
updateUserPoolDomainResponse_cloudFrontDomain :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPoolDomainResponse -> f UpdateUserPoolDomainResponse
updateUserPoolDomainResponse_cloudFrontDomain = (UpdateUserPoolDomainResponse -> Maybe Text)
-> (UpdateUserPoolDomainResponse
-> Maybe Text -> UpdateUserPoolDomainResponse)
-> Lens
UpdateUserPoolDomainResponse
UpdateUserPoolDomainResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolDomainResponse' {Maybe Text
cloudFrontDomain :: Maybe Text
$sel:cloudFrontDomain:UpdateUserPoolDomainResponse' :: UpdateUserPoolDomainResponse -> Maybe Text
cloudFrontDomain} -> Maybe Text
cloudFrontDomain) (\s :: UpdateUserPoolDomainResponse
s@UpdateUserPoolDomainResponse' {} Maybe Text
a -> UpdateUserPoolDomainResponse
s {$sel:cloudFrontDomain:UpdateUserPoolDomainResponse' :: Maybe Text
cloudFrontDomain = Maybe Text
a} :: UpdateUserPoolDomainResponse)
updateUserPoolDomainResponse_httpStatus :: Lens.Lens' UpdateUserPoolDomainResponse Prelude.Int
updateUserPoolDomainResponse_httpStatus :: (Int -> f Int)
-> UpdateUserPoolDomainResponse -> f UpdateUserPoolDomainResponse
updateUserPoolDomainResponse_httpStatus = (UpdateUserPoolDomainResponse -> Int)
-> (UpdateUserPoolDomainResponse
-> Int -> UpdateUserPoolDomainResponse)
-> Lens
UpdateUserPoolDomainResponse UpdateUserPoolDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateUserPoolDomainResponse' :: UpdateUserPoolDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateUserPoolDomainResponse
s@UpdateUserPoolDomainResponse' {} Int
a -> UpdateUserPoolDomainResponse
s {$sel:httpStatus:UpdateUserPoolDomainResponse' :: Int
httpStatus = Int
a} :: UpdateUserPoolDomainResponse)
instance Prelude.NFData UpdateUserPoolDomainResponse