{-# 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.APIGateway.GetUsagePlanKeys
-- 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)
--
-- Gets all the usage plan keys representing the API keys added to a
-- specified usage plan.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetUsagePlanKeys
  ( -- * Creating a Request
    GetUsagePlanKeys (..),
    newGetUsagePlanKeys,

    -- * Request Lenses
    getUsagePlanKeys_nameQuery,
    getUsagePlanKeys_limit,
    getUsagePlanKeys_position,
    getUsagePlanKeys_usagePlanId,

    -- * Destructuring the Response
    GetUsagePlanKeysResponse (..),
    newGetUsagePlanKeysResponse,

    -- * Response Lenses
    getUsagePlanKeysResponse_items,
    getUsagePlanKeysResponse_position,
    getUsagePlanKeysResponse_httpStatus,
  )
where

import Amazonka.APIGateway.Types
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

-- | The GET request to get all the usage plan keys representing the API keys
-- added to a specified usage plan.
--
-- /See:/ 'newGetUsagePlanKeys' smart constructor.
data GetUsagePlanKeys = GetUsagePlanKeys'
  { -- | A query parameter specifying the name of the to-be-returned usage plan
    -- keys.
    GetUsagePlanKeys -> Maybe Text
nameQuery :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of returned results per page. The default value is 25
    -- and the maximum value is 500.
    GetUsagePlanKeys -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set.
    GetUsagePlanKeys -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | [Required] The Id of the UsagePlan resource representing the usage plan
    -- containing the to-be-retrieved UsagePlanKey resource representing a plan
    -- customer.
    GetUsagePlanKeys -> Text
usagePlanId :: Prelude.Text
  }
  deriving (GetUsagePlanKeys -> GetUsagePlanKeys -> Bool
(GetUsagePlanKeys -> GetUsagePlanKeys -> Bool)
-> (GetUsagePlanKeys -> GetUsagePlanKeys -> Bool)
-> Eq GetUsagePlanKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsagePlanKeys -> GetUsagePlanKeys -> Bool
$c/= :: GetUsagePlanKeys -> GetUsagePlanKeys -> Bool
== :: GetUsagePlanKeys -> GetUsagePlanKeys -> Bool
$c== :: GetUsagePlanKeys -> GetUsagePlanKeys -> Bool
Prelude.Eq, ReadPrec [GetUsagePlanKeys]
ReadPrec GetUsagePlanKeys
Int -> ReadS GetUsagePlanKeys
ReadS [GetUsagePlanKeys]
(Int -> ReadS GetUsagePlanKeys)
-> ReadS [GetUsagePlanKeys]
-> ReadPrec GetUsagePlanKeys
-> ReadPrec [GetUsagePlanKeys]
-> Read GetUsagePlanKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsagePlanKeys]
$creadListPrec :: ReadPrec [GetUsagePlanKeys]
readPrec :: ReadPrec GetUsagePlanKeys
$creadPrec :: ReadPrec GetUsagePlanKeys
readList :: ReadS [GetUsagePlanKeys]
$creadList :: ReadS [GetUsagePlanKeys]
readsPrec :: Int -> ReadS GetUsagePlanKeys
$creadsPrec :: Int -> ReadS GetUsagePlanKeys
Prelude.Read, Int -> GetUsagePlanKeys -> ShowS
[GetUsagePlanKeys] -> ShowS
GetUsagePlanKeys -> String
(Int -> GetUsagePlanKeys -> ShowS)
-> (GetUsagePlanKeys -> String)
-> ([GetUsagePlanKeys] -> ShowS)
-> Show GetUsagePlanKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsagePlanKeys] -> ShowS
$cshowList :: [GetUsagePlanKeys] -> ShowS
show :: GetUsagePlanKeys -> String
$cshow :: GetUsagePlanKeys -> String
showsPrec :: Int -> GetUsagePlanKeys -> ShowS
$cshowsPrec :: Int -> GetUsagePlanKeys -> ShowS
Prelude.Show, (forall x. GetUsagePlanKeys -> Rep GetUsagePlanKeys x)
-> (forall x. Rep GetUsagePlanKeys x -> GetUsagePlanKeys)
-> Generic GetUsagePlanKeys
forall x. Rep GetUsagePlanKeys x -> GetUsagePlanKeys
forall x. GetUsagePlanKeys -> Rep GetUsagePlanKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUsagePlanKeys x -> GetUsagePlanKeys
$cfrom :: forall x. GetUsagePlanKeys -> Rep GetUsagePlanKeys x
Prelude.Generic)

-- |
-- Create a value of 'GetUsagePlanKeys' 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:
--
-- 'nameQuery', 'getUsagePlanKeys_nameQuery' - A query parameter specifying the name of the to-be-returned usage plan
-- keys.
--
-- 'limit', 'getUsagePlanKeys_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
--
-- 'position', 'getUsagePlanKeys_position' - The current pagination position in the paged result set.
--
-- 'usagePlanId', 'getUsagePlanKeys_usagePlanId' - [Required] The Id of the UsagePlan resource representing the usage plan
-- containing the to-be-retrieved UsagePlanKey resource representing a plan
-- customer.
newGetUsagePlanKeys ::
  -- | 'usagePlanId'
  Prelude.Text ->
  GetUsagePlanKeys
newGetUsagePlanKeys :: Text -> GetUsagePlanKeys
newGetUsagePlanKeys Text
pUsagePlanId_ =
  GetUsagePlanKeys' :: Maybe Text -> Maybe Int -> Maybe Text -> Text -> GetUsagePlanKeys
GetUsagePlanKeys'
    { $sel:nameQuery:GetUsagePlanKeys' :: Maybe Text
nameQuery = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:GetUsagePlanKeys' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetUsagePlanKeys' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePlanId:GetUsagePlanKeys' :: Text
usagePlanId = Text
pUsagePlanId_
    }

-- | A query parameter specifying the name of the to-be-returned usage plan
-- keys.
getUsagePlanKeys_nameQuery :: Lens.Lens' GetUsagePlanKeys (Prelude.Maybe Prelude.Text)
getUsagePlanKeys_nameQuery :: (Maybe Text -> f (Maybe Text))
-> GetUsagePlanKeys -> f GetUsagePlanKeys
getUsagePlanKeys_nameQuery = (GetUsagePlanKeys -> Maybe Text)
-> (GetUsagePlanKeys -> Maybe Text -> GetUsagePlanKeys)
-> Lens GetUsagePlanKeys GetUsagePlanKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeys' {Maybe Text
nameQuery :: Maybe Text
$sel:nameQuery:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
nameQuery} -> Maybe Text
nameQuery) (\s :: GetUsagePlanKeys
s@GetUsagePlanKeys' {} Maybe Text
a -> GetUsagePlanKeys
s {$sel:nameQuery:GetUsagePlanKeys' :: Maybe Text
nameQuery = Maybe Text
a} :: GetUsagePlanKeys)

-- | The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
getUsagePlanKeys_limit :: Lens.Lens' GetUsagePlanKeys (Prelude.Maybe Prelude.Int)
getUsagePlanKeys_limit :: (Maybe Int -> f (Maybe Int))
-> GetUsagePlanKeys -> f GetUsagePlanKeys
getUsagePlanKeys_limit = (GetUsagePlanKeys -> Maybe Int)
-> (GetUsagePlanKeys -> Maybe Int -> GetUsagePlanKeys)
-> Lens GetUsagePlanKeys GetUsagePlanKeys (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeys' {Maybe Int
limit :: Maybe Int
$sel:limit:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Int
limit} -> Maybe Int
limit) (\s :: GetUsagePlanKeys
s@GetUsagePlanKeys' {} Maybe Int
a -> GetUsagePlanKeys
s {$sel:limit:GetUsagePlanKeys' :: Maybe Int
limit = Maybe Int
a} :: GetUsagePlanKeys)

-- | The current pagination position in the paged result set.
getUsagePlanKeys_position :: Lens.Lens' GetUsagePlanKeys (Prelude.Maybe Prelude.Text)
getUsagePlanKeys_position :: (Maybe Text -> f (Maybe Text))
-> GetUsagePlanKeys -> f GetUsagePlanKeys
getUsagePlanKeys_position = (GetUsagePlanKeys -> Maybe Text)
-> (GetUsagePlanKeys -> Maybe Text -> GetUsagePlanKeys)
-> Lens GetUsagePlanKeys GetUsagePlanKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeys' {Maybe Text
position :: Maybe Text
$sel:position:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
position} -> Maybe Text
position) (\s :: GetUsagePlanKeys
s@GetUsagePlanKeys' {} Maybe Text
a -> GetUsagePlanKeys
s {$sel:position:GetUsagePlanKeys' :: Maybe Text
position = Maybe Text
a} :: GetUsagePlanKeys)

-- | [Required] The Id of the UsagePlan resource representing the usage plan
-- containing the to-be-retrieved UsagePlanKey resource representing a plan
-- customer.
getUsagePlanKeys_usagePlanId :: Lens.Lens' GetUsagePlanKeys Prelude.Text
getUsagePlanKeys_usagePlanId :: (Text -> f Text) -> GetUsagePlanKeys -> f GetUsagePlanKeys
getUsagePlanKeys_usagePlanId = (GetUsagePlanKeys -> Text)
-> (GetUsagePlanKeys -> Text -> GetUsagePlanKeys)
-> Lens GetUsagePlanKeys GetUsagePlanKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeys' {Text
usagePlanId :: Text
$sel:usagePlanId:GetUsagePlanKeys' :: GetUsagePlanKeys -> Text
usagePlanId} -> Text
usagePlanId) (\s :: GetUsagePlanKeys
s@GetUsagePlanKeys' {} Text
a -> GetUsagePlanKeys
s {$sel:usagePlanId:GetUsagePlanKeys' :: Text
usagePlanId = Text
a} :: GetUsagePlanKeys)

instance Core.AWSPager GetUsagePlanKeys where
  page :: GetUsagePlanKeys
-> AWSResponse GetUsagePlanKeys -> Maybe GetUsagePlanKeys
page GetUsagePlanKeys
rq AWSResponse GetUsagePlanKeys
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetUsagePlanKeys
GetUsagePlanKeysResponse
rs
            GetUsagePlanKeysResponse
-> Getting (First Text) GetUsagePlanKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetUsagePlanKeysResponse
-> Const (First Text) GetUsagePlanKeysResponse
Lens' GetUsagePlanKeysResponse (Maybe Text)
getUsagePlanKeysResponse_position
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetUsagePlanKeysResponse
 -> Const (First Text) GetUsagePlanKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetUsagePlanKeysResponse 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 GetUsagePlanKeys
forall a. Maybe a
Prelude.Nothing
    | Maybe [UsagePlanKey] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetUsagePlanKeys
GetUsagePlanKeysResponse
rs
            GetUsagePlanKeysResponse
-> Getting
     (First [UsagePlanKey]) GetUsagePlanKeysResponse [UsagePlanKey]
-> Maybe [UsagePlanKey]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [UsagePlanKey]
 -> Const (First [UsagePlanKey]) (Maybe [UsagePlanKey]))
-> GetUsagePlanKeysResponse
-> Const (First [UsagePlanKey]) GetUsagePlanKeysResponse
Lens' GetUsagePlanKeysResponse (Maybe [UsagePlanKey])
getUsagePlanKeysResponse_items ((Maybe [UsagePlanKey]
  -> Const (First [UsagePlanKey]) (Maybe [UsagePlanKey]))
 -> GetUsagePlanKeysResponse
 -> Const (First [UsagePlanKey]) GetUsagePlanKeysResponse)
-> (([UsagePlanKey] -> Const (First [UsagePlanKey]) [UsagePlanKey])
    -> Maybe [UsagePlanKey]
    -> Const (First [UsagePlanKey]) (Maybe [UsagePlanKey]))
-> Getting
     (First [UsagePlanKey]) GetUsagePlanKeysResponse [UsagePlanKey]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UsagePlanKey] -> Const (First [UsagePlanKey]) [UsagePlanKey])
-> Maybe [UsagePlanKey]
-> Const (First [UsagePlanKey]) (Maybe [UsagePlanKey])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetUsagePlanKeys
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetUsagePlanKeys -> Maybe GetUsagePlanKeys
forall a. a -> Maybe a
Prelude.Just (GetUsagePlanKeys -> Maybe GetUsagePlanKeys)
-> GetUsagePlanKeys -> Maybe GetUsagePlanKeys
forall a b. (a -> b) -> a -> b
Prelude.$
        GetUsagePlanKeys
rq
          GetUsagePlanKeys
-> (GetUsagePlanKeys -> GetUsagePlanKeys) -> GetUsagePlanKeys
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetUsagePlanKeys -> Identity GetUsagePlanKeys
Lens GetUsagePlanKeys GetUsagePlanKeys (Maybe Text) (Maybe Text)
getUsagePlanKeys_position
          ((Maybe Text -> Identity (Maybe Text))
 -> GetUsagePlanKeys -> Identity GetUsagePlanKeys)
-> Maybe Text -> GetUsagePlanKeys -> GetUsagePlanKeys
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetUsagePlanKeys
GetUsagePlanKeysResponse
rs
          GetUsagePlanKeysResponse
-> Getting (First Text) GetUsagePlanKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetUsagePlanKeysResponse
-> Const (First Text) GetUsagePlanKeysResponse
Lens' GetUsagePlanKeysResponse (Maybe Text)
getUsagePlanKeysResponse_position
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetUsagePlanKeysResponse
 -> Const (First Text) GetUsagePlanKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetUsagePlanKeysResponse 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 GetUsagePlanKeys where
  type
    AWSResponse GetUsagePlanKeys =
      GetUsagePlanKeysResponse
  request :: GetUsagePlanKeys -> Request GetUsagePlanKeys
request = Service -> GetUsagePlanKeys -> Request GetUsagePlanKeys
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUsagePlanKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUsagePlanKeys)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUsagePlanKeys))
-> Logger
-> Service
-> Proxy GetUsagePlanKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUsagePlanKeys)))
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 [UsagePlanKey]
-> Maybe Text -> Int -> GetUsagePlanKeysResponse
GetUsagePlanKeysResponse'
            (Maybe [UsagePlanKey]
 -> Maybe Text -> Int -> GetUsagePlanKeysResponse)
-> Either String (Maybe [UsagePlanKey])
-> Either String (Maybe Text -> Int -> GetUsagePlanKeysResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [UsagePlanKey]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"item" Either String (Maybe (Maybe [UsagePlanKey]))
-> Maybe [UsagePlanKey] -> Either String (Maybe [UsagePlanKey])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UsagePlanKey]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetUsagePlanKeysResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetUsagePlanKeysResponse)
forall (f :: * -> *) a b. Applicative f => 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
"position")
            Either String (Int -> GetUsagePlanKeysResponse)
-> Either String Int -> Either String GetUsagePlanKeysResponse
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 GetUsagePlanKeys

instance Prelude.NFData GetUsagePlanKeys

instance Core.ToHeaders GetUsagePlanKeys where
  toHeaders :: GetUsagePlanKeys -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUsagePlanKeys -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath GetUsagePlanKeys where
  toPath :: GetUsagePlanKeys -> ByteString
toPath GetUsagePlanKeys' {Maybe Int
Maybe Text
Text
usagePlanId :: Text
position :: Maybe Text
limit :: Maybe Int
nameQuery :: Maybe Text
$sel:usagePlanId:GetUsagePlanKeys' :: GetUsagePlanKeys -> Text
$sel:position:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
$sel:limit:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Int
$sel:nameQuery:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/usageplans/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
usagePlanId, ByteString
"/keys"]

instance Core.ToQuery GetUsagePlanKeys where
  toQuery :: GetUsagePlanKeys -> QueryString
toQuery GetUsagePlanKeys' {Maybe Int
Maybe Text
Text
usagePlanId :: Text
position :: Maybe Text
limit :: Maybe Int
nameQuery :: Maybe Text
$sel:usagePlanId:GetUsagePlanKeys' :: GetUsagePlanKeys -> Text
$sel:position:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
$sel:limit:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Int
$sel:nameQuery:GetUsagePlanKeys' :: GetUsagePlanKeys -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"name" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nameQuery,
        ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit,
        ByteString
"position" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
position
      ]

-- | Represents the collection of usage plan keys added to usage plans for
-- the associated API keys and, possibly, other types of keys.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html Create and Use Usage Plans>
--
-- /See:/ 'newGetUsagePlanKeysResponse' smart constructor.
data GetUsagePlanKeysResponse = GetUsagePlanKeysResponse'
  { -- | The current page of elements from this collection.
    GetUsagePlanKeysResponse -> Maybe [UsagePlanKey]
items :: Prelude.Maybe [UsagePlanKey],
    GetUsagePlanKeysResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetUsagePlanKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool
(GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool)
-> (GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool)
-> Eq GetUsagePlanKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool
$c/= :: GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool
== :: GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool
$c== :: GetUsagePlanKeysResponse -> GetUsagePlanKeysResponse -> Bool
Prelude.Eq, ReadPrec [GetUsagePlanKeysResponse]
ReadPrec GetUsagePlanKeysResponse
Int -> ReadS GetUsagePlanKeysResponse
ReadS [GetUsagePlanKeysResponse]
(Int -> ReadS GetUsagePlanKeysResponse)
-> ReadS [GetUsagePlanKeysResponse]
-> ReadPrec GetUsagePlanKeysResponse
-> ReadPrec [GetUsagePlanKeysResponse]
-> Read GetUsagePlanKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsagePlanKeysResponse]
$creadListPrec :: ReadPrec [GetUsagePlanKeysResponse]
readPrec :: ReadPrec GetUsagePlanKeysResponse
$creadPrec :: ReadPrec GetUsagePlanKeysResponse
readList :: ReadS [GetUsagePlanKeysResponse]
$creadList :: ReadS [GetUsagePlanKeysResponse]
readsPrec :: Int -> ReadS GetUsagePlanKeysResponse
$creadsPrec :: Int -> ReadS GetUsagePlanKeysResponse
Prelude.Read, Int -> GetUsagePlanKeysResponse -> ShowS
[GetUsagePlanKeysResponse] -> ShowS
GetUsagePlanKeysResponse -> String
(Int -> GetUsagePlanKeysResponse -> ShowS)
-> (GetUsagePlanKeysResponse -> String)
-> ([GetUsagePlanKeysResponse] -> ShowS)
-> Show GetUsagePlanKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsagePlanKeysResponse] -> ShowS
$cshowList :: [GetUsagePlanKeysResponse] -> ShowS
show :: GetUsagePlanKeysResponse -> String
$cshow :: GetUsagePlanKeysResponse -> String
showsPrec :: Int -> GetUsagePlanKeysResponse -> ShowS
$cshowsPrec :: Int -> GetUsagePlanKeysResponse -> ShowS
Prelude.Show, (forall x.
 GetUsagePlanKeysResponse -> Rep GetUsagePlanKeysResponse x)
-> (forall x.
    Rep GetUsagePlanKeysResponse x -> GetUsagePlanKeysResponse)
-> Generic GetUsagePlanKeysResponse
forall x.
Rep GetUsagePlanKeysResponse x -> GetUsagePlanKeysResponse
forall x.
GetUsagePlanKeysResponse -> Rep GetUsagePlanKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUsagePlanKeysResponse x -> GetUsagePlanKeysResponse
$cfrom :: forall x.
GetUsagePlanKeysResponse -> Rep GetUsagePlanKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUsagePlanKeysResponse' 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:
--
-- 'items', 'getUsagePlanKeysResponse_items' - The current page of elements from this collection.
--
-- 'position', 'getUsagePlanKeysResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getUsagePlanKeysResponse_httpStatus' - The response's http status code.
newGetUsagePlanKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUsagePlanKeysResponse
newGetUsagePlanKeysResponse :: Int -> GetUsagePlanKeysResponse
newGetUsagePlanKeysResponse Int
pHttpStatus_ =
  GetUsagePlanKeysResponse' :: Maybe [UsagePlanKey]
-> Maybe Text -> Int -> GetUsagePlanKeysResponse
GetUsagePlanKeysResponse'
    { $sel:items:GetUsagePlanKeysResponse' :: Maybe [UsagePlanKey]
items = Maybe [UsagePlanKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetUsagePlanKeysResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUsagePlanKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current page of elements from this collection.
getUsagePlanKeysResponse_items :: Lens.Lens' GetUsagePlanKeysResponse (Prelude.Maybe [UsagePlanKey])
getUsagePlanKeysResponse_items :: (Maybe [UsagePlanKey] -> f (Maybe [UsagePlanKey]))
-> GetUsagePlanKeysResponse -> f GetUsagePlanKeysResponse
getUsagePlanKeysResponse_items = (GetUsagePlanKeysResponse -> Maybe [UsagePlanKey])
-> (GetUsagePlanKeysResponse
    -> Maybe [UsagePlanKey] -> GetUsagePlanKeysResponse)
-> Lens' GetUsagePlanKeysResponse (Maybe [UsagePlanKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeysResponse' {Maybe [UsagePlanKey]
items :: Maybe [UsagePlanKey]
$sel:items:GetUsagePlanKeysResponse' :: GetUsagePlanKeysResponse -> Maybe [UsagePlanKey]
items} -> Maybe [UsagePlanKey]
items) (\s :: GetUsagePlanKeysResponse
s@GetUsagePlanKeysResponse' {} Maybe [UsagePlanKey]
a -> GetUsagePlanKeysResponse
s {$sel:items:GetUsagePlanKeysResponse' :: Maybe [UsagePlanKey]
items = Maybe [UsagePlanKey]
a} :: GetUsagePlanKeysResponse) ((Maybe [UsagePlanKey] -> f (Maybe [UsagePlanKey]))
 -> GetUsagePlanKeysResponse -> f GetUsagePlanKeysResponse)
-> ((Maybe [UsagePlanKey] -> f (Maybe [UsagePlanKey]))
    -> Maybe [UsagePlanKey] -> f (Maybe [UsagePlanKey]))
-> (Maybe [UsagePlanKey] -> f (Maybe [UsagePlanKey]))
-> GetUsagePlanKeysResponse
-> f GetUsagePlanKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UsagePlanKey] [UsagePlanKey] [UsagePlanKey] [UsagePlanKey]
-> Iso
     (Maybe [UsagePlanKey])
     (Maybe [UsagePlanKey])
     (Maybe [UsagePlanKey])
     (Maybe [UsagePlanKey])
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 [UsagePlanKey] [UsagePlanKey] [UsagePlanKey] [UsagePlanKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
getUsagePlanKeysResponse_position :: Lens.Lens' GetUsagePlanKeysResponse (Prelude.Maybe Prelude.Text)
getUsagePlanKeysResponse_position :: (Maybe Text -> f (Maybe Text))
-> GetUsagePlanKeysResponse -> f GetUsagePlanKeysResponse
getUsagePlanKeysResponse_position = (GetUsagePlanKeysResponse -> Maybe Text)
-> (GetUsagePlanKeysResponse
    -> Maybe Text -> GetUsagePlanKeysResponse)
-> Lens' GetUsagePlanKeysResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlanKeysResponse' {Maybe Text
position :: Maybe Text
$sel:position:GetUsagePlanKeysResponse' :: GetUsagePlanKeysResponse -> Maybe Text
position} -> Maybe Text
position) (\s :: GetUsagePlanKeysResponse
s@GetUsagePlanKeysResponse' {} Maybe Text
a -> GetUsagePlanKeysResponse
s {$sel:position:GetUsagePlanKeysResponse' :: Maybe Text
position = Maybe Text
a} :: GetUsagePlanKeysResponse)

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

instance Prelude.NFData GetUsagePlanKeysResponse