{-# 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.KMS.ListKeys
-- 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 a list of all KMS keys in the caller\'s Amazon Web Services account
-- and Region.
--
-- __Cross-account use__: No. You cannot perform this operation on a KMS
-- key in a different Amazon Web Services account.
--
-- __Required permissions__:
-- <https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html kms:ListKeys>
-- (IAM policy)
--
-- __Related operations:__
--
-- -   CreateKey
--
-- -   DescribeKey
--
-- -   ListAliases
--
-- -   ListResourceTags
--
-- This operation returns paginated results.
module Amazonka.KMS.ListKeys
  ( -- * Creating a Request
    ListKeys (..),
    newListKeys,

    -- * Request Lenses
    listKeys_marker,
    listKeys_limit,

    -- * Destructuring the Response
    ListKeysResponse (..),
    newListKeysResponse,

    -- * Response Lenses
    listKeysResponse_truncated,
    listKeysResponse_keys,
    listKeysResponse_nextMarker,
    listKeysResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KMS.Types
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:/ 'newListKeys' smart constructor.
data ListKeys = ListKeys'
  { -- | Use this parameter in a subsequent request after you receive a response
    -- with truncated results. Set it to the value of @NextMarker@ from the
    -- truncated response you just received.
    ListKeys -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to specify the maximum number of items to return.
    -- When this value is present, KMS does not return more than the specified
    -- number of items, but it might return fewer.
    --
    -- This value is optional. If you include a value, it must be between 1 and
    -- 1000, inclusive. If you do not include a value, it defaults to 100.
    ListKeys -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListKeys -> ListKeys -> Bool
(ListKeys -> ListKeys -> Bool)
-> (ListKeys -> ListKeys -> Bool) -> Eq ListKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKeys -> ListKeys -> Bool
$c/= :: ListKeys -> ListKeys -> Bool
== :: ListKeys -> ListKeys -> Bool
$c== :: ListKeys -> ListKeys -> Bool
Prelude.Eq, ReadPrec [ListKeys]
ReadPrec ListKeys
Int -> ReadS ListKeys
ReadS [ListKeys]
(Int -> ReadS ListKeys)
-> ReadS [ListKeys]
-> ReadPrec ListKeys
-> ReadPrec [ListKeys]
-> Read ListKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKeys]
$creadListPrec :: ReadPrec [ListKeys]
readPrec :: ReadPrec ListKeys
$creadPrec :: ReadPrec ListKeys
readList :: ReadS [ListKeys]
$creadList :: ReadS [ListKeys]
readsPrec :: Int -> ReadS ListKeys
$creadsPrec :: Int -> ReadS ListKeys
Prelude.Read, Int -> ListKeys -> ShowS
[ListKeys] -> ShowS
ListKeys -> String
(Int -> ListKeys -> ShowS)
-> (ListKeys -> String) -> ([ListKeys] -> ShowS) -> Show ListKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKeys] -> ShowS
$cshowList :: [ListKeys] -> ShowS
show :: ListKeys -> String
$cshow :: ListKeys -> String
showsPrec :: Int -> ListKeys -> ShowS
$cshowsPrec :: Int -> ListKeys -> ShowS
Prelude.Show, (forall x. ListKeys -> Rep ListKeys x)
-> (forall x. Rep ListKeys x -> ListKeys) -> Generic ListKeys
forall x. Rep ListKeys x -> ListKeys
forall x. ListKeys -> Rep ListKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListKeys x -> ListKeys
$cfrom :: forall x. ListKeys -> Rep ListKeys x
Prelude.Generic)

-- |
-- Create a value of 'ListKeys' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'marker', 'listKeys_marker' - Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
--
-- 'limit', 'listKeys_limit' - Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 1000, inclusive. If you do not include a value, it defaults to 100.
newListKeys ::
  ListKeys
newListKeys :: ListKeys
newListKeys =
  ListKeys' :: Maybe Text -> Maybe Natural -> ListKeys
ListKeys'
    { $sel:marker:ListKeys' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListKeys' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
listKeys_marker :: Lens.Lens' ListKeys (Prelude.Maybe Prelude.Text)
listKeys_marker :: (Maybe Text -> f (Maybe Text)) -> ListKeys -> f ListKeys
listKeys_marker = (ListKeys -> Maybe Text)
-> (ListKeys -> Maybe Text -> ListKeys)
-> Lens ListKeys ListKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeys' {Maybe Text
marker :: Maybe Text
$sel:marker:ListKeys' :: ListKeys -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListKeys
s@ListKeys' {} Maybe Text
a -> ListKeys
s {$sel:marker:ListKeys' :: Maybe Text
marker = Maybe Text
a} :: ListKeys)

-- | Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 1000, inclusive. If you do not include a value, it defaults to 100.
listKeys_limit :: Lens.Lens' ListKeys (Prelude.Maybe Prelude.Natural)
listKeys_limit :: (Maybe Natural -> f (Maybe Natural)) -> ListKeys -> f ListKeys
listKeys_limit = (ListKeys -> Maybe Natural)
-> (ListKeys -> Maybe Natural -> ListKeys)
-> Lens ListKeys ListKeys (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeys' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListKeys' :: ListKeys -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListKeys
s@ListKeys' {} Maybe Natural
a -> ListKeys
s {$sel:limit:ListKeys' :: Maybe Natural
limit = Maybe Natural
a} :: ListKeys)

instance Core.AWSPager ListKeys where
  page :: ListKeys -> AWSResponse ListKeys -> Maybe ListKeys
page ListKeys
rq AWSResponse ListKeys
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListKeys
ListKeysResponse
rs
            ListKeysResponse
-> Getting (First Bool) ListKeysResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListKeysResponse -> Const (First Bool) ListKeysResponse
Lens' ListKeysResponse (Maybe Bool)
listKeysResponse_truncated ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListKeysResponse -> Const (First Bool) ListKeysResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListKeysResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListKeys
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListKeys
ListKeysResponse
rs
            ListKeysResponse
-> Getting (First Text) ListKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListKeysResponse -> Const (First Text) ListKeysResponse
Lens' ListKeysResponse (Maybe Text)
listKeysResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListKeysResponse -> Const (First Text) ListKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListKeysResponse 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 ListKeys
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListKeys -> Maybe ListKeys
forall a. a -> Maybe a
Prelude.Just (ListKeys -> Maybe ListKeys) -> ListKeys -> Maybe ListKeys
forall a b. (a -> b) -> a -> b
Prelude.$
        ListKeys
rq
          ListKeys -> (ListKeys -> ListKeys) -> ListKeys
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListKeys -> Identity ListKeys
Lens ListKeys ListKeys (Maybe Text) (Maybe Text)
listKeys_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListKeys -> Identity ListKeys)
-> Maybe Text -> ListKeys -> ListKeys
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListKeys
ListKeysResponse
rs
          ListKeysResponse
-> Getting (First Text) ListKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListKeysResponse -> Const (First Text) ListKeysResponse
Lens' ListKeysResponse (Maybe Text)
listKeysResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListKeysResponse -> Const (First Text) ListKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListKeysResponse 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 ListKeys where
  type AWSResponse ListKeys = ListKeysResponse
  request :: ListKeys -> Request ListKeys
request = Service -> ListKeys -> Request ListKeys
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListKeys)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListKeys))
-> Logger
-> Service
-> Proxy ListKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListKeys)))
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 Bool
-> Maybe [KeyListEntry] -> Maybe Text -> Int -> ListKeysResponse
ListKeysResponse'
            (Maybe Bool
 -> Maybe [KeyListEntry] -> Maybe Text -> Int -> ListKeysResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [KeyListEntry] -> Maybe Text -> Int -> ListKeysResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Truncated")
            Either
  String
  (Maybe [KeyListEntry] -> Maybe Text -> Int -> ListKeysResponse)
-> Either String (Maybe [KeyListEntry])
-> Either String (Maybe Text -> Int -> ListKeysResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [KeyListEntry]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Keys" Either String (Maybe (Maybe [KeyListEntry]))
-> Maybe [KeyListEntry] -> Either String (Maybe [KeyListEntry])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [KeyListEntry]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListKeysResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListKeysResponse)
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
"NextMarker")
            Either String (Int -> ListKeysResponse)
-> Either String Int -> Either String ListKeysResponse
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 ListKeys

instance Prelude.NFData ListKeys

instance Core.ToHeaders ListKeys where
  toHeaders :: ListKeys -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListKeys -> 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
"TrentService.ListKeys" :: 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 ListKeys where
  toJSON :: ListKeys -> Value
toJSON ListKeys' {Maybe Natural
Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
$sel:limit:ListKeys' :: ListKeys -> Maybe Natural
$sel:marker:ListKeys' :: ListKeys -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Marker" 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
marker,
            (Text
"Limit" 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
limit
          ]
      )

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

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

-- | /See:/ 'newListKeysResponse' smart constructor.
data ListKeysResponse = ListKeysResponse'
  { -- | A flag that indicates whether there are more items in the list. When
    -- this value is true, the list in this response is truncated. To get more
    -- items, pass the value of the @NextMarker@ element in thisresponse to the
    -- @Marker@ parameter in a subsequent request.
    ListKeysResponse -> Maybe Bool
truncated :: Prelude.Maybe Prelude.Bool,
    -- | A list of KMS keys.
    ListKeysResponse -> Maybe [KeyListEntry]
keys :: Prelude.Maybe [KeyListEntry],
    -- | When @Truncated@ is true, this element is present and contains the value
    -- to use for the @Marker@ parameter in a subsequent request.
    ListKeysResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListKeysResponse -> ListKeysResponse -> Bool
(ListKeysResponse -> ListKeysResponse -> Bool)
-> (ListKeysResponse -> ListKeysResponse -> Bool)
-> Eq ListKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKeysResponse -> ListKeysResponse -> Bool
$c/= :: ListKeysResponse -> ListKeysResponse -> Bool
== :: ListKeysResponse -> ListKeysResponse -> Bool
$c== :: ListKeysResponse -> ListKeysResponse -> Bool
Prelude.Eq, ReadPrec [ListKeysResponse]
ReadPrec ListKeysResponse
Int -> ReadS ListKeysResponse
ReadS [ListKeysResponse]
(Int -> ReadS ListKeysResponse)
-> ReadS [ListKeysResponse]
-> ReadPrec ListKeysResponse
-> ReadPrec [ListKeysResponse]
-> Read ListKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKeysResponse]
$creadListPrec :: ReadPrec [ListKeysResponse]
readPrec :: ReadPrec ListKeysResponse
$creadPrec :: ReadPrec ListKeysResponse
readList :: ReadS [ListKeysResponse]
$creadList :: ReadS [ListKeysResponse]
readsPrec :: Int -> ReadS ListKeysResponse
$creadsPrec :: Int -> ReadS ListKeysResponse
Prelude.Read, Int -> ListKeysResponse -> ShowS
[ListKeysResponse] -> ShowS
ListKeysResponse -> String
(Int -> ListKeysResponse -> ShowS)
-> (ListKeysResponse -> String)
-> ([ListKeysResponse] -> ShowS)
-> Show ListKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKeysResponse] -> ShowS
$cshowList :: [ListKeysResponse] -> ShowS
show :: ListKeysResponse -> String
$cshow :: ListKeysResponse -> String
showsPrec :: Int -> ListKeysResponse -> ShowS
$cshowsPrec :: Int -> ListKeysResponse -> ShowS
Prelude.Show, (forall x. ListKeysResponse -> Rep ListKeysResponse x)
-> (forall x. Rep ListKeysResponse x -> ListKeysResponse)
-> Generic ListKeysResponse
forall x. Rep ListKeysResponse x -> ListKeysResponse
forall x. ListKeysResponse -> Rep ListKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListKeysResponse x -> ListKeysResponse
$cfrom :: forall x. ListKeysResponse -> Rep ListKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListKeysResponse' 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:
--
-- 'truncated', 'listKeysResponse_truncated' - A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
--
-- 'keys', 'listKeysResponse_keys' - A list of KMS keys.
--
-- 'nextMarker', 'listKeysResponse_nextMarker' - When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
--
-- 'httpStatus', 'listKeysResponse_httpStatus' - The response's http status code.
newListKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListKeysResponse
newListKeysResponse :: Int -> ListKeysResponse
newListKeysResponse Int
pHttpStatus_ =
  ListKeysResponse' :: Maybe Bool
-> Maybe [KeyListEntry] -> Maybe Text -> Int -> ListKeysResponse
ListKeysResponse'
    { $sel:truncated:ListKeysResponse' :: Maybe Bool
truncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:keys:ListKeysResponse' :: Maybe [KeyListEntry]
keys = Maybe [KeyListEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListKeysResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
listKeysResponse_truncated :: Lens.Lens' ListKeysResponse (Prelude.Maybe Prelude.Bool)
listKeysResponse_truncated :: (Maybe Bool -> f (Maybe Bool))
-> ListKeysResponse -> f ListKeysResponse
listKeysResponse_truncated = (ListKeysResponse -> Maybe Bool)
-> (ListKeysResponse -> Maybe Bool -> ListKeysResponse)
-> Lens' ListKeysResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeysResponse' {Maybe Bool
truncated :: Maybe Bool
$sel:truncated:ListKeysResponse' :: ListKeysResponse -> Maybe Bool
truncated} -> Maybe Bool
truncated) (\s :: ListKeysResponse
s@ListKeysResponse' {} Maybe Bool
a -> ListKeysResponse
s {$sel:truncated:ListKeysResponse' :: Maybe Bool
truncated = Maybe Bool
a} :: ListKeysResponse)

-- | A list of KMS keys.
listKeysResponse_keys :: Lens.Lens' ListKeysResponse (Prelude.Maybe [KeyListEntry])
listKeysResponse_keys :: (Maybe [KeyListEntry] -> f (Maybe [KeyListEntry]))
-> ListKeysResponse -> f ListKeysResponse
listKeysResponse_keys = (ListKeysResponse -> Maybe [KeyListEntry])
-> (ListKeysResponse -> Maybe [KeyListEntry] -> ListKeysResponse)
-> Lens
     ListKeysResponse
     ListKeysResponse
     (Maybe [KeyListEntry])
     (Maybe [KeyListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeysResponse' {Maybe [KeyListEntry]
keys :: Maybe [KeyListEntry]
$sel:keys:ListKeysResponse' :: ListKeysResponse -> Maybe [KeyListEntry]
keys} -> Maybe [KeyListEntry]
keys) (\s :: ListKeysResponse
s@ListKeysResponse' {} Maybe [KeyListEntry]
a -> ListKeysResponse
s {$sel:keys:ListKeysResponse' :: Maybe [KeyListEntry]
keys = Maybe [KeyListEntry]
a} :: ListKeysResponse) ((Maybe [KeyListEntry] -> f (Maybe [KeyListEntry]))
 -> ListKeysResponse -> f ListKeysResponse)
-> ((Maybe [KeyListEntry] -> f (Maybe [KeyListEntry]))
    -> Maybe [KeyListEntry] -> f (Maybe [KeyListEntry]))
-> (Maybe [KeyListEntry] -> f (Maybe [KeyListEntry]))
-> ListKeysResponse
-> f ListKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KeyListEntry] [KeyListEntry] [KeyListEntry] [KeyListEntry]
-> Iso
     (Maybe [KeyListEntry])
     (Maybe [KeyListEntry])
     (Maybe [KeyListEntry])
     (Maybe [KeyListEntry])
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 [KeyListEntry] [KeyListEntry] [KeyListEntry] [KeyListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
listKeysResponse_nextMarker :: Lens.Lens' ListKeysResponse (Prelude.Maybe Prelude.Text)
listKeysResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListKeysResponse -> f ListKeysResponse
listKeysResponse_nextMarker = (ListKeysResponse -> Maybe Text)
-> (ListKeysResponse -> Maybe Text -> ListKeysResponse)
-> Lens' ListKeysResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeysResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListKeysResponse' :: ListKeysResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListKeysResponse
s@ListKeysResponse' {} Maybe Text
a -> ListKeysResponse
s {$sel:nextMarker:ListKeysResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListKeysResponse)

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

instance Prelude.NFData ListKeysResponse