{-# 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.GetChange
(
GetChange (..),
newGetChange,
getChange_id,
GetChangeResponse (..),
newGetChangeResponse,
getChangeResponse_httpStatus,
getChangeResponse_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 GetChange = GetChange'
{
GetChange -> ResourceId
id :: ResourceId
}
deriving (GetChange -> GetChange -> Bool
(GetChange -> GetChange -> Bool)
-> (GetChange -> GetChange -> Bool) -> Eq GetChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChange -> GetChange -> Bool
$c/= :: GetChange -> GetChange -> Bool
== :: GetChange -> GetChange -> Bool
$c== :: GetChange -> GetChange -> Bool
Prelude.Eq, ReadPrec [GetChange]
ReadPrec GetChange
Int -> ReadS GetChange
ReadS [GetChange]
(Int -> ReadS GetChange)
-> ReadS [GetChange]
-> ReadPrec GetChange
-> ReadPrec [GetChange]
-> Read GetChange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChange]
$creadListPrec :: ReadPrec [GetChange]
readPrec :: ReadPrec GetChange
$creadPrec :: ReadPrec GetChange
readList :: ReadS [GetChange]
$creadList :: ReadS [GetChange]
readsPrec :: Int -> ReadS GetChange
$creadsPrec :: Int -> ReadS GetChange
Prelude.Read, Int -> GetChange -> ShowS
[GetChange] -> ShowS
GetChange -> String
(Int -> GetChange -> ShowS)
-> (GetChange -> String)
-> ([GetChange] -> ShowS)
-> Show GetChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChange] -> ShowS
$cshowList :: [GetChange] -> ShowS
show :: GetChange -> String
$cshow :: GetChange -> String
showsPrec :: Int -> GetChange -> ShowS
$cshowsPrec :: Int -> GetChange -> ShowS
Prelude.Show, (forall x. GetChange -> Rep GetChange x)
-> (forall x. Rep GetChange x -> GetChange) -> Generic GetChange
forall x. Rep GetChange x -> GetChange
forall x. GetChange -> Rep GetChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetChange x -> GetChange
$cfrom :: forall x. GetChange -> Rep GetChange x
Prelude.Generic)
newGetChange ::
ResourceId ->
GetChange
newGetChange :: ResourceId -> GetChange
newGetChange ResourceId
pId_ = GetChange' :: ResourceId -> GetChange
GetChange' {$sel:id:GetChange' :: ResourceId
id = ResourceId
pId_}
getChange_id :: Lens.Lens' GetChange ResourceId
getChange_id :: (ResourceId -> f ResourceId) -> GetChange -> f GetChange
getChange_id = (GetChange -> ResourceId)
-> (GetChange -> ResourceId -> GetChange)
-> Lens GetChange GetChange ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChange' {ResourceId
id :: ResourceId
$sel:id:GetChange' :: GetChange -> ResourceId
id} -> ResourceId
id) (\s :: GetChange
s@GetChange' {} ResourceId
a -> GetChange
s {$sel:id:GetChange' :: ResourceId
id = ResourceId
a} :: GetChange)
instance Core.AWSRequest GetChange where
type AWSResponse GetChange = GetChangeResponse
request :: GetChange -> Request GetChange
request = Service -> GetChange -> Request GetChange
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetChange
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetChange)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetChange))
-> Logger
-> Service
-> Proxy GetChange
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetChange)))
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 -> GetChangeResponse
GetChangeResponse'
(Int -> ChangeInfo -> GetChangeResponse)
-> Either String Int
-> Either String (ChangeInfo -> GetChangeResponse)
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 -> GetChangeResponse)
-> Either String ChangeInfo -> Either String GetChangeResponse
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 GetChange
instance Prelude.NFData GetChange
instance Core.ToHeaders GetChange where
toHeaders :: GetChange -> ResponseHeaders
toHeaders = ResponseHeaders -> GetChange -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetChange where
toPath :: GetChange -> ByteString
toPath GetChange' {ResourceId
id :: ResourceId
$sel:id:GetChange' :: GetChange -> ResourceId
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2013-04-01/change/", ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
id]
instance Core.ToQuery GetChange where
toQuery :: GetChange -> QueryString
toQuery = QueryString -> GetChange -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetChangeResponse = GetChangeResponse'
{
GetChangeResponse -> Int
httpStatus :: Prelude.Int,
GetChangeResponse -> ChangeInfo
changeInfo :: ChangeInfo
}
deriving (GetChangeResponse -> GetChangeResponse -> Bool
(GetChangeResponse -> GetChangeResponse -> Bool)
-> (GetChangeResponse -> GetChangeResponse -> Bool)
-> Eq GetChangeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChangeResponse -> GetChangeResponse -> Bool
$c/= :: GetChangeResponse -> GetChangeResponse -> Bool
== :: GetChangeResponse -> GetChangeResponse -> Bool
$c== :: GetChangeResponse -> GetChangeResponse -> Bool
Prelude.Eq, ReadPrec [GetChangeResponse]
ReadPrec GetChangeResponse
Int -> ReadS GetChangeResponse
ReadS [GetChangeResponse]
(Int -> ReadS GetChangeResponse)
-> ReadS [GetChangeResponse]
-> ReadPrec GetChangeResponse
-> ReadPrec [GetChangeResponse]
-> Read GetChangeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChangeResponse]
$creadListPrec :: ReadPrec [GetChangeResponse]
readPrec :: ReadPrec GetChangeResponse
$creadPrec :: ReadPrec GetChangeResponse
readList :: ReadS [GetChangeResponse]
$creadList :: ReadS [GetChangeResponse]
readsPrec :: Int -> ReadS GetChangeResponse
$creadsPrec :: Int -> ReadS GetChangeResponse
Prelude.Read, Int -> GetChangeResponse -> ShowS
[GetChangeResponse] -> ShowS
GetChangeResponse -> String
(Int -> GetChangeResponse -> ShowS)
-> (GetChangeResponse -> String)
-> ([GetChangeResponse] -> ShowS)
-> Show GetChangeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChangeResponse] -> ShowS
$cshowList :: [GetChangeResponse] -> ShowS
show :: GetChangeResponse -> String
$cshow :: GetChangeResponse -> String
showsPrec :: Int -> GetChangeResponse -> ShowS
$cshowsPrec :: Int -> GetChangeResponse -> ShowS
Prelude.Show, (forall x. GetChangeResponse -> Rep GetChangeResponse x)
-> (forall x. Rep GetChangeResponse x -> GetChangeResponse)
-> Generic GetChangeResponse
forall x. Rep GetChangeResponse x -> GetChangeResponse
forall x. GetChangeResponse -> Rep GetChangeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetChangeResponse x -> GetChangeResponse
$cfrom :: forall x. GetChangeResponse -> Rep GetChangeResponse x
Prelude.Generic)
newGetChangeResponse ::
Prelude.Int ->
ChangeInfo ->
GetChangeResponse
newGetChangeResponse :: Int -> ChangeInfo -> GetChangeResponse
newGetChangeResponse Int
pHttpStatus_ ChangeInfo
pChangeInfo_ =
GetChangeResponse' :: Int -> ChangeInfo -> GetChangeResponse
GetChangeResponse'
{ $sel:httpStatus:GetChangeResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:changeInfo:GetChangeResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
}
getChangeResponse_httpStatus :: Lens.Lens' GetChangeResponse Prelude.Int
getChangeResponse_httpStatus :: (Int -> f Int) -> GetChangeResponse -> f GetChangeResponse
getChangeResponse_httpStatus = (GetChangeResponse -> Int)
-> (GetChangeResponse -> Int -> GetChangeResponse)
-> Lens GetChangeResponse GetChangeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChangeResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetChangeResponse' :: GetChangeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetChangeResponse
s@GetChangeResponse' {} Int
a -> GetChangeResponse
s {$sel:httpStatus:GetChangeResponse' :: Int
httpStatus = Int
a} :: GetChangeResponse)
getChangeResponse_changeInfo :: Lens.Lens' GetChangeResponse ChangeInfo
getChangeResponse_changeInfo :: (ChangeInfo -> f ChangeInfo)
-> GetChangeResponse -> f GetChangeResponse
getChangeResponse_changeInfo = (GetChangeResponse -> ChangeInfo)
-> (GetChangeResponse -> ChangeInfo -> GetChangeResponse)
-> Lens GetChangeResponse GetChangeResponse ChangeInfo ChangeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChangeResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:GetChangeResponse' :: GetChangeResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: GetChangeResponse
s@GetChangeResponse' {} ChangeInfo
a -> GetChangeResponse
s {$sel:changeInfo:GetChangeResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: GetChangeResponse)
instance Prelude.NFData GetChangeResponse