{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CognitoIdentityProvider.UpdateUserPoolDomain
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the Secure Sockets Layer (SSL) certificate for the custom domain
-- for your user pool.
--
-- You can use this operation to provide the Amazon Resource Name (ARN) of
-- a new certificate to Amazon Cognito. You cannot use it to change the
-- domain for a user pool.
--
-- A custom domain is used to host the Amazon Cognito hosted UI, which
-- provides sign-up and sign-in pages for your application. When you set up
-- a custom domain, you provide a certificate that you manage with
-- Certificate Manager (ACM). When necessary, you can use this operation to
-- change the certificate that you applied to your custom domain.
--
-- Usually, this is unnecessary following routine certificate renewal with
-- ACM. When you renew your existing certificate in ACM, the ARN for your
-- certificate remains the same, and your custom domain uses the new
-- certificate automatically.
--
-- However, if you replace your existing certificate with a new one, ACM
-- gives the new certificate a new ARN. To apply the new certificate to
-- your custom domain, you must provide this ARN to Amazon Cognito.
--
-- When you add your new certificate in ACM, you must choose US East (N.
-- Virginia) as the Region.
--
-- After you submit your request, Amazon Cognito requires up to 1 hour to
-- distribute your new certificate to your custom domain.
--
-- For more information about adding a custom domain to your user pool, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html Using Your Own Domain for the Hosted UI>.
module Amazonka.CognitoIdentityProvider.UpdateUserPoolDomain
  ( -- * Creating a Request
    UpdateUserPoolDomain (..),
    newUpdateUserPoolDomain,

    -- * Request Lenses
    updateUserPoolDomain_domain,
    updateUserPoolDomain_userPoolId,
    updateUserPoolDomain_customDomainConfig,

    -- * Destructuring the Response
    UpdateUserPoolDomainResponse (..),
    newUpdateUserPoolDomainResponse,

    -- * Response Lenses
    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

-- | The UpdateUserPoolDomain request input.
--
-- /See:/ 'newUpdateUserPoolDomain' smart constructor.
data UpdateUserPoolDomain = UpdateUserPoolDomain'
  { -- | The domain name for the custom domain that hosts the sign-up and sign-in
    -- pages for your application. For example: @auth.example.com@.
    --
    -- This string can include only lowercase letters, numbers, and hyphens. Do
    -- not use a hyphen for the first or last character. Use periods to
    -- separate subdomain names.
    UpdateUserPoolDomain -> Text
domain :: Prelude.Text,
    -- | The ID of the user pool that is associated with the custom domain that
    -- you are updating the certificate for.
    UpdateUserPoolDomain -> Text
userPoolId :: Prelude.Text,
    -- | The configuration for a custom domain that hosts the sign-up and sign-in
    -- pages for your application. Use this object to specify an SSL
    -- certificate that is managed by ACM.
    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)

-- |
-- Create a value of 'UpdateUserPoolDomain' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'domain', 'updateUserPoolDomain_domain' - The domain name for the custom domain that hosts the sign-up and sign-in
-- pages for your application. For example: @auth.example.com@.
--
-- This string can include only lowercase letters, numbers, and hyphens. Do
-- not use a hyphen for the first or last character. Use periods to
-- separate subdomain names.
--
-- 'userPoolId', 'updateUserPoolDomain_userPoolId' - The ID of the user pool that is associated with the custom domain that
-- you are updating the certificate for.
--
-- 'customDomainConfig', 'updateUserPoolDomain_customDomainConfig' - The configuration for a custom domain that hosts the sign-up and sign-in
-- pages for your application. Use this object to specify an SSL
-- certificate that is managed by ACM.
newUpdateUserPoolDomain ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'customDomainConfig'
  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_
      }

-- | The domain name for the custom domain that hosts the sign-up and sign-in
-- pages for your application. For example: @auth.example.com@.
--
-- This string can include only lowercase letters, numbers, and hyphens. Do
-- not use a hyphen for the first or last character. Use periods to
-- separate subdomain names.
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)

-- | The ID of the user pool that is associated with the custom domain that
-- you are updating the certificate for.
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)

-- | The configuration for a custom domain that hosts the sign-up and sign-in
-- pages for your application. Use this object to specify an SSL
-- certificate that is managed by ACM.
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

-- | The UpdateUserPoolDomain response output.
--
-- /See:/ 'newUpdateUserPoolDomainResponse' smart constructor.
data UpdateUserPoolDomainResponse = UpdateUserPoolDomainResponse'
  { -- | The Amazon CloudFront endpoint that Amazon Cognito set up when you added
    -- the custom domain to your user pool.
    UpdateUserPoolDomainResponse -> Maybe Text
cloudFrontDomain :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'UpdateUserPoolDomainResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'cloudFrontDomain', 'updateUserPoolDomainResponse_cloudFrontDomain' - The Amazon CloudFront endpoint that Amazon Cognito set up when you added
-- the custom domain to your user pool.
--
-- 'httpStatus', 'updateUserPoolDomainResponse_httpStatus' - The response's http status code.
newUpdateUserPoolDomainResponse ::
  -- | 'httpStatus'
  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_
    }

-- | The Amazon CloudFront endpoint that Amazon Cognito set up when you added
-- the custom domain to your user pool.
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)

-- | The response's http status code.
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