{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.DomainDescriptionType
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CognitoIdentityProvider.Types.DomainDescriptionType where

import Amazonka.CognitoIdentityProvider.Types.CustomDomainConfigType
import Amazonka.CognitoIdentityProvider.Types.DomainStatusType
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

-- | A container for information about a domain.
--
-- /See:/ 'newDomainDescriptionType' smart constructor.
data DomainDescriptionType = DomainDescriptionType'
  { -- | The Amazon Web Services ID for the user pool owner.
    DomainDescriptionType -> Maybe Text
aWSAccountId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon CloudFront distribution.
    DomainDescriptionType -> Maybe Text
cloudFrontDistribution :: Prelude.Maybe Prelude.Text,
    -- | The configuration for a custom domain that hosts the sign-up and sign-in
    -- webpages for your application.
    DomainDescriptionType -> Maybe CustomDomainConfigType
customDomainConfig :: Prelude.Maybe CustomDomainConfigType,
    -- | The domain string. For custom domains, this is the fully-qualified
    -- domain name, such as @auth.example.com@. For Amazon Cognito prefix
    -- domains, this is the prefix alone, such as @auth@.
    DomainDescriptionType -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 bucket where the static files for this domain are stored.
    DomainDescriptionType -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The domain status.
    DomainDescriptionType -> Maybe DomainStatusType
status :: Prelude.Maybe DomainStatusType,
    -- | The user pool ID.
    DomainDescriptionType -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text,
    -- | The app version.
    DomainDescriptionType -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (DomainDescriptionType -> DomainDescriptionType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainDescriptionType -> DomainDescriptionType -> Bool
$c/= :: DomainDescriptionType -> DomainDescriptionType -> Bool
== :: DomainDescriptionType -> DomainDescriptionType -> Bool
$c== :: DomainDescriptionType -> DomainDescriptionType -> Bool
Prelude.Eq, ReadPrec [DomainDescriptionType]
ReadPrec DomainDescriptionType
Int -> ReadS DomainDescriptionType
ReadS [DomainDescriptionType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainDescriptionType]
$creadListPrec :: ReadPrec [DomainDescriptionType]
readPrec :: ReadPrec DomainDescriptionType
$creadPrec :: ReadPrec DomainDescriptionType
readList :: ReadS [DomainDescriptionType]
$creadList :: ReadS [DomainDescriptionType]
readsPrec :: Int -> ReadS DomainDescriptionType
$creadsPrec :: Int -> ReadS DomainDescriptionType
Prelude.Read, Int -> DomainDescriptionType -> ShowS
[DomainDescriptionType] -> ShowS
DomainDescriptionType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainDescriptionType] -> ShowS
$cshowList :: [DomainDescriptionType] -> ShowS
show :: DomainDescriptionType -> String
$cshow :: DomainDescriptionType -> String
showsPrec :: Int -> DomainDescriptionType -> ShowS
$cshowsPrec :: Int -> DomainDescriptionType -> ShowS
Prelude.Show, forall x. Rep DomainDescriptionType x -> DomainDescriptionType
forall x. DomainDescriptionType -> Rep DomainDescriptionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainDescriptionType x -> DomainDescriptionType
$cfrom :: forall x. DomainDescriptionType -> Rep DomainDescriptionType x
Prelude.Generic)

-- |
-- Create a value of 'DomainDescriptionType' 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:
--
-- 'aWSAccountId', 'domainDescriptionType_aWSAccountId' - The Amazon Web Services ID for the user pool owner.
--
-- 'cloudFrontDistribution', 'domainDescriptionType_cloudFrontDistribution' - The Amazon Resource Name (ARN) of the Amazon CloudFront distribution.
--
-- 'customDomainConfig', 'domainDescriptionType_customDomainConfig' - The configuration for a custom domain that hosts the sign-up and sign-in
-- webpages for your application.
--
-- 'domain', 'domainDescriptionType_domain' - The domain string. For custom domains, this is the fully-qualified
-- domain name, such as @auth.example.com@. For Amazon Cognito prefix
-- domains, this is the prefix alone, such as @auth@.
--
-- 's3Bucket', 'domainDescriptionType_s3Bucket' - The Amazon S3 bucket where the static files for this domain are stored.
--
-- 'status', 'domainDescriptionType_status' - The domain status.
--
-- 'userPoolId', 'domainDescriptionType_userPoolId' - The user pool ID.
--
-- 'version', 'domainDescriptionType_version' - The app version.
newDomainDescriptionType ::
  DomainDescriptionType
newDomainDescriptionType :: DomainDescriptionType
newDomainDescriptionType =
  DomainDescriptionType'
    { $sel:aWSAccountId:DomainDescriptionType' :: Maybe Text
aWSAccountId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cloudFrontDistribution:DomainDescriptionType' :: Maybe Text
cloudFrontDistribution = forall a. Maybe a
Prelude.Nothing,
      $sel:customDomainConfig:DomainDescriptionType' :: Maybe CustomDomainConfigType
customDomainConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:domain:DomainDescriptionType' :: Maybe Text
domain = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:DomainDescriptionType' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DomainDescriptionType' :: Maybe DomainStatusType
status = forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:DomainDescriptionType' :: Maybe Text
userPoolId = forall a. Maybe a
Prelude.Nothing,
      $sel:version:DomainDescriptionType' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Web Services ID for the user pool owner.
domainDescriptionType_aWSAccountId :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_aWSAccountId :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_aWSAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
aWSAccountId :: Maybe Text
$sel:aWSAccountId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
aWSAccountId} -> Maybe Text
aWSAccountId) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:aWSAccountId:DomainDescriptionType' :: Maybe Text
aWSAccountId = Maybe Text
a} :: DomainDescriptionType)

-- | The Amazon Resource Name (ARN) of the Amazon CloudFront distribution.
domainDescriptionType_cloudFrontDistribution :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_cloudFrontDistribution :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_cloudFrontDistribution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
cloudFrontDistribution :: Maybe Text
$sel:cloudFrontDistribution:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
cloudFrontDistribution} -> Maybe Text
cloudFrontDistribution) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:cloudFrontDistribution:DomainDescriptionType' :: Maybe Text
cloudFrontDistribution = Maybe Text
a} :: DomainDescriptionType)

-- | The configuration for a custom domain that hosts the sign-up and sign-in
-- webpages for your application.
domainDescriptionType_customDomainConfig :: Lens.Lens' DomainDescriptionType (Prelude.Maybe CustomDomainConfigType)
domainDescriptionType_customDomainConfig :: Lens' DomainDescriptionType (Maybe CustomDomainConfigType)
domainDescriptionType_customDomainConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe CustomDomainConfigType
customDomainConfig :: Maybe CustomDomainConfigType
$sel:customDomainConfig:DomainDescriptionType' :: DomainDescriptionType -> Maybe CustomDomainConfigType
customDomainConfig} -> Maybe CustomDomainConfigType
customDomainConfig) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe CustomDomainConfigType
a -> DomainDescriptionType
s {$sel:customDomainConfig:DomainDescriptionType' :: Maybe CustomDomainConfigType
customDomainConfig = Maybe CustomDomainConfigType
a} :: DomainDescriptionType)

-- | The domain string. For custom domains, this is the fully-qualified
-- domain name, such as @auth.example.com@. For Amazon Cognito prefix
-- domains, this is the prefix alone, such as @auth@.
domainDescriptionType_domain :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_domain :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
domain :: Maybe Text
$sel:domain:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
domain} -> Maybe Text
domain) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:domain:DomainDescriptionType' :: Maybe Text
domain = Maybe Text
a} :: DomainDescriptionType)

-- | The Amazon S3 bucket where the static files for this domain are stored.
domainDescriptionType_s3Bucket :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_s3Bucket :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:s3Bucket:DomainDescriptionType' :: Maybe Text
s3Bucket = Maybe Text
a} :: DomainDescriptionType)

