{-# 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.IAM.ListAccessKeys
-- 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)
--
-- Returns information about the access key IDs associated with the
-- specified IAM user. If there is none, the operation returns an empty
-- list.
--
-- Although each user is limited to a small number of keys, you can still
-- paginate the results using the @MaxItems@ and @Marker@ parameters.
--
-- If the @UserName@ field is not specified, the user name is determined
-- implicitly based on the Amazon Web Services access key ID used to sign
-- the request. This operation works for access keys under the Amazon Web
-- Services account. Consequently, you can use this operation to manage
-- Amazon Web Services account root user credentials even if the Amazon Web
-- Services account has no associated users.
--
-- To ensure the security of your Amazon Web Services account, the secret
-- access key is accessible only during key and user creation.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListAccessKeys
  ( -- * Creating a Request
    ListAccessKeys (..),
    newListAccessKeys,

    -- * Request Lenses
    listAccessKeys_userName,
    listAccessKeys_marker,
    listAccessKeys_maxItems,

    -- * Destructuring the Response
    ListAccessKeysResponse (..),
    newListAccessKeysResponse,

    -- * Response Lenses
    listAccessKeysResponse_marker,
    listAccessKeysResponse_isTruncated,
    listAccessKeysResponse_httpStatus,
    listAccessKeysResponse_accessKeyMetadata,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.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:/ 'newListAccessKeys' smart constructor.
data ListAccessKeys = ListAccessKeys'
  { -- | The name of the user.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    ListAccessKeys -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    ListAccessKeys -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    ListAccessKeys -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListAccessKeys -> ListAccessKeys -> Bool
(ListAccessKeys -> ListAccessKeys -> Bool)
-> (ListAccessKeys -> ListAccessKeys -> Bool) -> Eq ListAccessKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccessKeys -> ListAccessKeys -> Bool
$c/= :: ListAccessKeys -> ListAccessKeys -> Bool
== :: ListAccessKeys -> ListAccessKeys -> Bool
$c== :: ListAccessKeys -> ListAccessKeys -> Bool
Prelude.Eq, ReadPrec [ListAccessKeys]
ReadPrec ListAccessKeys
Int -> ReadS ListAccessKeys
ReadS [ListAccessKeys]
(Int -> ReadS ListAccessKeys)
-> ReadS [ListAccessKeys]
-> ReadPrec ListAccessKeys
-> ReadPrec [ListAccessKeys]
-> Read ListAccessKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccessKeys]
$creadListPrec :: ReadPrec [ListAccessKeys]
readPrec :: ReadPrec ListAccessKeys
$creadPrec :: ReadPrec ListAccessKeys
readList :: ReadS [ListAccessKeys]
$creadList :: ReadS [ListAccessKeys]
readsPrec :: Int -> ReadS ListAccessKeys
$creadsPrec :: Int -> ReadS ListAccessKeys
Prelude.Read, Int -> ListAccessKeys -> ShowS
[ListAccessKeys] -> ShowS
ListAccessKeys -> String
(Int -> ListAccessKeys -> ShowS)
-> (ListAccessKeys -> String)
-> ([ListAccessKeys] -> ShowS)
-> Show ListAccessKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccessKeys] -> ShowS
$cshowList :: [ListAccessKeys] -> ShowS
show :: ListAccessKeys -> String
$cshow :: ListAccessKeys -> String
showsPrec :: Int -> ListAccessKeys -> ShowS
$cshowsPrec :: Int -> ListAccessKeys -> ShowS
Prelude.Show, (forall x. ListAccessKeys -> Rep ListAccessKeys x)
-> (forall x. Rep ListAccessKeys x -> ListAccessKeys)
-> Generic ListAccessKeys
forall x. Rep ListAccessKeys x -> ListAccessKeys
forall x. ListAccessKeys -> Rep ListAccessKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAccessKeys x -> ListAccessKeys
$cfrom :: forall x. ListAccessKeys -> Rep ListAccessKeys x
Prelude.Generic)

-- |
-- Create a value of 'ListAccessKeys' 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:
--
-- 'userName', 'listAccessKeys_userName' - The name of the user.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
--
-- 'marker', 'listAccessKeys_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'listAccessKeys_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
newListAccessKeys ::
  ListAccessKeys
newListAccessKeys :: ListAccessKeys
newListAccessKeys =
  ListAccessKeys' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListAccessKeys
ListAccessKeys'
    { $sel:userName:ListAccessKeys' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListAccessKeys' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListAccessKeys' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the user.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
listAccessKeys_userName :: Lens.Lens' ListAccessKeys (Prelude.Maybe Prelude.Text)
listAccessKeys_userName :: (Maybe Text -> f (Maybe Text))
-> ListAccessKeys -> f ListAccessKeys
listAccessKeys_userName = (ListAccessKeys -> Maybe Text)
-> (ListAccessKeys -> Maybe Text -> ListAccessKeys)
-> Lens ListAccessKeys ListAccessKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessKeys' {Maybe Text
userName :: Maybe Text
$sel:userName:ListAccessKeys' :: ListAccessKeys -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ListAccessKeys
s@ListAccessKeys' {} Maybe Text
a -> ListAccessKeys
s {$sel:userName:ListAccessKeys' :: Maybe Text
userName = Maybe Text
a} :: ListAccessKeys)

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
listAccessKeys_marker :: Lens.Lens' ListAccessKeys (Prelude.Maybe Prelude.Text)
listAccessKeys_marker :: (Maybe Text -> f (Maybe Text))
-> ListAccessKeys -> f ListAccessKeys
listAccessKeys_marker = (ListAccessKeys -> Maybe Text)
-> (ListAccessKeys -> Maybe Text -> ListAccessKeys)
-> Lens ListAccessKeys ListAccessKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessKeys' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAccessKeys' :: ListAccessKeys -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAccessKeys
s@ListAccessKeys' {} Maybe Text
a -> ListAccessKeys
s {$sel:marker:ListAccessKeys' :: Maybe Text
marker = Maybe Text
a} :: ListAccessKeys)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
listAccessKeys_maxItems :: Lens.Lens' ListAccessKeys (Prelude.Maybe Prelude.Natural)
listAccessKeys_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListAccessKeys -> f ListAccessKeys
listAccessKeys_maxItems = (ListAccessKeys -> Maybe Natural)
-> (ListAccessKeys -> Maybe Natural -> ListAccessKeys)
-> Lens
     ListAccessKeys ListAccessKeys (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessKeys' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListAccessKeys' :: ListAccessKeys -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListAccessKeys
s@ListAccessKeys' {} Maybe Natural
a -> ListAccessKeys
s {$sel:maxItems:ListAccessKeys' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListAccessKeys)

instance Core.AWSPager ListAccessKeys where
  page :: ListAccessKeys
-> AWSResponse ListAccessKeys -> Maybe ListAccessKeys
page ListAccessKeys
rq AWSResponse ListAccessKeys
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAccessKeys
ListAccessKeysResponse
rs
            ListAccessKeysResponse
-> Getting (First Bool) ListAccessKeysResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListAccessKeysResponse
-> Const (First Bool) ListAccessKeysResponse
Lens' ListAccessKeysResponse (Maybe Bool)
listAccessKeysResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListAccessKeysResponse
 -> Const (First Bool) ListAccessKeysResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListAccessKeysResponse 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 ListAccessKeys
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListAccessKeys
ListAccessKeysResponse
rs
            ListAccessKeysResponse
-> Getting (First Text) ListAccessKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccessKeysResponse
-> Const (First Text) ListAccessKeysResponse
Lens' ListAccessKeysResponse (Maybe Text)
listAccessKeysResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccessKeysResponse
 -> Const (First Text) ListAccessKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAccessKeysResponse 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 ListAccessKeys
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAccessKeys -> Maybe ListAccessKeys
forall a. a -> Maybe a
Prelude.Just (ListAccessKeys -> Maybe ListAccessKeys)
-> ListAccessKeys -> Maybe ListAccessKeys
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAccessKeys
rq
          ListAccessKeys
-> (ListAccessKeys -> ListAccessKeys) -> ListAccessKeys
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAccessKeys -> Identity ListAccessKeys
Lens ListAccessKeys ListAccessKeys (Maybe Text) (Maybe Text)
listAccessKeys_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAccessKeys -> Identity ListAccessKeys)
-> Maybe Text -> ListAccessKeys -> ListAccessKeys
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAccessKeys
ListAccessKeysResponse
rs
          ListAccessKeysResponse
-> Getting (First Text) ListAccessKeysResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccessKeysResponse
-> Const (First Text) ListAccessKeysResponse
Lens' ListAccessKeysResponse (Maybe Text)
listAccessKeysResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccessKeysResponse
 -> Const (First Text) ListAccessKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAccessKeysResponse 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 ListAccessKeys where
  type
    AWSResponse ListAccessKeys =
      ListAccessKeysResponse
  request :: ListAccessKeys -> Request ListAccessKeys
request = Service -> ListAccessKeys -> Request ListAccessKeys
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAccessKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAccessKeys)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListAccessKeys))
-> Logger
-> Service
-> Proxy ListAccessKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAccessKeys)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListAccessKeysResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool
-> Int
-> [AccessKeyMetadata]
-> ListAccessKeysResponse
ListAccessKeysResponse'
            (Maybe Text
 -> Maybe Bool
 -> Int
 -> [AccessKeyMetadata]
 -> ListAccessKeysResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Int -> [AccessKeyMetadata] -> ListAccessKeysResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either
  String
  (Maybe Bool
   -> Int -> [AccessKeyMetadata] -> ListAccessKeysResponse)
-> Either String (Maybe Bool)
-> Either
     String (Int -> [AccessKeyMetadata] -> ListAccessKeysResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsTruncated")
            Either
  String (Int -> [AccessKeyMetadata] -> ListAccessKeysResponse)
-> Either String Int
-> Either String ([AccessKeyMetadata] -> ListAccessKeysResponse)
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))
            Either String ([AccessKeyMetadata] -> ListAccessKeysResponse)
-> Either String [AccessKeyMetadata]
-> Either String ListAccessKeysResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccessKeyMetadata"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [AccessKeyMetadata])
-> Either String [AccessKeyMetadata]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [AccessKeyMetadata]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListAccessKeys

instance Prelude.NFData ListAccessKeys

instance Core.ToHeaders ListAccessKeys where
  toHeaders :: ListAccessKeys -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAccessKeys -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListAccessKeys where
  toQuery :: ListAccessKeys -> QueryString
toQuery ListAccessKeys' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
userName :: Maybe Text
$sel:maxItems:ListAccessKeys' :: ListAccessKeys -> Maybe Natural
$sel:marker:ListAccessKeys' :: ListAccessKeys -> Maybe Text
$sel:userName:ListAccessKeys' :: ListAccessKeys -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListAccessKeys" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems
      ]

-- | Contains the response to a successful ListAccessKeys request.
--
-- /See:/ 'newListAccessKeysResponse' smart constructor.
data ListAccessKeysResponse = ListAccessKeysResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListAccessKeysResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    ListAccessKeysResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListAccessKeysResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of objects containing metadata about the access keys.
    ListAccessKeysResponse -> [AccessKeyMetadata]
accessKeyMetadata :: [AccessKeyMetadata]
  }
  deriving (ListAccessKeysResponse -> ListAccessKeysResponse -> Bool
(ListAccessKeysResponse -> ListAccessKeysResponse -> Bool)
-> (ListAccessKeysResponse -> ListAccessKeysResponse -> Bool)
-> Eq ListAccessKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccessKeysResponse -> ListAccessKeysResponse -> Bool
$c/= :: ListAccessKeysResponse -> ListAccessKeysResponse -> Bool
== :: ListAccessKeysResponse -> ListAccessKeysResponse -> Bool
$c== :: ListAccessKeysResponse -> ListAccessKeysResponse -> Bool
Prelude.Eq, ReadPrec [ListAccessKeysResponse]
ReadPrec ListAccessKeysResponse
Int -> ReadS ListAccessKeysResponse
ReadS [ListAccessKeysResponse]
(Int -> ReadS ListAccessKeysResponse)
-> ReadS [ListAccessKeysResponse]
-> ReadPrec ListAccessKeysResponse
-> ReadPrec [ListAccessKeysResponse]
-> Read ListAccessKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccessKeysResponse]
$creadListPrec :: ReadPrec [ListAccessKeysResponse]
readPrec :: ReadPrec ListAccessKeysResponse
$creadPrec :: ReadPrec ListAccessKeysResponse
readList :: ReadS [ListAccessKeysResponse]
$creadList :: ReadS [ListAccessKeysResponse]
readsPrec :: Int -> ReadS ListAccessKeysResponse
$creadsPrec :: Int -> ReadS ListAccessKeysResponse
Prelude.Read, Int -> ListAccessKeysResponse -> ShowS
[ListAccessKeysResponse] -> ShowS
ListAccessKeysResponse -> String
(Int -> ListAccessKeysResponse -> ShowS)
-> (ListAccessKeysResponse -> String)
-> ([ListAccessKeysResponse] -> ShowS)
-> Show ListAccessKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccessKeysResponse] -> ShowS
$cshowList :: [ListAccessKeysResponse] -> ShowS
show :: ListAccessKeysResponse -> String
$cshow :: ListAccessKeysResponse -> String
showsPrec :: Int -> ListAccessKeysResponse -> ShowS
$cshowsPrec :: Int -> ListAccessKeysResponse -> ShowS
Prelude.Show, (forall x. ListAccessKeysResponse -> Rep ListAccessKeysResponse x)
-> (forall x.
    Rep ListAccessKeysResponse x -> ListAccessKeysResponse)
-> Generic ListAccessKeysResponse
forall x. Rep ListAccessKeysResponse x -> ListAccessKeysResponse
forall x. ListAccessKeysResponse -> Rep ListAccessKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAccessKeysResponse x -> ListAccessKeysResponse
$cfrom :: forall x. ListAccessKeysResponse -> Rep ListAccessKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAccessKeysResponse' 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', 'listAccessKeysResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'isTruncated', 'listAccessKeysResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'httpStatus', 'listAccessKeysResponse_httpStatus' - The response's http status code.
--
-- 'accessKeyMetadata', 'listAccessKeysResponse_accessKeyMetadata' - A list of objects containing metadata about the access keys.
newListAccessKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAccessKeysResponse
newListAccessKeysResponse :: Int -> ListAccessKeysResponse
newListAccessKeysResponse Int
pHttpStatus_ =
  ListAccessKeysResponse' :: Maybe Text
-> Maybe Bool
-> Int
-> [AccessKeyMetadata]
-> ListAccessKeysResponse
ListAccessKeysResponse'
    { $sel:marker:ListAccessKeysResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListAccessKeysResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAccessKeysResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:accessKeyMetadata:ListAccessKeysResponse' :: [AccessKeyMetadata]
accessKeyMetadata = [AccessKeyMetadata]
forall a. Monoid a => a
Prelude.mempty
    }

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

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
listAccessKeysResponse_isTruncated :: Lens.Lens' ListAccessKeysResponse (Prelude.Maybe Prelude.Bool)
listAccessKeysResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListAccessKeysResponse -> f ListAccessKeysResponse
listAccessKeysResponse_isTruncated = (ListAccessKeysResponse -> Maybe Bool)
-> (ListAccessKeysResponse -> Maybe Bool -> ListAccessKeysResponse)
-> Lens' ListAccessKeysResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessKeysResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListAccessKeysResponse' :: ListAccessKeysResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListAccessKeysResponse
s@ListAccessKeysResponse' {} Maybe Bool
a -> ListAccessKeysResponse
s {$sel:isTruncated:ListAccessKeysResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListAccessKeysResponse)

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

-- | A list of objects containing metadata about the access keys.
listAccessKeysResponse_accessKeyMetadata :: Lens.Lens' ListAccessKeysResponse [AccessKeyMetadata]
listAccessKeysResponse_accessKeyMetadata :: ([AccessKeyMetadata] -> f [AccessKeyMetadata])
-> ListAccessKeysResponse -> f ListAccessKeysResponse
listAccessKeysResponse_accessKeyMetadata = (ListAccessKeysResponse -> [AccessKeyMetadata])
-> (ListAccessKeysResponse
    -> [AccessKeyMetadata] -> ListAccessKeysResponse)
-> Lens
     ListAccessKeysResponse
     ListAccessKeysResponse
     [AccessKeyMetadata]
     [AccessKeyMetadata]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessKeysResponse' {[AccessKeyMetadata]
accessKeyMetadata :: [AccessKeyMetadata]
$sel:accessKeyMetadata:ListAccessKeysResponse' :: ListAccessKeysResponse -> [AccessKeyMetadata]
accessKeyMetadata} -> [AccessKeyMetadata]
accessKeyMetadata) (\s :: ListAccessKeysResponse
s@ListAccessKeysResponse' {} [AccessKeyMetadata]
a -> ListAccessKeysResponse
s {$sel:accessKeyMetadata:ListAccessKeysResponse' :: [AccessKeyMetadata]
accessKeyMetadata = [AccessKeyMetadata]
a} :: ListAccessKeysResponse) (([AccessKeyMetadata] -> f [AccessKeyMetadata])
 -> ListAccessKeysResponse -> f ListAccessKeysResponse)
-> (([AccessKeyMetadata] -> f [AccessKeyMetadata])
    -> [AccessKeyMetadata] -> f [AccessKeyMetadata])
-> ([AccessKeyMetadata] -> f [AccessKeyMetadata])
-> ListAccessKeysResponse
-> f ListAccessKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AccessKeyMetadata] -> f [AccessKeyMetadata])
-> [AccessKeyMetadata] -> f [AccessKeyMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAccessKeysResponse