{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.APIGateway.CreateDomainName
-- 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)
--
-- Creates a new domain name.
module Amazonka.APIGateway.CreateDomainName
  ( -- * Creating a Request
    CreateDomainName (..),
    newCreateDomainName,

    -- * Request Lenses
    createDomainName_certificateName,
    createDomainName_ownershipVerificationCertificateArn,
    createDomainName_regionalCertificateArn,
    createDomainName_certificateArn,
    createDomainName_securityPolicy,
    createDomainName_mutualTlsAuthentication,
    createDomainName_certificatePrivateKey,
    createDomainName_regionalCertificateName,
    createDomainName_certificateBody,
    createDomainName_certificateChain,
    createDomainName_endpointConfiguration,
    createDomainName_tags,
    createDomainName_domainName,

    -- * Destructuring the Response
    DomainName (..),
    newDomainName,

    -- * Response Lenses
    domainName_regionalHostedZoneId,
    domainName_certificateName,
    domainName_ownershipVerificationCertificateArn,
    domainName_regionalCertificateArn,
    domainName_certificateArn,
    domainName_distributionHostedZoneId,
    domainName_securityPolicy,
    domainName_domainName,
    domainName_mutualTlsAuthentication,
    domainName_regionalCertificateName,
    domainName_regionalDomainName,
    domainName_certificateUploadDate,
    domainName_distributionDomainName,
    domainName_domainNameStatusMessage,
    domainName_endpointConfiguration,
    domainName_domainNameStatus,
    domainName_tags,
  )
where

import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | A request to create a new domain name.
--
-- /See:/ 'newCreateDomainName' smart constructor.
data CreateDomainName = CreateDomainName'
  { -- | The user-friendly name of the certificate that will be used by
    -- edge-optimized endpoint for this domain name.
    CreateDomainName -> Maybe Text
certificateName :: 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.
    CreateDomainName -> Maybe Text
ownershipVerificationCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | The reference to an AWS-managed certificate that will be used by
    -- regional endpoint for this domain name. AWS Certificate Manager is the
    -- only supported source.
    CreateDomainName -> Maybe Text
regionalCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | 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.
    CreateDomainName -> Maybe Text
certificateArn :: 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@.
    CreateDomainName -> Maybe SecurityPolicy
securityPolicy :: Prelude.Maybe SecurityPolicy,
    CreateDomainName -> Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication :: Prelude.Maybe MutualTlsAuthenticationInput,
    -- | [Deprecated] Your edge-optimized endpoint\'s domain name certificate\'s
    -- private key.
    CreateDomainName -> Maybe Text
certificatePrivateKey :: Prelude.Maybe Prelude.Text,
    -- | The user-friendly name of the certificate that will be used by regional
    -- endpoint for this domain name.
    CreateDomainName -> Maybe Text
regionalCertificateName :: Prelude.Maybe Prelude.Text,
    -- | [Deprecated] The body of the server certificate that will be used by
    -- edge-optimized endpoint for this domain name provided by your
    -- certificate authority.
    CreateDomainName -> Maybe Text
certificateBody :: Prelude.Maybe Prelude.Text,
    -- | [Deprecated] The intermediate certificates and optionally the root
    -- certificate, one after the other without any blank lines, used by an
    -- edge-optimized endpoint for this domain name. If you include the root
    -- certificate, your certificate chain must start with intermediate
    -- certificates and end with the root certificate. Use the intermediate
    -- certificates that were provided by your certificate authority. Do not
    -- include any intermediaries that are not in the chain of trust path.
    CreateDomainName -> Maybe Text
certificateChain :: Prelude.Maybe Prelude.Text,
    -- | The endpoint configuration of this DomainName showing the endpoint types
    -- of the domain name.
    CreateDomainName -> Maybe EndpointConfiguration
endpointConfiguration :: Prelude.Maybe EndpointConfiguration,
    -- | The key-value map of strings. The valid character set is
    -- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
    -- start with @aws:@. The tag value can be up to 256 characters.
    CreateDomainName -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | [Required] The name of the DomainName resource.
    CreateDomainName -> Text
domainName :: Prelude.Text
  }
  deriving (CreateDomainName -> CreateDomainName -> Bool
(CreateDomainName -> CreateDomainName -> Bool)
-> (CreateDomainName -> CreateDomainName -> Bool)
-> Eq CreateDomainName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDomainName -> CreateDomainName -> Bool
$c/= :: CreateDomainName -> CreateDomainName -> Bool
== :: CreateDomainName -> CreateDomainName -> Bool
$c== :: CreateDomainName -> CreateDomainName -> Bool
Prelude.Eq, ReadPrec [CreateDomainName]
ReadPrec CreateDomainName
Int -> ReadS CreateDomainName
ReadS [CreateDomainName]
(Int -> ReadS CreateDomainName)
-> ReadS [CreateDomainName]
-> ReadPrec CreateDomainName
-> ReadPrec [CreateDomainName]
-> Read CreateDomainName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDomainName]
$creadListPrec :: ReadPrec [CreateDomainName]
readPrec :: ReadPrec CreateDomainName
$creadPrec :: ReadPrec CreateDomainName
readList :: ReadS [CreateDomainName]
$creadList :: ReadS [CreateDomainName]
readsPrec :: Int -> ReadS CreateDomainName
$creadsPrec :: Int -> ReadS CreateDomainName
Prelude.Read, Int -> CreateDomainName -> ShowS
[CreateDomainName] -> ShowS
CreateDomainName -> String
(Int -> CreateDomainName -> ShowS)
-> (CreateDomainName -> String)
-> ([CreateDomainName] -> ShowS)
-> Show CreateDomainName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomainName] -> ShowS
$cshowList :: [CreateDomainName] -> ShowS
show :: CreateDomainName -> String
$cshow :: CreateDomainName -> String
showsPrec :: Int -> CreateDomainName -> ShowS
$cshowsPrec :: Int -> CreateDomainName -> ShowS
Prelude.Show, (forall x. CreateDomainName -> Rep CreateDomainName x)
-> (forall x. Rep CreateDomainName x -> CreateDomainName)
-> Generic CreateDomainName
forall x. Rep CreateDomainName x -> CreateDomainName
forall x. CreateDomainName -> Rep CreateDomainName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDomainName x -> CreateDomainName
$cfrom :: forall x. CreateDomainName -> Rep CreateDomainName x
Prelude.Generic)

-- |
-- Create a value of 'CreateDomainName' 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:
--
-- 'certificateName', 'createDomainName_certificateName' - The user-friendly name of the certificate that will be used by
-- edge-optimized endpoint for this domain name.
--
-- 'ownershipVerificationCertificateArn', 'createDomainName_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', 'createDomainName_regionalCertificateArn' - The reference to an AWS-managed certificate that will be used by
-- regional endpoint for this domain name. AWS Certificate Manager is the
-- only supported source.
--
-- 'certificateArn', 'createDomainName_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.
--
-- 'securityPolicy', 'createDomainName_securityPolicy' - The Transport Layer Security (TLS) version + cipher suite for this
-- DomainName. The valid values are @TLS_1_0@ and @TLS_1_2@.
--
-- 'mutualTlsAuthentication', 'createDomainName_mutualTlsAuthentication' - Undocumented member.
--
-- 'certificatePrivateKey', 'createDomainName_certificatePrivateKey' - [Deprecated] Your edge-optimized endpoint\'s domain name certificate\'s
-- private key.
--
-- 'regionalCertificateName', 'createDomainName_regionalCertificateName' - The user-friendly name of the certificate that will be used by regional
-- endpoint for this domain name.
--
-- 'certificateBody', 'createDomainName_certificateBody' - [Deprecated] The body of the server certificate that will be used by
-- edge-optimized endpoint for this domain name provided by your
-- certificate authority.
--
-- 'certificateChain', 'createDomainName_certificateChain' - [Deprecated] The intermediate certificates and optionally the root
-- certificate, one after the other without any blank lines, used by an
-- edge-optimized endpoint for this domain name. If you include the root
-- certificate, your certificate chain must start with intermediate
-- certificates and end with the root certificate. Use the intermediate
-- certificates that were provided by your certificate authority. Do not
-- include any intermediaries that are not in the chain of trust path.
--
-- 'endpointConfiguration', 'createDomainName_endpointConfiguration' - The endpoint configuration of this DomainName showing the endpoint types
-- of the domain name.
--
-- 'tags', 'createDomainName_tags' - The key-value map of strings. The valid character set is
-- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
-- start with @aws:@. The tag value can be up to 256 characters.
--
-- 'domainName', 'createDomainName_domainName' - [Required] The name of the DomainName resource.
newCreateDomainName ::
  -- | 'domainName'
  Prelude.Text ->
  CreateDomainName
newCreateDomainName :: Text -> CreateDomainName
newCreateDomainName Text
pDomainName_ =
  CreateDomainName' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SecurityPolicy
-> Maybe MutualTlsAuthenticationInput
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EndpointConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> CreateDomainName
CreateDomainName'
    { $sel:certificateName:CreateDomainName' :: Maybe Text
certificateName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ownershipVerificationCertificateArn:CreateDomainName' :: Maybe Text
ownershipVerificationCertificateArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regionalCertificateArn:CreateDomainName' :: Maybe Text
regionalCertificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:CreateDomainName' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityPolicy:CreateDomainName' :: Maybe SecurityPolicy
securityPolicy = Maybe SecurityPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:mutualTlsAuthentication:CreateDomainName' :: Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication = Maybe MutualTlsAuthenticationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePrivateKey:CreateDomainName' :: Maybe Text
certificatePrivateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regionalCertificateName:CreateDomainName' :: Maybe Text
regionalCertificateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateBody:CreateDomainName' :: Maybe Text
certificateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateChain:CreateDomainName' :: Maybe Text
certificateChain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointConfiguration:CreateDomainName' :: Maybe EndpointConfiguration
endpointConfiguration = Maybe EndpointConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDomainName' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CreateDomainName' :: Text
domainName = Text
pDomainName_
    }

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

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

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

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

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

-- | Undocumented member.
createDomainName_mutualTlsAuthentication :: Lens.Lens' CreateDomainName (Prelude.Maybe MutualTlsAuthenticationInput)
createDomainName_mutualTlsAuthentication :: (Maybe MutualTlsAuthenticationInput
 -> f (Maybe MutualTlsAuthenticationInput))
-> CreateDomainName -> f CreateDomainName
createDomainName_mutualTlsAuthentication = (CreateDomainName -> Maybe MutualTlsAuthenticationInput)
-> (CreateDomainName
    -> Maybe MutualTlsAuthenticationInput -> CreateDomainName)
-> Lens
     CreateDomainName
     CreateDomainName
     (Maybe MutualTlsAuthenticationInput)
     (Maybe MutualTlsAuthenticationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication :: Maybe MutualTlsAuthenticationInput
$sel:mutualTlsAuthentication:CreateDomainName' :: CreateDomainName -> Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication} -> Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication) (\s :: CreateDomainName
s@CreateDomainName' {} Maybe MutualTlsAuthenticationInput
a -> CreateDomainName
s {$sel:mutualTlsAuthentication:CreateDomainName' :: Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication = Maybe MutualTlsAuthenticationInput
a} :: CreateDomainName)

-- | [Deprecated] Your edge-optimized endpoint\'s domain name certificate\'s
-- private key.
createDomainName_certificatePrivateKey :: Lens.Lens' CreateDomainName (Prelude.Maybe Prelude.Text)
createDomainName_certificatePrivateKey :: (Maybe Text -> f (Maybe Text))
-> CreateDomainName -> f CreateDomainName
createDomainName_certificatePrivateKey = (CreateDomainName -> Maybe Text)
-> (CreateDomainName -> Maybe Text -> CreateDomainName)
-> Lens CreateDomainName CreateDomainName (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Maybe Text
certificatePrivateKey :: Maybe Text
$sel:certificatePrivateKey:CreateDomainName' :: CreateDomainName -> Maybe Text
certificatePrivateKey} -> Maybe Text
certificatePrivateKey) (\s :: CreateDomainName
s@CreateDomainName' {} Maybe Text
a -> CreateDomainName
s {$sel:certificatePrivateKey:CreateDomainName' :: Maybe Text
certificatePrivateKey = Maybe Text
a} :: CreateDomainName)

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

-- | [Deprecated] The body of the server certificate that will be used by
-- edge-optimized endpoint for this domain name provided by your
-- certificate authority.
createDomainName_certificateBody :: Lens.Lens' CreateDomainName (Prelude.Maybe Prelude.Text)
createDomainName_certificateBody :: (Maybe Text -> f (Maybe Text))
-> CreateDomainName -> f CreateDomainName
createDomainName_certificateBody = (CreateDomainName -> Maybe Text)
-> (CreateDomainName -> Maybe Text -> CreateDomainName)
-> Lens CreateDomainName CreateDomainName (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Maybe Text
certificateBody :: Maybe Text
$sel:certificateBody:CreateDomainName' :: CreateDomainName -> Maybe Text
certificateBody} -> Maybe Text
certificateBody) (\s :: CreateDomainName
s@CreateDomainName' {} Maybe Text
a -> CreateDomainName
s {$sel:certificateBody:CreateDomainName' :: Maybe Text
certificateBody = Maybe Text
a} :: CreateDomainName)

-- | [Deprecated] The intermediate certificates and optionally the root
-- certificate, one after the other without any blank lines, used by an
-- edge-optimized endpoint for this domain name. If you include the root
-- certificate, your certificate chain must start with intermediate
-- certificates and end with the root certificate. Use the intermediate
-- certificates that were provided by your certificate authority. Do not
-- include any intermediaries that are not in the chain of trust path.
createDomainName_certificateChain :: Lens.Lens' CreateDomainName (Prelude.Maybe Prelude.Text)
createDomainName_certificateChain :: (Maybe Text -> f (Maybe Text))
-> CreateDomainName -> f CreateDomainName
createDomainName_certificateChain = (CreateDomainName -> Maybe Text)
-> (CreateDomainName -> Maybe Text -> CreateDomainName)
-> Lens CreateDomainName CreateDomainName (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Maybe Text
certificateChain :: Maybe Text
$sel:certificateChain:CreateDomainName' :: CreateDomainName -> Maybe Text
certificateChain} -> Maybe Text
certificateChain) (\s :: CreateDomainName
s@CreateDomainName' {} Maybe Text
a -> CreateDomainName
s {$sel:certificateChain:CreateDomainName' :: Maybe Text
certificateChain = Maybe Text
a} :: CreateDomainName)

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

-- | The key-value map of strings. The valid character set is
-- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
-- start with @aws:@. The tag value can be up to 256 characters.
createDomainName_tags :: Lens.Lens' CreateDomainName (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDomainName_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainName -> f CreateDomainName
createDomainName_tags = (CreateDomainName -> Maybe (HashMap Text Text))
-> (CreateDomainName
    -> Maybe (HashMap Text Text) -> CreateDomainName)
-> Lens
     CreateDomainName
     CreateDomainName
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDomainName' :: CreateDomainName -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDomainName
s@CreateDomainName' {} Maybe (HashMap Text Text)
a -> CreateDomainName
s {$sel:tags:CreateDomainName' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDomainName) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateDomainName -> f CreateDomainName)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainName
-> f CreateDomainName
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Required] The name of the DomainName resource.
createDomainName_domainName :: Lens.Lens' CreateDomainName Prelude.Text
createDomainName_domainName :: (Text -> f Text) -> CreateDomainName -> f CreateDomainName
createDomainName_domainName = (CreateDomainName -> Text)
-> (CreateDomainName -> Text -> CreateDomainName)
-> Lens CreateDomainName CreateDomainName Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainName' {Text
domainName :: Text
$sel:domainName:CreateDomainName' :: CreateDomainName -> Text
domainName} -> Text
domainName) (\s :: CreateDomainName
s@CreateDomainName' {} Text
a -> CreateDomainName
s {$sel:domainName:CreateDomainName' :: Text
domainName = Text
a} :: CreateDomainName)

instance Core.AWSRequest CreateDomainName where
  type AWSResponse CreateDomainName = DomainName
  request :: CreateDomainName -> Request CreateDomainName
request = Service -> CreateDomainName -> Request CreateDomainName
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDomainName
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomainName)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDomainName))
-> Logger
-> Service
-> Proxy CreateDomainName
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomainName)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> Object -> Either String DomainName
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable CreateDomainName

instance Prelude.NFData CreateDomainName

instance Core.ToHeaders CreateDomainName where
  toHeaders :: CreateDomainName -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDomainName -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToJSON CreateDomainName where
  toJSON :: CreateDomainName -> Value
toJSON CreateDomainName' {Maybe Text
Maybe (HashMap Text Text)
Maybe EndpointConfiguration
Maybe MutualTlsAuthenticationInput
Maybe SecurityPolicy
Text
domainName :: Text
tags :: Maybe (HashMap Text Text)
endpointConfiguration :: Maybe EndpointConfiguration
certificateChain :: Maybe Text
certificateBody :: Maybe Text
regionalCertificateName :: Maybe Text
certificatePrivateKey :: Maybe Text
mutualTlsAuthentication :: Maybe MutualTlsAuthenticationInput
securityPolicy :: Maybe SecurityPolicy
certificateArn :: Maybe Text
regionalCertificateArn :: Maybe Text
ownershipVerificationCertificateArn :: Maybe Text
certificateName :: Maybe Text
$sel:domainName:CreateDomainName' :: CreateDomainName -> Text
$sel:tags:CreateDomainName' :: CreateDomainName -> Maybe (HashMap Text Text)
$sel:endpointConfiguration:CreateDomainName' :: CreateDomainName -> Maybe EndpointConfiguration
$sel:certificateChain:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:certificateBody:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:regionalCertificateName:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:certificatePrivateKey:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:mutualTlsAuthentication:CreateDomainName' :: CreateDomainName -> Maybe MutualTlsAuthenticationInput
$sel:securityPolicy:CreateDomainName' :: CreateDomainName -> Maybe SecurityPolicy
$sel:certificateArn:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:regionalCertificateArn:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:ownershipVerificationCertificateArn:CreateDomainName' :: CreateDomainName -> Maybe Text
$sel:certificateName:CreateDomainName' :: CreateDomainName -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"regionalCertificateArn" 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
regionalCertificateArn,
            (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
"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
"mutualTlsAuthentication" Text -> MutualTlsAuthenticationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MutualTlsAuthenticationInput -> Pair)
-> Maybe MutualTlsAuthenticationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MutualTlsAuthenticationInput
mutualTlsAuthentication,
            (Text
"certificatePrivateKey" 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
certificatePrivateKey,
            (Text
"regionalCertificateName" 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
regionalCertificateName,
            (Text
"certificateBody" 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
certificateBody,
            (Text
"certificateChain" 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
certificateChain,
            (Text
"endpointConfiguration" Text -> EndpointConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EndpointConfiguration -> Pair)
-> Maybe EndpointConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointConfiguration
endpointConfiguration,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"domainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
          ]
      )

instance Core.ToPath CreateDomainName where
  toPath :: CreateDomainName -> ByteString
toPath = ByteString -> CreateDomainName -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/domainnames"

instance Core.ToQuery CreateDomainName where
  toQuery :: CreateDomainName -> QueryString
toQuery = QueryString -> CreateDomainName -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty