{-# 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-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)
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.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A container for information about a domain.
--
-- /See:/ 'newDomainDescriptionType' smart constructor.
data DomainDescriptionType = DomainDescriptionType'
  { -- | The domain status.
    DomainDescriptionType -> Maybe DomainStatusType
status :: Prelude.Maybe DomainStatusType,
    -- | The ARN of the CloudFront distribution.
    DomainDescriptionType -> Maybe Text
cloudFrontDistribution :: Prelude.Maybe Prelude.Text,
    -- | The user pool ID.
    DomainDescriptionType -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text,
    -- | The domain string.
    DomainDescriptionType -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The account ID for the user pool owner.
    DomainDescriptionType -> Maybe Text
aWSAccountId :: 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 app version.
    DomainDescriptionType -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket where the static files for this domain are stored.
    DomainDescriptionType -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text
  }
  deriving (DomainDescriptionType -> DomainDescriptionType -> Bool
(DomainDescriptionType -> DomainDescriptionType -> Bool)
-> (DomainDescriptionType -> DomainDescriptionType -> Bool)
-> Eq DomainDescriptionType
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]
(Int -> ReadS DomainDescriptionType)
-> ReadS [DomainDescriptionType]
-> ReadPrec DomainDescriptionType
-> ReadPrec [DomainDescriptionType]
-> Read 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
(Int -> DomainDescriptionType -> ShowS)
-> (DomainDescriptionType -> String)
-> ([DomainDescriptionType] -> ShowS)
-> Show DomainDescriptionType
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. DomainDescriptionType -> Rep DomainDescriptionType x)
-> (forall x. Rep DomainDescriptionType x -> DomainDescriptionType)
-> Generic DomainDescriptionType
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:
--
-- 'status', 'domainDescriptionType_status' - The domain status.
--
-- 'cloudFrontDistribution', 'domainDescriptionType_cloudFrontDistribution' - The ARN of the CloudFront distribution.
--
-- 'userPoolId', 'domainDescriptionType_userPoolId' - The user pool ID.
--
-- 'domain', 'domainDescriptionType_domain' - The domain string.
--
-- 'aWSAccountId', 'domainDescriptionType_aWSAccountId' - The account ID for the user pool owner.
--
-- 'customDomainConfig', 'domainDescriptionType_customDomainConfig' - The configuration for a custom domain that hosts the sign-up and sign-in
-- webpages for your application.
--
-- 'version', 'domainDescriptionType_version' - The app version.
--
-- 's3Bucket', 'domainDescriptionType_s3Bucket' - The S3 bucket where the static files for this domain are stored.
newDomainDescriptionType ::
  DomainDescriptionType
newDomainDescriptionType :: DomainDescriptionType
newDomainDescriptionType =
  DomainDescriptionType' :: Maybe DomainStatusType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CustomDomainConfigType
-> Maybe Text
-> Maybe Text
-> DomainDescriptionType
DomainDescriptionType'
    { $sel:status:DomainDescriptionType' :: Maybe DomainStatusType
status = Maybe DomainStatusType
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudFrontDistribution:DomainDescriptionType' :: Maybe Text
cloudFrontDistribution = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:DomainDescriptionType' :: Maybe Text
userPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domain:DomainDescriptionType' :: Maybe Text
domain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:aWSAccountId:DomainDescriptionType' :: Maybe Text
aWSAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customDomainConfig:DomainDescriptionType' :: Maybe CustomDomainConfigType
customDomainConfig = Maybe CustomDomainConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:version:DomainDescriptionType' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:DomainDescriptionType' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The domain status.
domainDescriptionType_status :: Lens.Lens' DomainDescriptionType (Prelude.Maybe DomainStatusType)
domainDescriptionType_status :: (Maybe DomainStatusType -> f (Maybe DomainStatusType))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_status = (DomainDescriptionType -> Maybe DomainStatusType)
-> (DomainDescriptionType
    -> Maybe DomainStatusType -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe DomainStatusType)
     (Maybe DomainStatusType)
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 ARN of the CloudFront distribution.
domainDescriptionType_cloudFrontDistribution :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_cloudFrontDistribution :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_cloudFrontDistribution = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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 user pool ID.
domainDescriptionType_userPoolId :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_userPoolId :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_userPoolId = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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 domain string.
domainDescriptionType_domain :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_domain :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_domain = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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 account ID for the user pool owner.
domainDescriptionType_aWSAccountId :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_aWSAccountId :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_aWSAccountId = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe CustomDomainConfigType -> f (Maybe CustomDomainConfigType))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_customDomainConfig = (DomainDescriptionType -> Maybe CustomDomainConfigType)
-> (DomainDescriptionType
    -> Maybe CustomDomainConfigType -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe CustomDomainConfigType)
     (Maybe CustomDomainConfigType)
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 app version.
domainDescriptionType_version :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_version :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_version = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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)

-- | The S3 bucket where the static files for this domain are stored.
domainDescriptionType_s3Bucket :: Lens.Lens' DomainDescriptionType (Prelude.Maybe Prelude.Text)
domainDescriptionType_s3Bucket :: (Maybe Text -> f (Maybe Text))
-> DomainDescriptionType -> f DomainDescriptionType
domainDescriptionType_s3Bucket = (DomainDescriptionType -> Maybe Text)
-> (DomainDescriptionType -> Maybe Text -> DomainDescriptionType)
-> Lens
     DomainDescriptionType
     DomainDescriptionType
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable DomainDescriptionType

instance Prelude.NFData DomainDescriptionType