{-# 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.APIGateway.Types.DomainName
-- 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.APIGateway.Types.DomainName where

import Amazonka.APIGateway.Types.DomainNameStatus
import Amazonka.APIGateway.Types.EndpointConfiguration
import Amazonka.APIGateway.Types.MutualTlsAuthentication
import Amazonka.APIGateway.Types.SecurityPolicy
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

-- | Represents a custom domain name as a user-friendly host name of an API
-- (RestApi).
--
-- /See:/ 'newDomainName' smart constructor.
data DomainName = DomainName'
  { -- | The reference to an AWS-managed certificate that will be used by
    -- edge-optimized endpoint for this domain name. AWS Certificate Manager is
    -- the only supported source.
    DomainName -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the certificate that will be used by edge-optimized endpoint
    -- for this domain name.
    DomainName -> Maybe Text
certificateName :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the certificate that was used by edge-optimized
    -- endpoint for this domain name was uploaded.
    DomainName -> Maybe POSIX
certificateUploadDate :: Prelude.Maybe Data.POSIX,
    -- | The domain name of the Amazon CloudFront distribution associated with
    -- this custom domain name for an edge-optimized endpoint. You set up this
    -- association when adding a DNS record pointing the custom domain name to
    -- this distribution name. For more information about CloudFront
    -- distributions, see the Amazon CloudFront documentation.
    DomainName -> Maybe Text
distributionDomainName :: Prelude.Maybe Prelude.Text,
    -- | The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized
    -- endpoint. The valid value is @Z2FDTNDATAQYW2@ for all the regions. For
    -- more information, see Set up a Regional Custom Domain Name and AWS
    -- Regions and Endpoints for API Gateway.
    DomainName -> Maybe Text
distributionHostedZoneId :: Prelude.Maybe Prelude.Text,
    -- | The custom domain name as an API host name, for example,
    -- @my-api.example.com@.
    DomainName -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The status of the DomainName migration. The valid values are @AVAILABLE@
    -- and @UPDATING@. 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.
    DomainName -> Maybe DomainNameStatus
domainNameStatus :: Prelude.Maybe DomainNameStatus,
    -- | An optional text message containing detailed information about status of
    -- the DomainName migration.
    DomainName -> Maybe Text
domainNameStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The endpoint configuration of this DomainName showing the endpoint types
    -- of the domain name.
    DomainName -> Maybe EndpointConfiguration
endpointConfiguration :: Prelude.Maybe EndpointConfiguration,
    -- | The mutual TLS authentication configuration for a custom domain name. If
    -- specified, API Gateway performs two-way authentication between the
    -- client and the server. Clients must present a trusted certificate to
    -- access your API.
    DomainName -> Maybe MutualTlsAuthentication
mutualTlsAuthentication :: Prelude.Maybe MutualTlsAuthentication,
    -- | 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.
    DomainName -> Maybe Text
ownershipVerificationCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | The reference to an AWS-managed certificate that will be used for
    -- validating the regional domain name. AWS Certificate Manager is the only
    -- supported source.
    DomainName -> Maybe Text
regionalCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the certificate that will be used for validating the
    -- regional domain name.
    DomainName -> Maybe Text
regionalCertificateName :: Prelude.Maybe Prelude.Text,
    -- | The domain name associated with the regional endpoint for this custom
    -- domain name. You set up this association by adding a DNS record that
    -- points the custom domain name to this regional domain name. The regional
    -- domain name is returned by API Gateway when you create a regional
    -- endpoint.
    DomainName -> Maybe Text
regionalDomainName :: Prelude.Maybe Prelude.Text,
    -- | The region-specific Amazon Route 53 Hosted Zone ID of the regional
    -- endpoint. For more information, see Set up a Regional Custom Domain Name
    -- and AWS Regions and Endpoints for API Gateway.
    DomainName -> Maybe Text
regionalHostedZoneId :: Prelude.Maybe Prelude.Text,
    -- | The Transport Layer Security (TLS) version + cipher suite for this
    -- DomainName. The valid values are @TLS_1_0@ and @TLS_1_2@.
    DomainName -> Maybe SecurityPolicy
securityPolicy :: Prelude.Maybe SecurityPolicy,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    DomainName -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (DomainName -> DomainName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainName -> DomainName -> Bool
$c/= :: DomainName -> DomainName -> Bool
== :: DomainName -> DomainName -> Bool
$c== :: DomainName -> DomainName -> Bool
Prelude.Eq, ReadPrec [DomainName]
ReadPrec DomainName
Int -> ReadS DomainName
ReadS [DomainName]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainName]
$creadListPrec :: ReadPrec [DomainName]
readPrec :: ReadPrec DomainName
$creadPrec :: ReadPrec DomainName
readList :: ReadS [DomainName]
$creadList :: ReadS [DomainName]
readsPrec :: Int -> ReadS DomainName
$creadsPrec :: Int -> ReadS DomainName
Prelude.Read, Int -> DomainName -> ShowS
[DomainName] -> ShowS
DomainName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainName] -> ShowS
$cshowList :: [DomainName] -> ShowS
show :: DomainName -> String
$cshow :: DomainName -> String
showsPrec :: Int -> DomainName -> ShowS
$cshowsPrec :: Int -> DomainName -> ShowS
Prelude.Show, forall x. Rep DomainName x -> DomainName
forall x. DomainName -> Rep DomainName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainName x -> DomainName
$cfrom :: forall x. DomainName -> Rep DomainName x
Prelude.Generic)

