{-# 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.GetHostedZoneCount
(
GetHostedZoneCount (..),
newGetHostedZoneCount,
GetHostedZoneCountResponse (..),
newGetHostedZoneCountResponse,
getHostedZoneCountResponse_httpStatus,
getHostedZoneCountResponse_hostedZoneCount,
)
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 GetHostedZoneCount = GetHostedZoneCount'
{
}
deriving (GetHostedZoneCount -> GetHostedZoneCount -> Bool
(GetHostedZoneCount -> GetHostedZoneCount -> Bool)
-> (GetHostedZoneCount -> GetHostedZoneCount -> Bool)
-> Eq GetHostedZoneCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZoneCount -> GetHostedZoneCount -> Bool
$c/= :: GetHostedZoneCount -> GetHostedZoneCount -> Bool
== :: GetHostedZoneCount -> GetHostedZoneCount -> Bool
$c== :: GetHostedZoneCount -> GetHostedZoneCount -> Bool
Prelude.Eq, ReadPrec [GetHostedZoneCount]
ReadPrec GetHostedZoneCount
Int -> ReadS GetHostedZoneCount
ReadS [GetHostedZoneCount]
(Int -> ReadS GetHostedZoneCount)
-> ReadS [GetHostedZoneCount]
-> ReadPrec GetHostedZoneCount
-> ReadPrec [GetHostedZoneCount]
-> Read GetHostedZoneCount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZoneCount]
$creadListPrec :: ReadPrec [GetHostedZoneCount]
readPrec :: ReadPrec GetHostedZoneCount
$creadPrec :: ReadPrec GetHostedZoneCount
readList :: ReadS [GetHostedZoneCount]
$creadList :: ReadS [GetHostedZoneCount]
readsPrec :: Int -> ReadS GetHostedZoneCount
$creadsPrec :: Int -> ReadS GetHostedZoneCount
Prelude.Read, Int -> GetHostedZoneCount -> ShowS
[GetHostedZoneCount] -> ShowS
GetHostedZoneCount -> String
(Int -> GetHostedZoneCount -> ShowS)
-> (GetHostedZoneCount -> String)
-> ([GetHostedZoneCount] -> ShowS)
-> Show GetHostedZoneCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZoneCount] -> ShowS
$cshowList :: [GetHostedZoneCount] -> ShowS
show :: GetHostedZoneCount -> String
$cshow :: GetHostedZoneCount -> String
showsPrec :: Int -> GetHostedZoneCount -> ShowS
$cshowsPrec :: Int -> GetHostedZoneCount -> ShowS
Prelude.Show, (forall x. GetHostedZoneCount -> Rep GetHostedZoneCount x)
-> (forall x. Rep GetHostedZoneCount x -> GetHostedZoneCount)
-> Generic GetHostedZoneCount
forall x. Rep GetHostedZoneCount x -> GetHostedZoneCount
forall x. GetHostedZoneCount -> Rep GetHostedZoneCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetHostedZoneCount x -> GetHostedZoneCount
$cfrom :: forall x. GetHostedZoneCount -> Rep GetHostedZoneCount x
Prelude.Generic)
newGetHostedZoneCount ::
GetHostedZoneCount
newGetHostedZoneCount :: GetHostedZoneCount
newGetHostedZoneCount = GetHostedZoneCount
GetHostedZoneCount'
instance Core.AWSRequest GetHostedZoneCount where
type
AWSResponse GetHostedZoneCount =
GetHostedZoneCountResponse
request :: GetHostedZoneCount -> Request GetHostedZoneCount
request = Service -> GetHostedZoneCount -> Request GetHostedZoneCount
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetHostedZoneCount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetHostedZoneCount)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetHostedZoneCount))
-> Logger
-> Service
-> Proxy GetHostedZoneCount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetHostedZoneCount)))
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 -> Integer -> GetHostedZoneCountResponse
GetHostedZoneCountResponse'
(Int -> Integer -> GetHostedZoneCountResponse)
-> Either String Int
-> Either String (Integer -> GetHostedZoneCountResponse)
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 (Integer -> GetHostedZoneCountResponse)
-> Either String Integer
-> Either String GetHostedZoneCountResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Integer
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"HostedZoneCount")
)
instance Prelude.Hashable GetHostedZoneCount
instance Prelude.NFData GetHostedZoneCount
instance Core.ToHeaders GetHostedZoneCount where
toHeaders :: GetHostedZoneCount -> ResponseHeaders
toHeaders = ResponseHeaders -> GetHostedZoneCount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetHostedZoneCount where
toPath :: GetHostedZoneCount -> ByteString
toPath = ByteString -> GetHostedZoneCount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/hostedzonecount"
instance Core.ToQuery GetHostedZoneCount where
toQuery :: GetHostedZoneCount -> QueryString
toQuery = QueryString -> GetHostedZoneCount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetHostedZoneCountResponse = GetHostedZoneCountResponse'
{
GetHostedZoneCountResponse -> Int
httpStatus :: Prelude.Int,
GetHostedZoneCountResponse -> Integer
hostedZoneCount :: Prelude.Integer
}
deriving (GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool
(GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool)
-> (GetHostedZoneCountResponse
-> GetHostedZoneCountResponse -> Bool)
-> Eq GetHostedZoneCountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool
$c/= :: GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool
== :: GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool
$c== :: GetHostedZoneCountResponse -> GetHostedZoneCountResponse -> Bool
Prelude.Eq, ReadPrec [GetHostedZoneCountResponse]
ReadPrec GetHostedZoneCountResponse
Int -> ReadS GetHostedZoneCountResponse
ReadS [GetHostedZoneCountResponse]
(Int -> ReadS GetHostedZoneCountResponse)
-> ReadS [GetHostedZoneCountResponse]
-> ReadPrec GetHostedZoneCountResponse
-> ReadPrec [GetHostedZoneCountResponse]
-> Read GetHostedZoneCountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZoneCountResponse]
$creadListPrec :: ReadPrec [GetHostedZoneCountResponse]
readPrec :: ReadPrec GetHostedZoneCountResponse
$creadPrec :: ReadPrec GetHostedZoneCountResponse
readList :: ReadS [GetHostedZoneCountResponse]
$creadList :: ReadS [GetHostedZoneCountResponse]
readsPrec :: Int -> ReadS GetHostedZoneCountResponse
$creadsPrec :: Int -> ReadS GetHostedZoneCountResponse
Prelude.Read, Int -> GetHostedZoneCountResponse -> ShowS
[GetHostedZoneCountResponse] -> ShowS
GetHostedZoneCountResponse -> String
(Int -> GetHostedZoneCountResponse -> ShowS)
-> (GetHostedZoneCountResponse -> String)
-> ([GetHostedZoneCountResponse] -> ShowS)
-> Show GetHostedZoneCountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZoneCountResponse] -> ShowS
$cshowList :: [GetHostedZoneCountResponse] -> ShowS
show :: GetHostedZoneCountResponse -> String
$cshow :: GetHostedZoneCountResponse -> String
showsPrec :: Int -> GetHostedZoneCountResponse -> ShowS
$cshowsPrec :: Int -> GetHostedZoneCountResponse -> ShowS
Prelude.Show, (forall x.
GetHostedZoneCountResponse -> Rep GetHostedZoneCountResponse x)
-> (forall x.
Rep GetHostedZoneCountResponse x -> GetHostedZoneCountResponse)
-> Generic GetHostedZoneCountResponse
forall x.
Rep GetHostedZoneCountResponse x -> GetHostedZoneCountResponse
forall x.
GetHostedZoneCountResponse -> Rep GetHostedZoneCountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetHostedZoneCountResponse x -> GetHostedZoneCountResponse
$cfrom :: forall x.
GetHostedZoneCountResponse -> Rep GetHostedZoneCountResponse x
Prelude.Generic)
newGetHostedZoneCountResponse ::
Prelude.Int ->
Prelude.Integer ->
GetHostedZoneCountResponse
newGetHostedZoneCountResponse :: Int -> Integer -> GetHostedZoneCountResponse
newGetHostedZoneCountResponse
Int
pHttpStatus_
Integer
pHostedZoneCount_ =
GetHostedZoneCountResponse' :: Int -> Integer -> GetHostedZoneCountResponse
GetHostedZoneCountResponse'
{ $sel:httpStatus:GetHostedZoneCountResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:hostedZoneCount:GetHostedZoneCountResponse' :: Integer
hostedZoneCount = Integer
pHostedZoneCount_
}
getHostedZoneCountResponse_httpStatus :: Lens.Lens' GetHostedZoneCountResponse Prelude.Int
getHostedZoneCountResponse_httpStatus :: (Int -> f Int)
-> GetHostedZoneCountResponse -> f GetHostedZoneCountResponse
getHostedZoneCountResponse_httpStatus = (GetHostedZoneCountResponse -> Int)
-> (GetHostedZoneCountResponse
-> Int -> GetHostedZoneCountResponse)
-> Lens
GetHostedZoneCountResponse GetHostedZoneCountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneCountResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetHostedZoneCountResponse' :: GetHostedZoneCountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetHostedZoneCountResponse
s@GetHostedZoneCountResponse' {} Int
a -> GetHostedZoneCountResponse
s {$sel:httpStatus:GetHostedZoneCountResponse' :: Int
httpStatus = Int
a} :: GetHostedZoneCountResponse)
getHostedZoneCountResponse_hostedZoneCount :: Lens.Lens' GetHostedZoneCountResponse Prelude.Integer
getHostedZoneCountResponse_hostedZoneCount :: (Integer -> f Integer)
-> GetHostedZoneCountResponse -> f GetHostedZoneCountResponse
getHostedZoneCountResponse_hostedZoneCount = (GetHostedZoneCountResponse -> Integer)
-> (GetHostedZoneCountResponse
-> Integer -> GetHostedZoneCountResponse)
-> Lens
GetHostedZoneCountResponse
GetHostedZoneCountResponse
Integer
Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneCountResponse' {Integer
hostedZoneCount :: Integer
$sel:hostedZoneCount:GetHostedZoneCountResponse' :: GetHostedZoneCountResponse -> Integer
hostedZoneCount} -> Integer
hostedZoneCount) (\s :: GetHostedZoneCountResponse
s@GetHostedZoneCountResponse' {} Integer
a -> GetHostedZoneCountResponse
s {$sel:hostedZoneCount:GetHostedZoneCountResponse' :: Integer
hostedZoneCount = Integer
a} :: GetHostedZoneCountResponse)
instance Prelude.NFData GetHostedZoneCountResponse