{-# 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.ApiGatewayV2.Types.DomainNameConfiguration
-- 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.ApiGatewayV2.Types.DomainNameConfiguration where

import Amazonka.ApiGatewayV2.Types.DomainNameStatus
import Amazonka.ApiGatewayV2.Types.EndpointType
import Amazonka.ApiGatewayV2.Types.SecurityPolicy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The domain name configuration.
--
-- /See:/ 'newDomainNameConfiguration' smart constructor.
data DomainNameConfiguration = DomainNameConfiguration'
  { -- | A domain name for the API.
    DomainNameConfiguration -> Maybe Text
apiGatewayDomainName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the public certificate issued by ACM to validate ownership of
    -- your custom domain. Only required when configuring mutual TLS and using
    -- an ACM imported or private CA certificate ARN as the
    -- regionalCertificateArn
    DomainNameConfiguration -> Maybe Text
ownershipVerificationCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | The user-friendly name of the certificate that will be used by the
    -- edge-optimized endpoint for this domain name.
    DomainNameConfiguration -> Maybe Text
certificateName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Route 53 Hosted Zone ID of the endpoint.
    DomainNameConfiguration -> Maybe Text
hostedZoneId :: Prelude.Maybe Prelude.Text,
    -- | An AWS-managed certificate that will be used by the edge-optimized
    -- endpoint for this domain name. AWS Certificate Manager is the only
    -- supported source.
    DomainNameConfiguration -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The endpoint type.
    DomainNameConfiguration -> Maybe EndpointType
endpointType :: Prelude.Maybe EndpointType,
    -- | The Transport Layer Security (TLS) version of the security policy for
    -- this domain name. The valid values are TLS_1_0 and TLS_1_2.
    DomainNameConfiguration -> Maybe SecurityPolicy
securityPolicy :: Prelude.Maybe SecurityPolicy,
    -- | The timestamp when the certificate that was used by edge-optimized
    -- endpoint for this domain name was uploaded.
    DomainNameConfiguration -> Maybe POSIX
certificateUploadDate :: Prelude.Maybe Core.POSIX,
    -- | An optional text message containing detailed information about status of
    -- the domain name migration.
    DomainNameConfiguration -> Maybe Text
domainNameStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The status of the domain name migration. The valid values are AVAILABLE,
    -- UPDATING, PENDING_CERTIFICATE_REIMPORT, and
    -- PENDING_OWNERSHIP_VERIFICATION. If the status is UPDATING, the domain
    -- cannot be modified further until the existing operation is complete. If
    -- it is AVAILABLE, the domain can be updated.
    DomainNameConfiguration -> Maybe DomainNameStatus
domainNameStatus :: Prelude.Maybe DomainNameStatus
  }
  deriving (DomainNameConfiguration -> DomainNameConfiguration -> Bool
(DomainNameConfiguration -> DomainNameConfiguration -> Bool)
-> (DomainNameConfiguration -> DomainNameConfiguration -> Bool)
-> Eq DomainNameConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainNameConfiguration -> DomainNameConfiguration -> Bool
$c/= :: DomainNameConfiguration -> DomainNameConfiguration -> Bool
== :: DomainNameConfiguration -> DomainNameConfiguration -> Bool
$c== :: DomainNameConfiguration -> DomainNameConfiguration -> Bool
Prelude.Eq, ReadPrec [DomainNameConfiguration]
ReadPrec DomainNameConfiguration
Int -> ReadS DomainNameConfiguration
ReadS [DomainNameConfiguration]
(Int -> ReadS DomainNameConfiguration)
-> ReadS [DomainNameConfiguration]
-> ReadPrec DomainNameConfiguration
-> ReadPrec [DomainNameConfiguration]
-> Read DomainNameConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainNameConfiguration]
$creadListPrec :: ReadPrec [DomainNameConfiguration]
readPrec :: ReadPrec DomainNameConfiguration
$creadPrec :: ReadPrec DomainNameConfiguration
readList :: ReadS [DomainNameConfiguration]
$creadList :: ReadS [DomainNameConfiguration]
readsPrec :: Int -> ReadS DomainNameConfiguration
$creadsPrec :: Int -> ReadS DomainNameConfiguration
Prelude.Read, Int -> DomainNameConfiguration -> ShowS
[DomainNameConfiguration] -> ShowS
DomainNameConfiguration -> String
(Int -> DomainNameConfiguration -> ShowS)
-> (DomainNameConfiguration -> String)
-> ([DomainNameConfiguration] -> ShowS)
-> Show DomainNameConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainNameConfiguration] -> ShowS
$cshowList :: [DomainNameConfiguration] -> ShowS
show :: DomainNameConfiguration -> String
$cshow :: DomainNameConfiguration -> String
showsPrec :: Int -> DomainNameConfiguration -> ShowS
$cshowsPrec :: Int -> DomainNameConfiguration -> ShowS
Prelude.Show, (forall x.
 DomainNameConfiguration -> Rep DomainNameConfiguration x)
-> (forall x.
    Rep DomainNameConfiguration x -> DomainNameConfiguration)
-> Generic DomainNameConfiguration
forall x. Rep DomainNameConfiguration x -> DomainNameConfiguration
forall x. DomainNameConfiguration -> Rep DomainNameConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainNameConfiguration x -> DomainNameConfiguration
$cfrom :: forall x. DomainNameConfiguration -> Rep DomainNameConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DomainNameConfiguration' 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:
--
-- 'apiGatewayDomainName', 'domainNameConfiguration_apiGatewayDomainName' - A domain name for the API.
--
-- 'ownershipVerificationCertificateArn', 'domainNameConfiguration_ownershipVerificationCertificateArn' - The ARN of the public certificate issued by ACM to validate ownership of
-- your custom domain. Only required when configuring mutual TLS and using
-- an ACM imported or private CA certificate ARN as the
-- regionalCertificateArn
--
-- 'certificateName', 'domainNameConfiguration_certificateName' - The user-friendly name of the certificate that will be used by the
-- edge-optimized endpoint for this domain name.
--
-- 'hostedZoneId', 'domainNameConfiguration_hostedZoneId' - The Amazon Route 53 Hosted Zone ID of the endpoint.
--
-- 'certificateArn', 'domainNameConfiguration_certificateArn' - An AWS-managed certificate that will be used by the edge-optimized
-- endpoint for this domain name. AWS Certificate Manager is the only
-- supported source.
--
-- 'endpointType', 'domainNameConfiguration_endpointType' - The endpoint type.
--
-- 'securityPolicy', 'domainNameConfiguration_securityPolicy' - The Transport Layer Security (TLS) version of the security policy for
-- this domain name. The valid values are TLS_1_0 and TLS_1_2.
--
-- 'certificateUploadDate', 'domainNameConfiguration_certificateUploadDate' - The timestamp when the certificate that was used by edge-optimized
-- endpoint for this domain name was uploaded.
--
-- 'domainNameStatusMessage', 'domainNameConfiguration_domainNameStatusMessage' - An optional text message containing detailed information about status of
-- the domain name migration.
--
-- 'domainNameStatus', 'domainNameConfiguration_domainNameStatus' - The status of the domain name migration. The valid values are AVAILABLE,
-- UPDATING, PENDING_CERTIFICATE_REIMPORT, and
-- PENDING_OWNERSHIP_VERIFICATION. If the status is UPDATING, the domain
-- cannot be modified further until the existing operation is complete. If
-- it is AVAILABLE, the domain can be updated.
newDomainNameConfiguration ::
  DomainNameConfiguration
newDomainNameConfiguration :: DomainNameConfiguration
newDomainNameConfiguration =
  DomainNameConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EndpointType
-> Maybe SecurityPolicy
-> Maybe POSIX
-> Maybe Text
-> Maybe DomainNameStatus
-> DomainNameConfiguration
DomainNameConfiguration'
    { $sel:apiGatewayDomainName:DomainNameConfiguration' :: Maybe Text
apiGatewayDomainName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ownershipVerificationCertificateArn:DomainNameConfiguration' :: Maybe Text
ownershipVerificationCertificateArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateName:DomainNameConfiguration' :: Maybe Text
certificateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hostedZoneId:DomainNameConfiguration' :: Maybe Text
hostedZoneId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:DomainNameConfiguration' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:DomainNameConfiguration' :: Maybe EndpointType
endpointType = Maybe EndpointType
forall a. Maybe a
Prelude.Nothing,
      $sel:securityPolicy:DomainNameConfiguration' :: Maybe SecurityPolicy
securityPolicy = Maybe SecurityPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateUploadDate:DomainNameConfiguration' :: Maybe POSIX
certificateUploadDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:domainNameStatusMessage:DomainNameConfiguration' :: Maybe Text
domainNameStatusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainNameStatus:DomainNameConfiguration' :: Maybe DomainNameStatus
domainNameStatus = Maybe DomainNameStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | A domain name for the API.
domainNameConfiguration_apiGatewayDomainName :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_apiGatewayDomainName :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_apiGatewayDomainName = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
apiGatewayDomainName :: Maybe Text
$sel:apiGatewayDomainName:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
apiGatewayDomainName} -> Maybe Text
apiGatewayDomainName) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:apiGatewayDomainName:DomainNameConfiguration' :: Maybe Text
apiGatewayDomainName = Maybe Text
a} :: DomainNameConfiguration)

-- | The ARN of the public certificate issued by ACM to validate ownership of
-- your custom domain. Only required when configuring mutual TLS and using
-- an ACM imported or private CA certificate ARN as the
-- regionalCertificateArn
domainNameConfiguration_ownershipVerificationCertificateArn :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_ownershipVerificationCertificateArn :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_ownershipVerificationCertificateArn = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
$sel:ownershipVerificationCertificateArn:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
ownershipVerificationCertificateArn} -> Maybe Text
ownershipVerificationCertificateArn) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:ownershipVerificationCertificateArn:DomainNameConfiguration' :: Maybe Text
ownershipVerificationCertificateArn = Maybe Text
a} :: DomainNameConfiguration)

-- | The user-friendly name of the certificate that will be used by the
-- edge-optimized endpoint for this domain name.
domainNameConfiguration_certificateName :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_certificateName :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_certificateName = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
certificateName :: Maybe Text
$sel:certificateName:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
certificateName} -> Maybe Text
certificateName) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:certificateName:DomainNameConfiguration' :: Maybe Text
certificateName = Maybe Text
a} :: DomainNameConfiguration)

-- | The Amazon Route 53 Hosted Zone ID of the endpoint.
domainNameConfiguration_hostedZoneId :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_hostedZoneId :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_hostedZoneId = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
hostedZoneId :: Maybe Text
$sel:hostedZoneId:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
hostedZoneId} -> Maybe Text
hostedZoneId) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:hostedZoneId:DomainNameConfiguration' :: Maybe Text
hostedZoneId = Maybe Text
a} :: DomainNameConfiguration)

-- | An AWS-managed certificate that will be used by the edge-optimized
-- endpoint for this domain name. AWS Certificate Manager is the only
-- supported source.
domainNameConfiguration_certificateArn :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_certificateArn :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_certificateArn = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:certificateArn:DomainNameConfiguration' :: Maybe Text
certificateArn = Maybe Text
a} :: DomainNameConfiguration)

-- | The endpoint type.
domainNameConfiguration_endpointType :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe EndpointType)
domainNameConfiguration_endpointType :: (Maybe EndpointType -> f (Maybe EndpointType))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_endpointType = (DomainNameConfiguration -> Maybe EndpointType)
-> (DomainNameConfiguration
    -> Maybe EndpointType -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe EndpointType)
     (Maybe EndpointType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe EndpointType
endpointType :: Maybe EndpointType
$sel:endpointType:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe EndpointType
endpointType} -> Maybe EndpointType
endpointType) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe EndpointType
a -> DomainNameConfiguration
s {$sel:endpointType:DomainNameConfiguration' :: Maybe EndpointType
endpointType = Maybe EndpointType
a} :: DomainNameConfiguration)

-- | The Transport Layer Security (TLS) version of the security policy for
-- this domain name. The valid values are TLS_1_0 and TLS_1_2.
domainNameConfiguration_securityPolicy :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe SecurityPolicy)
domainNameConfiguration_securityPolicy :: (Maybe SecurityPolicy -> f (Maybe SecurityPolicy))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_securityPolicy = (DomainNameConfiguration -> Maybe SecurityPolicy)
-> (DomainNameConfiguration
    -> Maybe SecurityPolicy -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe SecurityPolicy)
     (Maybe SecurityPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe SecurityPolicy
securityPolicy :: Maybe SecurityPolicy
$sel:securityPolicy:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe SecurityPolicy
securityPolicy} -> Maybe SecurityPolicy
securityPolicy) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe SecurityPolicy
a -> DomainNameConfiguration
s {$sel:securityPolicy:DomainNameConfiguration' :: Maybe SecurityPolicy
securityPolicy = Maybe SecurityPolicy
a} :: DomainNameConfiguration)

-- | The timestamp when the certificate that was used by edge-optimized
-- endpoint for this domain name was uploaded.
domainNameConfiguration_certificateUploadDate :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.UTCTime)
domainNameConfiguration_certificateUploadDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_certificateUploadDate = (DomainNameConfiguration -> Maybe POSIX)
-> (DomainNameConfiguration
    -> Maybe POSIX -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe POSIX
certificateUploadDate :: Maybe POSIX
$sel:certificateUploadDate:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe POSIX
certificateUploadDate} -> Maybe POSIX
certificateUploadDate) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe POSIX
a -> DomainNameConfiguration
s {$sel:certificateUploadDate:DomainNameConfiguration' :: Maybe POSIX
certificateUploadDate = Maybe POSIX
a} :: DomainNameConfiguration) ((Maybe POSIX -> f (Maybe POSIX))
 -> DomainNameConfiguration -> f DomainNameConfiguration)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainNameConfiguration
-> f DomainNameConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An optional text message containing detailed information about status of
-- the domain name migration.
domainNameConfiguration_domainNameStatusMessage :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe Prelude.Text)
domainNameConfiguration_domainNameStatusMessage :: (Maybe Text -> f (Maybe Text))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_domainNameStatusMessage = (DomainNameConfiguration -> Maybe Text)
-> (DomainNameConfiguration
    -> Maybe Text -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe Text
domainNameStatusMessage :: Maybe Text
$sel:domainNameStatusMessage:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
domainNameStatusMessage} -> Maybe Text
domainNameStatusMessage) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe Text
a -> DomainNameConfiguration
s {$sel:domainNameStatusMessage:DomainNameConfiguration' :: Maybe Text
domainNameStatusMessage = Maybe Text
a} :: DomainNameConfiguration)

-- | The status of the domain name migration. The valid values are AVAILABLE,
-- UPDATING, PENDING_CERTIFICATE_REIMPORT, and
-- PENDING_OWNERSHIP_VERIFICATION. If the status is UPDATING, the domain
-- cannot be modified further until the existing operation is complete. If
-- it is AVAILABLE, the domain can be updated.
domainNameConfiguration_domainNameStatus :: Lens.Lens' DomainNameConfiguration (Prelude.Maybe DomainNameStatus)
domainNameConfiguration_domainNameStatus :: (Maybe DomainNameStatus -> f (Maybe DomainNameStatus))
-> DomainNameConfiguration -> f DomainNameConfiguration
domainNameConfiguration_domainNameStatus = (DomainNameConfiguration -> Maybe DomainNameStatus)
-> (DomainNameConfiguration
    -> Maybe DomainNameStatus -> DomainNameConfiguration)
-> Lens
     DomainNameConfiguration
     DomainNameConfiguration
     (Maybe DomainNameStatus)
     (Maybe DomainNameStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainNameConfiguration' {Maybe DomainNameStatus
domainNameStatus :: Maybe DomainNameStatus
$sel:domainNameStatus:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe DomainNameStatus
domainNameStatus} -> Maybe DomainNameStatus
domainNameStatus) (\s :: DomainNameConfiguration
s@DomainNameConfiguration' {} Maybe DomainNameStatus
a -> DomainNameConfiguration
s {$sel:domainNameStatus:DomainNameConfiguration' :: Maybe DomainNameStatus
domainNameStatus = Maybe DomainNameStatus
a} :: DomainNameConfiguration)

instance Core.FromJSON DomainNameConfiguration where
  parseJSON :: Value -> Parser DomainNameConfiguration
parseJSON =
    String
-> (Object -> Parser DomainNameConfiguration)
-> Value
-> Parser DomainNameConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainNameConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EndpointType
-> Maybe SecurityPolicy
-> Maybe POSIX
-> Maybe Text
-> Maybe DomainNameStatus
-> DomainNameConfiguration
DomainNameConfiguration'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe EndpointType
 -> Maybe SecurityPolicy
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe DomainNameStatus
 -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe EndpointType
      -> Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
forall (f :: * -> *) a b. Functor 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
"apiGatewayDomainName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe EndpointType
   -> Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe EndpointType
      -> Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
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
"ownershipVerificationCertificateArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe EndpointType
   -> Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe EndpointType
      -> Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
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
"certificateName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe EndpointType
   -> Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe EndpointType
      -> Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
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
"hostedZoneId")
            Parser
  (Maybe Text
   -> Maybe EndpointType
   -> Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe EndpointType
      -> Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
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
"certificateArn")
            Parser
  (Maybe EndpointType
   -> Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe EndpointType)
-> Parser
     (Maybe SecurityPolicy
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DomainNameStatus
      -> DomainNameConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EndpointType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"endpointType")
            Parser
  (Maybe SecurityPolicy
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DomainNameStatus
   -> DomainNameConfiguration)
-> Parser (Maybe SecurityPolicy)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe DomainNameStatus -> DomainNameConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SecurityPolicy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"securityPolicy")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe DomainNameStatus -> DomainNameConfiguration)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe DomainNameStatus -> DomainNameConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateUploadDate")
            Parser
  (Maybe Text -> Maybe DomainNameStatus -> DomainNameConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe DomainNameStatus -> DomainNameConfiguration)
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
"domainNameStatusMessage")
            Parser (Maybe DomainNameStatus -> DomainNameConfiguration)
-> Parser (Maybe DomainNameStatus)
-> Parser DomainNameConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DomainNameStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainNameStatus")
      )

instance Prelude.Hashable DomainNameConfiguration

instance Prelude.NFData DomainNameConfiguration

instance Core.ToJSON DomainNameConfiguration where
  toJSON :: DomainNameConfiguration -> Value
toJSON DomainNameConfiguration' {Maybe Text
Maybe POSIX
Maybe DomainNameStatus
Maybe EndpointType
Maybe SecurityPolicy
domainNameStatus :: Maybe DomainNameStatus
domainNameStatusMessage :: Maybe Text
certificateUploadDate :: Maybe POSIX
securityPolicy :: Maybe SecurityPolicy
endpointType :: Maybe EndpointType
certificateArn :: Maybe Text
hostedZoneId :: Maybe Text
certificateName :: Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
apiGatewayDomainName :: Maybe Text
$sel:domainNameStatus:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe DomainNameStatus
$sel:domainNameStatusMessage:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
$sel:certificateUploadDate:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe POSIX
$sel:securityPolicy:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe SecurityPolicy
$sel:endpointType:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe EndpointType
$sel:certificateArn:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
$sel:hostedZoneId:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
$sel:certificateName:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
$sel:ownershipVerificationCertificateArn:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
$sel:apiGatewayDomainName:DomainNameConfiguration' :: DomainNameConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"apiGatewayDomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiGatewayDomainName,
            (Text
"ownershipVerificationCertificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ownershipVerificationCertificateArn,
            (Text
"certificateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateName,
            (Text
"hostedZoneId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
hostedZoneId,
            (Text
"certificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateArn,
            (Text
"endpointType" Text -> EndpointType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EndpointType -> Pair) -> Maybe EndpointType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointType
endpointType,
            (Text
"securityPolicy" Text -> SecurityPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SecurityPolicy -> Pair) -> Maybe SecurityPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SecurityPolicy
securityPolicy,
            (Text
"certificateUploadDate" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
certificateUploadDate,
            (Text
"domainNameStatusMessage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domainNameStatusMessage,
            (Text
"domainNameStatus" Text -> DomainNameStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DomainNameStatus -> Pair) -> Maybe DomainNameStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DomainNameStatus
domainNameStatus
          ]
      )