{-# 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.Route53.CreateHostedZone
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new public or private hosted zone. You create records in a
-- public hosted zone to define how you want to route traffic on the
-- internet for a domain, such as example.com, and its subdomains
-- (apex.example.com, acme.example.com). You create records in a private
-- hosted zone to define how you want to route traffic for a domain and its
-- subdomains within one or more Amazon Virtual Private Clouds (Amazon
-- VPCs).
--
-- You can\'t convert a public hosted zone to a private hosted zone or vice
-- versa. Instead, you must create a new hosted zone with the same name and
-- create new resource record sets.
--
-- For more information about charges for hosted zones, see
-- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
--
-- Note the following:
--
-- -   You can\'t create a hosted zone for a top-level domain (TLD) such as
--     .com.
--
-- -   For public hosted zones, Route 53 automatically creates a default
--     SOA record and four NS records for the zone. For more information
--     about SOA and NS records, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html NS and SOA Records that Route 53 Creates for a Hosted Zone>
--     in the /Amazon Route 53 Developer Guide/.
--
--     If you want to use the same name servers for multiple public hosted
--     zones, you can optionally associate a reusable delegation set with
--     the hosted zone. See the @DelegationSetId@ element.
--
-- -   If your domain is registered with a registrar other than Route 53,
--     you must update the name servers with your registrar to make Route
--     53 the DNS service for the domain. For more information, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html Migrating DNS Service for an Existing Domain to Amazon Route 53>
--     in the /Amazon Route 53 Developer Guide/.
--
-- When you submit a @CreateHostedZone@ request, the initial status of the
-- hosted zone is @PENDING@. For public hosted zones, this means that the
-- NS and SOA records are not yet available on all Route 53 DNS servers.
-- When the NS and SOA records are available, the status of the zone
-- changes to @INSYNC@.
--
-- The @CreateHostedZone@ request requires the caller to have an
-- @ec2:DescribeVpcs@ permission.
--
-- When creating private hosted zones, the Amazon VPC must belong to the
-- same partition where the hosted zone is created. A partition is a group
-- of Amazon Web Services Regions. Each Amazon Web Services account is
-- scoped to one partition.
--
-- The following are the supported partitions:
--
-- -   @aws@ - Amazon Web Services Regions
--
-- -   @aws-cn@ - China Regions
--
-- -   @aws-us-gov@ - Amazon Web Services GovCloud (US) Region
--
-- For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Access Management>
-- in the /Amazon Web Services General Reference/.
module Amazonka.Route53.CreateHostedZone
  ( -- * Creating a Request
    CreateHostedZone (..),
    newCreateHostedZone,

    -- * Request Lenses
    createHostedZone_delegationSetId,
    createHostedZone_hostedZoneConfig,
    createHostedZone_vpc,
    createHostedZone_name,
    createHostedZone_callerReference,

    -- * Destructuring the Response
    CreateHostedZoneResponse (..),
    newCreateHostedZoneResponse,

    -- * Response Lenses
    createHostedZoneResponse_vpc,
    createHostedZoneResponse_httpStatus,
    createHostedZoneResponse_hostedZone,
    createHostedZoneResponse_changeInfo,
    createHostedZoneResponse_delegationSet,
    createHostedZoneResponse_location,
  )
where

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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53.Types

-- | A complex type that contains information about the request to create a
-- public or private hosted zone.
--
-- /See:/ 'newCreateHostedZone' smart constructor.
data CreateHostedZone = CreateHostedZone'
  { -- | If you want to associate a reusable delegation set with this hosted
    -- zone, the ID that Amazon Route 53 assigned to the reusable delegation
    -- set when you created it. For more information about reusable delegation
    -- sets, see
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html CreateReusableDelegationSet>.
    CreateHostedZone -> Maybe ResourceId
delegationSetId :: Prelude.Maybe ResourceId,
    -- | (Optional) A complex type that contains the following optional values:
    --
    -- -   For public and private hosted zones, an optional comment
    --
    -- -   For private hosted zones, an optional @PrivateZone@ element
    --
    -- If you don\'t specify a comment or the @PrivateZone@ element, omit
    -- @HostedZoneConfig@ and the other elements.
    CreateHostedZone -> Maybe HostedZoneConfig
hostedZoneConfig :: Prelude.Maybe HostedZoneConfig,
    -- | (Private hosted zones only) A complex type that contains information
    -- about the Amazon VPC that you\'re associating with this hosted zone.
    --
    -- You can specify only one Amazon VPC when you create a private hosted
    -- zone. If you are associating a VPC with a hosted zone with this request,
    -- the paramaters @VPCId@ and @VPCRegion@ are also required.
    --
    -- To associate additional Amazon VPCs with the hosted zone, use
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html AssociateVPCWithHostedZone>
    -- after you create a hosted zone.
    CreateHostedZone -> Maybe VPC
vpc :: Prelude.Maybe VPC,
    -- | The name of the domain. Specify a fully qualified domain name, for
    -- example, /www.example.com/. The trailing dot is optional; Amazon
    -- Route 53 assumes that the domain name is fully qualified. This means
    -- that Route 53 treats /www.example.com/ (without a trailing dot) and
    -- /www.example.com./ (with a trailing dot) as identical.
    --
    -- If you\'re creating a public hosted zone, this is the name you have
    -- registered with your DNS registrar. If your domain name is registered
    -- with a registrar other than Route 53, change the name servers for your
    -- domain to the set of @NameServers@ that @CreateHostedZone@ returns in
    -- @DelegationSet@.
    CreateHostedZone -> Text
name :: Prelude.Text,
    -- | A unique string that identifies the request and that allows failed
    -- @CreateHostedZone@ requests to be retried without the risk of executing
    -- the operation twice. You must use a unique @CallerReference@ string
    -- every time you submit a @CreateHostedZone@ request. @CallerReference@
    -- can be any unique string, for example, a date\/time stamp.
    CreateHostedZone -> Text
callerReference :: Prelude.Text
  }
  deriving (CreateHostedZone -> CreateHostedZone -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHostedZone -> CreateHostedZone -> Bool
$c/= :: CreateHostedZone -> CreateHostedZone -> Bool
== :: CreateHostedZone -> CreateHostedZone -> Bool
$c== :: CreateHostedZone -> CreateHostedZone -> Bool
Prelude.Eq, ReadPrec [CreateHostedZone]
ReadPrec CreateHostedZone
Int -> ReadS CreateHostedZone
ReadS [CreateHostedZone]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHostedZone]
$creadListPrec :: ReadPrec [CreateHostedZone]
readPrec :: ReadPrec CreateHostedZone
$creadPrec :: ReadPrec CreateHostedZone
readList :: ReadS [CreateHostedZone]
$creadList :: ReadS [CreateHostedZone]
readsPrec :: Int -> ReadS CreateHostedZone
$creadsPrec :: Int -> ReadS CreateHostedZone
Prelude.Read, Int -> CreateHostedZone -> ShowS
[CreateHostedZone] -> ShowS
CreateHostedZone -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHostedZone] -> ShowS
$cshowList :: [CreateHostedZone] -> ShowS
show :: CreateHostedZone -> String
$cshow :: CreateHostedZone -> String
showsPrec :: Int -> CreateHostedZone -> ShowS
$cshowsPrec :: Int -> CreateHostedZone -> ShowS
Prelude.Show, forall x. Rep CreateHostedZone x -> CreateHostedZone
forall x. CreateHostedZone -> Rep CreateHostedZone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHostedZone x -> CreateHostedZone
$cfrom :: forall x. CreateHostedZone -> Rep CreateHostedZone x
Prelude.Generic)

