{-# 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 #-}
module Amazonka.Route53.AssociateVPCWithHostedZone
(
AssociateVPCWithHostedZone (..),
newAssociateVPCWithHostedZone,
associateVPCWithHostedZone_comment,
associateVPCWithHostedZone_hostedZoneId,
associateVPCWithHostedZone_vpc,
AssociateVPCWithHostedZoneResponse (..),
newAssociateVPCWithHostedZoneResponse,
associateVPCWithHostedZoneResponse_httpStatus,
associateVPCWithHostedZoneResponse_changeInfo,
)
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
data AssociateVPCWithHostedZone = AssociateVPCWithHostedZone'
{
:: Prelude.Maybe Prelude.Text,
AssociateVPCWithHostedZone -> ResourceId
hostedZoneId :: ResourceId,
AssociateVPCWithHostedZone -> VPC
vpc :: VPC
}
deriving (AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool
$c/= :: AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool
== :: AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool
$c== :: AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool
Prelude.Eq, ReadPrec [AssociateVPCWithHostedZone]
ReadPrec AssociateVPCWithHostedZone
Int -> ReadS AssociateVPCWithHostedZone
ReadS [AssociateVPCWithHostedZone]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateVPCWithHostedZone]
$creadListPrec :: ReadPrec [AssociateVPCWithHostedZone]
readPrec :: ReadPrec AssociateVPCWithHostedZone
$creadPrec :: ReadPrec AssociateVPCWithHostedZone
readList :: ReadS [AssociateVPCWithHostedZone]
$creadList :: ReadS [AssociateVPCWithHostedZone]
readsPrec :: Int -> ReadS AssociateVPCWithHostedZone
$creadsPrec :: Int -> ReadS AssociateVPCWithHostedZone
Prelude.Read, Int -> AssociateVPCWithHostedZone -> ShowS
[AssociateVPCWithHostedZone] -> ShowS
AssociateVPCWithHostedZone -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateVPCWithHostedZone] -> ShowS
$cshowList :: [AssociateVPCWithHostedZone] -> ShowS
show :: AssociateVPCWithHostedZone -> String
$cshow :: AssociateVPCWithHostedZone -> String
showsPrec :: Int -> AssociateVPCWithHostedZone -> ShowS
$cshowsPrec :: Int -> AssociateVPCWithHostedZone -> ShowS
Prelude.Show, forall x.
Rep AssociateVPCWithHostedZone x -> AssociateVPCWithHostedZone
forall x.
AssociateVPCWithHostedZone -> Rep AssociateVPCWithHostedZone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateVPCWithHostedZone x -> AssociateVPCWithHostedZone
$cfrom :: forall x.
AssociateVPCWithHostedZone -> Rep AssociateVPCWithHostedZone x
Prelude.Generic)
newAssociateVPCWithHostedZone ::
ResourceId ->
VPC ->
AssociateVPCWithHostedZone
newAssociateVPCWithHostedZone :: ResourceId -> VPC -> AssociateVPCWithHostedZone
newAssociateVPCWithHostedZone ResourceId
pHostedZoneId_ VPC
pVPC_ =
AssociateVPCWithHostedZone'
{ $sel:comment:AssociateVPCWithHostedZone' :: Maybe Text
comment =
forall a. Maybe a
Prelude.Nothing,
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_,
$sel:vpc:AssociateVPCWithHostedZone' :: VPC
vpc = VPC
pVPC_
}
associateVPCWithHostedZone_comment :: Lens.Lens' AssociateVPCWithHostedZone (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateVPCWithHostedZone' {Maybe Text
comment :: Maybe Text
$sel:comment:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> Maybe Text
comment} -> Maybe Text
comment) (\s :: AssociateVPCWithHostedZone
s@AssociateVPCWithHostedZone' {} Maybe Text
a -> AssociateVPCWithHostedZone
s {$sel:comment:AssociateVPCWithHostedZone' :: Maybe Text
comment = Maybe Text
a} :: AssociateVPCWithHostedZone)
associateVPCWithHostedZone_hostedZoneId :: Lens.Lens' AssociateVPCWithHostedZone ResourceId
associateVPCWithHostedZone_hostedZoneId :: Lens' AssociateVPCWithHostedZone ResourceId
associateVPCWithHostedZone_hostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateVPCWithHostedZone' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: AssociateVPCWithHostedZone
s@AssociateVPCWithHostedZone' {} ResourceId
a -> AssociateVPCWithHostedZone
s {$sel:hostedZoneId:AssociateVPCWithHostedZone' :: ResourceId
hostedZoneId = ResourceId
a} :: AssociateVPCWithHostedZone)
associateVPCWithHostedZone_vpc :: Lens.Lens' AssociateVPCWithHostedZone VPC
associateVPCWithHostedZone_vpc :: Lens' AssociateVPCWithHostedZone VPC
associateVPCWithHostedZone_vpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateVPCWithHostedZone' {VPC
vpc :: VPC
$sel:vpc:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> VPC
vpc} -> VPC
vpc) (\s :: AssociateVPCWithHostedZone
s@AssociateVPCWithHostedZone' {} VPC
a -> AssociateVPCWithHostedZone
s {$sel:vpc:AssociateVPCWithHostedZone' :: VPC
vpc = VPC
a} :: AssociateVPCWithHostedZone)
instance Core.AWSRequest AssociateVPCWithHostedZone where
type
AWSResponse AssociateVPCWithHostedZone =
AssociateVPCWithHostedZoneResponse
request :: (Service -> Service)
-> AssociateVPCWithHostedZone -> Request AssociateVPCWithHostedZone
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 AssociateVPCWithHostedZone
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateVPCWithHostedZone)))
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 ->
Int -> ChangeInfo -> AssociateVPCWithHostedZoneResponse
AssociateVPCWithHostedZoneResponse'
forall (f :: * -> *) a b. Functor 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
"ChangeInfo")
)
instance Prelude.Hashable AssociateVPCWithHostedZone where
hashWithSalt :: Int -> AssociateVPCWithHostedZone -> Int
hashWithSalt Int
_salt AssociateVPCWithHostedZone' {Maybe Text
ResourceId
VPC
vpc :: VPC
hostedZoneId :: ResourceId
comment :: Maybe Text
$sel:vpc:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> VPC
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> ResourceId
$sel:comment:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceId
hostedZoneId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VPC
vpc
instance Prelude.NFData AssociateVPCWithHostedZone where
rnf :: AssociateVPCWithHostedZone -> ()
rnf AssociateVPCWithHostedZone' {Maybe Text
ResourceId
VPC
vpc :: VPC
hostedZoneId :: ResourceId
comment :: Maybe Text
$sel:vpc:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> VPC
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> ResourceId
$sel:comment:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceId
hostedZoneId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VPC
vpc
instance Data.ToElement AssociateVPCWithHostedZone where
toElement :: AssociateVPCWithHostedZone -> Element
toElement =
forall a. ToXML a => Name -> a -> Element
Data.mkElement
Name
"{https://route53.amazonaws.com/doc/2013-04-01/}AssociateVPCWithHostedZoneRequest"
instance Data.ToHeaders AssociateVPCWithHostedZone where
toHeaders :: AssociateVPCWithHostedZone -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AssociateVPCWithHostedZone where
toPath :: AssociateVPCWithHostedZone -> ByteString
toPath AssociateVPCWithHostedZone' {Maybe Text
ResourceId
VPC
vpc :: VPC
hostedZoneId :: ResourceId
comment :: Maybe Text
$sel:vpc:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> VPC
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> ResourceId
$sel:comment:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2013-04-01/hostedzone/",
forall a. ToByteString a => a -> ByteString
Data.toBS ResourceId
hostedZoneId,
ByteString
"/associatevpc"
]
instance Data.ToQuery AssociateVPCWithHostedZone where
toQuery :: AssociateVPCWithHostedZone -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToXML AssociateVPCWithHostedZone where
toXML :: AssociateVPCWithHostedZone -> XML
toXML AssociateVPCWithHostedZone' {Maybe Text
ResourceId
VPC
vpc :: VPC
hostedZoneId :: ResourceId
comment :: Maybe Text
$sel:vpc:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> VPC
$sel:hostedZoneId:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> ResourceId
$sel:comment:AssociateVPCWithHostedZone' :: AssociateVPCWithHostedZone -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"Comment" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
comment, Name
"VPC" forall a. ToXML a => Name -> a -> XML
Data.@= VPC
vpc]
data AssociateVPCWithHostedZoneResponse = AssociateVPCWithHostedZoneResponse'
{
AssociateVPCWithHostedZoneResponse -> Int
httpStatus :: Prelude.Int,
AssociateVPCWithHostedZoneResponse -> ChangeInfo
changeInfo :: ChangeInfo
}
deriving (AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
$c/= :: AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
== :: AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
$c== :: AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
Prelude.Eq, ReadPrec [AssociateVPCWithHostedZoneResponse]
ReadPrec AssociateVPCWithHostedZoneResponse
Int -> ReadS AssociateVPCWithHostedZoneResponse
ReadS [AssociateVPCWithHostedZoneResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateVPCWithHostedZoneResponse]
$creadListPrec :: ReadPrec [AssociateVPCWithHostedZoneResponse]
readPrec :: ReadPrec AssociateVPCWithHostedZoneResponse
$creadPrec :: ReadPrec AssociateVPCWithHostedZoneResponse
readList :: ReadS [AssociateVPCWithHostedZoneResponse]
$creadList :: ReadS [AssociateVPCWithHostedZoneResponse]
readsPrec :: Int -> ReadS AssociateVPCWithHostedZoneResponse
$creadsPrec :: Int -> ReadS AssociateVPCWithHostedZoneResponse
Prelude.Read, Int -> AssociateVPCWithHostedZoneResponse -> ShowS
[AssociateVPCWithHostedZoneResponse] -> ShowS
AssociateVPCWithHostedZoneResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateVPCWithHostedZoneResponse] -> ShowS
$cshowList :: [AssociateVPCWithHostedZoneResponse] -> ShowS
show :: AssociateVPCWithHostedZoneResponse -> String
$cshow :: AssociateVPCWithHostedZoneResponse -> String
showsPrec :: Int -> AssociateVPCWithHostedZoneResponse -> ShowS
$cshowsPrec :: Int -> AssociateVPCWithHostedZoneResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateVPCWithHostedZoneResponse x
-> AssociateVPCWithHostedZoneResponse
forall x.
AssociateVPCWithHostedZoneResponse
-> Rep AssociateVPCWithHostedZoneResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateVPCWithHostedZoneResponse x
-> AssociateVPCWithHostedZoneResponse
$cfrom :: forall x.
AssociateVPCWithHostedZoneResponse
-> Rep AssociateVPCWithHostedZoneResponse x
Prelude.Generic)
newAssociateVPCWithHostedZoneResponse ::
Prelude.Int ->
ChangeInfo ->
AssociateVPCWithHostedZoneResponse
newAssociateVPCWithHostedZoneResponse :: Int -> ChangeInfo -> AssociateVPCWithHostedZoneResponse
newAssociateVPCWithHostedZoneResponse
Int
pHttpStatus_
ChangeInfo
pChangeInfo_ =
AssociateVPCWithHostedZoneResponse'
{ $sel:httpStatus:AssociateVPCWithHostedZoneResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:changeInfo:AssociateVPCWithHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
}
associateVPCWithHostedZoneResponse_httpStatus :: Lens.Lens' AssociateVPCWithHostedZoneResponse Prelude.Int
associateVPCWithHostedZoneResponse_httpStatus :: Lens' AssociateVPCWithHostedZoneResponse Int
associateVPCWithHostedZoneResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateVPCWithHostedZoneResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateVPCWithHostedZoneResponse' :: AssociateVPCWithHostedZoneResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateVPCWithHostedZoneResponse
s@AssociateVPCWithHostedZoneResponse' {} Int
a -> AssociateVPCWithHostedZoneResponse
s {$sel:httpStatus:AssociateVPCWithHostedZoneResponse' :: Int
httpStatus = Int
a} :: AssociateVPCWithHostedZoneResponse)
associateVPCWithHostedZoneResponse_changeInfo :: Lens.Lens' AssociateVPCWithHostedZoneResponse ChangeInfo
associateVPCWithHostedZoneResponse_changeInfo :: Lens' AssociateVPCWithHostedZoneResponse ChangeInfo
associateVPCWithHostedZoneResponse_changeInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateVPCWithHostedZoneResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:AssociateVPCWithHostedZoneResponse' :: AssociateVPCWithHostedZoneResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: AssociateVPCWithHostedZoneResponse
s@AssociateVPCWithHostedZoneResponse' {} ChangeInfo
a -> AssociateVPCWithHostedZoneResponse
s {$sel:changeInfo:AssociateVPCWithHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: AssociateVPCWithHostedZoneResponse)
instance
Prelude.NFData
AssociateVPCWithHostedZoneResponse
where
rnf :: AssociateVPCWithHostedZoneResponse -> ()
rnf AssociateVPCWithHostedZoneResponse' {Int
ChangeInfo
changeInfo :: ChangeInfo
httpStatus :: Int
$sel:changeInfo:AssociateVPCWithHostedZoneResponse' :: AssociateVPCWithHostedZoneResponse -> ChangeInfo
$sel:httpStatus:AssociateVPCWithHostedZoneResponse' :: AssociateVPCWithHostedZoneResponse -> Int
..} =
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 ChangeInfo
changeInfo