{-# 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.Lens as Lens
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
(AssociateVPCWithHostedZone -> AssociateVPCWithHostedZone -> Bool)
-> (AssociateVPCWithHostedZone
-> AssociateVPCWithHostedZone -> Bool)
-> Eq AssociateVPCWithHostedZone
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]
(Int -> ReadS AssociateVPCWithHostedZone)
-> ReadS [AssociateVPCWithHostedZone]
-> ReadPrec AssociateVPCWithHostedZone
-> ReadPrec [AssociateVPCWithHostedZone]
-> Read 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
(Int -> AssociateVPCWithHostedZone -> ShowS)
-> (AssociateVPCWithHostedZone -> String)
-> ([AssociateVPCWithHostedZone] -> ShowS)
-> Show AssociateVPCWithHostedZone
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.
AssociateVPCWithHostedZone -> Rep AssociateVPCWithHostedZone x)
-> (forall x.
Rep AssociateVPCWithHostedZone x -> AssociateVPCWithHostedZone)
-> Generic AssociateVPCWithHostedZone
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' :: Maybe Text -> ResourceId -> VPC -> AssociateVPCWithHostedZone
AssociateVPCWithHostedZone'
{ $sel:comment:AssociateVPCWithHostedZone' :: Maybe Text
comment =
Maybe Text
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)
= (AssociateVPCWithHostedZone -> Maybe Text)
-> (AssociateVPCWithHostedZone
-> Maybe Text -> AssociateVPCWithHostedZone)
-> Lens
AssociateVPCWithHostedZone
AssociateVPCWithHostedZone
(Maybe Text)
(Maybe 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 :: (ResourceId -> f ResourceId)
-> AssociateVPCWithHostedZone -> f AssociateVPCWithHostedZone
associateVPCWithHostedZone_hostedZoneId = (AssociateVPCWithHostedZone -> ResourceId)
-> (AssociateVPCWithHostedZone
-> ResourceId -> AssociateVPCWithHostedZone)
-> Lens
AssociateVPCWithHostedZone
AssociateVPCWithHostedZone
ResourceId
ResourceId
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 :: (VPC -> f VPC)
-> AssociateVPCWithHostedZone -> f AssociateVPCWithHostedZone
associateVPCWithHostedZone_vpc = (AssociateVPCWithHostedZone -> VPC)
-> (AssociateVPCWithHostedZone
-> VPC -> AssociateVPCWithHostedZone)
-> Lens
AssociateVPCWithHostedZone AssociateVPCWithHostedZone VPC 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 :: AssociateVPCWithHostedZone -> Request AssociateVPCWithHostedZone
request = Service
-> AssociateVPCWithHostedZone -> Request AssociateVPCWithHostedZone
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateVPCWithHostedZone
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateVPCWithHostedZone)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse AssociateVPCWithHostedZone))
-> Logger
-> Service
-> Proxy AssociateVPCWithHostedZone
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateVPCWithHostedZone)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> ChangeInfo -> AssociateVPCWithHostedZoneResponse
AssociateVPCWithHostedZoneResponse'
(Int -> ChangeInfo -> AssociateVPCWithHostedZoneResponse)
-> Either String Int
-> Either String (ChangeInfo -> AssociateVPCWithHostedZoneResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (ChangeInfo -> AssociateVPCWithHostedZoneResponse)
-> Either String ChangeInfo
-> Either String AssociateVPCWithHostedZoneResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ChangeInfo
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ChangeInfo")
)
instance Prelude.Hashable AssociateVPCWithHostedZone
instance Prelude.NFData AssociateVPCWithHostedZone
instance Core.ToElement AssociateVPCWithHostedZone where
toElement :: AssociateVPCWithHostedZone -> Element
toElement =
Name -> AssociateVPCWithHostedZone -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{https://route53.amazonaws.com/doc/2013-04-01/}AssociateVPCWithHostedZoneRequest"
instance Core.ToHeaders AssociateVPCWithHostedZone where
toHeaders :: AssociateVPCWithHostedZone -> ResponseHeaders
toHeaders = ResponseHeaders -> AssociateVPCWithHostedZone -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.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
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2013-04-01/hostedzone/",
ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
hostedZoneId,
ByteString
"/associatevpc"
]
instance Core.ToQuery AssociateVPCWithHostedZone where
toQuery :: AssociateVPCWithHostedZone -> QueryString
toQuery = QueryString -> AssociateVPCWithHostedZone -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
instance Core.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
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"Comment" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
comment, Name
"VPC" Name -> VPC -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= VPC
vpc]
data AssociateVPCWithHostedZoneResponse = AssociateVPCWithHostedZoneResponse'
{
AssociateVPCWithHostedZoneResponse -> Int
httpStatus :: Prelude.Int,
AssociateVPCWithHostedZoneResponse -> ChangeInfo
changeInfo :: ChangeInfo
}
deriving (AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool
(AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool)
-> (AssociateVPCWithHostedZoneResponse
-> AssociateVPCWithHostedZoneResponse -> Bool)
-> Eq AssociateVPCWithHostedZoneResponse
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]
(Int -> ReadS AssociateVPCWithHostedZoneResponse)
-> ReadS [AssociateVPCWithHostedZoneResponse]
-> ReadPrec AssociateVPCWithHostedZoneResponse
-> ReadPrec [AssociateVPCWithHostedZoneResponse]
-> Read 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
(Int -> AssociateVPCWithHostedZoneResponse -> ShowS)
-> (AssociateVPCWithHostedZoneResponse -> String)
-> ([AssociateVPCWithHostedZoneResponse] -> ShowS)
-> Show AssociateVPCWithHostedZoneResponse
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.
AssociateVPCWithHostedZoneResponse
-> Rep AssociateVPCWithHostedZoneResponse x)
-> (forall x.
Rep AssociateVPCWithHostedZoneResponse x
-> AssociateVPCWithHostedZoneResponse)
-> Generic AssociateVPCWithHostedZoneResponse
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' :: Int -> ChangeInfo -> AssociateVPCWithHostedZoneResponse
AssociateVPCWithHostedZoneResponse'
{ $sel:httpStatus:AssociateVPCWithHostedZoneResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:changeInfo:AssociateVPCWithHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
}
associateVPCWithHostedZoneResponse_httpStatus :: Lens.Lens' AssociateVPCWithHostedZoneResponse Prelude.Int
associateVPCWithHostedZoneResponse_httpStatus :: (Int -> f Int)
-> AssociateVPCWithHostedZoneResponse
-> f AssociateVPCWithHostedZoneResponse
associateVPCWithHostedZoneResponse_httpStatus = (AssociateVPCWithHostedZoneResponse -> Int)
-> (AssociateVPCWithHostedZoneResponse
-> Int -> AssociateVPCWithHostedZoneResponse)
-> Lens
AssociateVPCWithHostedZoneResponse
AssociateVPCWithHostedZoneResponse
Int
Int
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 :: (ChangeInfo -> f ChangeInfo)
-> AssociateVPCWithHostedZoneResponse
-> f AssociateVPCWithHostedZoneResponse
associateVPCWithHostedZoneResponse_changeInfo = (AssociateVPCWithHostedZoneResponse -> ChangeInfo)
-> (AssociateVPCWithHostedZoneResponse
-> ChangeInfo -> AssociateVPCWithHostedZoneResponse)
-> Lens
AssociateVPCWithHostedZoneResponse
AssociateVPCWithHostedZoneResponse
ChangeInfo
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