-- |
-- Create a value of 'CreateHostedZone' 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:
--
-- 'delegationSetId', 'createHostedZone_delegationSetId' - If you want to associate a reusable delegation set with this hosted
-- zone, the ID that Amazon Route 53 assigned to the reusable delegation
-- set when you created it. For more information about reusable delegation
-- sets, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html CreateReusableDelegationSet>.
--
-- 'hostedZoneConfig', 'createHostedZone_hostedZoneConfig' - (Optional) A complex type that contains the following optional values:
--
-- -   For public and private hosted zones, an optional comment
--
-- -   For private hosted zones, an optional @PrivateZone@ element
--
-- If you don\'t specify a comment or the @PrivateZone@ element, omit
-- @HostedZoneConfig@ and the other elements.
--
-- 'vpc', 'createHostedZone_vpc' - (Private hosted zones only) A complex type that contains information
-- about the Amazon VPC that you\'re associating with this hosted zone.
--
-- You can specify only one Amazon VPC when you create a private hosted
-- zone. If you are associating a VPC with a hosted zone with this request,
-- the paramaters @VPCId@ and @VPCRegion@ are also required.
--
-- To associate additional Amazon VPCs with the hosted zone, use
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html AssociateVPCWithHostedZone>
-- after you create a hosted zone.
--
-- 'name', 'createHostedZone_name' - The name of the domain. Specify a fully qualified domain name, for
-- example, /www.example.com/. The trailing dot is optional; Amazon
-- Route 53 assumes that the domain name is fully qualified. This means
-- that Route 53 treats /www.example.com/ (without a trailing dot) and
-- /www.example.com./ (with a trailing dot) as identical.
--
-- If you\'re creating a public hosted zone, this is the name you have
-- registered with your DNS registrar. If your domain name is registered
-- with a registrar other than Route 53, change the name servers for your
-- domain to the set of @NameServers@ that @CreateHostedZone@ returns in
-- @DelegationSet@.
--
-- 'callerReference', 'createHostedZone_callerReference' - A unique string that identifies the request and that allows failed
-- @CreateHostedZone@ requests to be retried without the risk of executing
-- the operation twice. You must use a unique @CallerReference@ string
-- every time you submit a @CreateHostedZone@ request. @CallerReference@
-- can be any unique string, for example, a date\/time stamp.
newCreateHostedZone ::
  -- | 'name'
  Prelude.Text ->
  -- | 'callerReference'
  Prelude.Text ->
  CreateHostedZone
newCreateHostedZone :: Text -> Text -> CreateHostedZone
newCreateHostedZone Text
pName_ Text
pCallerReference_ =
  CreateHostedZone'
    { $sel:delegationSetId:CreateHostedZone' :: Maybe ResourceId
delegationSetId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:hostedZoneConfig:CreateHostedZone' :: Maybe HostedZoneConfig
hostedZoneConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:CreateHostedZone' :: Maybe VPC
vpc = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateHostedZone' :: Text
name = Text
pName_,
      $sel:callerReference:CreateHostedZone' :: Text
callerReference = Text
pCallerReference_
    }

-- | If you want to associate a reusable delegation set with this hosted
-- zone, the ID that Amazon Route 53 assigned to the reusable delegation
-- set when you created it. For more information about reusable delegation
-- sets, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html CreateReusableDelegationSet>.
createHostedZone_delegationSetId :: Lens.Lens' CreateHostedZone (Prelude.Maybe ResourceId)
createHostedZone_delegationSetId :: Lens' CreateHostedZone (Maybe ResourceId)
createHostedZone_delegationSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZone' {Maybe ResourceId
delegationSetId :: Maybe ResourceId
$sel:delegationSetId:CreateHostedZone' :: CreateHostedZone -> Maybe ResourceId
delegationSetId} -> Maybe ResourceId
delegationSetId) (\s :: CreateHostedZone
s@CreateHostedZone' {} Maybe ResourceId
a -> CreateHostedZone
s {$sel:delegationSetId:CreateHostedZone' :: Maybe ResourceId
delegationSetId = Maybe ResourceId
a} :: CreateHostedZone)

-- | (Optional) A complex type that contains the following optional values:
--
-- -   For public and private hosted zones, an optional comment
--
-- -   For private hosted zones, an optional @PrivateZone@ element
--
-- If you don\'t specify a comment or the @PrivateZone@ element, omit
-- @HostedZoneConfig@ and the other elements.
createHostedZone_hostedZoneConfig :: Lens.Lens' CreateHostedZone (Prelude.Maybe HostedZoneConfig)
createHostedZone_hostedZoneConfig :: Lens' CreateHostedZone (Maybe HostedZoneConfig)
createHostedZone_hostedZoneConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZone' {Maybe HostedZoneConfig
hostedZoneConfig :: Maybe HostedZoneConfig
$sel:hostedZoneConfig:CreateHostedZone' :: CreateHostedZone -> Maybe HostedZoneConfig
hostedZoneConfig} -> Maybe HostedZoneConfig
hostedZoneConfig) (\s :: CreateHostedZone
s@CreateHostedZone' {} Maybe HostedZoneConfig
a -> CreateHostedZone
s {$sel:hostedZoneConfig:CreateHostedZone' :: Maybe HostedZoneConfig
hostedZoneConfig = Maybe HostedZoneConfig
a} :: CreateHostedZone)

-- | (Private hosted zones only) A complex type that contains information
-- about the Amazon VPC that you\'re associating with this hosted zone.
--
-- You can specify only one Amazon VPC when you create a private hosted
-- zone. If you are associating a VPC with a hosted zone with this request,
-- the paramaters @VPCId@ and @VPCRegion@ are also required.
--
-- To associate additional Amazon VPCs with the hosted zone, use
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html AssociateVPCWithHostedZone>
-- after you create a hosted zone.
createHostedZone_vpc :: Lens.Lens' CreateHostedZone (Prelude.Maybe VPC)
createHostedZone_vpc :: Lens' CreateHostedZone (Maybe VPC)
createHostedZone_vpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZone' {Maybe VPC
vpc :: Maybe VPC
$sel:vpc:CreateHostedZone' :: CreateHostedZone -> Maybe VPC
vpc} -> Maybe VPC
vpc) (\s :: CreateHostedZone
s@CreateHostedZone' {} Maybe VPC
a -> CreateHostedZone
s {$sel:vpc:CreateHostedZone' :: Maybe VPC
vpc = Maybe VPC
a} :: CreateHostedZone)

-- | The name of the domain. Specify a fully qualified domain name, for
-- example, /www.example.com/. The trailing dot is optional; Amazon
-- Route 53 assumes that the domain name is fully qualified. This means
-- that Route 53 treats /www.example.com/ (without a trailing dot) and
-- /www.example.com./ (with a trailing dot) as identical.
--
-- If you\'re creating a public hosted zone, this is the name you have
-- registered with your DNS registrar. If your domain name is registered
-- with a registrar other than Route 53, change the name servers for your
-- domain to the set of @NameServers@ that @CreateHostedZone@ returns in
-- @DelegationSet@.
createHostedZone_name :: Lens.Lens' CreateHostedZone Prelude.Text
createHostedZone_name :: Lens' CreateHostedZone Text
createHostedZone_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZone' {Text
name :: Text
$sel:name:CreateHostedZone' :: CreateHostedZone -> Text
name} -> Text
name) (\s :: CreateHostedZone
s@CreateHostedZone' {} Text
a -> CreateHostedZone
s {$sel:name:CreateHostedZone' :: Text
name = Text
a} :: CreateHostedZone)

-- | A unique string that identifies the request and that allows failed
-- @CreateHostedZone@ requests to be retried without the risk of executing
-- the operation twice. You must use a unique @CallerReference@ string
-- every time you submit a @CreateHostedZone@ request. @CallerReference@
-- can be any unique string, for example, a date\/time stamp.
createHostedZone_callerReference :: Lens.Lens' CreateHostedZone Prelude.Text
createHostedZone_callerReference :: Lens' CreateHostedZone Text
createHostedZone_callerReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZone' {Text
callerReference :: Text
$sel:callerReference:CreateHostedZone' :: CreateHostedZone -> Text
callerReference} -> Text
callerReference) (\s :: CreateHostedZone
s@CreateHostedZone' {} Text
a -> CreateHostedZone
s {$sel:callerReference:CreateHostedZone' :: Text
callerReference = Text
a} :: CreateHostedZone)

instance Core.AWSRequest CreateHostedZone where
  type
    AWSResponse CreateHostedZone =
      CreateHostedZoneResponse
  request :: (Service -> Service)
-> CreateHostedZone -> Request CreateHostedZone
request Service -> Service
overrides =
    forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateHostedZone
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateHostedZone)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe VPC
-> Int
-> HostedZone
-> ChangeInfo
-> DelegationSet
-> Text
-> CreateHostedZoneResponse
CreateHostedZoneResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"VPC")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"HostedZone")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ChangeInfo")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"DelegationSet")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String a
Data..# HeaderName
"Location")
      )

instance Prelude.Hashable CreateHostedZone where
  hashWithSalt :: Int -> CreateHostedZone -> Int
hashWithSalt Int
_salt CreateHostedZone' {Maybe ResourceId
Maybe HostedZoneConfig
Maybe VPC
Text
callerReference :: Text
name :: Text
vpc :: Maybe VPC
hostedZoneConfig :: Maybe HostedZoneConfig
delegationSetId :: Maybe ResourceId
$sel:callerReference:CreateHostedZone' :: CreateHostedZone -> Text
$sel:name:CreateHostedZone' :: CreateHostedZone -> Text
$sel:vpc:CreateHostedZone' :: CreateHostedZone -> Maybe VPC
$sel:hostedZoneConfig:CreateHostedZone' :: CreateHostedZone -> Maybe HostedZoneConfig
$sel:delegationSetId:CreateHostedZone' :: CreateHostedZone -> Maybe ResourceId
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceId
delegationSetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HostedZoneConfig
hostedZoneConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VPC
vpc
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
callerReference

instance Prelude.NFData CreateHostedZone where
  rnf :: CreateHostedZone -> ()
rnf CreateHostedZone' {Maybe ResourceId
Maybe HostedZoneConfig
Maybe VPC
Text
callerReference :: Text
name :: Text
vpc :: Maybe VPC
hostedZoneConfig :: Maybe HostedZoneConfig
delegationSetId :: Maybe ResourceId
$sel:callerReference:CreateHostedZone' :: CreateHostedZone -> Text
$sel:name:CreateHostedZone' :: CreateHostedZone -> Text
$sel:vpc:CreateHostedZone' :: CreateHostedZone -> Maybe VPC
$sel:hostedZoneConfig:CreateHostedZone' :: CreateHostedZone -> Maybe HostedZoneConfig
$sel:delegationSetId:CreateHostedZone' :: CreateHostedZone -> Maybe ResourceId
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceId
delegationSetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HostedZoneConfig
hostedZoneConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VPC
vpc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
callerReference

instance Data.ToElement CreateHostedZone where
  toElement :: CreateHostedZone -> Element
toElement =
    forall a. ToXML a => Name -> a -> Element
Data.mkElement
      Name
"{https://route53.amazonaws.com/doc/2013-04-01/}CreateHostedZoneRequest"

instance Data.ToHeaders CreateHostedZone where
  toHeaders :: CreateHostedZone -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath CreateHostedZone where
  toPath :: CreateHostedZone -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/hostedzone"

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

instance Data.ToXML CreateHostedZone where
  toXML :: CreateHostedZone -> XML
toXML CreateHostedZone' {Maybe ResourceId
Maybe HostedZoneConfig
Maybe VPC
Text
callerReference :: Text
name :: Text
vpc :: Maybe VPC
hostedZoneConfig :: Maybe HostedZoneConfig
delegationSetId :: Maybe ResourceId
$sel:callerReference:CreateHostedZone' :: CreateHostedZone -> Text
$sel:name:CreateHostedZone' :: CreateHostedZone -> Text
$sel:vpc:CreateHostedZone' :: CreateHostedZone -> Maybe VPC
$sel:hostedZoneConfig:CreateHostedZone' :: CreateHostedZone -> Maybe HostedZoneConfig
$sel:delegationSetId:CreateHostedZone' :: CreateHostedZone -> Maybe ResourceId
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"DelegationSetId" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe ResourceId
delegationSetId,
        Name
"HostedZoneConfig" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe HostedZoneConfig
hostedZoneConfig,
        Name
"VPC" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe VPC
vpc,
        Name
"Name" forall a. ToXML a => Name -> a -> XML
Data.@= Text
name,
        Name
"CallerReference" forall a. ToXML a => Name -> a -> XML
Data.@= Text
callerReference
      ]

-- | A complex type containing the response information for the hosted zone.
--
-- /See:/ 'newCreateHostedZoneResponse' smart constructor.
data CreateHostedZoneResponse = CreateHostedZoneResponse'
  { -- | A complex type that contains information about an Amazon VPC that you
    -- associated with this hosted zone.
    CreateHostedZoneResponse -> Maybe VPC
vpc :: Prelude.Maybe VPC,
    -- | The response's http status code.
    CreateHostedZoneResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains general information about the hosted zone.
    CreateHostedZoneResponse -> HostedZone
hostedZone :: HostedZone,
    -- | A complex type that contains information about the @CreateHostedZone@
    -- request.
    CreateHostedZoneResponse -> ChangeInfo
changeInfo :: ChangeInfo,
    -- | A complex type that describes the name servers for this hosted zone.
    CreateHostedZoneResponse -> DelegationSet
delegationSet :: DelegationSet,
    -- | The unique URL representing the new hosted zone.
    CreateHostedZoneResponse -> Text
location :: Prelude.Text
  }
  deriving (CreateHostedZoneResponse -> CreateHostedZoneResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHostedZoneResponse -> CreateHostedZoneResponse -> Bool
$c/= :: CreateHostedZoneResponse -> CreateHostedZoneResponse -> Bool
== :: CreateHostedZoneResponse -> CreateHostedZoneResponse -> Bool
$c== :: CreateHostedZoneResponse -> CreateHostedZoneResponse -> Bool
Prelude.Eq, ReadPrec [CreateHostedZoneResponse]
ReadPrec CreateHostedZoneResponse
Int -> ReadS CreateHostedZoneResponse
ReadS [CreateHostedZoneResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHostedZoneResponse]
$creadListPrec :: ReadPrec [CreateHostedZoneResponse]
readPrec :: ReadPrec CreateHostedZoneResponse
$creadPrec :: ReadPrec CreateHostedZoneResponse
readList :: ReadS [CreateHostedZoneResponse]
$creadList :: ReadS [CreateHostedZoneResponse]
readsPrec :: Int -> ReadS CreateHostedZoneResponse
$creadsPrec :: Int -> ReadS CreateHostedZoneResponse
Prelude.Read, Int -> CreateHostedZoneResponse -> ShowS
[CreateHostedZoneResponse] -> ShowS
CreateHostedZoneResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHostedZoneResponse] -> ShowS
$cshowList :: [CreateHostedZoneResponse] -> ShowS
show :: CreateHostedZoneResponse -> String
$cshow :: CreateHostedZoneResponse -> String
showsPrec :: Int -> CreateHostedZoneResponse -> ShowS
$cshowsPrec :: Int -> CreateHostedZoneResponse -> ShowS
Prelude.Show, forall x.
Rep CreateHostedZoneResponse x -> CreateHostedZoneResponse
forall x.
CreateHostedZoneResponse -> Rep CreateHostedZoneResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateHostedZoneResponse x -> CreateHostedZoneResponse
$cfrom :: forall x.
CreateHostedZoneResponse -> Rep CreateHostedZoneResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateHostedZoneResponse' 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:
--
-- 'vpc', 'createHostedZoneResponse_vpc' - A complex type that contains information about an Amazon VPC that you
-- associated with this hosted zone.
--
-- 'httpStatus', 'createHostedZoneResponse_httpStatus' - The response's http status code.
--
-- 'hostedZone', 'createHostedZoneResponse_hostedZone' - A complex type that contains general information about the hosted zone.
--
-- 'changeInfo', 'createHostedZoneResponse_changeInfo' - A complex type that contains information about the @CreateHostedZone@
-- request.
--
-- 'delegationSet', 'createHostedZoneResponse_delegationSet' - A complex type that describes the name servers for this hosted zone.
--
-- 'location', 'createHostedZoneResponse_location' - The unique URL representing the new hosted zone.
newCreateHostedZoneResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'hostedZone'
  HostedZone ->
  -- | 'changeInfo'
  ChangeInfo ->
  -- | 'delegationSet'
  DelegationSet ->
  -- | 'location'
  Prelude.Text ->
  CreateHostedZoneResponse
newCreateHostedZoneResponse :: Int
-> HostedZone
-> ChangeInfo
-> DelegationSet
-> Text
-> CreateHostedZoneResponse
newCreateHostedZoneResponse
  Int
pHttpStatus_
  HostedZone
pHostedZone_
  ChangeInfo
pChangeInfo_
  DelegationSet
pDelegationSet_
  Text
pLocation_ =
    CreateHostedZoneResponse'
      { $sel:vpc:CreateHostedZoneResponse' :: Maybe VPC
vpc = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateHostedZoneResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:hostedZone:CreateHostedZoneResponse' :: HostedZone
hostedZone = HostedZone
pHostedZone_,
        $sel:changeInfo:CreateHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_,
        $sel:delegationSet:CreateHostedZoneResponse' :: DelegationSet
delegationSet = DelegationSet
pDelegationSet_,
        $sel:location:CreateHostedZoneResponse' :: Text
location = Text
pLocation_
      }

-- | A complex type that contains information about an Amazon VPC that you
-- associated with this hosted zone.
createHostedZoneResponse_vpc :: Lens.Lens' CreateHostedZoneResponse (Prelude.Maybe VPC)
createHostedZoneResponse_vpc :: Lens' CreateHostedZoneResponse (Maybe VPC)
createHostedZoneResponse_vpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {Maybe VPC
vpc :: Maybe VPC
$sel:vpc:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Maybe VPC
vpc} -> Maybe VPC
vpc) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} Maybe VPC
a -> CreateHostedZoneResponse
s {$sel:vpc:CreateHostedZoneResponse' :: Maybe VPC
vpc = Maybe VPC
a} :: CreateHostedZoneResponse)

-- | The response's http status code.
createHostedZoneResponse_httpStatus :: Lens.Lens' CreateHostedZoneResponse Prelude.Int
createHostedZoneResponse_httpStatus :: Lens' CreateHostedZoneResponse Int
createHostedZoneResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} Int
a -> CreateHostedZoneResponse
s {$sel:httpStatus:CreateHostedZoneResponse' :: Int
httpStatus = Int
a} :: CreateHostedZoneResponse)

-- | A complex type that contains general information about the hosted zone.
createHostedZoneResponse_hostedZone :: Lens.Lens' CreateHostedZoneResponse HostedZone
createHostedZoneResponse_hostedZone :: Lens' CreateHostedZoneResponse HostedZone
createHostedZoneResponse_hostedZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {HostedZone
hostedZone :: HostedZone
$sel:hostedZone:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> HostedZone
hostedZone} -> HostedZone
hostedZone) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} HostedZone
a -> CreateHostedZoneResponse
s {$sel:hostedZone:CreateHostedZoneResponse' :: HostedZone
hostedZone = HostedZone
a} :: CreateHostedZoneResponse)

-- | A complex type that contains information about the @CreateHostedZone@
-- request.
createHostedZoneResponse_changeInfo :: Lens.Lens' CreateHostedZoneResponse ChangeInfo
createHostedZoneResponse_changeInfo :: Lens' CreateHostedZoneResponse ChangeInfo
createHostedZoneResponse_changeInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} ChangeInfo
a -> CreateHostedZoneResponse
s {$sel:changeInfo:CreateHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: CreateHostedZoneResponse)

-- | A complex type that describes the name servers for this hosted zone.
createHostedZoneResponse_delegationSet :: Lens.Lens' CreateHostedZoneResponse DelegationSet
createHostedZoneResponse_delegationSet :: Lens' CreateHostedZoneResponse DelegationSet
createHostedZoneResponse_delegationSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {DelegationSet
delegationSet :: DelegationSet
$sel:delegationSet:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> DelegationSet
delegationSet} -> DelegationSet
delegationSet) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} DelegationSet
a -> CreateHostedZoneResponse
s {$sel:delegationSet:CreateHostedZoneResponse' :: DelegationSet
delegationSet = DelegationSet
a} :: CreateHostedZoneResponse)

-- | The unique URL representing the new hosted zone.
createHostedZoneResponse_location :: Lens.Lens' CreateHostedZoneResponse Prelude.Text
createHostedZoneResponse_location :: Lens' CreateHostedZoneResponse Text
createHostedZoneResponse_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedZoneResponse' {Text
location :: Text
$sel:location:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Text
location} -> Text
location) (\s :: CreateHostedZoneResponse
s@CreateHostedZoneResponse' {} Text
a -> CreateHostedZoneResponse
s {$sel:location:CreateHostedZoneResponse' :: Text
location = Text
a} :: CreateHostedZoneResponse)

instance Prelude.NFData CreateHostedZoneResponse where
  rnf :: CreateHostedZoneResponse -> ()
rnf CreateHostedZoneResponse' {Int
Maybe VPC
Text
ChangeInfo
DelegationSet
HostedZone
location :: Text
delegationSet :: DelegationSet
changeInfo :: ChangeInfo
hostedZone :: HostedZone
httpStatus :: Int
vpc :: Maybe VPC
$sel:location:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Text
$sel:delegationSet:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> DelegationSet
$sel:changeInfo:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> ChangeInfo
$sel:hostedZone:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> HostedZone
$sel:httpStatus:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Int
$sel:vpc:CreateHostedZoneResponse' :: CreateHostedZoneResponse -> Maybe VPC
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VPC
vpc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HostedZone
hostedZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ChangeInfo
changeInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DelegationSet
delegationSet
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
location