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