-- |
-- Create a value of 'DomainName' 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:
--
-- 'certificateArn', 'domainName_certificateArn' - The reference to an AWS-managed certificate that will be used by
-- edge-optimized endpoint for this domain name. AWS Certificate Manager is
-- the only supported source.
--
-- 'certificateName', 'domainName_certificateName' - The name of the certificate that will be used by edge-optimized endpoint
-- for this domain name.
--
-- 'certificateUploadDate', 'domainName_certificateUploadDate' - The timestamp when the certificate that was used by edge-optimized
-- endpoint for this domain name was uploaded.
--
-- 'distributionDomainName', 'domainName_distributionDomainName' - The domain name of the Amazon CloudFront distribution associated with
-- this custom domain name for an edge-optimized endpoint. You set up this
-- association when adding a DNS record pointing the custom domain name to
-- this distribution name. For more information about CloudFront
-- distributions, see the Amazon CloudFront documentation.
--
-- 'distributionHostedZoneId', 'domainName_distributionHostedZoneId' - The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized
-- endpoint. The valid value is @Z2FDTNDATAQYW2@ for all the regions. For
-- more information, see Set up a Regional Custom Domain Name and AWS
-- Regions and Endpoints for API Gateway.
--
-- 'domainName', 'domainName_domainName' - The custom domain name as an API host name, for example,
-- @my-api.example.com@.
--
-- 'domainNameStatus', 'domainName_domainNameStatus' - The status of the DomainName migration. The valid values are @AVAILABLE@
-- and @UPDATING@. 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.
--
-- 'domainNameStatusMessage', 'domainName_domainNameStatusMessage' - An optional text message containing detailed information about status of
-- the DomainName migration.
--
-- 'endpointConfiguration', 'domainName_endpointConfiguration' - The endpoint configuration of this DomainName showing the endpoint types
-- of the domain name.
--
-- 'mutualTlsAuthentication', 'domainName_mutualTlsAuthentication' - The mutual TLS authentication configuration for a custom domain name. If
-- specified, API Gateway performs two-way authentication between the
-- client and the server. Clients must present a trusted certificate to
-- access your API.
--
-- 'ownershipVerificationCertificateArn', 'domainName_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.
--
-- 'regionalCertificateArn', 'domainName_regionalCertificateArn' - The reference to an AWS-managed certificate that will be used for
-- validating the regional domain name. AWS Certificate Manager is the only
-- supported source.
--
-- 'regionalCertificateName', 'domainName_regionalCertificateName' - The name of the certificate that will be used for validating the
-- regional domain name.
--
-- 'regionalDomainName', 'domainName_regionalDomainName' - The domain name associated with the regional endpoint for this custom
-- domain name. You set up this association by adding a DNS record that
-- points the custom domain name to this regional domain name. The regional
-- domain name is returned by API Gateway when you create a regional
-- endpoint.
--
-- 'regionalHostedZoneId', 'domainName_regionalHostedZoneId' - The region-specific Amazon Route 53 Hosted Zone ID of the regional
-- endpoint. For more information, see Set up a Regional Custom Domain Name
-- and AWS Regions and Endpoints for API Gateway.
--
-- 'securityPolicy', 'domainName_securityPolicy' - The Transport Layer Security (TLS) version + cipher suite for this
-- DomainName. The valid values are @TLS_1_0@ and @TLS_1_2@.
--
-- 'tags', 'domainName_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
newDomainName ::
  DomainName
newDomainName :: DomainName
newDomainName =
  DomainName'
    { $sel:certificateArn:DomainName' :: Maybe Text
certificateArn = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateName:DomainName' :: Maybe Text
certificateName = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateUploadDate:DomainName' :: Maybe POSIX
certificateUploadDate = forall a. Maybe a
Prelude.Nothing,
      $sel:distributionDomainName:DomainName' :: Maybe Text
distributionDomainName = forall a. Maybe a
Prelude.Nothing,
      $sel:distributionHostedZoneId:DomainName' :: Maybe Text
distributionHostedZoneId = forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:DomainName' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing,
      $sel:domainNameStatus:DomainName' :: Maybe DomainNameStatus
domainNameStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:domainNameStatusMessage:DomainName' :: Maybe Text
domainNameStatusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointConfiguration:DomainName' :: Maybe EndpointConfiguration
endpointConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:mutualTlsAuthentication:DomainName' :: Maybe MutualTlsAuthentication
mutualTlsAuthentication = forall a. Maybe a
Prelude.Nothing,
      $sel:ownershipVerificationCertificateArn:DomainName' :: Maybe Text
ownershipVerificationCertificateArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:regionalCertificateArn:DomainName' :: Maybe Text
regionalCertificateArn = forall a. Maybe a
Prelude.Nothing,
      $sel:regionalCertificateName:DomainName' :: Maybe Text
regionalCertificateName = forall a. Maybe a
Prelude.Nothing,
      $sel:regionalDomainName:DomainName' :: Maybe Text
regionalDomainName = forall a. Maybe a
Prelude.Nothing,
      $sel:regionalHostedZoneId:DomainName' :: Maybe Text
regionalHostedZoneId = forall a. Maybe a
Prelude.Nothing,
      $sel:securityPolicy:DomainName' :: Maybe SecurityPolicy
securityPolicy = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DomainName' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The timestamp when the certificate that was used by edge-optimized
-- endpoint for this domain name was uploaded.
domainName_certificateUploadDate :: Lens.Lens' DomainName (Prelude.Maybe Prelude.UTCTime)
domainName_certificateUploadDate :: Lens' DomainName (Maybe UTCTime)
domainName_certificateUploadDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe POSIX
certificateUploadDate :: Maybe POSIX
$sel:certificateUploadDate:DomainName' :: DomainName -> Maybe POSIX
certificateUploadDate} -> Maybe POSIX
certificateUploadDate) (\s :: DomainName
s@DomainName' {} Maybe POSIX
a -> DomainName
s {$sel:certificateUploadDate:DomainName' :: Maybe POSIX
certificateUploadDate = Maybe POSIX
a} :: DomainName) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The domain name of the Amazon CloudFront distribution associated with
-- this custom domain name for an edge-optimized endpoint. You set up this
-- association when adding a DNS record pointing the custom domain name to
-- this distribution name. For more information about CloudFront
-- distributions, see the Amazon CloudFront documentation.
domainName_distributionDomainName :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_distributionDomainName :: Lens' DomainName (Maybe Text)
domainName_distributionDomainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
distributionDomainName :: Maybe Text
$sel:distributionDomainName:DomainName' :: DomainName -> Maybe Text
distributionDomainName} -> Maybe Text
distributionDomainName) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:distributionDomainName:DomainName' :: Maybe Text
distributionDomainName = Maybe Text
a} :: DomainName)

-- | The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized
-- endpoint. The valid value is @Z2FDTNDATAQYW2@ for all the regions. For
-- more information, see Set up a Regional Custom Domain Name and AWS
-- Regions and Endpoints for API Gateway.
domainName_distributionHostedZoneId :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_distributionHostedZoneId :: Lens' DomainName (Maybe Text)
domainName_distributionHostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
distributionHostedZoneId :: Maybe Text
$sel:distributionHostedZoneId:DomainName' :: DomainName -> Maybe Text
distributionHostedZoneId} -> Maybe Text
distributionHostedZoneId) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:distributionHostedZoneId:DomainName' :: Maybe Text
distributionHostedZoneId = Maybe Text
a} :: DomainName)

-- | The custom domain name as an API host name, for example,
-- @my-api.example.com@.
domainName_domainName :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_domainName :: Lens' DomainName (Maybe Text)
domainName_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
domainName :: Maybe Text
$sel:domainName:DomainName' :: DomainName -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:domainName:DomainName' :: Maybe Text
domainName = Maybe Text
a} :: DomainName)

-- | The status of the DomainName migration. The valid values are @AVAILABLE@
-- and @UPDATING@. 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.
domainName_domainNameStatus :: Lens.Lens' DomainName (Prelude.Maybe DomainNameStatus)
domainName_domainNameStatus :: Lens' DomainName (Maybe DomainNameStatus)
domainName_domainNameStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe DomainNameStatus
domainNameStatus :: Maybe DomainNameStatus
$sel:domainNameStatus:DomainName' :: DomainName -> Maybe DomainNameStatus
domainNameStatus} -> Maybe DomainNameStatus
domainNameStatus) (\s :: DomainName
s@DomainName' {} Maybe DomainNameStatus
a -> DomainName
s {$sel:domainNameStatus:DomainName' :: Maybe DomainNameStatus
domainNameStatus = Maybe DomainNameStatus
a} :: DomainName)

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

-- | The endpoint configuration of this DomainName showing the endpoint types
-- of the domain name.
domainName_endpointConfiguration :: Lens.Lens' DomainName (Prelude.Maybe EndpointConfiguration)
domainName_endpointConfiguration :: Lens' DomainName (Maybe EndpointConfiguration)
domainName_endpointConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe EndpointConfiguration
endpointConfiguration :: Maybe EndpointConfiguration
$sel:endpointConfiguration:DomainName' :: DomainName -> Maybe EndpointConfiguration
endpointConfiguration} -> Maybe EndpointConfiguration
endpointConfiguration) (\s :: DomainName
s@DomainName' {} Maybe EndpointConfiguration
a -> DomainName
s {$sel:endpointConfiguration:DomainName' :: Maybe EndpointConfiguration
endpointConfiguration = Maybe EndpointConfiguration
a} :: DomainName)

-- | The mutual TLS authentication configuration for a custom domain name. If
-- specified, API Gateway performs two-way authentication between the
-- client and the server. Clients must present a trusted certificate to
-- access your API.
domainName_mutualTlsAuthentication :: Lens.Lens' DomainName (Prelude.Maybe MutualTlsAuthentication)
domainName_mutualTlsAuthentication :: Lens' DomainName (Maybe MutualTlsAuthentication)
domainName_mutualTlsAuthentication = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe MutualTlsAuthentication
mutualTlsAuthentication :: Maybe MutualTlsAuthentication
$sel:mutualTlsAuthentication:DomainName' :: DomainName -> Maybe MutualTlsAuthentication
mutualTlsAuthentication} -> Maybe MutualTlsAuthentication
mutualTlsAuthentication) (\s :: DomainName
s@DomainName' {} Maybe MutualTlsAuthentication
a -> DomainName
s {$sel:mutualTlsAuthentication:DomainName' :: Maybe MutualTlsAuthentication
mutualTlsAuthentication = Maybe MutualTlsAuthentication
a} :: DomainName)

-- | 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.
domainName_ownershipVerificationCertificateArn :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_ownershipVerificationCertificateArn :: Lens' DomainName (Maybe Text)
domainName_ownershipVerificationCertificateArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
$sel:ownershipVerificationCertificateArn:DomainName' :: DomainName -> Maybe Text
ownershipVerificationCertificateArn} -> Maybe Text
ownershipVerificationCertificateArn) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:ownershipVerificationCertificateArn:DomainName' :: Maybe Text
ownershipVerificationCertificateArn = Maybe Text
a} :: DomainName)

-- | The reference to an AWS-managed certificate that will be used for
-- validating the regional domain name. AWS Certificate Manager is the only
-- supported source.
domainName_regionalCertificateArn :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_regionalCertificateArn :: Lens' DomainName (Maybe Text)
domainName_regionalCertificateArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
regionalCertificateArn :: Maybe Text
$sel:regionalCertificateArn:DomainName' :: DomainName -> Maybe Text
regionalCertificateArn} -> Maybe Text
regionalCertificateArn) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:regionalCertificateArn:DomainName' :: Maybe Text
regionalCertificateArn = Maybe Text
a} :: DomainName)

-- | The name of the certificate that will be used for validating the
-- regional domain name.
domainName_regionalCertificateName :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_regionalCertificateName :: Lens' DomainName (Maybe Text)
domainName_regionalCertificateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
regionalCertificateName :: Maybe Text
$sel:regionalCertificateName:DomainName' :: DomainName -> Maybe Text
regionalCertificateName} -> Maybe Text
regionalCertificateName) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:regionalCertificateName:DomainName' :: Maybe Text
regionalCertificateName = Maybe Text
a} :: DomainName)

-- | The domain name associated with the regional endpoint for this custom
-- domain name. You set up this association by adding a DNS record that
-- points the custom domain name to this regional domain name. The regional
-- domain name is returned by API Gateway when you create a regional
-- endpoint.
domainName_regionalDomainName :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_regionalDomainName :: Lens' DomainName (Maybe Text)
domainName_regionalDomainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
regionalDomainName :: Maybe Text
$sel:regionalDomainName:DomainName' :: DomainName -> Maybe Text
regionalDomainName} -> Maybe Text
regionalDomainName) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:regionalDomainName:DomainName' :: Maybe Text
regionalDomainName = Maybe Text
a} :: DomainName)

-- | The region-specific Amazon Route 53 Hosted Zone ID of the regional
-- endpoint. For more information, see Set up a Regional Custom Domain Name
-- and AWS Regions and Endpoints for API Gateway.
domainName_regionalHostedZoneId :: Lens.Lens' DomainName (Prelude.Maybe Prelude.Text)
domainName_regionalHostedZoneId :: Lens' DomainName (Maybe Text)
domainName_regionalHostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe Text
regionalHostedZoneId :: Maybe Text
$sel:regionalHostedZoneId:DomainName' :: DomainName -> Maybe Text
regionalHostedZoneId} -> Maybe Text
regionalHostedZoneId) (\s :: DomainName
s@DomainName' {} Maybe Text
a -> DomainName
s {$sel:regionalHostedZoneId:DomainName' :: Maybe Text
regionalHostedZoneId = Maybe Text
a} :: DomainName)

-- | The Transport Layer Security (TLS) version + cipher suite for this
-- DomainName. The valid values are @TLS_1_0@ and @TLS_1_2@.
domainName_securityPolicy :: Lens.Lens' DomainName (Prelude.Maybe SecurityPolicy)
domainName_securityPolicy :: Lens' DomainName (Maybe SecurityPolicy)
domainName_securityPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe SecurityPolicy
securityPolicy :: Maybe SecurityPolicy
$sel:securityPolicy:DomainName' :: DomainName -> Maybe SecurityPolicy
securityPolicy} -> Maybe SecurityPolicy
securityPolicy) (\s :: DomainName
s@DomainName' {} Maybe SecurityPolicy
a -> DomainName
s {$sel:securityPolicy:DomainName' :: Maybe SecurityPolicy
securityPolicy = Maybe SecurityPolicy
a} :: DomainName)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
domainName_tags :: Lens.Lens' DomainName (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
domainName_tags :: Lens' DomainName (Maybe (HashMap Text Text))
domainName_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainName' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:DomainName' :: DomainName -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: DomainName
s@DomainName' {} Maybe (HashMap Text Text)
a -> DomainName
s {$sel:tags:DomainName' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: DomainName) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON DomainName where
  parseJSON :: Value -> Parser DomainName
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainName"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DomainNameStatus
-> Maybe Text
-> Maybe EndpointConfiguration
-> Maybe MutualTlsAuthentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SecurityPolicy
-> Maybe (HashMap Text Text)
-> DomainName
DomainName'
            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
"certificateArn")
            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
"certificateName")
            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
"certificateUploadDate")
            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
"distributionDomainName")
            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
"distributionHostedZoneId")
            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
"domainName")
            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
"domainNameStatus")
            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
"domainNameStatusMessage")
            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
"endpointConfiguration")
            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
"mutualTlsAuthentication")
            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
"ownershipVerificationCertificateArn")
            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
"regionalCertificateArn")
            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
"regionalCertificateName")
            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
"regionalDomainName")
            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
"regionalHostedZoneId")
            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
"securityPolicy")
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DomainName where
  hashWithSalt :: Int -> DomainName -> Int
hashWithSalt Int
_salt DomainName' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe DomainNameStatus
Maybe EndpointConfiguration
Maybe MutualTlsAuthentication
Maybe SecurityPolicy
tags :: Maybe (HashMap Text Text)
securityPolicy :: Maybe SecurityPolicy
regionalHostedZoneId :: Maybe Text
regionalDomainName :: Maybe Text
regionalCertificateName :: Maybe Text
regionalCertificateArn :: Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
mutualTlsAuthentication :: Maybe MutualTlsAuthentication
endpointConfiguration :: Maybe EndpointConfiguration
domainNameStatusMessage :: Maybe Text
domainNameStatus :: Maybe DomainNameStatus
domainName :: Maybe Text
distributionHostedZoneId :: Maybe Text
distributionDomainName :: Maybe Text
certificateUploadDate :: Maybe POSIX
certificateName :: Maybe Text
certificateArn :: Maybe Text
$sel:tags:DomainName' :: DomainName -> Maybe (HashMap Text Text)
$sel:securityPolicy:DomainName' :: DomainName -> Maybe SecurityPolicy
$sel:regionalHostedZoneId:DomainName' :: DomainName -> Maybe Text
$sel:regionalDomainName:DomainName' :: DomainName -> Maybe Text
$sel:regionalCertificateName:DomainName' :: DomainName -> Maybe Text
$sel:regionalCertificateArn:DomainName' :: DomainName -> Maybe Text
$sel:ownershipVerificationCertificateArn:DomainName' :: DomainName -> Maybe Text
$sel:mutualTlsAuthentication:DomainName' :: DomainName -> Maybe MutualTlsAuthentication
$sel:endpointConfiguration:DomainName' :: DomainName -> Maybe EndpointConfiguration
$sel:domainNameStatusMessage:DomainName' :: DomainName -> Maybe Text
$sel:domainNameStatus:DomainName' :: DomainName -> Maybe DomainNameStatus
$sel:domainName:DomainName' :: DomainName -> Maybe Text
$sel:distributionHostedZoneId:DomainName' :: DomainName -> Maybe Text
$sel:distributionDomainName:DomainName' :: DomainName -> Maybe Text
$sel:certificateUploadDate:DomainName' :: DomainName -> Maybe POSIX
$sel:certificateName:DomainName' :: DomainName -> Maybe Text
$sel:certificateArn:DomainName' :: DomainName -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
certificateUploadDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
distributionDomainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
distributionHostedZoneId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DomainNameStatus
domainNameStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainNameStatusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointConfiguration
endpointConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MutualTlsAuthentication
mutualTlsAuthentication
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownershipVerificationCertificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
regionalCertificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
regionalCertificateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
regionalDomainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
regionalHostedZoneId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SecurityPolicy
securityPolicy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData DomainName where
  rnf :: DomainName -> ()
rnf DomainName' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe DomainNameStatus
Maybe EndpointConfiguration
Maybe MutualTlsAuthentication
Maybe SecurityPolicy
tags :: Maybe (HashMap Text Text)
securityPolicy :: Maybe SecurityPolicy
regionalHostedZoneId :: Maybe Text
regionalDomainName :: Maybe Text
regionalCertificateName :: Maybe Text
regionalCertificateArn :: Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
mutualTlsAuthentication :: Maybe MutualTlsAuthentication
endpointConfiguration :: Maybe EndpointConfiguration
domainNameStatusMessage :: Maybe Text
domainNameStatus :: Maybe DomainNameStatus
domainName :: Maybe Text
distributionHostedZoneId :: Maybe Text
distributionDomainName :: Maybe Text
certificateUploadDate :: Maybe POSIX
certificateName :: Maybe Text
certificateArn :: Maybe Text
$sel:tags:DomainName' :: DomainName -> Maybe (HashMap Text Text)
$sel:securityPolicy:DomainName' :: DomainName -> Maybe SecurityPolicy
$sel:regionalHostedZoneId:DomainName' :: DomainName -> Maybe Text
$sel:regionalDomainName:DomainName' :: DomainName -> Maybe Text
$sel:regionalCertificateName:DomainName' :: DomainName -> Maybe Text
$sel:regionalCertificateArn:DomainName' :: DomainName -> Maybe Text
$sel:ownershipVerificationCertificateArn:DomainName' :: DomainName -> Maybe Text
$sel:mutualTlsAuthentication:DomainName' :: DomainName -> Maybe MutualTlsAuthentication
$sel:endpointConfiguration:DomainName' :: DomainName -> Maybe EndpointConfiguration
$sel:domainNameStatusMessage:DomainName' :: DomainName -> Maybe Text
$sel:domainNameStatus:DomainName' :: DomainName -> Maybe DomainNameStatus
$sel:domainName:DomainName' :: DomainName -> Maybe Text
$sel:distributionHostedZoneId:DomainName' :: DomainName -> Maybe Text
$sel:distributionDomainName:DomainName' :: DomainName -> Maybe Text
$sel:certificateUploadDate:DomainName' :: DomainName -> Maybe POSIX
$sel:certificateName:DomainName' :: DomainName -> Maybe Text
$sel:certificateArn:DomainName' :: DomainName -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
certificateUploadDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
distributionDomainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
distributionHostedZoneId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainNameStatus
domainNameStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainNameStatusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointConfiguration
endpointConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MutualTlsAuthentication
mutualTlsAuthentication
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownershipVerificationCertificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
regionalCertificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
regionalCertificateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
regionalDomainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
regionalHostedZoneId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SecurityPolicy
securityPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags