{-# 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.GetHostedZoneLimit
(
GetHostedZoneLimit (..),
newGetHostedZoneLimit,
getHostedZoneLimit_type,
getHostedZoneLimit_hostedZoneId,
GetHostedZoneLimitResponse (..),
newGetHostedZoneLimitResponse,
getHostedZoneLimitResponse_httpStatus,
getHostedZoneLimitResponse_limit,
getHostedZoneLimitResponse_count,
)
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 GetHostedZoneLimit = GetHostedZoneLimit'
{
GetHostedZoneLimit -> HostedZoneLimitType
type' :: HostedZoneLimitType,
GetHostedZoneLimit -> ResourceId
hostedZoneId :: ResourceId
}
deriving (GetHostedZoneLimit -> GetHostedZoneLimit -> Bool
(GetHostedZoneLimit -> GetHostedZoneLimit -> Bool)
-> (GetHostedZoneLimit -> GetHostedZoneLimit -> Bool)
-> Eq GetHostedZoneLimit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZoneLimit -> GetHostedZoneLimit -> Bool
$c/= :: GetHostedZoneLimit -> GetHostedZoneLimit -> Bool
== :: GetHostedZoneLimit -> GetHostedZoneLimit -> Bool
$c== :: GetHostedZoneLimit -> GetHostedZoneLimit -> Bool
Prelude.Eq, ReadPrec [GetHostedZoneLimit]
ReadPrec GetHostedZoneLimit
Int -> ReadS GetHostedZoneLimit
ReadS [GetHostedZoneLimit]
(Int -> ReadS GetHostedZoneLimit)
-> ReadS [GetHostedZoneLimit]
-> ReadPrec GetHostedZoneLimit
-> ReadPrec [GetHostedZoneLimit]
-> Read GetHostedZoneLimit
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZoneLimit]
$creadListPrec :: ReadPrec [GetHostedZoneLimit]
readPrec :: ReadPrec GetHostedZoneLimit
$creadPrec :: ReadPrec GetHostedZoneLimit
readList :: ReadS [GetHostedZoneLimit]
$creadList :: ReadS [GetHostedZoneLimit]
readsPrec :: Int -> ReadS GetHostedZoneLimit
$creadsPrec :: Int -> ReadS GetHostedZoneLimit
Prelude.Read, Int -> GetHostedZoneLimit -> ShowS
[GetHostedZoneLimit] -> ShowS
GetHostedZoneLimit -> String
(Int -> GetHostedZoneLimit -> ShowS)
-> (GetHostedZoneLimit -> String)
-> ([GetHostedZoneLimit] -> ShowS)
-> Show GetHostedZoneLimit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZoneLimit] -> ShowS
$cshowList :: [GetHostedZoneLimit] -> ShowS
show :: GetHostedZoneLimit -> String
$cshow :: GetHostedZoneLimit -> String
showsPrec :: Int -> GetHostedZoneLimit -> ShowS
$cshowsPrec :: Int -> GetHostedZoneLimit -> ShowS
Prelude.Show, (forall x. GetHostedZoneLimit -> Rep GetHostedZoneLimit x)
-> (forall x. Rep GetHostedZoneLimit x -> GetHostedZoneLimit)
-> Generic GetHostedZoneLimit
forall x. Rep GetHostedZoneLimit x -> GetHostedZoneLimit
forall x. GetHostedZoneLimit -> Rep GetHostedZoneLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetHostedZoneLimit x -> GetHostedZoneLimit
$cfrom :: forall x. GetHostedZoneLimit -> Rep GetHostedZoneLimit x
Prelude.Generic)
newGetHostedZoneLimit ::
HostedZoneLimitType ->
ResourceId ->
GetHostedZoneLimit
newGetHostedZoneLimit :: HostedZoneLimitType -> ResourceId -> GetHostedZoneLimit
newGetHostedZoneLimit HostedZoneLimitType
pType_ ResourceId
pHostedZoneId_ =
GetHostedZoneLimit' :: HostedZoneLimitType -> ResourceId -> GetHostedZoneLimit
GetHostedZoneLimit'
{ $sel:type':GetHostedZoneLimit' :: HostedZoneLimitType
type' = HostedZoneLimitType
pType_,
$sel:hostedZoneId:GetHostedZoneLimit' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_
}
getHostedZoneLimit_type :: Lens.Lens' GetHostedZoneLimit HostedZoneLimitType
getHostedZoneLimit_type :: (HostedZoneLimitType -> f HostedZoneLimitType)
-> GetHostedZoneLimit -> f GetHostedZoneLimit
getHostedZoneLimit_type = (GetHostedZoneLimit -> HostedZoneLimitType)
-> (GetHostedZoneLimit
-> HostedZoneLimitType -> GetHostedZoneLimit)
-> Lens
GetHostedZoneLimit
GetHostedZoneLimit
HostedZoneLimitType
HostedZoneLimitType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneLimit' {HostedZoneLimitType
type' :: HostedZoneLimitType
$sel:type':GetHostedZoneLimit' :: GetHostedZoneLimit -> HostedZoneLimitType
type'} -> HostedZoneLimitType
type') (\s :: GetHostedZoneLimit
s@GetHostedZoneLimit' {} HostedZoneLimitType
a -> GetHostedZoneLimit
s {$sel:type':GetHostedZoneLimit' :: HostedZoneLimitType
type' = HostedZoneLimitType
a} :: GetHostedZoneLimit)
getHostedZoneLimit_hostedZoneId :: Lens.Lens' GetHostedZoneLimit ResourceId
getHostedZoneLimit_hostedZoneId :: (ResourceId -> f ResourceId)
-> GetHostedZoneLimit -> f GetHostedZoneLimit
getHostedZoneLimit_hostedZoneId = (GetHostedZoneLimit -> ResourceId)
-> (GetHostedZoneLimit -> ResourceId -> GetHostedZoneLimit)
-> Lens GetHostedZoneLimit GetHostedZoneLimit ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneLimit' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:GetHostedZoneLimit' :: GetHostedZoneLimit -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: GetHostedZoneLimit
s@GetHostedZoneLimit' {} ResourceId
a -> GetHostedZoneLimit
s {$sel:hostedZoneId:GetHostedZoneLimit' :: ResourceId
hostedZoneId = ResourceId
a} :: GetHostedZoneLimit)
instance Core.AWSRequest GetHostedZoneLimit where
type
AWSResponse GetHostedZoneLimit =
GetHostedZoneLimitResponse
request :: GetHostedZoneLimit -> Request GetHostedZoneLimit
request = Service -> GetHostedZoneLimit -> Request GetHostedZoneLimit
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetHostedZoneLimit
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetHostedZoneLimit)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetHostedZoneLimit))
-> Logger
-> Service
-> Proxy GetHostedZoneLimit
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetHostedZoneLimit)))
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 -> HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse
GetHostedZoneLimitResponse'
(Int -> HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse)
-> Either String Int
-> Either
String (HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse)
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 (HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse)
-> Either String HostedZoneLimit
-> Either String (Natural -> GetHostedZoneLimitResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String HostedZoneLimit
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Limit")
Either String (Natural -> GetHostedZoneLimitResponse)
-> Either String Natural
-> Either String GetHostedZoneLimitResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Count")
)
instance Prelude.Hashable GetHostedZoneLimit
instance Prelude.NFData GetHostedZoneLimit
instance Core.ToHeaders GetHostedZoneLimit where
toHeaders :: GetHostedZoneLimit -> ResponseHeaders
toHeaders = ResponseHeaders -> GetHostedZoneLimit -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetHostedZoneLimit where
toPath :: GetHostedZoneLimit -> ByteString
toPath GetHostedZoneLimit' {ResourceId
HostedZoneLimitType
hostedZoneId :: ResourceId
type' :: HostedZoneLimitType
$sel:hostedZoneId:GetHostedZoneLimit' :: GetHostedZoneLimit -> ResourceId
$sel:type':GetHostedZoneLimit' :: GetHostedZoneLimit -> HostedZoneLimitType
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2013-04-01/hostedzonelimit/",
ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
hostedZoneId,
ByteString
"/",
HostedZoneLimitType -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS HostedZoneLimitType
type'
]
instance Core.ToQuery GetHostedZoneLimit where
toQuery :: GetHostedZoneLimit -> QueryString
toQuery = QueryString -> GetHostedZoneLimit -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetHostedZoneLimitResponse = GetHostedZoneLimitResponse'
{
GetHostedZoneLimitResponse -> Int
httpStatus :: Prelude.Int,
GetHostedZoneLimitResponse -> HostedZoneLimit
limit :: HostedZoneLimit,
GetHostedZoneLimitResponse -> Natural
count :: Prelude.Natural
}
deriving (GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool
(GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool)
-> (GetHostedZoneLimitResponse
-> GetHostedZoneLimitResponse -> Bool)
-> Eq GetHostedZoneLimitResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool
$c/= :: GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool
== :: GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool
$c== :: GetHostedZoneLimitResponse -> GetHostedZoneLimitResponse -> Bool
Prelude.Eq, ReadPrec [GetHostedZoneLimitResponse]
ReadPrec GetHostedZoneLimitResponse
Int -> ReadS GetHostedZoneLimitResponse
ReadS [GetHostedZoneLimitResponse]
(Int -> ReadS GetHostedZoneLimitResponse)
-> ReadS [GetHostedZoneLimitResponse]
-> ReadPrec GetHostedZoneLimitResponse
-> ReadPrec [GetHostedZoneLimitResponse]
-> Read GetHostedZoneLimitResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZoneLimitResponse]
$creadListPrec :: ReadPrec [GetHostedZoneLimitResponse]
readPrec :: ReadPrec GetHostedZoneLimitResponse
$creadPrec :: ReadPrec GetHostedZoneLimitResponse
readList :: ReadS [GetHostedZoneLimitResponse]
$creadList :: ReadS [GetHostedZoneLimitResponse]
readsPrec :: Int -> ReadS GetHostedZoneLimitResponse
$creadsPrec :: Int -> ReadS GetHostedZoneLimitResponse
Prelude.Read, Int -> GetHostedZoneLimitResponse -> ShowS
[GetHostedZoneLimitResponse] -> ShowS
GetHostedZoneLimitResponse -> String
(Int -> GetHostedZoneLimitResponse -> ShowS)
-> (GetHostedZoneLimitResponse -> String)
-> ([GetHostedZoneLimitResponse] -> ShowS)
-> Show GetHostedZoneLimitResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZoneLimitResponse] -> ShowS
$cshowList :: [GetHostedZoneLimitResponse] -> ShowS
show :: GetHostedZoneLimitResponse -> String
$cshow :: GetHostedZoneLimitResponse -> String
showsPrec :: Int -> GetHostedZoneLimitResponse -> ShowS
$cshowsPrec :: Int -> GetHostedZoneLimitResponse -> ShowS
Prelude.Show, (forall x.
GetHostedZoneLimitResponse -> Rep GetHostedZoneLimitResponse x)
-> (forall x.
Rep GetHostedZoneLimitResponse x -> GetHostedZoneLimitResponse)
-> Generic GetHostedZoneLimitResponse
forall x.
Rep GetHostedZoneLimitResponse x -> GetHostedZoneLimitResponse
forall x.
GetHostedZoneLimitResponse -> Rep GetHostedZoneLimitResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetHostedZoneLimitResponse x -> GetHostedZoneLimitResponse
$cfrom :: forall x.
GetHostedZoneLimitResponse -> Rep GetHostedZoneLimitResponse x
Prelude.Generic)
newGetHostedZoneLimitResponse ::
Prelude.Int ->
HostedZoneLimit ->
Prelude.Natural ->
GetHostedZoneLimitResponse
newGetHostedZoneLimitResponse :: Int -> HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse
newGetHostedZoneLimitResponse
Int
pHttpStatus_
HostedZoneLimit
pLimit_
Natural
pCount_ =
GetHostedZoneLimitResponse' :: Int -> HostedZoneLimit -> Natural -> GetHostedZoneLimitResponse
GetHostedZoneLimitResponse'
{ $sel:httpStatus:GetHostedZoneLimitResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:limit:GetHostedZoneLimitResponse' :: HostedZoneLimit
limit = HostedZoneLimit
pLimit_,
$sel:count:GetHostedZoneLimitResponse' :: Natural
count = Natural
pCount_
}
getHostedZoneLimitResponse_httpStatus :: Lens.Lens' GetHostedZoneLimitResponse Prelude.Int
getHostedZoneLimitResponse_httpStatus :: (Int -> f Int)
-> GetHostedZoneLimitResponse -> f GetHostedZoneLimitResponse
getHostedZoneLimitResponse_httpStatus = (GetHostedZoneLimitResponse -> Int)
-> (GetHostedZoneLimitResponse
-> Int -> GetHostedZoneLimitResponse)
-> Lens
GetHostedZoneLimitResponse GetHostedZoneLimitResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneLimitResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetHostedZoneLimitResponse' :: GetHostedZoneLimitResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetHostedZoneLimitResponse
s@GetHostedZoneLimitResponse' {} Int
a -> GetHostedZoneLimitResponse
s {$sel:httpStatus:GetHostedZoneLimitResponse' :: Int
httpStatus = Int
a} :: GetHostedZoneLimitResponse)
getHostedZoneLimitResponse_limit :: Lens.Lens' GetHostedZoneLimitResponse HostedZoneLimit
getHostedZoneLimitResponse_limit :: (HostedZoneLimit -> f HostedZoneLimit)
-> GetHostedZoneLimitResponse -> f GetHostedZoneLimitResponse
getHostedZoneLimitResponse_limit = (GetHostedZoneLimitResponse -> HostedZoneLimit)
-> (GetHostedZoneLimitResponse
-> HostedZoneLimit -> GetHostedZoneLimitResponse)
-> Lens
GetHostedZoneLimitResponse
GetHostedZoneLimitResponse
HostedZoneLimit
HostedZoneLimit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneLimitResponse' {HostedZoneLimit
limit :: HostedZoneLimit
$sel:limit:GetHostedZoneLimitResponse' :: GetHostedZoneLimitResponse -> HostedZoneLimit
limit} -> HostedZoneLimit
limit) (\s :: GetHostedZoneLimitResponse
s@GetHostedZoneLimitResponse' {} HostedZoneLimit
a -> GetHostedZoneLimitResponse
s {$sel:limit:GetHostedZoneLimitResponse' :: HostedZoneLimit
limit = HostedZoneLimit
a} :: GetHostedZoneLimitResponse)
getHostedZoneLimitResponse_count :: Lens.Lens' GetHostedZoneLimitResponse Prelude.Natural
getHostedZoneLimitResponse_count :: (Natural -> f Natural)
-> GetHostedZoneLimitResponse -> f GetHostedZoneLimitResponse
getHostedZoneLimitResponse_count = (GetHostedZoneLimitResponse -> Natural)
-> (GetHostedZoneLimitResponse
-> Natural -> GetHostedZoneLimitResponse)
-> Lens
GetHostedZoneLimitResponse
GetHostedZoneLimitResponse
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneLimitResponse' {Natural
count :: Natural
$sel:count:GetHostedZoneLimitResponse' :: GetHostedZoneLimitResponse -> Natural
count} -> Natural
count) (\s :: GetHostedZoneLimitResponse
s@GetHostedZoneLimitResponse' {} Natural
a -> GetHostedZoneLimitResponse
s {$sel:count:GetHostedZoneLimitResponse' :: Natural
count = Natural
a} :: GetHostedZoneLimitResponse)
instance Prelude.NFData GetHostedZoneLimitResponse