{-# 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.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 UpdateUserPoolDomain = UpdateUserPoolDomain'
{
UpdateUserPoolDomain -> Text
domain :: Prelude.Text,
UpdateUserPoolDomain -> Text
userPoolId :: Prelude.Text,
UpdateUserPoolDomain -> CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
}
deriving (UpdateUserPoolDomain -> UpdateUserPoolDomain -> Bool
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]
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
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. 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'
{ $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 :: Lens' UpdateUserPoolDomain Text
updateUserPoolDomain_domain = 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 :: Lens' UpdateUserPoolDomain Text
updateUserPoolDomain_userPoolId = 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 :: Lens' UpdateUserPoolDomain CustomDomainConfigType
updateUserPoolDomain_customDomainConfig = 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 :: (Service -> Service)
-> UpdateUserPoolDomain -> Request UpdateUserPoolDomain
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 UpdateUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserPoolDomain)))
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 ->
Maybe Text -> Int -> UpdateUserPoolDomainResponse
UpdateUserPoolDomainResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CloudFrontDomain")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable UpdateUserPoolDomain where
hashWithSalt :: Int -> UpdateUserPoolDomain -> Int
hashWithSalt Int
_salt UpdateUserPoolDomain' {Text
CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
userPoolId :: Text
domain :: Text
$sel:customDomainConfig:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> CustomDomainConfigType
$sel:userPoolId:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
$sel:domain:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CustomDomainConfigType
customDomainConfig
instance Prelude.NFData UpdateUserPoolDomain where
rnf :: UpdateUserPoolDomain -> ()
rnf UpdateUserPoolDomain' {Text
CustomDomainConfigType
customDomainConfig :: CustomDomainConfigType
userPoolId :: Text
domain :: Text
$sel:customDomainConfig:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> CustomDomainConfigType
$sel:userPoolId:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
$sel:domain:UpdateUserPoolDomain' :: UpdateUserPoolDomain -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CustomDomainConfigType
customDomainConfig
instance Data.ToHeaders UpdateUserPoolDomain where
toHeaders :: UpdateUserPoolDomain -> 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.UpdateUserPoolDomain" ::
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 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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain),
forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId),
forall a. a -> Maybe a
Prelude.Just
(Key
"CustomDomainConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CustomDomainConfigType
customDomainConfig)
]
)
instance Data.ToPath UpdateUserPoolDomain where
toPath :: UpdateUserPoolDomain -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateUserPoolDomain where
toQuery :: UpdateUserPoolDomain -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:cloudFrontDomain:UpdateUserPoolDomainResponse' :: Maybe Text
cloudFrontDomain =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateUserPoolDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateUserPoolDomainResponse_cloudFrontDomain :: Lens.Lens' UpdateUserPoolDomainResponse (Prelude.Maybe Prelude.Text)
updateUserPoolDomainResponse_cloudFrontDomain :: Lens' UpdateUserPoolDomainResponse (Maybe Text)
updateUserPoolDomainResponse_cloudFrontDomain = 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 :: Lens' UpdateUserPoolDomainResponse Int
updateUserPoolDomainResponse_httpStatus = 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 where
rnf :: UpdateUserPoolDomainResponse -> ()
rnf UpdateUserPoolDomainResponse' {Int
Maybe Text
httpStatus :: Int
cloudFrontDomain :: Maybe Text
$sel:httpStatus:UpdateUserPoolDomainResponse' :: UpdateUserPoolDomainResponse -> Int
$sel:cloudFrontDomain:UpdateUserPoolDomainResponse' :: UpdateUserPoolDomainResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cloudFrontDomain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus