{-# 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.Redshift.DescribeUsageLimits
(
DescribeUsageLimits (..),
newDescribeUsageLimits,
describeUsageLimits_tagValues,
describeUsageLimits_usageLimitId,
describeUsageLimits_tagKeys,
describeUsageLimits_clusterIdentifier,
describeUsageLimits_featureType,
describeUsageLimits_marker,
describeUsageLimits_maxRecords,
DescribeUsageLimitsResponse (..),
newDescribeUsageLimitsResponse,
describeUsageLimitsResponse_usageLimits,
describeUsageLimitsResponse_marker,
describeUsageLimitsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeUsageLimits = DescribeUsageLimits'
{
DescribeUsageLimits -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text],
DescribeUsageLimits -> Maybe Text
usageLimitId :: Prelude.Maybe Prelude.Text,
DescribeUsageLimits -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
DescribeUsageLimits -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
DescribeUsageLimits -> Maybe UsageLimitFeatureType
featureType :: Prelude.Maybe UsageLimitFeatureType,
DescribeUsageLimits -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeUsageLimits -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
}
deriving (DescribeUsageLimits -> DescribeUsageLimits -> Bool
(DescribeUsageLimits -> DescribeUsageLimits -> Bool)
-> (DescribeUsageLimits -> DescribeUsageLimits -> Bool)
-> Eq DescribeUsageLimits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUsageLimits -> DescribeUsageLimits -> Bool
$c/= :: DescribeUsageLimits -> DescribeUsageLimits -> Bool
== :: DescribeUsageLimits -> DescribeUsageLimits -> Bool
$c== :: DescribeUsageLimits -> DescribeUsageLimits -> Bool
Prelude.Eq, ReadPrec [DescribeUsageLimits]
ReadPrec DescribeUsageLimits
Int -> ReadS DescribeUsageLimits
ReadS [DescribeUsageLimits]
(Int -> ReadS DescribeUsageLimits)
-> ReadS [DescribeUsageLimits]
-> ReadPrec DescribeUsageLimits
-> ReadPrec [DescribeUsageLimits]
-> Read DescribeUsageLimits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUsageLimits]
$creadListPrec :: ReadPrec [DescribeUsageLimits]
readPrec :: ReadPrec DescribeUsageLimits
$creadPrec :: ReadPrec DescribeUsageLimits
readList :: ReadS [DescribeUsageLimits]
$creadList :: ReadS [DescribeUsageLimits]
readsPrec :: Int -> ReadS DescribeUsageLimits
$creadsPrec :: Int -> ReadS DescribeUsageLimits
Prelude.Read, Int -> DescribeUsageLimits -> ShowS
[DescribeUsageLimits] -> ShowS
DescribeUsageLimits -> String
(Int -> DescribeUsageLimits -> ShowS)
-> (DescribeUsageLimits -> String)
-> ([DescribeUsageLimits] -> ShowS)
-> Show DescribeUsageLimits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUsageLimits] -> ShowS
$cshowList :: [DescribeUsageLimits] -> ShowS
show :: DescribeUsageLimits -> String
$cshow :: DescribeUsageLimits -> String
showsPrec :: Int -> DescribeUsageLimits -> ShowS
$cshowsPrec :: Int -> DescribeUsageLimits -> ShowS
Prelude.Show, (forall x. DescribeUsageLimits -> Rep DescribeUsageLimits x)
-> (forall x. Rep DescribeUsageLimits x -> DescribeUsageLimits)
-> Generic DescribeUsageLimits
forall x. Rep DescribeUsageLimits x -> DescribeUsageLimits
forall x. DescribeUsageLimits -> Rep DescribeUsageLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUsageLimits x -> DescribeUsageLimits
$cfrom :: forall x. DescribeUsageLimits -> Rep DescribeUsageLimits x
Prelude.Generic)
newDescribeUsageLimits ::
DescribeUsageLimits
newDescribeUsageLimits :: DescribeUsageLimits
newDescribeUsageLimits =
DescribeUsageLimits' :: Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe UsageLimitFeatureType
-> Maybe Text
-> Maybe Int
-> DescribeUsageLimits
DescribeUsageLimits'
{ $sel:tagValues:DescribeUsageLimits' :: Maybe [Text]
tagValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:usageLimitId:DescribeUsageLimits' :: Maybe Text
usageLimitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tagKeys:DescribeUsageLimits' :: Maybe [Text]
tagKeys = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:DescribeUsageLimits' :: Maybe Text
clusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:featureType:DescribeUsageLimits' :: Maybe UsageLimitFeatureType
featureType = Maybe UsageLimitFeatureType
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeUsageLimits' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxRecords:DescribeUsageLimits' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
describeUsageLimits_tagValues :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe [Prelude.Text])
describeUsageLimits_tagValues :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_tagValues = (DescribeUsageLimits -> Maybe [Text])
-> (DescribeUsageLimits -> Maybe [Text] -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits
DescribeUsageLimits
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe [Text]
a -> DescribeUsageLimits
s {$sel:tagValues:DescribeUsageLimits' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeUsageLimits) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits -> f DescribeUsageLimits)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits
-> f DescribeUsageLimits
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeUsageLimits_usageLimitId :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_usageLimitId :: (Maybe Text -> f (Maybe Text))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_usageLimitId = (DescribeUsageLimits -> Maybe Text)
-> (DescribeUsageLimits -> Maybe Text -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits DescribeUsageLimits (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe Text
usageLimitId :: Maybe Text
$sel:usageLimitId:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
usageLimitId} -> Maybe Text
usageLimitId) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe Text
a -> DescribeUsageLimits
s {$sel:usageLimitId:DescribeUsageLimits' :: Maybe Text
usageLimitId = Maybe Text
a} :: DescribeUsageLimits)
describeUsageLimits_tagKeys :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe [Prelude.Text])
describeUsageLimits_tagKeys :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_tagKeys = (DescribeUsageLimits -> Maybe [Text])
-> (DescribeUsageLimits -> Maybe [Text] -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits
DescribeUsageLimits
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe [Text]
a -> DescribeUsageLimits
s {$sel:tagKeys:DescribeUsageLimits' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeUsageLimits) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits -> f DescribeUsageLimits)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeUsageLimits
-> f DescribeUsageLimits
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeUsageLimits_clusterIdentifier :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_clusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_clusterIdentifier = (DescribeUsageLimits -> Maybe Text)
-> (DescribeUsageLimits -> Maybe Text -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits DescribeUsageLimits (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe Text
a -> DescribeUsageLimits
s {$sel:clusterIdentifier:DescribeUsageLimits' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: DescribeUsageLimits)
describeUsageLimits_featureType :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe UsageLimitFeatureType)
describeUsageLimits_featureType :: (Maybe UsageLimitFeatureType -> f (Maybe UsageLimitFeatureType))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_featureType = (DescribeUsageLimits -> Maybe UsageLimitFeatureType)
-> (DescribeUsageLimits
-> Maybe UsageLimitFeatureType -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits
DescribeUsageLimits
(Maybe UsageLimitFeatureType)
(Maybe UsageLimitFeatureType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe UsageLimitFeatureType
featureType :: Maybe UsageLimitFeatureType
$sel:featureType:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe UsageLimitFeatureType
featureType} -> Maybe UsageLimitFeatureType
featureType) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe UsageLimitFeatureType
a -> DescribeUsageLimits
s {$sel:featureType:DescribeUsageLimits' :: Maybe UsageLimitFeatureType
featureType = Maybe UsageLimitFeatureType
a} :: DescribeUsageLimits)
describeUsageLimits_marker :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_marker = (DescribeUsageLimits -> Maybe Text)
-> (DescribeUsageLimits -> Maybe Text -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits DescribeUsageLimits (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe Text
a -> DescribeUsageLimits
s {$sel:marker:DescribeUsageLimits' :: Maybe Text
marker = Maybe Text
a} :: DescribeUsageLimits)
describeUsageLimits_maxRecords :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Int)
describeUsageLimits_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeUsageLimits -> f DescribeUsageLimits
describeUsageLimits_maxRecords = (DescribeUsageLimits -> Maybe Int)
-> (DescribeUsageLimits -> Maybe Int -> DescribeUsageLimits)
-> Lens
DescribeUsageLimits DescribeUsageLimits (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimits' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeUsageLimits
s@DescribeUsageLimits' {} Maybe Int
a -> DescribeUsageLimits
s {$sel:maxRecords:DescribeUsageLimits' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeUsageLimits)
instance Core.AWSPager DescribeUsageLimits where
page :: DescribeUsageLimits
-> AWSResponse DescribeUsageLimits -> Maybe DescribeUsageLimits
page DescribeUsageLimits
rq AWSResponse DescribeUsageLimits
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeUsageLimits
DescribeUsageLimitsResponse
rs
DescribeUsageLimitsResponse
-> Getting (First Text) DescribeUsageLimitsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsageLimitsResponse
-> Const (First Text) DescribeUsageLimitsResponse
Lens' DescribeUsageLimitsResponse (Maybe Text)
describeUsageLimitsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsageLimitsResponse
-> Const (First Text) DescribeUsageLimitsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeUsageLimitsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeUsageLimits
forall a. Maybe a
Prelude.Nothing
| Maybe [UsageLimit] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeUsageLimits
DescribeUsageLimitsResponse
rs
DescribeUsageLimitsResponse
-> Getting
(First [UsageLimit]) DescribeUsageLimitsResponse [UsageLimit]
-> Maybe [UsageLimit]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [UsageLimit]
-> Const (First [UsageLimit]) (Maybe [UsageLimit]))
-> DescribeUsageLimitsResponse
-> Const (First [UsageLimit]) DescribeUsageLimitsResponse
Lens' DescribeUsageLimitsResponse (Maybe [UsageLimit])
describeUsageLimitsResponse_usageLimits
((Maybe [UsageLimit]
-> Const (First [UsageLimit]) (Maybe [UsageLimit]))
-> DescribeUsageLimitsResponse
-> Const (First [UsageLimit]) DescribeUsageLimitsResponse)
-> (([UsageLimit] -> Const (First [UsageLimit]) [UsageLimit])
-> Maybe [UsageLimit]
-> Const (First [UsageLimit]) (Maybe [UsageLimit]))
-> Getting
(First [UsageLimit]) DescribeUsageLimitsResponse [UsageLimit]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UsageLimit] -> Const (First [UsageLimit]) [UsageLimit])
-> Maybe [UsageLimit]
-> Const (First [UsageLimit]) (Maybe [UsageLimit])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeUsageLimits
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeUsageLimits -> Maybe DescribeUsageLimits
forall a. a -> Maybe a
Prelude.Just (DescribeUsageLimits -> Maybe DescribeUsageLimits)
-> DescribeUsageLimits -> Maybe DescribeUsageLimits
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeUsageLimits
rq
DescribeUsageLimits
-> (DescribeUsageLimits -> DescribeUsageLimits)
-> DescribeUsageLimits
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeUsageLimits -> Identity DescribeUsageLimits
Lens
DescribeUsageLimits DescribeUsageLimits (Maybe Text) (Maybe Text)
describeUsageLimits_marker
((Maybe Text -> Identity (Maybe Text))
-> DescribeUsageLimits -> Identity DescribeUsageLimits)
-> Maybe Text -> DescribeUsageLimits -> DescribeUsageLimits
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeUsageLimits
DescribeUsageLimitsResponse
rs
DescribeUsageLimitsResponse
-> Getting (First Text) DescribeUsageLimitsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsageLimitsResponse
-> Const (First Text) DescribeUsageLimitsResponse
Lens' DescribeUsageLimitsResponse (Maybe Text)
describeUsageLimitsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsageLimitsResponse
-> Const (First Text) DescribeUsageLimitsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeUsageLimitsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeUsageLimits where
type
AWSResponse DescribeUsageLimits =
DescribeUsageLimitsResponse
request :: DescribeUsageLimits -> Request DescribeUsageLimits
request = Service -> DescribeUsageLimits -> Request DescribeUsageLimits
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeUsageLimits
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeUsageLimits)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeUsageLimits))
-> Logger
-> Service
-> Proxy DescribeUsageLimits
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeUsageLimits)))
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
"DescribeUsageLimitsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [UsageLimit]
-> Maybe Text -> Int -> DescribeUsageLimitsResponse
DescribeUsageLimitsResponse'
(Maybe [UsageLimit]
-> Maybe Text -> Int -> DescribeUsageLimitsResponse)
-> Either String (Maybe [UsageLimit])
-> Either String (Maybe Text -> Int -> DescribeUsageLimitsResponse)
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
"UsageLimits" 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 [UsageLimit]))
-> Either String (Maybe [UsageLimit])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [UsageLimit])
-> [Node] -> Either String (Maybe [UsageLimit])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [UsageLimit]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Maybe Text -> Int -> DescribeUsageLimitsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeUsageLimitsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
Either String (Int -> DescribeUsageLimitsResponse)
-> Either String Int -> Either String DescribeUsageLimitsResponse
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 DescribeUsageLimits
instance Prelude.NFData DescribeUsageLimits
instance Core.ToHeaders DescribeUsageLimits where
toHeaders :: DescribeUsageLimits -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeUsageLimits -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeUsageLimits where
toPath :: DescribeUsageLimits -> ByteString
toPath = ByteString -> DescribeUsageLimits -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeUsageLimits where
toQuery :: DescribeUsageLimits -> QueryString
toQuery DescribeUsageLimits' {Maybe Int
Maybe [Text]
Maybe Text
Maybe UsageLimitFeatureType
maxRecords :: Maybe Int
marker :: Maybe Text
featureType :: Maybe UsageLimitFeatureType
clusterIdentifier :: Maybe Text
tagKeys :: Maybe [Text]
usageLimitId :: Maybe Text
tagValues :: Maybe [Text]
$sel:maxRecords:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Int
$sel:marker:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:featureType:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe UsageLimitFeatureType
$sel:clusterIdentifier:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:tagKeys:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
$sel:usageLimitId:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:tagValues:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeUsageLimits" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"TagValues"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"TagValue" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues),
ByteString
"UsageLimitId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
usageLimitId,
ByteString
"TagKeys"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"TagKey" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
ByteString
"ClusterIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clusterIdentifier,
ByteString
"FeatureType" ByteString -> Maybe UsageLimitFeatureType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe UsageLimitFeatureType
featureType,
ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
]
data DescribeUsageLimitsResponse = DescribeUsageLimitsResponse'
{
DescribeUsageLimitsResponse -> Maybe [UsageLimit]
usageLimits :: Prelude.Maybe [UsageLimit],
DescribeUsageLimitsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeUsageLimitsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
(DescribeUsageLimitsResponse
-> DescribeUsageLimitsResponse -> Bool)
-> (DescribeUsageLimitsResponse
-> DescribeUsageLimitsResponse -> Bool)
-> Eq DescribeUsageLimitsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
$c/= :: DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
== :: DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
$c== :: DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeUsageLimitsResponse]
ReadPrec DescribeUsageLimitsResponse
Int -> ReadS DescribeUsageLimitsResponse
ReadS [DescribeUsageLimitsResponse]
(Int -> ReadS DescribeUsageLimitsResponse)
-> ReadS [DescribeUsageLimitsResponse]
-> ReadPrec DescribeUsageLimitsResponse
-> ReadPrec [DescribeUsageLimitsResponse]
-> Read DescribeUsageLimitsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUsageLimitsResponse]
$creadListPrec :: ReadPrec [DescribeUsageLimitsResponse]
readPrec :: ReadPrec DescribeUsageLimitsResponse
$creadPrec :: ReadPrec DescribeUsageLimitsResponse
readList :: ReadS [DescribeUsageLimitsResponse]
$creadList :: ReadS [DescribeUsageLimitsResponse]
readsPrec :: Int -> ReadS DescribeUsageLimitsResponse
$creadsPrec :: Int -> ReadS DescribeUsageLimitsResponse
Prelude.Read, Int -> DescribeUsageLimitsResponse -> ShowS
[DescribeUsageLimitsResponse] -> ShowS
DescribeUsageLimitsResponse -> String
(Int -> DescribeUsageLimitsResponse -> ShowS)
-> (DescribeUsageLimitsResponse -> String)
-> ([DescribeUsageLimitsResponse] -> ShowS)
-> Show DescribeUsageLimitsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUsageLimitsResponse] -> ShowS
$cshowList :: [DescribeUsageLimitsResponse] -> ShowS
show :: DescribeUsageLimitsResponse -> String
$cshow :: DescribeUsageLimitsResponse -> String
showsPrec :: Int -> DescribeUsageLimitsResponse -> ShowS
$cshowsPrec :: Int -> DescribeUsageLimitsResponse -> ShowS
Prelude.Show, (forall x.
DescribeUsageLimitsResponse -> Rep DescribeUsageLimitsResponse x)
-> (forall x.
Rep DescribeUsageLimitsResponse x -> DescribeUsageLimitsResponse)
-> Generic DescribeUsageLimitsResponse
forall x.
Rep DescribeUsageLimitsResponse x -> DescribeUsageLimitsResponse
forall x.
DescribeUsageLimitsResponse -> Rep DescribeUsageLimitsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeUsageLimitsResponse x -> DescribeUsageLimitsResponse
$cfrom :: forall x.
DescribeUsageLimitsResponse -> Rep DescribeUsageLimitsResponse x
Prelude.Generic)
newDescribeUsageLimitsResponse ::
Prelude.Int ->
DescribeUsageLimitsResponse
newDescribeUsageLimitsResponse :: Int -> DescribeUsageLimitsResponse
newDescribeUsageLimitsResponse Int
pHttpStatus_ =
DescribeUsageLimitsResponse' :: Maybe [UsageLimit]
-> Maybe Text -> Int -> DescribeUsageLimitsResponse
DescribeUsageLimitsResponse'
{ $sel:usageLimits:DescribeUsageLimitsResponse' :: Maybe [UsageLimit]
usageLimits =
Maybe [UsageLimit]
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeUsageLimitsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeUsageLimitsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeUsageLimitsResponse_usageLimits :: Lens.Lens' DescribeUsageLimitsResponse (Prelude.Maybe [UsageLimit])
describeUsageLimitsResponse_usageLimits :: (Maybe [UsageLimit] -> f (Maybe [UsageLimit]))
-> DescribeUsageLimitsResponse -> f DescribeUsageLimitsResponse
describeUsageLimitsResponse_usageLimits = (DescribeUsageLimitsResponse -> Maybe [UsageLimit])
-> (DescribeUsageLimitsResponse
-> Maybe [UsageLimit] -> DescribeUsageLimitsResponse)
-> Lens' DescribeUsageLimitsResponse (Maybe [UsageLimit])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimitsResponse' {Maybe [UsageLimit]
usageLimits :: Maybe [UsageLimit]
$sel:usageLimits:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Maybe [UsageLimit]
usageLimits} -> Maybe [UsageLimit]
usageLimits) (\s :: DescribeUsageLimitsResponse
s@DescribeUsageLimitsResponse' {} Maybe [UsageLimit]
a -> DescribeUsageLimitsResponse
s {$sel:usageLimits:DescribeUsageLimitsResponse' :: Maybe [UsageLimit]
usageLimits = Maybe [UsageLimit]
a} :: DescribeUsageLimitsResponse) ((Maybe [UsageLimit] -> f (Maybe [UsageLimit]))
-> DescribeUsageLimitsResponse -> f DescribeUsageLimitsResponse)
-> ((Maybe [UsageLimit] -> f (Maybe [UsageLimit]))
-> Maybe [UsageLimit] -> f (Maybe [UsageLimit]))
-> (Maybe [UsageLimit] -> f (Maybe [UsageLimit]))
-> DescribeUsageLimitsResponse
-> f DescribeUsageLimitsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UsageLimit] [UsageLimit] [UsageLimit] [UsageLimit]
-> Iso
(Maybe [UsageLimit])
(Maybe [UsageLimit])
(Maybe [UsageLimit])
(Maybe [UsageLimit])
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 [UsageLimit] [UsageLimit] [UsageLimit] [UsageLimit]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeUsageLimitsResponse_marker :: Lens.Lens' DescribeUsageLimitsResponse (Prelude.Maybe Prelude.Text)
describeUsageLimitsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeUsageLimitsResponse -> f DescribeUsageLimitsResponse
describeUsageLimitsResponse_marker = (DescribeUsageLimitsResponse -> Maybe Text)
-> (DescribeUsageLimitsResponse
-> Maybe Text -> DescribeUsageLimitsResponse)
-> Lens' DescribeUsageLimitsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimitsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUsageLimitsResponse
s@DescribeUsageLimitsResponse' {} Maybe Text
a -> DescribeUsageLimitsResponse
s {$sel:marker:DescribeUsageLimitsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeUsageLimitsResponse)
describeUsageLimitsResponse_httpStatus :: Lens.Lens' DescribeUsageLimitsResponse Prelude.Int
describeUsageLimitsResponse_httpStatus :: (Int -> f Int)
-> DescribeUsageLimitsResponse -> f DescribeUsageLimitsResponse
describeUsageLimitsResponse_httpStatus = (DescribeUsageLimitsResponse -> Int)
-> (DescribeUsageLimitsResponse
-> Int -> DescribeUsageLimitsResponse)
-> Lens
DescribeUsageLimitsResponse DescribeUsageLimitsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsageLimitsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeUsageLimitsResponse
s@DescribeUsageLimitsResponse' {} Int
a -> DescribeUsageLimitsResponse
s {$sel:httpStatus:DescribeUsageLimitsResponse' :: Int
httpStatus = Int
a} :: DescribeUsageLimitsResponse)
instance Prelude.NFData DescribeUsageLimitsResponse