{-# 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.AppSync.ListApiKeys
-- 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 API keys for a given API.
--
-- API keys are deleted automatically 60 days after they expire. However,
-- they may still be included in the response until they have actually been
-- deleted. You can safely call @DeleteApiKey@ to manually delete a key
-- before it\'s automatically deleted.
--
-- This operation returns paginated results.
module Amazonka.AppSync.ListApiKeys
  ( -- * Creating a Request
    ListApiKeys (..),
    newListApiKeys,

    -- * Request Lenses
    listApiKeys_nextToken,
    listApiKeys_maxResults,
    listApiKeys_apiId,

    -- * Destructuring the Response
    ListApiKeysResponse (..),
    newListApiKeysResponse,

    -- * Response Lenses
    listApiKeysResponse_apiKeys,
    listApiKeysResponse_nextToken,
    listApiKeysResponse_httpStatus,
  )
where

import Amazonka.AppSync.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

-- | /See:/ 'newListApiKeys' smart constructor.
data ListApiKeys = ListApiKeys'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListApiKeys -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results you want the request to return.
    ListApiKeys -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The API ID.
    ListApiKeys -> Text
apiId :: Prelude.Text
  }
  deriving (ListApiKeys -> ListApiKeys -> Bool
(ListApiKeys -> ListApiKeys -> Bool)
-> (ListApiKeys -> ListApiKeys -> Bool) -> Eq ListApiKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApiKeys -> ListApiKeys -> Bool
$c/= :: ListApiKeys -> ListApiKeys -> Bool
== :: ListApiKeys -> ListApiKeys -> Bool
$c== :: ListApiKeys -> ListApiKeys -> Bool
Prelude.Eq, ReadPrec [ListApiKeys]
ReadPrec ListApiKeys
Int -> ReadS ListApiKeys
ReadS [ListApiKeys]
(Int -> ReadS ListApiKeys)
-> ReadS [ListApiKeys]
-> ReadPrec ListApiKeys
-> ReadPrec [ListApiKeys]
-> Read ListApiKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApiKeys]
$creadListPrec :: ReadPrec [ListApiKeys]
readPrec :: ReadPrec ListApiKeys
$creadPrec :: ReadPrec ListApiKeys
readList :: ReadS [ListApiKeys]
$creadList :: ReadS [ListApiKeys]
readsPrec :: Int -> ReadS ListApiKeys
$creadsPrec :: Int -> ReadS ListApiKeys
Prelude.Read, Int -> ListApiKeys -> ShowS
[ListApiKeys] -> ShowS
ListApiKeys -> String
(Int -> ListApiKeys -> ShowS)
-> (ListApiKeys -> String)
-> ([ListApiKeys] -> ShowS)
-> Show ListApiKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApiKeys] -> ShowS
$cshowList :: [ListApiKeys] -> ShowS
show :: ListApiKeys -> String
$cshow :: ListApiKeys -> String
showsPrec :: Int -> ListApiKeys -> ShowS
$cshowsPrec :: Int -> ListApiKeys -> ShowS
Prelude.Show, (forall x. ListApiKeys -> Rep ListApiKeys x)
-> (forall x. Rep ListApiKeys x -> ListApiKeys)
-> Generic ListApiKeys
forall x. Rep ListApiKeys x -> ListApiKeys
forall x. ListApiKeys -> Rep ListApiKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApiKeys x -> ListApiKeys
$cfrom :: forall x. ListApiKeys -> Rep ListApiKeys x
Prelude.Generic)

-- |
-- Create a value of 'ListApiKeys' 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', 'listApiKeys_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'maxResults', 'listApiKeys_maxResults' - The maximum number of results you want the request to return.
--
-- 'apiId', 'listApiKeys_apiId' - The API ID.
newListApiKeys ::
  -- | 'apiId'
  Prelude.Text ->
  ListApiKeys
newListApiKeys :: Text -> ListApiKeys
newListApiKeys Text
pApiId_ =
  ListApiKeys' :: Maybe Text -> Maybe Natural -> Text -> ListApiKeys
ListApiKeys'
    { $sel:nextToken:ListApiKeys' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListApiKeys' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:ListApiKeys' :: Text
apiId = Text
pApiId_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listApiKeys_nextToken :: Lens.Lens' ListApiKeys (Prelude.Maybe Prelude.Text)
listApiKeys_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListApiKeys -> f ListApiKeys
listApiKeys_nextToken = (ListApiKeys -> Maybe Text)
-> (ListApiKeys -> Maybe Text -> ListApiKeys)
-> Lens ListApiKeys ListApiKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApiKeys' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApiKeys' :: ListApiKeys -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApiKeys
s@ListApiKeys' {} Maybe Text
a -> ListApiKeys
s {$sel:nextToken:ListApiKeys' :: Maybe Text
nextToken = Maybe Text
a} :: ListApiKeys)

-- | The maximum number of results you want the request to return.
listApiKeys_maxResults :: Lens.Lens' ListApiKeys (Prelude.Maybe Prelude.Natural)
listApiKeys_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListApiKeys -> f ListApiKeys
listApiKeys_maxResults = (ListApiKeys -> Maybe Natural)
-> (ListApiKeys -> Maybe Natural -> ListApiKeys)
-> Lens ListApiKeys ListApiKeys (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApiKeys' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListApiKeys' :: ListApiKeys -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListApiKeys
s@ListApiKeys' {} Maybe Natural
a -> ListApiKeys
s {$sel:maxResults:ListApiKeys' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListApiKeys)

-- | The API ID.
listApiKeys_apiId :: Lens.Lens' ListApiKeys Prelude.Text
listApiKeys_apiId :: (Text -> f Text) -> ListApiKeys -> f ListApiKeys
listApiKeys_apiId = (ListApiKeys -> Text)
-> (ListApiKeys -> Text -> ListApiKeys)
-> Lens ListApiKeys ListApiKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApiKeys' {Text
apiId :: Text
$sel:apiId:ListApiKeys' :: ListApiKeys -> Text
apiId} -> Text
apiId) (\s :: ListApiKeys
s@ListApiKeys' {} Text
a -> ListApiKeys
s {$sel:apiId:ListApiKeys' :: Text
apiId = Text
a} :: ListApiKeys)

instance Core.AWSPager ListApiKeys where
  page :: ListApiKeys -> AWSResponse ListApiKeys -> Maybe ListApiKeys
page ListApiKeys
rq AWSResponse ListApiKeys
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApiKeys
ListApiKeysResponse
rs
            ListApiKeysResponse
-> Getting (First Text) ListApiKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListApiKeysResponse -> Const (First Text) ListApiKeysResponse
Lens' ListApiKeysResponse (Maybe Text)
listApiKeysResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListApiKeysResponse -> Const (First Text) ListApiKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListApiKeysResponse 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 ListApiKeys
forall a. Maybe a
Prelude.Nothing
    | Maybe [ApiKey] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApiKeys
ListApiKeysResponse
rs
            ListApiKeysResponse
-> Getting (First [ApiKey]) ListApiKeysResponse [ApiKey]
-> Maybe [ApiKey]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ApiKey] -> Const (First [ApiKey]) (Maybe [ApiKey]))
-> ListApiKeysResponse
-> Const (First [ApiKey]) ListApiKeysResponse
Lens' ListApiKeysResponse (Maybe [ApiKey])
listApiKeysResponse_apiKeys ((Maybe [ApiKey] -> Const (First [ApiKey]) (Maybe [ApiKey]))
 -> ListApiKeysResponse
 -> Const (First [ApiKey]) ListApiKeysResponse)
-> (([ApiKey] -> Const (First [ApiKey]) [ApiKey])
    -> Maybe [ApiKey] -> Const (First [ApiKey]) (Maybe [ApiKey]))
-> Getting (First [ApiKey]) ListApiKeysResponse [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 ListApiKeys
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListApiKeys -> Maybe ListApiKeys
forall a. a -> Maybe a
Prelude.Just (ListApiKeys -> Maybe ListApiKeys)
-> ListApiKeys -> Maybe ListApiKeys
forall a b. (a -> b) -> a -> b
Prelude.$
        ListApiKeys
rq
          ListApiKeys -> (ListApiKeys -> ListApiKeys) -> ListApiKeys
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListApiKeys -> Identity ListApiKeys
Lens ListApiKeys ListApiKeys (Maybe Text) (Maybe Text)
listApiKeys_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListApiKeys -> Identity ListApiKeys)
-> Maybe Text -> ListApiKeys -> ListApiKeys
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListApiKeys
ListApiKeysResponse
rs
          ListApiKeysResponse
-> Getting (First Text) ListApiKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListApiKeysResponse -> Const (First Text) ListApiKeysResponse
Lens' ListApiKeysResponse (Maybe Text)
listApiKeysResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListApiKeysResponse -> Const (First Text) ListApiKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListApiKeysResponse 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 ListApiKeys where
  type AWSResponse ListApiKeys = ListApiKeysResponse
  request :: ListApiKeys -> Request ListApiKeys
request = Service -> ListApiKeys -> Request ListApiKeys
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListApiKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListApiKeys)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListApiKeys))
-> Logger
-> Service
-> Proxy ListApiKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListApiKeys)))
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 -> Int -> ListApiKeysResponse
ListApiKeysResponse'
            (Maybe [ApiKey] -> Maybe Text -> Int -> ListApiKeysResponse)
-> Either String (Maybe [ApiKey])
-> Either String (Maybe Text -> Int -> ListApiKeysResponse)
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
"apiKeys" 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 -> Int -> ListApiKeysResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListApiKeysResponse)
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
"nextToken")
            Either String (Int -> ListApiKeysResponse)
-> Either String Int -> Either String ListApiKeysResponse
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 ListApiKeys

instance Prelude.NFData ListApiKeys

instance Core.ToHeaders ListApiKeys where
  toHeaders :: ListApiKeys -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListApiKeys -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListApiKeys where
  toPath :: ListApiKeys -> ByteString
toPath ListApiKeys' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId:ListApiKeys' :: ListApiKeys -> Text
$sel:maxResults:ListApiKeys' :: ListApiKeys -> Maybe Natural
$sel:nextToken:ListApiKeys' :: ListApiKeys -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/apikeys"]

instance Core.ToQuery ListApiKeys where
  toQuery :: ListApiKeys -> QueryString
toQuery ListApiKeys' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId:ListApiKeys' :: ListApiKeys -> Text
$sel:maxResults:ListApiKeys' :: ListApiKeys -> Maybe Natural
$sel:nextToken:ListApiKeys' :: ListApiKeys -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListApiKeysResponse' smart constructor.
data ListApiKeysResponse = ListApiKeysResponse'
  { -- | The @ApiKey@ objects.
    ListApiKeysResponse -> Maybe [ApiKey]
apiKeys :: Prelude.Maybe [ApiKey],
    -- | An identifier to be passed in the next request to this operation to
    -- return the next set of items in the list.
    ListApiKeysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListApiKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListApiKeysResponse -> ListApiKeysResponse -> Bool
(ListApiKeysResponse -> ListApiKeysResponse -> Bool)
-> (ListApiKeysResponse -> ListApiKeysResponse -> Bool)
-> Eq ListApiKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApiKeysResponse -> ListApiKeysResponse -> Bool
$c/= :: ListApiKeysResponse -> ListApiKeysResponse -> Bool
== :: ListApiKeysResponse -> ListApiKeysResponse -> Bool
$c== :: ListApiKeysResponse -> ListApiKeysResponse -> Bool
Prelude.Eq, ReadPrec [ListApiKeysResponse]
ReadPrec ListApiKeysResponse
Int -> ReadS ListApiKeysResponse
ReadS [ListApiKeysResponse]
(Int -> ReadS ListApiKeysResponse)
-> ReadS [ListApiKeysResponse]
-> ReadPrec ListApiKeysResponse
-> ReadPrec [ListApiKeysResponse]
-> Read ListApiKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApiKeysResponse]
$creadListPrec :: ReadPrec [ListApiKeysResponse]
readPrec :: ReadPrec ListApiKeysResponse
$creadPrec :: ReadPrec ListApiKeysResponse
readList :: ReadS [ListApiKeysResponse]
$creadList :: ReadS [ListApiKeysResponse]
readsPrec :: Int -> ReadS ListApiKeysResponse
$creadsPrec :: Int -> ReadS ListApiKeysResponse
Prelude.Read, Int -> ListApiKeysResponse -> ShowS
[ListApiKeysResponse] -> ShowS
ListApiKeysResponse -> String
(Int -> ListApiKeysResponse -> ShowS)
-> (ListApiKeysResponse -> String)
-> ([ListApiKeysResponse] -> ShowS)
-> Show ListApiKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApiKeysResponse] -> ShowS
$cshowList :: [ListApiKeysResponse] -> ShowS
show :: ListApiKeysResponse -> String
$cshow :: ListApiKeysResponse -> String
showsPrec :: Int -> ListApiKeysResponse -> ShowS
$cshowsPrec :: Int -> ListApiKeysResponse -> ShowS
Prelude.Show, (forall x. ListApiKeysResponse -> Rep ListApiKeysResponse x)
-> (forall x. Rep ListApiKeysResponse x -> ListApiKeysResponse)
-> Generic ListApiKeysResponse
forall x. Rep ListApiKeysResponse x -> ListApiKeysResponse
forall x. ListApiKeysResponse -> Rep ListApiKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApiKeysResponse x -> ListApiKeysResponse
$cfrom :: forall x. ListApiKeysResponse -> Rep ListApiKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListApiKeysResponse' 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:
--
-- 'apiKeys', 'listApiKeysResponse_apiKeys' - The @ApiKey@ objects.
--
-- 'nextToken', 'listApiKeysResponse_nextToken' - An identifier to be passed in the next request to this operation to
-- return the next set of items in the list.
--
-- 'httpStatus', 'listApiKeysResponse_httpStatus' - The response's http status code.
newListApiKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListApiKeysResponse
newListApiKeysResponse :: Int -> ListApiKeysResponse
newListApiKeysResponse Int
pHttpStatus_ =
  ListApiKeysResponse' :: Maybe [ApiKey] -> Maybe Text -> Int -> ListApiKeysResponse
ListApiKeysResponse'
    { $sel:apiKeys:ListApiKeysResponse' :: Maybe [ApiKey]
apiKeys = Maybe [ApiKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApiKeysResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListApiKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @ApiKey@ objects.
listApiKeysResponse_apiKeys :: Lens.Lens' ListApiKeysResponse (Prelude.Maybe [ApiKey])
listApiKeysResponse_apiKeys :: (Maybe [ApiKey] -> f (Maybe [ApiKey]))
-> ListApiKeysResponse -> f ListApiKeysResponse
listApiKeysResponse_apiKeys = (ListApiKeysResponse -> Maybe [ApiKey])
-> (ListApiKeysResponse -> Maybe [ApiKey] -> ListApiKeysResponse)
-> Lens' ListApiKeysResponse (Maybe [ApiKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApiKeysResponse' {Maybe [ApiKey]
apiKeys :: Maybe [ApiKey]
$sel:apiKeys:ListApiKeysResponse' :: ListApiKeysResponse -> Maybe [ApiKey]
apiKeys} -> Maybe [ApiKey]
apiKeys) (\s :: ListApiKeysResponse
s@ListApiKeysResponse' {} Maybe [ApiKey]
a -> ListApiKeysResponse
s {$sel:apiKeys:ListApiKeysResponse' :: Maybe [ApiKey]
apiKeys = Maybe [ApiKey]
a} :: ListApiKeysResponse) ((Maybe [ApiKey] -> f (Maybe [ApiKey]))
 -> ListApiKeysResponse -> f ListApiKeysResponse)
-> ((Maybe [ApiKey] -> f (Maybe [ApiKey]))
    -> Maybe [ApiKey] -> f (Maybe [ApiKey]))
-> (Maybe [ApiKey] -> f (Maybe [ApiKey]))
-> ListApiKeysResponse
-> f ListApiKeysResponse
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

-- | An identifier to be passed in the next request to this operation to
-- return the next set of items in the list.
listApiKeysResponse_nextToken :: Lens.Lens' ListApiKeysResponse (Prelude.Maybe Prelude.Text)
listApiKeysResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApiKeysResponse -> f ListApiKeysResponse
listApiKeysResponse_nextToken = (ListApiKeysResponse -> Maybe Text)
-> (ListApiKeysResponse -> Maybe Text -> ListApiKeysResponse)
-> Lens' ListApiKeysResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApiKeysResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApiKeysResponse' :: ListApiKeysResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApiKeysResponse
s@ListApiKeysResponse' {} Maybe Text
a -> ListApiKeysResponse
s {$sel:nextToken:ListApiKeysResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListApiKeysResponse)

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

instance Prelude.NFData ListApiKeysResponse