{-# 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.ListSigningCertificates
-- 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 signing certificates associated with the
-- specified IAM user. If none exists, the operation returns an empty list.
--
-- Although each user is limited to a small number of signing certificates,
-- 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 for this operation. 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.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListSigningCertificates
  ( -- * Creating a Request
    ListSigningCertificates (..),
    newListSigningCertificates,

    -- * Request Lenses
    listSigningCertificates_userName,
    listSigningCertificates_marker,
    listSigningCertificates_maxItems,

    -- * Destructuring the Response
    ListSigningCertificatesResponse (..),
    newListSigningCertificatesResponse,

    -- * Response Lenses
    listSigningCertificatesResponse_marker,
    listSigningCertificatesResponse_isTruncated,
    listSigningCertificatesResponse_httpStatus,
    listSigningCertificatesResponse_certificates,
  )
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:/ 'newListSigningCertificates' smart constructor.
data ListSigningCertificates = ListSigningCertificates'
  { -- | The name of the IAM user whose signing certificates you want to examine.
    --
    -- 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: _+=,.\@-
    ListSigningCertificates -> 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.
    ListSigningCertificates -> 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.
    ListSigningCertificates -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSigningCertificates -> ListSigningCertificates -> Bool
(ListSigningCertificates -> ListSigningCertificates -> Bool)
-> (ListSigningCertificates -> ListSigningCertificates -> Bool)
-> Eq ListSigningCertificates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningCertificates -> ListSigningCertificates -> Bool
$c/= :: ListSigningCertificates -> ListSigningCertificates -> Bool
== :: ListSigningCertificates -> ListSigningCertificates -> Bool
$c== :: ListSigningCertificates -> ListSigningCertificates -> Bool
Prelude.Eq, ReadPrec [ListSigningCertificates]
ReadPrec ListSigningCertificates
Int -> ReadS ListSigningCertificates
ReadS [ListSigningCertificates]
(Int -> ReadS ListSigningCertificates)
-> ReadS [ListSigningCertificates]
-> ReadPrec ListSigningCertificates
-> ReadPrec [ListSigningCertificates]
-> Read ListSigningCertificates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningCertificates]
$creadListPrec :: ReadPrec [ListSigningCertificates]
readPrec :: ReadPrec ListSigningCertificates
$creadPrec :: ReadPrec ListSigningCertificates
readList :: ReadS [ListSigningCertificates]
$creadList :: ReadS [ListSigningCertificates]
readsPrec :: Int -> ReadS ListSigningCertificates
$creadsPrec :: Int -> ReadS ListSigningCertificates
Prelude.Read, Int -> ListSigningCertificates -> ShowS
[ListSigningCertificates] -> ShowS
ListSigningCertificates -> String
(Int -> ListSigningCertificates -> ShowS)
-> (ListSigningCertificates -> String)
-> ([ListSigningCertificates] -> ShowS)
-> Show ListSigningCertificates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningCertificates] -> ShowS
$cshowList :: [ListSigningCertificates] -> ShowS
show :: ListSigningCertificates -> String
$cshow :: ListSigningCertificates -> String
showsPrec :: Int -> ListSigningCertificates -> ShowS
$cshowsPrec :: Int -> ListSigningCertificates -> ShowS
Prelude.Show, (forall x.
 ListSigningCertificates -> Rep ListSigningCertificates x)
-> (forall x.
    Rep ListSigningCertificates x -> ListSigningCertificates)
-> Generic ListSigningCertificates
forall x. Rep ListSigningCertificates x -> ListSigningCertificates
forall x. ListSigningCertificates -> Rep ListSigningCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSigningCertificates x -> ListSigningCertificates
$cfrom :: forall x. ListSigningCertificates -> Rep ListSigningCertificates x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningCertificates' 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', 'listSigningCertificates_userName' - The name of the IAM user whose signing certificates you want to examine.
--
-- 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', 'listSigningCertificates_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', 'listSigningCertificates_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.
newListSigningCertificates ::
  ListSigningCertificates
newListSigningCertificates :: ListSigningCertificates
newListSigningCertificates =
  ListSigningCertificates' :: Maybe Text