-- | The domain status.
domainDescriptionType_status :: Lens.Lens' DomainDescriptionType (Prelude.Maybe DomainStatusType)
domainDescriptionType_status :: Lens' DomainDescriptionType (Maybe DomainStatusType)
domainDescriptionType_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe DomainStatusType
status :: Maybe DomainStatusType
$sel:status:DomainDescriptionType' :: DomainDescriptionType -> Maybe DomainStatusType
status} -> Maybe DomainStatusType
status) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe DomainStatusType
a -> DomainDescriptionType
s {$sel:status:DomainDescriptionType' :: Maybe DomainStatusType
status = Maybe DomainStatusType
a} :: DomainDescriptionType)

-- | The user pool ID.
domainDescriptionType_userPoolId :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_userPoolId :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
userPoolId :: Maybe Text
$sel:userPoolId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
userPoolId} -> Maybe Text
userPoolId) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:userPoolId:DomainDescriptionType' :: Maybe Text
userPoolId = Maybe Text
a} :: DomainDescriptionType)

-- | The app version.
domainDescriptionType_version :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_version :: Lens' DomainDescriptionType (Maybe Text)
domainDescriptionType_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDescriptionType' {Maybe Text
version :: Maybe Text
$sel:version:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
version} -> Maybe Text
version) (\s :: DomainDescriptionType
s@DomainDescriptionType' {} Maybe Text
a -> DomainDescriptionType
s {$sel:version:DomainDescriptionType' :: Maybe Text
version = Maybe Text
a} :: DomainDescriptionType)

instance Data.FromJSON DomainDescriptionType where
  parseJSON :: Value -> Parser DomainDescriptionType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainDescriptionType"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe CustomDomainConfigType
-> Maybe Text
-> Maybe Text
-> Maybe DomainStatusType
-> Maybe Text
-> Maybe Text
-> DomainDescriptionType
DomainDescriptionType'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AWSAccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CloudFrontDistribution")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CustomDomainConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Domain")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"S3Bucket")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UserPoolId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
      )

instance Prelude.Hashable DomainDescriptionType where
  hashWithSalt :: Int -> DomainDescriptionType -> Int
hashWithSalt Int
_salt DomainDescriptionType' {Maybe Text
Maybe CustomDomainConfigType
Maybe DomainStatusType
version :: Maybe Text
userPoolId :: Maybe Text
status :: Maybe DomainStatusType
s3Bucket :: Maybe Text
domain :: Maybe Text
customDomainConfig :: Maybe CustomDomainConfigType
cloudFrontDistribution :: Maybe Text
aWSAccountId :: Maybe Text
$sel:version:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:userPoolId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:status:DomainDescriptionType' :: DomainDescriptionType -> Maybe DomainStatusType
$sel:s3Bucket:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:domain:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:customDomainConfig:DomainDescriptionType' :: DomainDescriptionType -> Maybe CustomDomainConfigType
$sel:cloudFrontDistribution:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:aWSAccountId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aWSAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cloudFrontDistribution
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomDomainConfigType
customDomainConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DomainStatusType
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userPoolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version

instance Prelude.NFData DomainDescriptionType where
  rnf :: DomainDescriptionType -> ()
rnf DomainDescriptionType' {Maybe Text
Maybe CustomDomainConfigType
Maybe DomainStatusType
version :: Maybe Text
userPoolId :: Maybe Text
status :: Maybe DomainStatusType
s3Bucket :: Maybe Text
domain :: Maybe Text
customDomainConfig :: Maybe CustomDomainConfigType
cloudFrontDistribution :: Maybe Text
aWSAccountId :: Maybe Text
$sel:version:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:userPoolId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:status:DomainDescriptionType' :: DomainDescriptionType -> Maybe DomainStatusType
$sel:s3Bucket:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:domain:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:customDomainConfig:DomainDescriptionType' :: DomainDescriptionType -> Maybe CustomDomainConfigType
$sel:cloudFrontDistribution:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
$sel:aWSAccountId:DomainDescriptionType' :: DomainDescriptionType -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aWSAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cloudFrontDistribution
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomDomainConfigType
customDomainConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainStatusType
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userPoolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version