{-# 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.GetApiKeys
-- 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 information about the current ApiKeys resource.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetApiKeys
  ( -- * Creating a Request
    GetApiKeys (..),
    newGetApiKeys,

    -- * Request Lenses
    getApiKeys_includeValues,
    getApiKeys_customerId,
    getApiKeys_nameQuery,
    getApiKeys_limit,
    getApiKeys_position,

    -- * Destructuring the Response
    GetApiKeysResponse (..),
    newGetApiKeysResponse,

    -- * Response Lenses
    getApiKeysResponse_items,
    getApiKeysResponse_warnings,
    getApiKeysResponse_position,
    getApiKeysResponse_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

-- | A request to get information about the current ApiKeys resource.
--
-- /See:/ 'newGetApiKeys' smart constructor.
data GetApiKeys = GetApiKeys'
  { -- | A boolean flag to specify whether (@true@) or not (@false@) the result
    -- contains key values.
    GetApiKeys -> Maybe Bool
includeValues :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of a customer in AWS Marketplace or an external system,
    -- such as a developer portal.
    GetApiKeys -> Maybe Text
customerId :: Prelude.Maybe Prelude.Text,
    -- | The name of queried API keys.
    GetApiKeys -> 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.
    GetApiKeys -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set.
    GetApiKeys -> Maybe Text
position :: Prelude.Maybe Prelude.Text
  }
  deriving (GetApiKeys -> GetApiKeys -> Bool
(GetApiKeys -> GetApiKeys -> Bool)
-> (GetApiKeys -> GetApiKeys -> Bool) -> Eq GetApiKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApiKeys -> GetApiKeys -> Bool
$c/= :: GetApiKeys -> GetApiKeys -> Bool
== :: GetApiKeys -> GetApiKeys -> Bool
$c== :: GetApiKeys -> GetApiKeys -> Bool
Prelude.Eq, ReadPrec [GetApiKeys]
ReadPrec GetApiKeys
Int -> ReadS GetApiKeys
ReadS [GetApiKeys]
(Int -> ReadS GetApiKeys)
-> ReadS [GetApiKeys]
-> ReadPrec GetApiKeys
-> ReadPrec [GetApiKeys]
-> Read GetApiKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApiKeys]
$creadListPrec :: ReadPrec [GetApiKeys]
readPrec :: ReadPrec GetApiKeys
$creadPrec :: ReadPrec GetApiKeys
readList :: ReadS [GetApiKeys]
$creadList :: ReadS [GetApiKeys]
readsPrec :: Int -> ReadS GetApiKeys
$creadsPrec :: Int -> ReadS GetApiKeys
Prelude.Read, Int -> GetApiKeys -> ShowS
[GetApiKeys] -> ShowS
GetApiKeys -> String
(Int -> GetApiKeys -> ShowS)
-> (GetApiKeys -> String)
-> ([GetApiKeys] -> ShowS)
-> Show GetApiKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApiKeys] -> ShowS
$cshowList :: [GetApiKeys] -> ShowS
show :: GetApiKeys -> String
$cshow :: GetApiKeys -> String
showsPrec :: Int -> GetApiKeys -> ShowS
$cshowsPrec :: Int -> GetApiKeys -> ShowS
Prelude.Show, (forall x. GetApiKeys -> Rep GetApiKeys x)
-> (forall x. Rep GetApiKeys x -> GetApiKeys) -> Generic GetApiKeys
forall x. Rep GetApiKeys x -> GetApiKeys
forall x. GetApiKeys -> Rep GetApiKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApiKeys x -> GetApiKeys
$cfrom :: forall x. GetApiKeys -> Rep GetApiKeys x
Prelude.Generic)

-- |
-- Create a value of 'GetApiKeys' 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:
--
-- 'includeValues', 'getApiKeys_includeValues' - A boolean flag to specify whether (@true@) or not (@false@) the result
-- contains key values.
--
-- 'customerId', 'getApiKeys_customerId' - The identifier of a customer in AWS Marketplace or an external system,
-- such as a developer portal.
--
-- 'nameQuery', 'getApiKeys_nameQuery' - The name of queried API keys.
--
-- 'limit', 'getApiKeys_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
--
-- 'position', 'getApiKeys_position' - The current pagination position in the paged result set.
newGetApiKeys ::
  GetApiKeys
newGetApiKeys :: GetApiKeys
newGetApiKeys =
  GetApiKeys' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetApiKeys
GetApiKeys'
    { $sel:includeValues:GetApiKeys' :: Maybe Bool
includeValues = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:customerId:GetApiKeys' :: Maybe Text
customerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nameQuery:GetApiKeys' :: Maybe Text
nameQuery = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:GetApiKeys' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetApiKeys' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A boolean flag to specify whether (@true@) or not (@false@) the result
-- contains key values.
getApiKeys_includeValues :: Lens.Lens' GetApiKeys (Prelude.Maybe Prelude.Bool)
getApiKeys_includeValues :: (Maybe Bool -> f (Maybe Bool)) -> GetApiKeys -> f GetApiKeys
getApiKeys_includeValues = (GetApiKeys -> Maybe Bool)
-> (GetApiKeys -> Maybe Bool -> GetApiKeys)
-> Lens GetApiKeys GetApiKeys (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiKeys' {Maybe Bool
includeValues :: Maybe Bool
$sel:includeValues:GetApiKeys' :: GetApiKeys -> Maybe Bool
includeValues} -> Maybe Bool
includeValues) (\s :: GetApiKeys
s@GetApiKeys' {} Maybe Bool
a -> GetApiKeys
s {$sel:includeValues:GetApiKeys' :: Maybe Bool
includeValues = Maybe Bool
a} :: GetApiKeys)

-- | The identifier of a customer in AWS Marketplace or an external system,
-- such as a developer portal.
getApiKeys_customerId :: Lens.Lens' GetApiKeys (Prelude.Maybe Prelude.Text)
getApiKeys_customerId :: (Maybe Text -> f (Maybe Text)) -> GetApiKeys -> f GetApiKeys
getApiKeys_customerId = (GetApiKeys -> Maybe Text)
-> (GetApiKeys -> Maybe Text -> GetApiKeys)
-> Lens GetApiKeys GetApiKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiKeys' {Maybe Text
customerId :: Maybe Text
$sel:customerId:GetApiKeys' :: GetApiKeys -> Maybe Text
customerId} -> Maybe Text
customerId) (\s :: GetApiKeys
s@GetApiKeys' {} Maybe Text
a -> GetApiKeys
s {$sel:customerId:GetApiKeys' :: Maybe Text
customerId = Maybe Text
a} :: GetApiKeys)

-- | The name of queried API keys.
getApiKeys_nameQuery :: Lens.Lens' GetApiKeys (Prelude.Maybe Prelude.Text)
getApiKeys_nameQuery :: (Maybe Text -> f (Maybe Text)) -> GetApiKeys -> f GetApiKeys
getApiKeys_nameQuery = (GetApiKeys -> Maybe Text)
-> (GetApiKeys -> Maybe Text -> GetApiKeys)
-> Lens GetApiKeys GetApiKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiKeys' {Maybe Text
nameQuery :: Maybe Text
$sel:nameQuery:GetApiKeys' :: GetApiKeys -> Maybe Text
nameQuery} -> Maybe Text
nameQuery) (\s :: GetApiKeys
s@GetApiKeys' {} Maybe Text
a -> GetApiKeys
s {$sel:nameQuery:GetApiKeys' :: Maybe Text
nameQuery = Maybe Text
a} :: GetApiKeys)

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

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

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

instance Prelude.NFData GetApiKeys

instance Core.ToHeaders GetApiKeys where
  toHeaders :: GetApiKeys -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetApiKeys -> 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 GetApiKeys where
  toPath :: GetApiKeys -> ByteString
toPath = ByteString -> GetApiKeys -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/apikeys"

instance Core.ToQuery GetApiKeys where
  toQuery :: GetApiKeys -> QueryString
toQuery GetApiKeys' {Maybe Bool
Maybe Int
Maybe Text
position :: Maybe Text
limit :: Maybe Int
nameQuery :: Maybe Text
customerId :: Maybe Text
includeValues :: Maybe Bool
$sel:position:GetApiKeys' :: GetApiKeys -> Maybe Text
$sel:limit:GetApiKeys' :: GetApiKeys -> Maybe Int
$sel:nameQuery:GetApiKeys' :: GetApiKeys -> Maybe Text
$sel:customerId:GetApiKeys' :: GetApiKeys -> Maybe Text
$sel:includeValues:GetApiKeys' :: GetApiKeys -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"includeValues" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includeValues,
        ByteString
"customerId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
customerId,
        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 a collection of API keys as represented by an ApiKeys
-- resource.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-api-keys.html Use API Keys>
--
-- /See:/ 'newGetApiKeysResponse' smart constructor.
data GetApiKeysResponse = GetApiKeysResponse'
  { -- | The current page of elements from this collection.
    GetApiKeysResponse -> Maybe [ApiKey]
items :: Prelude.Maybe [ApiKey],
    -- | A list of warning messages logged during the import of API keys when the
    -- @failOnWarnings@ option is set to true.
    GetApiKeysResponse -> Maybe [Text]
warnings :: Prelude.Maybe [Prelude.Text],
    GetApiKeysResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetApiKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetApiKeysResponse -> GetApiKeysResponse -> Bool
(GetApiKeysResponse -> GetApiKeysResponse -> Bool)
-> (GetApiKeysResponse -> GetApiKeysResponse -> Bool)
-> Eq GetApiKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApiKeysResponse -> GetApiKeysResponse -> Bool
$c/= :: GetApiKeysResponse -> GetApiKeysResponse -> Bool
== :: GetApiKeysResponse -> GetApiKeysResponse -> Bool
$c== :: GetApiKeysResponse -> GetApiKeysResponse -> Bool
Prelude.Eq, ReadPrec [GetApiKeysResponse]
ReadPrec GetApiKeysResponse
Int -> ReadS GetApiKeysResponse
ReadS [GetApiKeysResponse]
(Int -> ReadS GetApiKeysResponse)
-> ReadS [GetApiKeysResponse]
-> ReadPrec GetApiKeysResponse
-> ReadPrec [GetApiKeysResponse]
-> Read GetApiKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApiKeysResponse]
$creadListPrec :: ReadPrec [GetApiKeysResponse]
readPrec :: ReadPrec GetApiKeysResponse
$creadPrec :: ReadPrec GetApiKeysResponse
readList :: ReadS [GetApiKeysResponse]
$creadList :: ReadS [GetApiKeysResponse]
readsPrec :: Int -> ReadS GetApiKeysResponse
$creadsPrec :: Int -> ReadS GetApiKeysResponse
Prelude.Read, Int -> GetApiKeysResponse -> ShowS
[GetApiKeysResponse] -> ShowS
GetApiKeysResponse -> String
(Int -> GetApiKeysResponse -> ShowS)
-> (GetApiKeysResponse -> String)
-> ([GetApiKeysResponse] -> ShowS)
-> Show GetApiKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApiKeysResponse] -> ShowS
$cshowList :: [GetApiKeysResponse] -> ShowS
show :: GetApiKeysResponse -> String
$cshow :: GetApiKeysResponse -> String
showsPrec :: Int -> GetApiKeysResponse -> ShowS
$cshowsPrec :: Int -> GetApiKeysResponse -> ShowS
Prelude.Show, (forall x. GetApiKeysResponse -> Rep GetApiKeysResponse x)
-> (forall x. Rep GetApiKeysResponse x -> GetApiKeysResponse)
-> Generic GetApiKeysResponse
forall x. Rep GetApiKeysResponse x -> GetApiKeysResponse
forall x. GetApiKeysResponse -> Rep GetApiKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApiKeysResponse x -> GetApiKeysResponse
$cfrom :: forall x. GetApiKeysResponse -> Rep GetApiKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetApiKeysResponse' 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', 'getApiKeysResponse_items' - The current page of elements from this collection.
--
-- 'warnings', 'getApiKeysResponse_warnings' - A list of warning messages logged during the import of API keys when the
-- @failOnWarnings@ option is set to true.
--
-- 'position', 'getApiKeysResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getApiKeysResponse_httpStatus' - The response's http status code.
newGetApiKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetApiKeysResponse
newGetApiKeysResponse :: Int -> GetApiKeysResponse
newGetApiKeysResponse Int
pHttpStatus_ =
  GetApiKeysResponse' :: Maybe [ApiKey]
-> Maybe [Text] -> Maybe Text -> Int -> GetApiKeysResponse
GetApiKeysResponse'
    { $sel:items:GetApiKeysResponse' :: Maybe [ApiKey]
items = Maybe [ApiKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:GetApiKeysResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetApiKeysResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetApiKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of warning messages logged during the import of API keys when the
-- @failOnWarnings@ option is set to true.
getApiKeysResponse_warnings :: Lens.Lens' GetApiKeysResponse (Prelude.Maybe [Prelude.Text])
getApiKeysResponse_warnings :: (Maybe [Text] -> f (Maybe [Text]))
-> GetApiKeysResponse -> f GetApiKeysResponse
getApiKeysResponse_warnings = (GetApiKeysResponse -> Maybe [Text])
-> (GetApiKeysResponse -> Maybe [Text] -> GetApiKeysResponse)
-> Lens
     GetApiKeysResponse GetApiKeysResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiKeysResponse' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:GetApiKeysResponse' :: GetApiKeysResponse -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: GetApiKeysResponse
s@GetApiKeysResponse' {} Maybe [Text]
a -> GetApiKeysResponse
s {$sel:warnings:GetApiKeysResponse' :: Maybe [Text]
warnings = Maybe [Text]
a} :: GetApiKeysResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetApiKeysResponse -> f GetApiKeysResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetApiKeysResponse
-> f GetApiKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData GetApiKeysResponse