-> Maybe Text -> Maybe Natural -> ListSigningCertificates
ListSigningCertificates'
    { $sel:userName:ListSigningCertificates' :: Maybe Text
userName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListSigningCertificates' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListSigningCertificates' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the IAM user whose signing certificates you want to examine.
--
-- 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: _+=,.\@-
listSigningCertificates_userName :: Lens.Lens' ListSigningCertificates (Prelude.Maybe Prelude.Text)
listSigningCertificates_userName :: (Maybe Text -> f (Maybe Text))
-> ListSigningCertificates -> f ListSigningCertificates
listSigningCertificates_userName = (ListSigningCertificates -> Maybe Text)
-> (ListSigningCertificates
    -> Maybe Text -> ListSigningCertificates)
-> Lens
     ListSigningCertificates
     ListSigningCertificates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningCertificates' {Maybe Text
userName :: Maybe Text
$sel:userName:ListSigningCertificates' :: ListSigningCertificates -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ListSigningCertificates
s@ListSigningCertificates' {} Maybe Text
a -> ListSigningCertificates
s {$sel:userName:ListSigningCertificates' :: Maybe Text
userName = Maybe Text
a} :: ListSigningCertificates)

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

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

instance Core.AWSPager ListSigningCertificates where
  page :: ListSigningCertificates
-> AWSResponse ListSigningCertificates
-> Maybe ListSigningCertificates
page ListSigningCertificates
rq AWSResponse ListSigningCertificates
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSigningCertificates
ListSigningCertificatesResponse
rs
            ListSigningCertificatesResponse
-> Getting (First Bool) ListSigningCertificatesResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListSigningCertificatesResponse
-> Const (First Bool) ListSigningCertificatesResponse
Lens' ListSigningCertificatesResponse (Maybe Bool)
listSigningCertificatesResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListSigningCertificatesResponse
 -> Const (First Bool) ListSigningCertificatesResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListSigningCertificatesResponse 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 ListSigningCertificates
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListSigningCertificates
ListSigningCertificatesResponse
rs
            ListSigningCertificatesResponse
-> Getting (First Text) ListSigningCertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSigningCertificatesResponse
-> Const (First Text) ListSigningCertificatesResponse
Lens' ListSigningCertificatesResponse (Maybe Text)
listSigningCertificatesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSigningCertificatesResponse
 -> Const (First Text) ListSigningCertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSigningCertificatesResponse 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 ListSigningCertificates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListSigningCertificates -> Maybe ListSigningCertificates
forall a. a -> Maybe a
Prelude.Just (ListSigningCertificates -> Maybe ListSigningCertificates)
-> ListSigningCertificates -> Maybe ListSigningCertificates
forall a b. (a -> b) -> a -> b
Prelude.$
        ListSigningCertificates
rq
          ListSigningCertificates
-> (ListSigningCertificates -> ListSigningCertificates)
-> ListSigningCertificates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListSigningCertificates -> Identity ListSigningCertificates
Lens
  ListSigningCertificates
  ListSigningCertificates
  (Maybe Text)
  (Maybe Text)
listSigningCertificates_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListSigningCertificates -> Identity ListSigningCertificates)
-> Maybe Text -> ListSigningCertificates -> ListSigningCertificates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSigningCertificates
ListSigningCertificatesResponse
rs
          ListSigningCertificatesResponse
-> Getting (First Text) ListSigningCertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSigningCertificatesResponse
-> Const (First Text) ListSigningCertificatesResponse
Lens' ListSigningCertificatesResponse (Maybe Text)
listSigningCertificatesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSigningCertificatesResponse
 -> Const (First Text) ListSigningCertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSigningCertificatesResponse 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 ListSigningCertificates where
  type
    AWSResponse ListSigningCertificates =
      ListSigningCertificatesResponse
  request :: ListSigningCertificates -> Request ListSigningCertificates
request = Service
-> ListSigningCertificates -> Request ListSigningCertificates
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListSigningCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSigningCertificates)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListSigningCertificates))
-> Logger
-> Service
-> Proxy ListSigningCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSigningCertificates)))
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
"ListSigningCertificatesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool
-> Int
-> [SigningCertificate]
-> ListSigningCertificatesResponse
ListSigningCertificatesResponse'
            (Maybe Text
 -> Maybe Bool
 -> Int
 -> [SigningCertificate]
 -> ListSigningCertificatesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Int -> [SigningCertificate] -> ListSigningCertificatesResponse)
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 -> [SigningCertificate] -> ListSigningCertificatesResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Int -> [SigningCertificate] -> ListSigningCertificatesResponse)
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 -> [SigningCertificate] -> ListSigningCertificatesResponse)
-> Either String Int
-> Either
     String ([SigningCertificate] -> ListSigningCertificatesResponse)
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 ([SigningCertificate] -> ListSigningCertificatesResponse)
-> Either String [SigningCertificate]
-> Either String ListSigningCertificatesResponse
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
"Certificates" 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 [SigningCertificate])
-> Either String [SigningCertificate]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [SigningCertificate]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListSigningCertificates

instance Prelude.NFData ListSigningCertificates

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

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

instance Core.ToQuery ListSigningCertificates where
  toQuery :: ListSigningCertificates -> QueryString
toQuery ListSigningCertificates' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
userName :: Maybe Text
$sel:maxItems:ListSigningCertificates' :: ListSigningCertificates -> Maybe Natural
$sel:marker:ListSigningCertificates' :: ListSigningCertificates -> Maybe Text
$sel:userName:ListSigningCertificates' :: ListSigningCertificates -> 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
"ListSigningCertificates" :: 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 ListSigningCertificates request.
--
-- /See:/ 'newListSigningCertificatesResponse' smart constructor.
data ListSigningCertificatesResponse = ListSigningCertificatesResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListSigningCertificatesResponse -> 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.
    ListSigningCertificatesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListSigningCertificatesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of the user\'s signing certificate information.
    ListSigningCertificatesResponse -> [SigningCertificate]
certificates :: [SigningCertificate]
  }
  deriving (ListSigningCertificatesResponse
-> ListSigningCertificatesResponse -> Bool
(ListSigningCertificatesResponse
 -> ListSigningCertificatesResponse -> Bool)
-> (ListSigningCertificatesResponse
    -> ListSigningCertificatesResponse -> Bool)
-> Eq ListSigningCertificatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningCertificatesResponse
-> ListSigningCertificatesResponse -> Bool
$c/= :: ListSigningCertificatesResponse
-> ListSigningCertificatesResponse -> Bool
== :: ListSigningCertificatesResponse
-> ListSigningCertificatesResponse -> Bool
$c== :: ListSigningCertificatesResponse
-> ListSigningCertificatesResponse -> Bool
Prelude.Eq, ReadPrec [ListSigningCertificatesResponse]
ReadPrec ListSigningCertificatesResponse
Int -> ReadS ListSigningCertificatesResponse
ReadS [ListSigningCertificatesResponse]
(Int -> ReadS ListSigningCertificatesResponse)
-> ReadS [ListSigningCertificatesResponse]
-> ReadPrec ListSigningCertificatesResponse
-> ReadPrec [ListSigningCertificatesResponse]
-> Read ListSigningCertificatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningCertificatesResponse]
$creadListPrec :: ReadPrec [ListSigningCertificatesResponse]
readPrec :: ReadPrec ListSigningCertificatesResponse
$creadPrec :: ReadPrec ListSigningCertificatesResponse
readList :: ReadS [ListSigningCertificatesResponse]
$creadList :: ReadS [ListSigningCertificatesResponse]
readsPrec :: Int -> ReadS ListSigningCertificatesResponse
$creadsPrec :: Int -> ReadS ListSigningCertificatesResponse
Prelude.Read, Int -> ListSigningCertificatesResponse -> ShowS
[ListSigningCertificatesResponse] -> ShowS
ListSigningCertificatesResponse -> String
(Int -> ListSigningCertificatesResponse -> ShowS)
-> (ListSigningCertificatesResponse -> String)
-> ([ListSigningCertificatesResponse] -> ShowS)
-> Show ListSigningCertificatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningCertificatesResponse] -> ShowS
$cshowList :: [ListSigningCertificatesResponse] -> ShowS
show :: ListSigningCertificatesResponse -> String
$cshow :: ListSigningCertificatesResponse -> String
showsPrec :: Int -> ListSigningCertificatesResponse -> ShowS
$cshowsPrec :: Int -> ListSigningCertificatesResponse -> ShowS
Prelude.Show, (forall x.
 ListSigningCertificatesResponse
 -> Rep ListSigningCertificatesResponse x)
-> (forall x.
    Rep ListSigningCertificatesResponse x
    -> ListSigningCertificatesResponse)
-> Generic ListSigningCertificatesResponse
forall x.
Rep ListSigningCertificatesResponse x
-> ListSigningCertificatesResponse
forall x.
ListSigningCertificatesResponse
-> Rep ListSigningCertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSigningCertificatesResponse x
-> ListSigningCertificatesResponse
$cfrom :: forall x.
ListSigningCertificatesResponse
-> Rep ListSigningCertificatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningCertificatesResponse' 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', 'listSigningCertificatesResponse_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', 'listSigningCertificatesResponse_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', 'listSigningCertificatesResponse_httpStatus' - The response's http status code.
--
-- 'certificates', 'listSigningCertificatesResponse_certificates' - A list of the user\'s signing certificate information.
newListSigningCertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSigningCertificatesResponse
newListSigningCertificatesResponse :: Int -> ListSigningCertificatesResponse
newListSigningCertificatesResponse Int
pHttpStatus_ =
  ListSigningCertificatesResponse' :: Maybe Text
-> Maybe Bool
-> Int
-> [SigningCertificate]
-> ListSigningCertificatesResponse
ListSigningCertificatesResponse'
    { $sel:marker:ListSigningCertificatesResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListSigningCertificatesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSigningCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:certificates:ListSigningCertificatesResponse' :: [SigningCertificate]
certificates = [SigningCertificate]
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.
listSigningCertificatesResponse_marker :: Lens.Lens' ListSigningCertificatesResponse (Prelude.Maybe Prelude.Text)
listSigningCertificatesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListSigningCertificatesResponse
-> f ListSigningCertificatesResponse
listSigningCertificatesResponse_marker = (ListSigningCertificatesResponse -> Maybe Text)
-> (ListSigningCertificatesResponse
    -> Maybe Text -> ListSigningCertificatesResponse)
-> Lens' ListSigningCertificatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningCertificatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListSigningCertificatesResponse' :: ListSigningCertificatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListSigningCertificatesResponse
s@ListSigningCertificatesResponse' {} Maybe Text
a -> ListSigningCertificatesResponse
s {$sel:marker:ListSigningCertificatesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListSigningCertificatesResponse)

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

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

-- | A list of the user\'s signing certificate information.
listSigningCertificatesResponse_certificates :: Lens.Lens' ListSigningCertificatesResponse [SigningCertificate]
listSigningCertificatesResponse_certificates :: ([SigningCertificate] -> f [SigningCertificate])
-> ListSigningCertificatesResponse
-> f ListSigningCertificatesResponse
listSigningCertificatesResponse_certificates = (ListSigningCertificatesResponse -> [SigningCertificate])
-> (ListSigningCertificatesResponse
    -> [SigningCertificate] -> ListSigningCertificatesResponse)
-> Lens
     ListSigningCertificatesResponse
     ListSigningCertificatesResponse
     [SigningCertificate]
     [SigningCertificate]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningCertificatesResponse' {[SigningCertificate]
certificates :: [SigningCertificate]
$sel:certificates:ListSigningCertificatesResponse' :: ListSigningCertificatesResponse -> [SigningCertificate]
certificates} -> [SigningCertificate]
certificates) (\s :: ListSigningCertificatesResponse
s@ListSigningCertificatesResponse' {} [SigningCertificate]
a -> ListSigningCertificatesResponse
s {$sel:certificates:ListSigningCertificatesResponse' :: [SigningCertificate]
certificates = [SigningCertificate]
a} :: ListSigningCertificatesResponse) (([SigningCertificate] -> f [SigningCertificate])
 -> ListSigningCertificatesResponse
 -> f ListSigningCertificatesResponse)
-> (([SigningCertificate] -> f [SigningCertificate])
    -> [SigningCertificate] -> f [SigningCertificate])
-> ([SigningCertificate] -> f [SigningCertificate])
-> ListSigningCertificatesResponse
-> f ListSigningCertificatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SigningCertificate] -> f [SigningCertificate])
-> [SigningCertificate] -> f [SigningCertificate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListSigningCertificatesResponse