{-# 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.ListSSHPublicKeys
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about the SSH public keys associated with the
-- specified IAM user. If none exists, the operation returns an empty list.
--
-- The SSH public keys returned by this operation are used only for
-- authenticating the IAM user to an CodeCommit repository. For more
-- information about using SSH keys to authenticate to an CodeCommit
-- repository, see
-- <https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html Set up CodeCommit for SSH connections>
-- in the /CodeCommit User Guide/.
--
-- Although each user is limited to a small number of keys, you can still
-- paginate the results using the @MaxItems@ and @Marker@ parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListSSHPublicKeys
  ( -- * Creating a Request
    ListSSHPublicKeys (..),
    newListSSHPublicKeys,

    -- * Request Lenses
    listSSHPublicKeys_marker,
    listSSHPublicKeys_maxItems,
    listSSHPublicKeys_userName,

    -- * Destructuring the Response
    ListSSHPublicKeysResponse (..),
    newListSSHPublicKeysResponse,

    -- * Response Lenses
    listSSHPublicKeysResponse_isTruncated,
    listSSHPublicKeysResponse_marker,
    listSSHPublicKeysResponse_sSHPublicKeys,
    listSSHPublicKeysResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListSSHPublicKeys' smart constructor.
data ListSSHPublicKeys = ListSSHPublicKeys'
  { -- | 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.
    ListSSHPublicKeys -> 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.
    ListSSHPublicKeys -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the IAM user to list SSH public keys for. If none is
    -- specified, the @UserName@ field is determined implicitly based on the
    -- Amazon Web Services access key used to sign the request.
    --
    -- 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: _+=,.\@-
    ListSSHPublicKeys -> Maybe Text
userName :: Prelude.Maybe Prelude.Text
  }
  deriving (ListSSHPublicKeys -> ListSSHPublicKeys -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSSHPublicKeys -> ListSSHPublicKeys -> Bool
$c/= :: ListSSHPublicKeys -> ListSSHPublicKeys -> Bool
== :: ListSSHPublicKeys -> ListSSHPublicKeys -> Bool
$c== :: ListSSHPublicKeys -> ListSSHPublicKeys -> Bool
Prelude.Eq, ReadPrec [ListSSHPublicKeys]
ReadPrec ListSSHPublicKeys
Int -> ReadS ListSSHPublicKeys
ReadS [ListSSHPublicKeys]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSSHPublicKeys]
$creadListPrec :: ReadPrec [ListSSHPublicKeys]
readPrec :: ReadPrec ListSSHPublicKeys
$creadPrec :: ReadPrec ListSSHPublicKeys
readList :: ReadS [ListSSHPublicKeys]
$creadList :: ReadS [ListSSHPublicKeys]
readsPrec :: Int -> ReadS ListSSHPublicKeys
$creadsPrec :: Int -> ReadS ListSSHPublicKeys
Prelude.Read, Int -> ListSSHPublicKeys -> ShowS
[ListSSHPublicKeys] -> ShowS
ListSSHPublicKeys -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSSHPublicKeys] -> ShowS
$cshowList :: [ListSSHPublicKeys] -> ShowS
show :: ListSSHPublicKeys -> String
$cshow :: ListSSHPublicKeys -> String
showsPrec :: Int -> ListSSHPublicKeys -> ShowS
$cshowsPrec :: Int -> ListSSHPublicKeys -> ShowS
Prelude.Show, forall x. Rep ListSSHPublicKeys x -> ListSSHPublicKeys
forall x. ListSSHPublicKeys -> Rep ListSSHPublicKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSSHPublicKeys x -> ListSSHPublicKeys
$cfrom :: forall x. ListSSHPublicKeys -> Rep ListSSHPublicKeys x
Prelude.Generic)

-- |
-- Create a value of 'ListSSHPublicKeys' 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', 'listSSHPublicKeys_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', 'listSSHPublicKeys_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.
--
-- 'userName', 'listSSHPublicKeys_userName' - The name of the IAM user to list SSH public keys for. If none is
-- specified, the @UserName@ field is determined implicitly based on the
-- Amazon Web Services access key used to sign the request.
--
-- 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: _+=,.\@-
newListSSHPublicKeys ::
  ListSSHPublicKeys
newListSSHPublicKeys :: ListSSHPublicKeys
newListSSHPublicKeys =
  ListSSHPublicKeys'
    { $sel:marker:ListSSHPublicKeys' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListSSHPublicKeys' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:ListSSHPublicKeys' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing
    }

-- | 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.
listSSHPublicKeys_marker :: Lens.Lens' ListSSHPublicKeys (Prelude.Maybe Prelude.Text)
listSSHPublicKeys_marker :: Lens' ListSSHPublicKeys (Maybe Text)
listSSHPublicKeys_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSSHPublicKeys' {Maybe Text
marker :: Maybe Text
$sel:marker:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListSSHPublicKeys
s@ListSSHPublicKeys' {} Maybe Text
a -> ListSSHPublicKeys
s {$sel:marker:ListSSHPublicKeys' :: Maybe Text
marker = Maybe Text
a} :: ListSSHPublicKeys)

-- | 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.
listSSHPublicKeys_maxItems :: Lens.Lens' ListSSHPublicKeys (Prelude.Maybe Prelude.Natural)
listSSHPublicKeys_maxItems :: Lens' ListSSHPublicKeys (Maybe Natural)
listSSHPublicKeys_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSSHPublicKeys' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListSSHPublicKeys
s@ListSSHPublicKeys' {} Maybe Natural
a -> ListSSHPublicKeys
s {$sel:maxItems:ListSSHPublicKeys' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListSSHPublicKeys)

-- | The name of the IAM user to list SSH public keys for. If none is
-- specified, the @UserName@ field is determined implicitly based on the
-- Amazon Web Services access key used to sign the request.
--
-- 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: _+=,.\@-
listSSHPublicKeys_userName :: Lens.Lens' ListSSHPublicKeys (Prelude.Maybe Prelude.Text)
listSSHPublicKeys_userName :: Lens' ListSSHPublicKeys (Maybe Text)
listSSHPublicKeys_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSSHPublicKeys' {Maybe Text
userName :: Maybe Text
$sel:userName:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ListSSHPublicKeys
s@ListSSHPublicKeys' {} Maybe Text
a -> ListSSHPublicKeys
s {$sel:userName:ListSSHPublicKeys' :: Maybe Text
userName = Maybe Text
a} :: ListSSHPublicKeys)

instance Core.AWSPager ListSSHPublicKeys where
  page :: ListSSHPublicKeys
-> AWSResponse ListSSHPublicKeys -> Maybe ListSSHPublicKeys
page ListSSHPublicKeys
rq AWSResponse ListSSHPublicKeys
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSSHPublicKeys
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSSHPublicKeysResponse (Maybe Bool)
listSSHPublicKeysResponse_isTruncated
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListSSHPublicKeys
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSSHPublicKeysResponse (Maybe Text)
listSSHPublicKeysResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListSSHPublicKeys
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSSHPublicKeys (Maybe Text)
listSSHPublicKeys_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSSHPublicKeys
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSSHPublicKeysResponse (Maybe Text)
listSSHPublicKeysResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListSSHPublicKeys where
  type
    AWSResponse ListSSHPublicKeys =
      ListSSHPublicKeysResponse
  request :: (Service -> Service)
-> ListSSHPublicKeys -> Request ListSSHPublicKeys
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSSHPublicKeys
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSSHPublicKeys)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListSSHPublicKeysResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text
-> Maybe [SSHPublicKeyMetadata]
-> Int
-> ListSSHPublicKeysResponse
ListSSHPublicKeysResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SSHPublicKeys"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListSSHPublicKeys where
  hashWithSalt :: Int -> ListSSHPublicKeys -> Int
hashWithSalt Int
_salt ListSSHPublicKeys' {Maybe Natural
Maybe Text
userName :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:userName:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
$sel:maxItems:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Natural
$sel:marker:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName

instance Prelude.NFData ListSSHPublicKeys where
  rnf :: ListSSHPublicKeys -> ()
rnf ListSSHPublicKeys' {Maybe Natural
Maybe Text
userName :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:userName:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
$sel:maxItems:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Natural
$sel:marker:ListSSHPublicKeys' :: ListSSHPublicKeys -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName

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

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

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

