{-# 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.ChangeResourceRecordSets
(
ChangeResourceRecordSets (..),
newChangeResourceRecordSets,
changeResourceRecordSets_hostedZoneId,
changeResourceRecordSets_changeBatch,
ChangeResourceRecordSetsResponse (..),
newChangeResourceRecordSetsResponse,
changeResourceRecordSetsResponse_httpStatus,
changeResourceRecordSetsResponse_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 ChangeResourceRecordSets = ChangeResourceRecordSets'
{
ChangeResourceRecordSets -> ResourceId
hostedZoneId :: ResourceId,
ChangeResourceRecordSets -> ChangeBatch
changeBatch :: ChangeBatch
}
deriving (ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool
(ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool)
-> (ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool)
-> Eq ChangeResourceRecordSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool
$c/= :: ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool
== :: ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool
$c== :: ChangeResourceRecordSets -> ChangeResourceRecordSets -> Bool
Prelude.Eq, ReadPrec [ChangeResourceRecordSets]
ReadPrec ChangeResourceRecordSets
Int -> ReadS ChangeResourceRecordSets
ReadS [ChangeResourceRecordSets]
(Int -> ReadS ChangeResourceRecordSets)
-> ReadS [ChangeResourceRecordSets]
-> ReadPrec ChangeResourceRecordSets
-> ReadPrec [ChangeResourceRecordSets]
-> Read ChangeResourceRecordSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeResourceRecordSets]
$creadListPrec :: ReadPrec [ChangeResourceRecordSets]
readPrec :: ReadPrec ChangeResourceRecordSets
$creadPrec :: ReadPrec ChangeResourceRecordSets
readList :: ReadS [ChangeResourceRecordSets]
$creadList :: ReadS [ChangeResourceRecordSets]
readsPrec :: Int -> ReadS ChangeResourceRecordSets
$creadsPrec :: Int -> ReadS ChangeResourceRecordSets
Prelude.Read, Int -> ChangeResourceRecordSets -> ShowS
[ChangeResourceRecordSets] -> ShowS
ChangeResourceRecordSets -> String
(Int -> ChangeResourceRecordSets -> ShowS)
-> (ChangeResourceRecordSets -> String)
-> ([ChangeResourceRecordSets] -> ShowS)
-> Show ChangeResourceRecordSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeResourceRecordSets] -> ShowS
$cshowList :: [ChangeResourceRecordSets] -> ShowS
show :: ChangeResourceRecordSets -> String
$cshow :: ChangeResourceRecordSets -> String
showsPrec :: Int -> ChangeResourceRecordSets -> ShowS
$cshowsPrec :: Int -> ChangeResourceRecordSets -> ShowS
Prelude.Show, (forall x.
ChangeResourceRecordSets -> Rep ChangeResourceRecordSets x)
-> (forall x.
Rep ChangeResourceRecordSets x -> ChangeResourceRecordSets)
-> Generic ChangeResourceRecordSets
forall x.
Rep ChangeResourceRecordSets x -> ChangeResourceRecordSets
forall x.
ChangeResourceRecordSets -> Rep ChangeResourceRecordSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChangeResourceRecordSets x -> ChangeResourceRecordSets
$cfrom :: forall x.
ChangeResourceRecordSets -> Rep ChangeResourceRecordSets x
Prelude.Generic)
newChangeResourceRecordSets ::
ResourceId ->
ChangeBatch ->
ChangeResourceRecordSets
newChangeResourceRecordSets :: ResourceId -> ChangeBatch -> ChangeResourceRecordSets
newChangeResourceRecordSets
ResourceId
pHostedZoneId_
ChangeBatch
pChangeBatch_ =
ChangeResourceRecordSets' :: ResourceId -> ChangeBatch -> ChangeResourceRecordSets
ChangeResourceRecordSets'
{ $sel:hostedZoneId:ChangeResourceRecordSets' :: ResourceId
hostedZoneId =
ResourceId
pHostedZoneId_,
$sel:changeBatch:ChangeResourceRecordSets' :: ChangeBatch
changeBatch = ChangeBatch
pChangeBatch_
}
changeResourceRecordSets_hostedZoneId :: Lens.Lens' ChangeResourceRecordSets ResourceId
changeResourceRecordSets_hostedZoneId :: (ResourceId -> f ResourceId)
-> ChangeResourceRecordSets -> f ChangeResourceRecordSets
changeResourceRecordSets_hostedZoneId = (ChangeResourceRecordSets -> ResourceId)
-> (ChangeResourceRecordSets
-> ResourceId -> ChangeResourceRecordSets)
-> Lens
ChangeResourceRecordSets
ChangeResourceRecordSets
ResourceId
ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeResourceRecordSets' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: ChangeResourceRecordSets
s@ChangeResourceRecordSets' {} ResourceId
a -> ChangeResourceRecordSets
s {$sel:hostedZoneId:ChangeResourceRecordSets' :: ResourceId
hostedZoneId = ResourceId
a} :: ChangeResourceRecordSets)
changeResourceRecordSets_changeBatch :: Lens.Lens' ChangeResourceRecordSets ChangeBatch
changeResourceRecordSets_changeBatch :: (ChangeBatch -> f ChangeBatch)
-> ChangeResourceRecordSets -> f ChangeResourceRecordSets
changeResourceRecordSets_changeBatch = (ChangeResourceRecordSets -> ChangeBatch)
-> (ChangeResourceRecordSets
-> ChangeBatch -> ChangeResourceRecordSets)
-> Lens
ChangeResourceRecordSets
ChangeResourceRecordSets
ChangeBatch
ChangeBatch
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeResourceRecordSets' {ChangeBatch
changeBatch :: ChangeBatch
$sel:changeBatch:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ChangeBatch
changeBatch} -> ChangeBatch
changeBatch) (\s :: ChangeResourceRecordSets
s@ChangeResourceRecordSets' {} ChangeBatch
a -> ChangeResourceRecordSets
s {$sel:changeBatch:ChangeResourceRecordSets' :: ChangeBatch
changeBatch = ChangeBatch
a} :: ChangeResourceRecordSets)
instance Core.AWSRequest ChangeResourceRecordSets where
type
AWSResponse ChangeResourceRecordSets =
ChangeResourceRecordSetsResponse
request :: ChangeResourceRecordSets -> Request ChangeResourceRecordSets
request = Service
-> ChangeResourceRecordSets -> Request ChangeResourceRecordSets
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
response :: Logger
-> Service
-> Proxy ChangeResourceRecordSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ChangeResourceRecordSets)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ChangeResourceRecordSets))
-> Logger
-> Service
-> Proxy ChangeResourceRecordSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ChangeResourceRecordSets)))
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 -> ChangeResourceRecordSetsResponse
ChangeResourceRecordSetsResponse'
(Int -> ChangeInfo -> ChangeResourceRecordSetsResponse)
-> Either String Int
-> Either String (ChangeInfo -> ChangeResourceRecordSetsResponse)
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 -> ChangeResourceRecordSetsResponse)
-> Either String ChangeInfo
-> Either String ChangeResourceRecordSetsResponse
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 ChangeResourceRecordSets
instance Prelude.NFData ChangeResourceRecordSets
instance Core.ToElement ChangeResourceRecordSets where
toElement :: ChangeResourceRecordSets -> Element
toElement =
Name -> ChangeResourceRecordSets -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{https://route53.amazonaws.com/doc/2013-04-01/}ChangeResourceRecordSetsRequest"
instance Core.ToHeaders ChangeResourceRecordSets where
toHeaders :: ChangeResourceRecordSets -> ResponseHeaders
toHeaders = ResponseHeaders -> ChangeResourceRecordSets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ChangeResourceRecordSets where
toPath :: ChangeResourceRecordSets -> ByteString
toPath ChangeResourceRecordSets' {ResourceId
ChangeBatch
changeBatch :: ChangeBatch
hostedZoneId :: ResourceId
$sel:changeBatch:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ChangeBatch
$sel:hostedZoneId:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ResourceId
..} =
[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
"/rrset/"
]
instance Core.ToQuery ChangeResourceRecordSets where
toQuery :: ChangeResourceRecordSets -> QueryString
toQuery = QueryString -> ChangeResourceRecordSets -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
instance Core.ToXML ChangeResourceRecordSets where
toXML :: ChangeResourceRecordSets -> XML
toXML ChangeResourceRecordSets' {ResourceId
ChangeBatch
changeBatch :: ChangeBatch
hostedZoneId :: ResourceId
$sel:changeBatch:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ChangeBatch
$sel:hostedZoneId:ChangeResourceRecordSets' :: ChangeResourceRecordSets -> ResourceId
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"ChangeBatch" Name -> ChangeBatch -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ChangeBatch
changeBatch]
data ChangeResourceRecordSetsResponse = ChangeResourceRecordSetsResponse'
{
ChangeResourceRecordSetsResponse -> Int
httpStatus :: Prelude.Int,
ChangeResourceRecordSetsResponse -> ChangeInfo
changeInfo :: ChangeInfo
}
deriving (ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool
(ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool)
-> (ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool)
-> Eq ChangeResourceRecordSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool
$c/= :: ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool
== :: ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool
$c== :: ChangeResourceRecordSetsResponse
-> ChangeResourceRecordSetsResponse -> Bool
Prelude.Eq, ReadPrec [ChangeResourceRecordSetsResponse]
ReadPrec ChangeResourceRecordSetsResponse
Int -> ReadS ChangeResourceRecordSetsResponse
ReadS [ChangeResourceRecordSetsResponse]
(Int -> ReadS ChangeResourceRecordSetsResponse)
-> ReadS [ChangeResourceRecordSetsResponse]
-> ReadPrec ChangeResourceRecordSetsResponse
-> ReadPrec [ChangeResourceRecordSetsResponse]
-> Read ChangeResourceRecordSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeResourceRecordSetsResponse]
$creadListPrec :: ReadPrec [ChangeResourceRecordSetsResponse]
readPrec :: ReadPrec ChangeResourceRecordSetsResponse
$creadPrec :: ReadPrec ChangeResourceRecordSetsResponse
readList :: ReadS [ChangeResourceRecordSetsResponse]
$creadList :: ReadS [ChangeResourceRecordSetsResponse]
readsPrec :: Int -> ReadS ChangeResourceRecordSetsResponse
$creadsPrec :: Int -> ReadS ChangeResourceRecordSetsResponse
Prelude.Read, Int -> ChangeResourceRecordSetsResponse -> ShowS
[ChangeResourceRecordSetsResponse] -> ShowS
ChangeResourceRecordSetsResponse -> String
(Int -> ChangeResourceRecordSetsResponse -> ShowS)
-> (ChangeResourceRecordSetsResponse -> String)
-> ([ChangeResourceRecordSetsResponse] -> ShowS)
-> Show ChangeResourceRecordSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeResourceRecordSetsResponse] -> ShowS
$cshowList :: [ChangeResourceRecordSetsResponse] -> ShowS
show :: ChangeResourceRecordSetsResponse -> String
$cshow :: ChangeResourceRecordSetsResponse -> String
showsPrec :: Int -> ChangeResourceRecordSetsResponse -> ShowS
$cshowsPrec :: Int -> ChangeResourceRecordSetsResponse -> ShowS
Prelude.Show, (forall x.
ChangeResourceRecordSetsResponse
-> Rep ChangeResourceRecordSetsResponse x)
-> (forall x.
Rep ChangeResourceRecordSetsResponse x
-> ChangeResourceRecordSetsResponse)
-> Generic ChangeResourceRecordSetsResponse
forall x.
Rep ChangeResourceRecordSetsResponse x
-> ChangeResourceRecordSetsResponse
forall x.
ChangeResourceRecordSetsResponse
-> Rep ChangeResourceRecordSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChangeResourceRecordSetsResponse x
-> ChangeResourceRecordSetsResponse
$cfrom :: forall x.
ChangeResourceRecordSetsResponse
-> Rep ChangeResourceRecordSetsResponse x
Prelude.Generic)
newChangeResourceRecordSetsResponse ::
Prelude.Int ->
ChangeInfo ->
ChangeResourceRecordSetsResponse
newChangeResourceRecordSetsResponse :: Int -> ChangeInfo -> ChangeResourceRecordSetsResponse
newChangeResourceRecordSetsResponse
Int
pHttpStatus_
ChangeInfo
pChangeInfo_ =
ChangeResourceRecordSetsResponse' :: Int -> ChangeInfo -> ChangeResourceRecordSetsResponse
ChangeResourceRecordSetsResponse'
{ $sel:httpStatus:ChangeResourceRecordSetsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:changeInfo:ChangeResourceRecordSetsResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
}
changeResourceRecordSetsResponse_httpStatus :: Lens.Lens' ChangeResourceRecordSetsResponse Prelude.Int
changeResourceRecordSetsResponse_httpStatus :: (Int -> f Int)
-> ChangeResourceRecordSetsResponse
-> f ChangeResourceRecordSetsResponse
changeResourceRecordSetsResponse_httpStatus = (ChangeResourceRecordSetsResponse -> Int)
-> (ChangeResourceRecordSetsResponse
-> Int -> ChangeResourceRecordSetsResponse)
-> Lens
ChangeResourceRecordSetsResponse
ChangeResourceRecordSetsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeResourceRecordSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ChangeResourceRecordSetsResponse' :: ChangeResourceRecordSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ChangeResourceRecordSetsResponse
s@ChangeResourceRecordSetsResponse' {} Int
a -> ChangeResourceRecordSetsResponse
s {$sel:httpStatus:ChangeResourceRecordSetsResponse' :: Int
httpStatus = Int
a} :: ChangeResourceRecordSetsResponse)
changeResourceRecordSetsResponse_changeInfo :: Lens.Lens' ChangeResourceRecordSetsResponse ChangeInfo
changeResourceRecordSetsResponse_changeInfo :: (ChangeInfo -> f ChangeInfo)
-> ChangeResourceRecordSetsResponse
-> f ChangeResourceRecordSetsResponse
changeResourceRecordSetsResponse_changeInfo = (ChangeResourceRecordSetsResponse -> ChangeInfo)
-> (ChangeResourceRecordSetsResponse
-> ChangeInfo -> ChangeResourceRecordSetsResponse)
-> Lens
ChangeResourceRecordSetsResponse
ChangeResourceRecordSetsResponse
ChangeInfo
ChangeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeResourceRecordSetsResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:ChangeResourceRecordSetsResponse' :: ChangeResourceRecordSetsResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: ChangeResourceRecordSetsResponse
s@ChangeResourceRecordSetsResponse' {} ChangeInfo
a -> ChangeResourceRecordSetsResponse
s {$sel:changeInfo:ChangeResourceRecordSetsResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: ChangeResourceRecordSetsResponse)
instance
Prelude.NFData
ChangeResourceRecordSetsResponse