{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Redshift.DescribeUsageLimits
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Shows usage limits on a cluster. Results are filtered based on the
-- combination of input usage limit identifier, cluster identifier, and
-- feature type parameters:
--
-- -   If usage limit identifier, cluster identifier, and feature type are
--     not provided, then all usage limit objects for the current account
--     in the current region are returned.
--
-- -   If usage limit identifier is provided, then the corresponding usage
--     limit object is returned.
--
-- -   If cluster identifier is provided, then all usage limit objects for
--     the specified cluster are returned.
--
-- -   If cluster identifier and feature type are provided, then all usage
--     limit objects for the combination of cluster and feature are
--     returned.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeUsageLimits
  ( -- * Creating a Request
    DescribeUsageLimits (..),
    newDescribeUsageLimits,

    -- * Request Lenses
    describeUsageLimits_clusterIdentifier,
    describeUsageLimits_featureType,
    describeUsageLimits_marker,
    describeUsageLimits_maxRecords,
    describeUsageLimits_tagKeys,
    describeUsageLimits_tagValues,
    describeUsageLimits_usageLimitId,

    -- * Destructuring the Response
    DescribeUsageLimitsResponse (..),
    newDescribeUsageLimitsResponse,

    -- * Response Lenses
    describeUsageLimitsResponse_marker,
    describeUsageLimitsResponse_usageLimits,
    describeUsageLimitsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeUsageLimits' smart constructor.
data DescribeUsageLimits = DescribeUsageLimits'
  { -- | The identifier of the cluster for which you want to describe usage
    -- limits.
    DescribeUsageLimits -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The feature type for which you want to describe usage limits.
    DescribeUsageLimits -> Maybe UsageLimitFeatureType
featureType :: Prelude.Maybe UsageLimitFeatureType,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeUsageLimits request
    -- exceed the value specified in @MaxRecords@, Amazon Web Services returns
    -- a value in the @Marker@ field of the response. You can retrieve the next
    -- set of response records by providing the returned marker value in the
    -- @Marker@ parameter and retrying the request.
    DescribeUsageLimits -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeUsageLimits -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | A tag key or keys for which you want to return all matching usage limit
    -- objects that are associated with the specified key or keys. For example,
    -- suppose that you have parameter groups that are tagged with keys called
    -- @owner@ and @environment@. If you specify both of these tag keys in the
    -- request, Amazon Redshift returns a response with the usage limit objects
    -- have either or both of these tag keys associated with them.
    DescribeUsageLimits -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching usage
    -- limit objects that are associated with the specified tag value or
    -- values. For example, suppose that you have parameter groups that are
    -- tagged with values called @admin@ and @test@. If you specify both of
    -- these tag values in the request, Amazon Redshift returns a response with
    -- the usage limit objects that have either or both of these tag values
    -- associated with them.
    DescribeUsageLimits -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text],
    -- | The identifier of the usage limit to describe.
    DescribeUsageLimits -> Maybe Text
usageLimitId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeUsageLimits -> DescribeUsageLimits -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'DescribeUsageLimits' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clusterIdentifier', 'describeUsageLimits_clusterIdentifier' - The identifier of the cluster for which you want to describe usage
-- limits.
--
-- 'featureType', 'describeUsageLimits_featureType' - The feature type for which you want to describe usage limits.
--
-- 'marker', 'describeUsageLimits_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeUsageLimits request
-- exceed the value specified in @MaxRecords@, Amazon Web Services returns
-- a value in the @Marker@ field of the response. You can retrieve the next
-- set of response records by providing the returned marker value in the
-- @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeUsageLimits_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'tagKeys', 'describeUsageLimits_tagKeys' - A tag key or keys for which you want to return all matching usage limit
-- objects that are associated with the specified key or keys. For example,
-- suppose that you have parameter groups that are tagged with keys called
-- @owner@ and @environment@. If you specify both of these tag keys in the
-- request, Amazon Redshift returns a response with the usage limit objects
-- have either or both of these tag keys associated with them.
--
-- 'tagValues', 'describeUsageLimits_tagValues' - A tag value or values for which you want to return all matching usage
-- limit objects that are associated with the specified tag value or
-- values. For example, suppose that you have parameter groups that are
-- tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the usage limit objects that have either or both of these tag values
-- associated with them.
--
-- 'usageLimitId', 'describeUsageLimits_usageLimitId' - The identifier of the usage limit to describe.
newDescribeUsageLimits ::
  DescribeUsageLimits
newDescribeUsageLimits :: DescribeUsageLimits
newDescribeUsageLimits =
  DescribeUsageLimits'
    { $sel:clusterIdentifier:DescribeUsageLimits' :: Maybe Text
clusterIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:featureType:DescribeUsageLimits' :: Maybe UsageLimitFeatureType
featureType = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeUsageLimits' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeUsageLimits' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeUsageLimits' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeUsageLimits' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing,
      $sel:usageLimitId:DescribeUsageLimits' :: Maybe Text
usageLimitId = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the cluster for which you want to describe usage
-- limits.
describeUsageLimits_clusterIdentifier :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_clusterIdentifier :: Lens' DescribeUsageLimits (Maybe Text)
describeUsageLimits_clusterIdentifier = 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)

-- | The feature type for which you want to describe usage limits.
describeUsageLimits_featureType :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe UsageLimitFeatureType)
describeUsageLimits_featureType :: Lens' DescribeUsageLimits (Maybe UsageLimitFeatureType)
describeUsageLimits_featureType = 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)

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeUsageLimits request
-- exceed the value specified in @MaxRecords@, Amazon Web Services returns
-- a value in the @Marker@ field of the response. You can retrieve the next
-- set of response records by providing the returned marker value in the
-- @Marker@ parameter and retrying the request.
describeUsageLimits_marker :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_marker :: Lens' DescribeUsageLimits (Maybe Text)
describeUsageLimits_marker = 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)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeUsageLimits_maxRecords :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Int)
describeUsageLimits_maxRecords :: Lens' DescribeUsageLimits (Maybe Int)
describeUsageLimits_maxRecords = 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)

-- | A tag key or keys for which you want to return all matching usage limit
-- objects that are associated with the specified key or keys. For example,
-- suppose that you have parameter groups that are tagged with keys called
-- @owner@ and @environment@. If you specify both of these tag keys in the
-- request, Amazon Redshift returns a response with the usage limit objects
-- have either or both of these tag keys associated with them.
describeUsageLimits_tagKeys :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe [Prelude.Text])
describeUsageLimits_tagKeys :: Lens' DescribeUsageLimits (Maybe [Text])
describeUsageLimits_tagKeys = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A tag value or values for which you want to return all matching usage
-- limit objects that are associated with the specified tag value or
-- values. For example, suppose that you have parameter groups that are
-- tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the usage limit objects that have either or both of these tag values
-- associated with them.
describeUsageLimits_tagValues :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe [Prelude.Text])
describeUsageLimits_tagValues :: Lens' DescribeUsageLimits (Maybe [Text])
describeUsageLimits_tagValues = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the usage limit to describe.
describeUsageLimits_usageLimitId :: Lens.Lens' DescribeUsageLimits (Prelude.Maybe Prelude.Text)
describeUsageLimits_usageLimitId :: Lens' DescribeUsageLimits (Maybe Text)
describeUsageLimits_usageLimitId = 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)

instance Core.AWSPager DescribeUsageLimits where
  page :: DescribeUsageLimits
-> AWSResponse DescribeUsageLimits -> Maybe DescribeUsageLimits
page DescribeUsageLimits
rq AWSResponse DescribeUsageLimits
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeUsageLimits
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeUsageLimitsResponse (Maybe Text)
describeUsageLimitsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeUsageLimits
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeUsageLimitsResponse (Maybe [UsageLimit])
describeUsageLimitsResponse_usageLimits
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeUsageLimits
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeUsageLimits (Maybe Text)
describeUsageLimits_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeUsageLimits
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeUsageLimitsResponse (Maybe Text)
describeUsageLimitsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeUsageLimits where
  type
    AWSResponse DescribeUsageLimits =
      DescribeUsageLimitsResponse
  request :: (Service -> Service)
-> DescribeUsageLimits -> Request DescribeUsageLimits
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeUsageLimits
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeUsageLimits)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeUsageLimitsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [UsageLimit] -> Int -> DescribeUsageLimitsResponse
DescribeUsageLimitsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"UsageLimits"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeUsageLimits where
  hashWithSalt :: Int -> DescribeUsageLimits -> Int
hashWithSalt Int
_salt DescribeUsageLimits' {Maybe Int
Maybe [Text]
Maybe Text
Maybe UsageLimitFeatureType
usageLimitId :: Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
featureType :: Maybe UsageLimitFeatureType
clusterIdentifier :: Maybe Text
$sel:usageLimitId:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:tagValues:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
$sel:tagKeys:DescribeUsageLimits' :: DescribeUsageLimits -> 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageLimitFeatureType
featureType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagValues
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
usageLimitId

instance Prelude.NFData DescribeUsageLimits where
  rnf :: DescribeUsageLimits -> ()
rnf DescribeUsageLimits' {Maybe Int
Maybe [Text]
Maybe Text
Maybe UsageLimitFeatureType
usageLimitId :: Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
featureType :: Maybe UsageLimitFeatureType
clusterIdentifier :: Maybe Text
$sel:usageLimitId:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:tagValues:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
$sel:tagKeys:DescribeUsageLimits' :: DescribeUsageLimits -> 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageLimitFeatureType
featureType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagValues
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
usageLimitId

instance Data.ToHeaders DescribeUsageLimits where
  toHeaders :: DescribeUsageLimits -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DescribeUsageLimits where
  toPath :: DescribeUsageLimits -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeUsageLimits where
  toQuery :: DescribeUsageLimits -> QueryString
toQuery DescribeUsageLimits' {Maybe Int
Maybe [Text]
Maybe Text
Maybe UsageLimitFeatureType
usageLimitId :: Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
featureType :: Maybe UsageLimitFeatureType
clusterIdentifier :: Maybe Text
$sel:usageLimitId:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe Text
$sel:tagValues:DescribeUsageLimits' :: DescribeUsageLimits -> Maybe [Text]
$sel:tagKeys:DescribeUsageLimits' :: DescribeUsageLimits -> 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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeUsageLimits" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clusterIdentifier,
        ByteString
"FeatureType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe UsageLimitFeatureType
featureType,
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"TagKeys"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagKey" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
        ByteString
"TagValues"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagValue" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues),
        ByteString
"UsageLimitId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
usageLimitId
      ]

-- | /See:/ 'newDescribeUsageLimitsResponse' smart constructor.
data DescribeUsageLimitsResponse = DescribeUsageLimitsResponse'
  { -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeUsageLimitsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Contains the output from the DescribeUsageLimits action.
    DescribeUsageLimitsResponse -> Maybe [UsageLimit]
usageLimits :: Prelude.Maybe [UsageLimit],
    -- | The response's http status code.
    DescribeUsageLimitsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeUsageLimitsResponse -> DescribeUsageLimitsResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'DescribeUsageLimitsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'marker', 'describeUsageLimitsResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'usageLimits', 'describeUsageLimitsResponse_usageLimits' - Contains the output from the DescribeUsageLimits action.
--
-- 'httpStatus', 'describeUsageLimitsResponse_httpStatus' - The response's http status code.
newDescribeUsageLimitsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUsageLimitsResponse
newDescribeUsageLimitsResponse :: Int -> DescribeUsageLimitsResponse
newDescribeUsageLimitsResponse Int
pHttpStatus_ =
  DescribeUsageLimitsResponse'
    { $sel:marker:DescribeUsageLimitsResponse' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:usageLimits:DescribeUsageLimitsResponse' :: Maybe [UsageLimit]
usageLimits = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUsageLimitsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeUsageLimitsResponse_marker :: Lens.Lens' DescribeUsageLimitsResponse (Prelude.Maybe Prelude.Text)
describeUsageLimitsResponse_marker :: Lens' DescribeUsageLimitsResponse (Maybe Text)
describeUsageLimitsResponse_marker = 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)

-- | Contains the output from the DescribeUsageLimits action.
describeUsageLimitsResponse_usageLimits :: Lens.Lens' DescribeUsageLimitsResponse (Prelude.Maybe [UsageLimit])
describeUsageLimitsResponse_usageLimits :: Lens' DescribeUsageLimitsResponse (Maybe [UsageLimit])
describeUsageLimitsResponse_usageLimits = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeUsageLimitsResponse_httpStatus :: Lens.Lens' DescribeUsageLimitsResponse Prelude.Int
describeUsageLimitsResponse_httpStatus :: Lens' DescribeUsageLimitsResponse Int
describeUsageLimitsResponse_httpStatus = 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 where
  rnf :: DescribeUsageLimitsResponse -> ()
rnf DescribeUsageLimitsResponse' {Int
Maybe [UsageLimit]
Maybe Text
httpStatus :: Int
usageLimits :: Maybe [UsageLimit]
marker :: Maybe Text
$sel:httpStatus:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Int
$sel:usageLimits:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Maybe [UsageLimit]
$sel:marker:DescribeUsageLimitsResponse' :: DescribeUsageLimitsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UsageLimit]
usageLimits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus