{-# 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.ServiceQuotas.ListAWSDefaultServiceQuotas
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the default values for the quotas for the specified AWS service. A
-- default value does not reflect any quota increases.
--
-- This operation returns paginated results.
module Amazonka.ServiceQuotas.ListAWSDefaultServiceQuotas
  ( -- * Creating a Request
    ListAWSDefaultServiceQuotas (..),
    newListAWSDefaultServiceQuotas,

    -- * Request Lenses
    listAWSDefaultServiceQuotas_nextToken,
    listAWSDefaultServiceQuotas_maxResults,
    listAWSDefaultServiceQuotas_serviceCode,

    -- * Destructuring the Response
    ListAWSDefaultServiceQuotasResponse (..),
    newListAWSDefaultServiceQuotasResponse,

    -- * Response Lenses
    listAWSDefaultServiceQuotasResponse_nextToken,
    listAWSDefaultServiceQuotasResponse_quotas,
    listAWSDefaultServiceQuotasResponse_httpStatus,
  )
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.ServiceQuotas.Types

-- | /See:/ 'newListAWSDefaultServiceQuotas' smart constructor.
data ListAWSDefaultServiceQuotas = ListAWSDefaultServiceQuotas'
  { -- | The token for the next page of results.
    ListAWSDefaultServiceQuotas -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, if any, make another call with the token returned
    -- from this call.
    ListAWSDefaultServiceQuotas -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The service identifier.
    ListAWSDefaultServiceQuotas -> Text
serviceCode :: Prelude.Text
  }
  deriving (ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas -> Bool
(ListAWSDefaultServiceQuotas
 -> ListAWSDefaultServiceQuotas -> Bool)
-> (ListAWSDefaultServiceQuotas
    -> ListAWSDefaultServiceQuotas -> Bool)
-> Eq ListAWSDefaultServiceQuotas
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas -> Bool
$c/= :: ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas -> Bool
== :: ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas -> Bool
$c== :: ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas -> Bool
Prelude.Eq, ReadPrec [ListAWSDefaultServiceQuotas]
ReadPrec ListAWSDefaultServiceQuotas
Int -> ReadS ListAWSDefaultServiceQuotas
ReadS [ListAWSDefaultServiceQuotas]
(Int -> ReadS ListAWSDefaultServiceQuotas)
-> ReadS [ListAWSDefaultServiceQuotas]
-> ReadPrec ListAWSDefaultServiceQuotas
-> ReadPrec [ListAWSDefaultServiceQuotas]
-> Read ListAWSDefaultServiceQuotas
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAWSDefaultServiceQuotas]
$creadListPrec :: ReadPrec [ListAWSDefaultServiceQuotas]
readPrec :: ReadPrec ListAWSDefaultServiceQuotas
$creadPrec :: ReadPrec ListAWSDefaultServiceQuotas
readList :: ReadS [ListAWSDefaultServiceQuotas]
$creadList :: ReadS [ListAWSDefaultServiceQuotas]
readsPrec :: Int -> ReadS ListAWSDefaultServiceQuotas
$creadsPrec :: Int -> ReadS ListAWSDefaultServiceQuotas
Prelude.Read, Int -> ListAWSDefaultServiceQuotas -> ShowS
[ListAWSDefaultServiceQuotas] -> ShowS
ListAWSDefaultServiceQuotas -> String
(Int -> ListAWSDefaultServiceQuotas -> ShowS)
-> (ListAWSDefaultServiceQuotas -> String)
-> ([ListAWSDefaultServiceQuotas] -> ShowS)
-> Show ListAWSDefaultServiceQuotas
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAWSDefaultServiceQuotas] -> ShowS
$cshowList :: [ListAWSDefaultServiceQuotas] -> ShowS
show :: ListAWSDefaultServiceQuotas -> String
$cshow :: ListAWSDefaultServiceQuotas -> String
showsPrec :: Int -> ListAWSDefaultServiceQuotas -> ShowS
$cshowsPrec :: Int -> ListAWSDefaultServiceQuotas -> ShowS
Prelude.Show, (forall x.
 ListAWSDefaultServiceQuotas -> Rep ListAWSDefaultServiceQuotas x)
-> (forall x.
    Rep ListAWSDefaultServiceQuotas x -> ListAWSDefaultServiceQuotas)
-> Generic ListAWSDefaultServiceQuotas
forall x.
Rep ListAWSDefaultServiceQuotas x -> ListAWSDefaultServiceQuotas
forall x.
ListAWSDefaultServiceQuotas -> Rep ListAWSDefaultServiceQuotas x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAWSDefaultServiceQuotas x -> ListAWSDefaultServiceQuotas
$cfrom :: forall x.
ListAWSDefaultServiceQuotas -> Rep ListAWSDefaultServiceQuotas x
Prelude.Generic)

-- |
-- Create a value of 'ListAWSDefaultServiceQuotas' 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:
--
-- 'nextToken', 'listAWSDefaultServiceQuotas_nextToken' - The token for the next page of results.
--
-- 'maxResults', 'listAWSDefaultServiceQuotas_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, if any, make another call with the token returned
-- from this call.
--
-- 'serviceCode', 'listAWSDefaultServiceQuotas_serviceCode' - The service identifier.
newListAWSDefaultServiceQuotas ::
  -- | 'serviceCode'
  Prelude.Text ->
  ListAWSDefaultServiceQuotas
newListAWSDefaultServiceQuotas :: Text -> ListAWSDefaultServiceQuotas
newListAWSDefaultServiceQuotas Text
pServiceCode_ =
  ListAWSDefaultServiceQuotas' :: Maybe Text -> Maybe Natural -> Text -> ListAWSDefaultServiceQuotas
ListAWSDefaultServiceQuotas'
    { $sel:nextToken:ListAWSDefaultServiceQuotas' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAWSDefaultServiceQuotas' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCode:ListAWSDefaultServiceQuotas' :: Text
serviceCode = Text
pServiceCode_
    }

-- | The token for the next page of results.
listAWSDefaultServiceQuotas_nextToken :: Lens.Lens' ListAWSDefaultServiceQuotas (Prelude.Maybe Prelude.Text)
listAWSDefaultServiceQuotas_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAWSDefaultServiceQuotas -> f ListAWSDefaultServiceQuotas
listAWSDefaultServiceQuotas_nextToken = (ListAWSDefaultServiceQuotas -> Maybe Text)
-> (ListAWSDefaultServiceQuotas
    -> Maybe Text -> ListAWSDefaultServiceQuotas)
-> Lens
     ListAWSDefaultServiceQuotas
     ListAWSDefaultServiceQuotas
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotas' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAWSDefaultServiceQuotas
s@ListAWSDefaultServiceQuotas' {} Maybe Text
a -> ListAWSDefaultServiceQuotas
s {$sel:nextToken:ListAWSDefaultServiceQuotas' :: Maybe Text
nextToken = Maybe Text
a} :: ListAWSDefaultServiceQuotas)

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, if any, make another call with the token returned
-- from this call.
listAWSDefaultServiceQuotas_maxResults :: Lens.Lens' ListAWSDefaultServiceQuotas (Prelude.Maybe Prelude.Natural)
listAWSDefaultServiceQuotas_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAWSDefaultServiceQuotas -> f ListAWSDefaultServiceQuotas
listAWSDefaultServiceQuotas_maxResults = (ListAWSDefaultServiceQuotas -> Maybe Natural)
-> (ListAWSDefaultServiceQuotas
    -> Maybe Natural -> ListAWSDefaultServiceQuotas)
-> Lens
     ListAWSDefaultServiceQuotas
     ListAWSDefaultServiceQuotas
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotas' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAWSDefaultServiceQuotas
s@ListAWSDefaultServiceQuotas' {} Maybe Natural
a -> ListAWSDefaultServiceQuotas
s {$sel:maxResults:ListAWSDefaultServiceQuotas' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAWSDefaultServiceQuotas)

-- | The service identifier.
listAWSDefaultServiceQuotas_serviceCode :: Lens.Lens' ListAWSDefaultServiceQuotas Prelude.Text
listAWSDefaultServiceQuotas_serviceCode :: (Text -> f Text)
-> ListAWSDefaultServiceQuotas -> f ListAWSDefaultServiceQuotas
listAWSDefaultServiceQuotas_serviceCode = (ListAWSDefaultServiceQuotas -> Text)
-> (ListAWSDefaultServiceQuotas
    -> Text -> ListAWSDefaultServiceQuotas)
-> Lens
     ListAWSDefaultServiceQuotas ListAWSDefaultServiceQuotas Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotas' {Text
serviceCode :: Text
$sel:serviceCode:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Text
serviceCode} -> Text
serviceCode) (\s :: ListAWSDefaultServiceQuotas
s@ListAWSDefaultServiceQuotas' {} Text
a -> ListAWSDefaultServiceQuotas
s {$sel:serviceCode:ListAWSDefaultServiceQuotas' :: Text
serviceCode = Text
a} :: ListAWSDefaultServiceQuotas)

instance Core.AWSPager ListAWSDefaultServiceQuotas where
  page :: ListAWSDefaultServiceQuotas
-> AWSResponse ListAWSDefaultServiceQuotas
-> Maybe ListAWSDefaultServiceQuotas
page ListAWSDefaultServiceQuotas
rq AWSResponse ListAWSDefaultServiceQuotas
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAWSDefaultServiceQuotas
ListAWSDefaultServiceQuotasResponse
rs
            ListAWSDefaultServiceQuotasResponse
-> Getting (First Text) ListAWSDefaultServiceQuotasResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAWSDefaultServiceQuotasResponse
-> Const (First Text) ListAWSDefaultServiceQuotasResponse
Lens' ListAWSDefaultServiceQuotasResponse (Maybe Text)
listAWSDefaultServiceQuotasResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAWSDefaultServiceQuotasResponse
 -> Const (First Text) ListAWSDefaultServiceQuotasResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAWSDefaultServiceQuotasResponse 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 ListAWSDefaultServiceQuotas
forall a. Maybe a
Prelude.Nothing
    | Maybe [ServiceQuota] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAWSDefaultServiceQuotas
ListAWSDefaultServiceQuotasResponse
rs
            ListAWSDefaultServiceQuotasResponse
-> Getting
     (First [ServiceQuota])
     ListAWSDefaultServiceQuotasResponse
     [ServiceQuota]
-> Maybe [ServiceQuota]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ServiceQuota]
 -> Const (First [ServiceQuota]) (Maybe [ServiceQuota]))
-> ListAWSDefaultServiceQuotasResponse
-> Const (First [ServiceQuota]) ListAWSDefaultServiceQuotasResponse
Lens' ListAWSDefaultServiceQuotasResponse (Maybe [ServiceQuota])
listAWSDefaultServiceQuotasResponse_quotas
              ((Maybe [ServiceQuota]
  -> Const (First [ServiceQuota]) (Maybe [ServiceQuota]))
 -> ListAWSDefaultServiceQuotasResponse
 -> Const
      (First [ServiceQuota]) ListAWSDefaultServiceQuotasResponse)
-> (([ServiceQuota] -> Const (First [ServiceQuota]) [ServiceQuota])
    -> Maybe [ServiceQuota]
    -> Const (First [ServiceQuota]) (Maybe [ServiceQuota]))
-> Getting
     (First [ServiceQuota])
     ListAWSDefaultServiceQuotasResponse
     [ServiceQuota]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ServiceQuota] -> Const (First [ServiceQuota]) [ServiceQuota])
-> Maybe [ServiceQuota]
-> Const (First [ServiceQuota]) (Maybe [ServiceQuota])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAWSDefaultServiceQuotas
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAWSDefaultServiceQuotas -> Maybe ListAWSDefaultServiceQuotas
forall a. a -> Maybe a
Prelude.Just (ListAWSDefaultServiceQuotas -> Maybe ListAWSDefaultServiceQuotas)
-> ListAWSDefaultServiceQuotas -> Maybe ListAWSDefaultServiceQuotas
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAWSDefaultServiceQuotas
rq
          ListAWSDefaultServiceQuotas
-> (ListAWSDefaultServiceQuotas -> ListAWSDefaultServiceQuotas)
-> ListAWSDefaultServiceQuotas
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAWSDefaultServiceQuotas
-> Identity ListAWSDefaultServiceQuotas
Lens
  ListAWSDefaultServiceQuotas
  ListAWSDefaultServiceQuotas
  (Maybe Text)
  (Maybe Text)
listAWSDefaultServiceQuotas_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAWSDefaultServiceQuotas
 -> Identity ListAWSDefaultServiceQuotas)
-> Maybe Text
-> ListAWSDefaultServiceQuotas
-> ListAWSDefaultServiceQuotas
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAWSDefaultServiceQuotas
ListAWSDefaultServiceQuotasResponse
rs
          ListAWSDefaultServiceQuotasResponse
-> Getting (First Text) ListAWSDefaultServiceQuotasResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAWSDefaultServiceQuotasResponse
-> Const (First Text) ListAWSDefaultServiceQuotasResponse
Lens' ListAWSDefaultServiceQuotasResponse (Maybe Text)
listAWSDefaultServiceQuotasResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAWSDefaultServiceQuotasResponse
 -> Const (First Text) ListAWSDefaultServiceQuotasResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAWSDefaultServiceQuotasResponse 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 ListAWSDefaultServiceQuotas where
  type
    AWSResponse ListAWSDefaultServiceQuotas =
      ListAWSDefaultServiceQuotasResponse
  request :: ListAWSDefaultServiceQuotas -> Request ListAWSDefaultServiceQuotas
request = Service
-> ListAWSDefaultServiceQuotas
-> Request ListAWSDefaultServiceQuotas
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAWSDefaultServiceQuotas
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAWSDefaultServiceQuotas)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAWSDefaultServiceQuotas))
-> Logger
-> Service
-> Proxy ListAWSDefaultServiceQuotas
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAWSDefaultServiceQuotas)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ServiceQuota]
-> Int
-> ListAWSDefaultServiceQuotasResponse
ListAWSDefaultServiceQuotasResponse'
            (Maybe Text
 -> Maybe [ServiceQuota]
 -> Int
 -> ListAWSDefaultServiceQuotasResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ServiceQuota]
      -> Int -> ListAWSDefaultServiceQuotasResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [ServiceQuota]
   -> Int -> ListAWSDefaultServiceQuotasResponse)
-> Either String (Maybe [ServiceQuota])
-> Either String (Int -> ListAWSDefaultServiceQuotasResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ServiceQuota]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Quotas" Either String (Maybe (Maybe [ServiceQuota]))
-> Maybe [ServiceQuota] -> Either String (Maybe [ServiceQuota])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ServiceQuota]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListAWSDefaultServiceQuotasResponse)
-> Either String Int
-> Either String ListAWSDefaultServiceQuotasResponse
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 ListAWSDefaultServiceQuotas

instance Prelude.NFData ListAWSDefaultServiceQuotas

instance Core.ToHeaders ListAWSDefaultServiceQuotas where
  toHeaders :: ListAWSDefaultServiceQuotas -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAWSDefaultServiceQuotas -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ServiceQuotasV20190624.ListAWSDefaultServiceQuotas" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListAWSDefaultServiceQuotas where
  toJSON :: ListAWSDefaultServiceQuotas -> Value
toJSON ListAWSDefaultServiceQuotas' {Maybe Natural
Maybe Text
Text
serviceCode :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:serviceCode:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Text
$sel:maxResults:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Maybe Natural
$sel:nextToken:ListAWSDefaultServiceQuotas' :: ListAWSDefaultServiceQuotas -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServiceCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceCode)
          ]
      )

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

instance Core.ToQuery ListAWSDefaultServiceQuotas where
  toQuery :: ListAWSDefaultServiceQuotas -> QueryString
toQuery = QueryString -> ListAWSDefaultServiceQuotas -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListAWSDefaultServiceQuotasResponse' smart constructor.
data ListAWSDefaultServiceQuotasResponse = ListAWSDefaultServiceQuotasResponse'
  { -- | The token to use to retrieve the next page of results. This value is
    -- null when there are no more results to return.
    ListAWSDefaultServiceQuotasResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the quotas.
    ListAWSDefaultServiceQuotasResponse -> Maybe [ServiceQuota]
quotas :: Prelude.Maybe [ServiceQuota],
    -- | The response's http status code.
    ListAWSDefaultServiceQuotasResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAWSDefaultServiceQuotasResponse
-> ListAWSDefaultServiceQuotasResponse -> Bool
(ListAWSDefaultServiceQuotasResponse
 -> ListAWSDefaultServiceQuotasResponse -> Bool)
-> (ListAWSDefaultServiceQuotasResponse
    -> ListAWSDefaultServiceQuotasResponse -> Bool)
-> Eq ListAWSDefaultServiceQuotasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAWSDefaultServiceQuotasResponse
-> ListAWSDefaultServiceQuotasResponse -> Bool
$c/= :: ListAWSDefaultServiceQuotasResponse
-> ListAWSDefaultServiceQuotasResponse -> Bool
== :: ListAWSDefaultServiceQuotasResponse
-> ListAWSDefaultServiceQuotasResponse -> Bool
$c== :: ListAWSDefaultServiceQuotasResponse
-> ListAWSDefaultServiceQuotasResponse -> Bool
Prelude.Eq, ReadPrec [ListAWSDefaultServiceQuotasResponse]
ReadPrec ListAWSDefaultServiceQuotasResponse
Int -> ReadS ListAWSDefaultServiceQuotasResponse
ReadS [ListAWSDefaultServiceQuotasResponse]
(Int -> ReadS ListAWSDefaultServiceQuotasResponse)
-> ReadS [ListAWSDefaultServiceQuotasResponse]
-> ReadPrec ListAWSDefaultServiceQuotasResponse
-> ReadPrec [ListAWSDefaultServiceQuotasResponse]
-> Read ListAWSDefaultServiceQuotasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAWSDefaultServiceQuotasResponse]
$creadListPrec :: ReadPrec [ListAWSDefaultServiceQuotasResponse]
readPrec :: ReadPrec ListAWSDefaultServiceQuotasResponse
$creadPrec :: ReadPrec ListAWSDefaultServiceQuotasResponse
readList :: ReadS [ListAWSDefaultServiceQuotasResponse]
$creadList :: ReadS [ListAWSDefaultServiceQuotasResponse]
readsPrec :: Int -> ReadS ListAWSDefaultServiceQuotasResponse
$creadsPrec :: Int -> ReadS ListAWSDefaultServiceQuotasResponse
Prelude.Read, Int -> ListAWSDefaultServiceQuotasResponse -> ShowS
[ListAWSDefaultServiceQuotasResponse] -> ShowS
ListAWSDefaultServiceQuotasResponse -> String
(Int -> ListAWSDefaultServiceQuotasResponse -> ShowS)
-> (ListAWSDefaultServiceQuotasResponse -> String)
-> ([ListAWSDefaultServiceQuotasResponse] -> ShowS)
-> Show ListAWSDefaultServiceQuotasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAWSDefaultServiceQuotasResponse] -> ShowS
$cshowList :: [ListAWSDefaultServiceQuotasResponse] -> ShowS
show :: ListAWSDefaultServiceQuotasResponse -> String
$cshow :: ListAWSDefaultServiceQuotasResponse -> String
showsPrec :: Int -> ListAWSDefaultServiceQuotasResponse -> ShowS
$cshowsPrec :: Int -> ListAWSDefaultServiceQuotasResponse -> ShowS
Prelude.Show, (forall x.
 ListAWSDefaultServiceQuotasResponse
 -> Rep ListAWSDefaultServiceQuotasResponse x)
-> (forall x.
    Rep ListAWSDefaultServiceQuotasResponse x
    -> ListAWSDefaultServiceQuotasResponse)
-> Generic ListAWSDefaultServiceQuotasResponse
forall x.
Rep ListAWSDefaultServiceQuotasResponse x
-> ListAWSDefaultServiceQuotasResponse
forall x.
ListAWSDefaultServiceQuotasResponse
-> Rep ListAWSDefaultServiceQuotasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAWSDefaultServiceQuotasResponse x
-> ListAWSDefaultServiceQuotasResponse
$cfrom :: forall x.
ListAWSDefaultServiceQuotasResponse
-> Rep ListAWSDefaultServiceQuotasResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAWSDefaultServiceQuotasResponse' 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:
--
-- 'nextToken', 'listAWSDefaultServiceQuotasResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
--
-- 'quotas', 'listAWSDefaultServiceQuotasResponse_quotas' - Information about the quotas.
--
-- 'httpStatus', 'listAWSDefaultServiceQuotasResponse_httpStatus' - The response's http status code.
newListAWSDefaultServiceQuotasResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAWSDefaultServiceQuotasResponse
newListAWSDefaultServiceQuotasResponse :: Int -> ListAWSDefaultServiceQuotasResponse
newListAWSDefaultServiceQuotasResponse Int
pHttpStatus_ =
  ListAWSDefaultServiceQuotasResponse' :: Maybe Text
-> Maybe [ServiceQuota]
-> Int
-> ListAWSDefaultServiceQuotasResponse
ListAWSDefaultServiceQuotasResponse'
    { $sel:nextToken:ListAWSDefaultServiceQuotasResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:quotas:ListAWSDefaultServiceQuotasResponse' :: Maybe [ServiceQuota]
quotas = Maybe [ServiceQuota]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAWSDefaultServiceQuotasResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
listAWSDefaultServiceQuotasResponse_nextToken :: Lens.Lens' ListAWSDefaultServiceQuotasResponse (Prelude.Maybe Prelude.Text)
listAWSDefaultServiceQuotasResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAWSDefaultServiceQuotasResponse
-> f ListAWSDefaultServiceQuotasResponse
listAWSDefaultServiceQuotasResponse_nextToken = (ListAWSDefaultServiceQuotasResponse -> Maybe Text)
-> (ListAWSDefaultServiceQuotasResponse
    -> Maybe Text -> ListAWSDefaultServiceQuotasResponse)
-> Lens' ListAWSDefaultServiceQuotasResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotasResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAWSDefaultServiceQuotasResponse' :: ListAWSDefaultServiceQuotasResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAWSDefaultServiceQuotasResponse
s@ListAWSDefaultServiceQuotasResponse' {} Maybe Text
a -> ListAWSDefaultServiceQuotasResponse
s {$sel:nextToken:ListAWSDefaultServiceQuotasResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAWSDefaultServiceQuotasResponse)

-- | Information about the quotas.
listAWSDefaultServiceQuotasResponse_quotas :: Lens.Lens' ListAWSDefaultServiceQuotasResponse (Prelude.Maybe [ServiceQuota])
listAWSDefaultServiceQuotasResponse_quotas :: (Maybe [ServiceQuota] -> f (Maybe [ServiceQuota]))
-> ListAWSDefaultServiceQuotasResponse
-> f ListAWSDefaultServiceQuotasResponse
listAWSDefaultServiceQuotasResponse_quotas = (ListAWSDefaultServiceQuotasResponse -> Maybe [ServiceQuota])
-> (ListAWSDefaultServiceQuotasResponse
    -> Maybe [ServiceQuota] -> ListAWSDefaultServiceQuotasResponse)
-> Lens' ListAWSDefaultServiceQuotasResponse (Maybe [ServiceQuota])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotasResponse' {Maybe [ServiceQuota]
quotas :: Maybe [ServiceQuota]
$sel:quotas:ListAWSDefaultServiceQuotasResponse' :: ListAWSDefaultServiceQuotasResponse -> Maybe [ServiceQuota]
quotas} -> Maybe [ServiceQuota]
quotas) (\s :: ListAWSDefaultServiceQuotasResponse
s@ListAWSDefaultServiceQuotasResponse' {} Maybe [ServiceQuota]
a -> ListAWSDefaultServiceQuotasResponse
s {$sel:quotas:ListAWSDefaultServiceQuotasResponse' :: Maybe [ServiceQuota]
quotas = Maybe [ServiceQuota]
a} :: ListAWSDefaultServiceQuotasResponse) ((Maybe [ServiceQuota] -> f (Maybe [ServiceQuota]))
 -> ListAWSDefaultServiceQuotasResponse
 -> f ListAWSDefaultServiceQuotasResponse)
-> ((Maybe [ServiceQuota] -> f (Maybe [ServiceQuota]))
    -> Maybe [ServiceQuota] -> f (Maybe [ServiceQuota]))
-> (Maybe [ServiceQuota] -> f (Maybe [ServiceQuota]))
-> ListAWSDefaultServiceQuotasResponse
-> f ListAWSDefaultServiceQuotasResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ServiceQuota] [ServiceQuota] [ServiceQuota] [ServiceQuota]
-> Iso
     (Maybe [ServiceQuota])
     (Maybe [ServiceQuota])
     (Maybe [ServiceQuota])
     (Maybe [ServiceQuota])
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 [ServiceQuota] [ServiceQuota] [ServiceQuota] [ServiceQuota]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listAWSDefaultServiceQuotasResponse_httpStatus :: Lens.Lens' ListAWSDefaultServiceQuotasResponse Prelude.Int
listAWSDefaultServiceQuotasResponse_httpStatus :: (Int -> f Int)
-> ListAWSDefaultServiceQuotasResponse
-> f ListAWSDefaultServiceQuotasResponse
listAWSDefaultServiceQuotasResponse_httpStatus = (ListAWSDefaultServiceQuotasResponse -> Int)
-> (ListAWSDefaultServiceQuotasResponse
    -> Int -> ListAWSDefaultServiceQuotasResponse)
-> Lens
     ListAWSDefaultServiceQuotasResponse
     ListAWSDefaultServiceQuotasResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSDefaultServiceQuotasResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAWSDefaultServiceQuotasResponse' :: ListAWSDefaultServiceQuotasResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAWSDefaultServiceQuotasResponse
s@ListAWSDefaultServiceQuotasResponse' {} Int
a -> ListAWSDefaultServiceQuotasResponse
s {$sel:httpStatus:ListAWSDefaultServiceQuotasResponse' :: Int
httpStatus = Int
a} :: ListAWSDefaultServiceQuotasResponse)

instance
  Prelude.NFData
    ListAWSDefaultServiceQuotasResponse