-- | Contains the response to a successful ListSSHPublicKeys request.
--
-- /See:/ 'newListSSHPublicKeysResponse' smart constructor.
data ListSSHPublicKeysResponse = ListSSHPublicKeysResponse'
  { -- | 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.
    ListSSHPublicKeysResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListSSHPublicKeysResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A list of the SSH public keys assigned to IAM user.
    ListSSHPublicKeysResponse -> Maybe [SSHPublicKeyMetadata]
sSHPublicKeys :: Prelude.Maybe [SSHPublicKeyMetadata],
    -- | The response's http status code.
    ListSSHPublicKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSSHPublicKeysResponse -> ListSSHPublicKeysResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSSHPublicKeysResponse -> ListSSHPublicKeysResponse -> Bool
$c/= :: ListSSHPublicKeysResponse -> ListSSHPublicKeysResponse -> Bool
== :: ListSSHPublicKeysResponse -> ListSSHPublicKeysResponse -> Bool
$c== :: ListSSHPublicKeysResponse -> ListSSHPublicKeysResponse -> Bool
Prelude.Eq, ReadPrec [ListSSHPublicKeysResponse]
ReadPrec ListSSHPublicKeysResponse
Int -> ReadS ListSSHPublicKeysResponse
ReadS [ListSSHPublicKeysResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSSHPublicKeysResponse]
$creadListPrec :: ReadPrec [ListSSHPublicKeysResponse]
readPrec :: ReadPrec ListSSHPublicKeysResponse
$creadPrec :: ReadPrec ListSSHPublicKeysResponse
readList :: ReadS [ListSSHPublicKeysResponse]
$creadList :: ReadS [ListSSHPublicKeysResponse]
readsPrec :: Int -> ReadS ListSSHPublicKeysResponse
$creadsPrec :: Int -> ReadS ListSSHPublicKeysResponse
Prelude.Read, Int -> ListSSHPublicKeysResponse -> ShowS
[ListSSHPublicKeysResponse] -> ShowS
ListSSHPublicKeysResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSSHPublicKeysResponse] -> ShowS
$cshowList :: [ListSSHPublicKeysResponse] -> ShowS
show :: ListSSHPublicKeysResponse -> String
$cshow :: ListSSHPublicKeysResponse -> String
showsPrec :: Int -> ListSSHPublicKeysResponse -> ShowS
$cshowsPrec :: Int -> ListSSHPublicKeysResponse -> ShowS
Prelude.Show, forall x.
Rep ListSSHPublicKeysResponse x -> ListSSHPublicKeysResponse
forall x.
ListSSHPublicKeysResponse -> Rep ListSSHPublicKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSSHPublicKeysResponse x -> ListSSHPublicKeysResponse
$cfrom :: forall x.
ListSSHPublicKeysResponse -> Rep ListSSHPublicKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSSHPublicKeysResponse' 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:
--
-- 'isTruncated', 'listSSHPublicKeysResponse_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.
--
-- 'marker', 'listSSHPublicKeysResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'sSHPublicKeys', 'listSSHPublicKeysResponse_sSHPublicKeys' - A list of the SSH public keys assigned to IAM user.
--
-- 'httpStatus', 'listSSHPublicKeysResponse_httpStatus' - The response's http status code.
newListSSHPublicKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSSHPublicKeysResponse
newListSSHPublicKeysResponse :: Int -> ListSSHPublicKeysResponse
newListSSHPublicKeysResponse Int
pHttpStatus_ =
  ListSSHPublicKeysResponse'
    { $sel:isTruncated:ListSSHPublicKeysResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListSSHPublicKeysResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:sSHPublicKeys:ListSSHPublicKeysResponse' :: Maybe [SSHPublicKeyMetadata]
sSHPublicKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSSHPublicKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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.
listSSHPublicKeysResponse_isTruncated :: Lens.Lens' ListSSHPublicKeysResponse (Prelude.Maybe Prelude.Bool)
listSSHPublicKeysResponse_isTruncated :: Lens' ListSSHPublicKeysResponse (Maybe Bool)
listSSHPublicKeysResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSSHPublicKeysResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListSSHPublicKeysResponse
s@ListSSHPublicKeysResponse' {} Maybe Bool
a -> ListSSHPublicKeysResponse
s {$sel:isTruncated:ListSSHPublicKeysResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListSSHPublicKeysResponse)

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

-- | A list of the SSH public keys assigned to IAM user.
listSSHPublicKeysResponse_sSHPublicKeys :: Lens.Lens' ListSSHPublicKeysResponse (Prelude.Maybe [SSHPublicKeyMetadata])
listSSHPublicKeysResponse_sSHPublicKeys :: Lens' ListSSHPublicKeysResponse (Maybe [SSHPublicKeyMetadata])
listSSHPublicKeysResponse_sSHPublicKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSSHPublicKeysResponse' {Maybe [SSHPublicKeyMetadata]
sSHPublicKeys :: Maybe [SSHPublicKeyMetadata]
$sel:sSHPublicKeys:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Maybe [SSHPublicKeyMetadata]
sSHPublicKeys} -> Maybe [SSHPublicKeyMetadata]
sSHPublicKeys) (\s :: ListSSHPublicKeysResponse
s@ListSSHPublicKeysResponse' {} Maybe [SSHPublicKeyMetadata]
a -> ListSSHPublicKeysResponse
s {$sel:sSHPublicKeys:ListSSHPublicKeysResponse' :: Maybe [SSHPublicKeyMetadata]
sSHPublicKeys = Maybe [SSHPublicKeyMetadata]
a} :: ListSSHPublicKeysResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSSHPublicKeysResponse where
  rnf :: ListSSHPublicKeysResponse -> ()
rnf ListSSHPublicKeysResponse' {Int
Maybe Bool
Maybe [SSHPublicKeyMetadata]
Maybe Text
httpStatus :: Int
sSHPublicKeys :: Maybe [SSHPublicKeyMetadata]
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:httpStatus:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Int
$sel:sSHPublicKeys:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Maybe [SSHPublicKeyMetadata]
$sel:marker:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Maybe Text
$sel:isTruncated:ListSSHPublicKeysResponse' :: ListSSHPublicKeysResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SSHPublicKeyMetadata]
sSHPublicKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus