{-# 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.RDS.DescribeAccountAttributes
(
DescribeAccountAttributes (..),
newDescribeAccountAttributes,
DescribeAccountAttributesResponse (..),
newDescribeAccountAttributesResponse,
describeAccountAttributesResponse_accountQuotas,
describeAccountAttributesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeAccountAttributes = DescribeAccountAttributes'
{
}
deriving (DescribeAccountAttributes -> DescribeAccountAttributes -> Bool
(DescribeAccountAttributes -> DescribeAccountAttributes -> Bool)
-> (DescribeAccountAttributes -> DescribeAccountAttributes -> Bool)
-> Eq DescribeAccountAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccountAttributes -> DescribeAccountAttributes -> Bool
$c/= :: DescribeAccountAttributes -> DescribeAccountAttributes -> Bool
== :: DescribeAccountAttributes -> DescribeAccountAttributes -> Bool
$c== :: DescribeAccountAttributes -> DescribeAccountAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeAccountAttributes]
ReadPrec DescribeAccountAttributes
Int -> ReadS DescribeAccountAttributes
ReadS [DescribeAccountAttributes]
(Int -> ReadS DescribeAccountAttributes)
-> ReadS [DescribeAccountAttributes]
-> ReadPrec DescribeAccountAttributes
-> ReadPrec [DescribeAccountAttributes]
-> Read DescribeAccountAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccountAttributes]
$creadListPrec :: ReadPrec [DescribeAccountAttributes]
readPrec :: ReadPrec DescribeAccountAttributes
$creadPrec :: ReadPrec DescribeAccountAttributes
readList :: ReadS [DescribeAccountAttributes]
$creadList :: ReadS [DescribeAccountAttributes]
readsPrec :: Int -> ReadS DescribeAccountAttributes
$creadsPrec :: Int -> ReadS DescribeAccountAttributes
Prelude.Read, Int -> DescribeAccountAttributes -> ShowS
[DescribeAccountAttributes] -> ShowS
DescribeAccountAttributes -> String
(Int -> DescribeAccountAttributes -> ShowS)
-> (DescribeAccountAttributes -> String)
-> ([DescribeAccountAttributes] -> ShowS)
-> Show DescribeAccountAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccountAttributes] -> ShowS
$cshowList :: [DescribeAccountAttributes] -> ShowS
show :: DescribeAccountAttributes -> String
$cshow :: DescribeAccountAttributes -> String
showsPrec :: Int -> DescribeAccountAttributes -> ShowS
$cshowsPrec :: Int -> DescribeAccountAttributes -> ShowS
Prelude.Show, (forall x.
DescribeAccountAttributes -> Rep DescribeAccountAttributes x)
-> (forall x.
Rep DescribeAccountAttributes x -> DescribeAccountAttributes)
-> Generic DescribeAccountAttributes
forall x.
Rep DescribeAccountAttributes x -> DescribeAccountAttributes
forall x.
DescribeAccountAttributes -> Rep DescribeAccountAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAccountAttributes x -> DescribeAccountAttributes
$cfrom :: forall x.
DescribeAccountAttributes -> Rep DescribeAccountAttributes x
Prelude.Generic)
newDescribeAccountAttributes ::
DescribeAccountAttributes
newDescribeAccountAttributes :: DescribeAccountAttributes
newDescribeAccountAttributes =
DescribeAccountAttributes
DescribeAccountAttributes'
instance Core.AWSRequest DescribeAccountAttributes where
type
AWSResponse DescribeAccountAttributes =
DescribeAccountAttributesResponse
request :: DescribeAccountAttributes -> Request DescribeAccountAttributes
request = Service
-> DescribeAccountAttributes -> Request DescribeAccountAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeAccountAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAccountAttributes)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeAccountAttributes))
-> Logger
-> Service
-> Proxy DescribeAccountAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAccountAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeAccountAttributesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [AccountQuota] -> Int -> DescribeAccountAttributesResponse
DescribeAccountAttributesResponse'
(Maybe [AccountQuota] -> Int -> DescribeAccountAttributesResponse)
-> Either String (Maybe [AccountQuota])
-> Either String (Int -> DescribeAccountAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccountQuotas" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [AccountQuota]))
-> Either String (Maybe [AccountQuota])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AccountQuota])
-> [Node] -> Either String (Maybe [AccountQuota])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AccountQuota]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"AccountQuota")
)
Either String (Int -> DescribeAccountAttributesResponse)
-> Either String Int
-> Either String DescribeAccountAttributesResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DescribeAccountAttributes
instance Prelude.NFData DescribeAccountAttributes
instance Core.ToHeaders DescribeAccountAttributes where
toHeaders :: DescribeAccountAttributes -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAccountAttributes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeAccountAttributes where
toPath :: DescribeAccountAttributes -> ByteString
toPath = ByteString -> DescribeAccountAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeAccountAttributes where
toQuery :: DescribeAccountAttributes -> QueryString
toQuery =
QueryString -> DescribeAccountAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const
( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeAccountAttributes" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString)
]
)
data DescribeAccountAttributesResponse = DescribeAccountAttributesResponse'
{
DescribeAccountAttributesResponse -> Maybe [AccountQuota]
accountQuotas :: Prelude.Maybe [AccountQuota],
DescribeAccountAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool
(DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool)
-> (DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool)
-> Eq DescribeAccountAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool
$c/= :: DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool
== :: DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool
$c== :: DescribeAccountAttributesResponse
-> DescribeAccountAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAccountAttributesResponse]
ReadPrec DescribeAccountAttributesResponse
Int -> ReadS DescribeAccountAttributesResponse
ReadS [DescribeAccountAttributesResponse]
(Int -> ReadS DescribeAccountAttributesResponse)
-> ReadS [DescribeAccountAttributesResponse]
-> ReadPrec DescribeAccountAttributesResponse
-> ReadPrec [DescribeAccountAttributesResponse]
-> Read DescribeAccountAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccountAttributesResponse]
$creadListPrec :: ReadPrec [DescribeAccountAttributesResponse]
readPrec :: ReadPrec DescribeAccountAttributesResponse
$creadPrec :: ReadPrec DescribeAccountAttributesResponse
readList :: ReadS [DescribeAccountAttributesResponse]
$creadList :: ReadS [DescribeAccountAttributesResponse]
readsPrec :: Int -> ReadS DescribeAccountAttributesResponse
$creadsPrec :: Int -> ReadS DescribeAccountAttributesResponse
Prelude.Read, Int -> DescribeAccountAttributesResponse -> ShowS
[DescribeAccountAttributesResponse] -> ShowS
DescribeAccountAttributesResponse -> String
(Int -> DescribeAccountAttributesResponse -> ShowS)
-> (DescribeAccountAttributesResponse -> String)
-> ([DescribeAccountAttributesResponse] -> ShowS)
-> Show DescribeAccountAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccountAttributesResponse] -> ShowS
$cshowList :: [DescribeAccountAttributesResponse] -> ShowS
show :: DescribeAccountAttributesResponse -> String
$cshow :: DescribeAccountAttributesResponse -> String
showsPrec :: Int -> DescribeAccountAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeAccountAttributesResponse -> ShowS
Prelude.Show, (forall x.
DescribeAccountAttributesResponse
-> Rep DescribeAccountAttributesResponse x)
-> (forall x.
Rep DescribeAccountAttributesResponse x
-> DescribeAccountAttributesResponse)
-> Generic DescribeAccountAttributesResponse
forall x.
Rep DescribeAccountAttributesResponse x
-> DescribeAccountAttributesResponse
forall x.
DescribeAccountAttributesResponse
-> Rep DescribeAccountAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAccountAttributesResponse x
-> DescribeAccountAttributesResponse
$cfrom :: forall x.
DescribeAccountAttributesResponse
-> Rep DescribeAccountAttributesResponse x
Prelude.Generic)
newDescribeAccountAttributesResponse ::
Prelude.Int ->
DescribeAccountAttributesResponse
newDescribeAccountAttributesResponse :: Int -> DescribeAccountAttributesResponse
newDescribeAccountAttributesResponse Int
pHttpStatus_ =
DescribeAccountAttributesResponse' :: Maybe [AccountQuota] -> Int -> DescribeAccountAttributesResponse
DescribeAccountAttributesResponse'
{ $sel:accountQuotas:DescribeAccountAttributesResponse' :: Maybe [AccountQuota]
accountQuotas =
Maybe [AccountQuota]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeAccountAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeAccountAttributesResponse_accountQuotas :: Lens.Lens' DescribeAccountAttributesResponse (Prelude.Maybe [AccountQuota])
describeAccountAttributesResponse_accountQuotas :: (Maybe [AccountQuota] -> f (Maybe [AccountQuota]))
-> DescribeAccountAttributesResponse
-> f DescribeAccountAttributesResponse
describeAccountAttributesResponse_accountQuotas = (DescribeAccountAttributesResponse -> Maybe [AccountQuota])
-> (DescribeAccountAttributesResponse
-> Maybe [AccountQuota] -> DescribeAccountAttributesResponse)
-> Lens
DescribeAccountAttributesResponse
DescribeAccountAttributesResponse
(Maybe [AccountQuota])
(Maybe [AccountQuota])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccountAttributesResponse' {Maybe [AccountQuota]
accountQuotas :: Maybe [AccountQuota]
$sel:accountQuotas:DescribeAccountAttributesResponse' :: DescribeAccountAttributesResponse -> Maybe [AccountQuota]
accountQuotas} -> Maybe [AccountQuota]
accountQuotas) (\s :: DescribeAccountAttributesResponse
s@DescribeAccountAttributesResponse' {} Maybe [AccountQuota]
a -> DescribeAccountAttributesResponse
s {$sel:accountQuotas:DescribeAccountAttributesResponse' :: Maybe [AccountQuota]
accountQuotas = Maybe [AccountQuota]
a} :: DescribeAccountAttributesResponse) ((Maybe [AccountQuota] -> f (Maybe [AccountQuota]))
-> DescribeAccountAttributesResponse
-> f DescribeAccountAttributesResponse)
-> ((Maybe [AccountQuota] -> f (Maybe [AccountQuota]))
-> Maybe [AccountQuota] -> f (Maybe [AccountQuota]))
-> (Maybe [AccountQuota] -> f (Maybe [AccountQuota]))
-> DescribeAccountAttributesResponse
-> f DescribeAccountAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AccountQuota] [AccountQuota] [AccountQuota] [AccountQuota]
-> Iso
(Maybe [AccountQuota])
(Maybe [AccountQuota])
(Maybe [AccountQuota])
(Maybe [AccountQuota])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [AccountQuota] [AccountQuota] [AccountQuota] [AccountQuota]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeAccountAttributesResponse_httpStatus :: Lens.Lens' DescribeAccountAttributesResponse Prelude.Int
describeAccountAttributesResponse_httpStatus :: (Int -> f Int)
-> DescribeAccountAttributesResponse
-> f DescribeAccountAttributesResponse
describeAccountAttributesResponse_httpStatus = (DescribeAccountAttributesResponse -> Int)
-> (DescribeAccountAttributesResponse
-> Int -> DescribeAccountAttributesResponse)
-> Lens
DescribeAccountAttributesResponse
DescribeAccountAttributesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccountAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAccountAttributesResponse' :: DescribeAccountAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAccountAttributesResponse
s@DescribeAccountAttributesResponse' {} Int
a -> DescribeAccountAttributesResponse
s {$sel:httpStatus:DescribeAccountAttributesResponse' :: Int
httpStatus = Int
a} :: DescribeAccountAttributesResponse)
instance
Prelude.NFData
DescribeAccountAttributesResponse