{-# 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.ListServerCertificates
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the server certificates stored in IAM that have the specified path
-- prefix. If none exist, the operation returns an empty list.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- For more information about working with server certificates, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html Working with server certificates>
-- in the /IAM User Guide/. This topic also includes a list of Amazon Web
-- Services services that can use the server certificates that you manage
-- with IAM.
--
-- IAM resource-listing operations return a subset of the available
-- attributes for the resource. For example, this operation does not return
-- tags, even though they are an attribute of the returned object. To view
-- all of the information for a servercertificate, see
-- GetServerCertificate.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListServerCertificates
  ( -- * Creating a Request
    ListServerCertificates (..),
    newListServerCertificates,

    -- * Request Lenses
    listServerCertificates_pathPrefix,
    listServerCertificates_marker,
    listServerCertificates_maxItems,

    -- * Destructuring the Response
    ListServerCertificatesResponse (..),
    newListServerCertificatesResponse,

    -- * Response Lenses
    listServerCertificatesResponse_marker,
    listServerCertificatesResponse_isTruncated,
    listServerCertificatesResponse_httpStatus,
    listServerCertificatesResponse_serverCertificateMetadataList,
  )
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:/ 'newListServerCertificates' smart constructor.
data ListServerCertificates = ListServerCertificates'
  { -- | The path prefix for filtering the results. For example:
    -- @\/company\/servercerts@ would get all server certificates for which the
    -- path starts with @\/company\/servercerts@.
    --
    -- This parameter is optional. If it is not included, it defaults to a
    -- slash (\/), listing all server certificates. This parameter allows
    -- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
    -- of characters consisting of either a forward slash (\/) by itself or a
    -- string that must begin and end with forward slashes. In addition, it can
    -- contain any ASCII character from the ! (@\\u0021@) through the DEL
    -- character (@\\u007F@), including most punctuation characters, digits,
    -- and upper and lowercased letters.
    ListServerCertificates -> Maybe Text
pathPrefix :: 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.
    ListServerCertificates -> 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.
    ListServerCertificates -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListServerCertificates -> ListServerCertificates -> Bool
(ListServerCertificates -> ListServerCertificates -> Bool)
-> (ListServerCertificates -> ListServerCertificates -> Bool)
-> Eq ListServerCertificates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServerCertificates -> ListServerCertificates -> Bool
$c/= :: ListServerCertificates -> ListServerCertificates -> Bool
== :: ListServerCertificates -> ListServerCertificates -> Bool
$c== :: ListServerCertificates -> ListServerCertificates -> Bool
Prelude.Eq, ReadPrec [ListServerCertificates]
ReadPrec ListServerCertificates
Int -> ReadS ListServerCertificates
ReadS [ListServerCertificates]
(Int -> ReadS ListServerCertificates)
-> ReadS [ListServerCertificates]
-> ReadPrec ListServerCertificates
-> ReadPrec [ListServerCertificates]
-> Read ListServerCertificates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServerCertificates]
$creadListPrec :: ReadPrec [ListServerCertificates]
readPrec :: ReadPrec ListServerCertificates
$creadPrec :: ReadPrec ListServerCertificates
readList :: ReadS [ListServerCertificates]
$creadList :: ReadS [ListServerCertificates]
readsPrec :: Int -> ReadS ListServerCertificates
$creadsPrec :: Int -> ReadS ListServerCertificates
Prelude.Read, Int -> ListServerCertificates -> ShowS
[ListServerCertificates] -> ShowS
ListServerCertificates -> String
(Int -> ListServerCertificates -> ShowS)
-> (ListServerCertificates -> String)
-> ([ListServerCertificates] -> ShowS)
-> Show ListServerCertificates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServerCertificates] -> ShowS
$cshowList :: [ListServerCertificates] -> ShowS
show :: ListServerCertificates -> String
$cshow :: ListServerCertificates -> String
showsPrec :: Int -> ListServerCertificates -> ShowS
$cshowsPrec :: Int -> ListServerCertificates -> ShowS
Prelude.Show, (forall x. ListServerCertificates -> Rep ListServerCertificates x)
-> (forall x.
    Rep ListServerCertificates x -> ListServerCertificates)
-> Generic ListServerCertificates
forall x. Rep ListServerCertificates x -> ListServerCertificates
forall x. ListServerCertificates -> Rep ListServerCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListServerCertificates x -> ListServerCertificates
$cfrom :: forall x. ListServerCertificates -> Rep ListServerCertificates x
Prelude.Generic)

-- |
-- Create a value of 'ListServerCertificates' 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:
--
-- 'pathPrefix', 'listServerCertificates_pathPrefix' - The path prefix for filtering the results. For example:
-- @\/company\/servercerts@ would get all server certificates for which the
-- path starts with @\/company\/servercerts@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all server certificates. This parameter allows
-- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
-- of characters consisting of either a forward slash (\/) by itself or a
-- string that must begin and end with forward slashes. In addition, it can
-- contain any ASCII character from the ! (@\\u0021@) through the DEL
-- character (@\\u007F@), including most punctuation characters, digits,
-- and upper and lowercased letters.
--
-- 'marker', 'listServerCertificates_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', 'listServerCertificates_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.
newListServerCertificates ::
  ListServerCertificates
newListServerCertificates :: ListServerCertificates
newListServerCertificates =
  ListServerCertificates' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListServerCertificates
ListServerCertificates'
    { $sel:pathPrefix:ListServerCertificates' :: Maybe Text
pathPrefix =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListServerCertificates' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListServerCertificates' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The path prefix for filtering the results. For example:
-- @\/company\/servercerts@ would get all server certificates for which the
-- path starts with @\/company\/servercerts@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all server certificates. This parameter allows
-- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
-- of characters consisting of either a forward slash (\/) by itself or a
-- string that must begin and end with forward slashes. In addition, it can
-- contain any ASCII character from the ! (@\\u0021@) through the DEL
-- character (@\\u007F@), including most punctuation characters, digits,
-- and upper and lowercased letters.
listServerCertificates_pathPrefix :: Lens.Lens' ListServerCertificates (Prelude.Maybe Prelude.Text)
listServerCertificates_pathPrefix :: (Maybe Text -> f (Maybe Text))
-> ListServerCertificates -> f ListServerCertificates
listServerCertificates_pathPrefix = (ListServerCertificates -> Maybe Text)
-> (ListServerCertificates -> Maybe Text -> ListServerCertificates)
-> Lens
     ListServerCertificates
     ListServerCertificates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificates' {Maybe Text
pathPrefix :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
pathPrefix} -> Maybe Text
pathPrefix) (\s :: ListServerCertificates
s@ListServerCertificates' {} Maybe Text
a -> ListServerCertificates
s {$sel:pathPrefix:ListServerCertificates' :: Maybe Text
pathPrefix = Maybe Text
a} :: ListServerCertificates)

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

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

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

instance Prelude.Hashable ListServerCertificates

instance Prelude.NFData ListServerCertificates

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

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

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

-- |
-- Create a value of 'ListServerCertificatesResponse' 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', 'listServerCertificatesResponse_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', 'listServerCertificatesResponse_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', 'listServerCertificatesResponse_httpStatus' - The response's http status code.
--
-- 'serverCertificateMetadataList', 'listServerCertificatesResponse_serverCertificateMetadataList' - A list of server certificates.
newListServerCertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListServerCertificatesResponse
newListServerCertificatesResponse :: Int -> ListServerCertificatesResponse
newListServerCertificatesResponse Int
pHttpStatus_ =
  ListServerCertificatesResponse' :: Maybe Text
-> Maybe Bool
-> Int
-> [ServerCertificateMetadata]
-> ListServerCertificatesResponse
ListServerCertificatesResponse'
    { $sel:marker:ListServerCertificatesResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListServerCertificatesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServerCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: [ServerCertificateMetadata]
serverCertificateMetadataList =
        [ServerCertificateMetadata]
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.
listServerCertificatesResponse_marker :: Lens.Lens' ListServerCertificatesResponse (Prelude.Maybe Prelude.Text)
listServerCertificatesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListServerCertificatesResponse
-> f ListServerCertificatesResponse
listServerCertificatesResponse_marker = (ListServerCertificatesResponse -> Maybe Text)
-> (ListServerCertificatesResponse
    -> Maybe Text -> ListServerCertificatesResponse)
-> Lens' ListServerCertificatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} Maybe Text
a -> ListServerCertificatesResponse
s {$sel:marker:ListServerCertificatesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListServerCertificatesResponse)

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

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

-- | A list of server certificates.
listServerCertificatesResponse_serverCertificateMetadataList :: Lens.Lens' ListServerCertificatesResponse [ServerCertificateMetadata]
listServerCertificatesResponse_serverCertificateMetadataList :: ([ServerCertificateMetadata] -> f [ServerCertificateMetadata])
-> ListServerCertificatesResponse
-> f ListServerCertificatesResponse
listServerCertificatesResponse_serverCertificateMetadataList = (ListServerCertificatesResponse -> [ServerCertificateMetadata])
-> (ListServerCertificatesResponse
    -> [ServerCertificateMetadata] -> ListServerCertificatesResponse)
-> Lens
     ListServerCertificatesResponse
     ListServerCertificatesResponse
     [ServerCertificateMetadata]
     [ServerCertificateMetadata]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {[ServerCertificateMetadata]
serverCertificateMetadataList :: [ServerCertificateMetadata]
$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> [ServerCertificateMetadata]
serverCertificateMetadataList} -> [ServerCertificateMetadata]
serverCertificateMetadataList) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} [ServerCertificateMetadata]
a -> ListServerCertificatesResponse
s {$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: [ServerCertificateMetadata]
serverCertificateMetadataList = [ServerCertificateMetadata]
a} :: ListServerCertificatesResponse) (([ServerCertificateMetadata] -> f [ServerCertificateMetadata])
 -> ListServerCertificatesResponse
 -> f ListServerCertificatesResponse)
-> (([ServerCertificateMetadata] -> f [ServerCertificateMetadata])
    -> [ServerCertificateMetadata] -> f [ServerCertificateMetadata])
-> ([ServerCertificateMetadata] -> f [ServerCertificateMetadata])
-> ListServerCertificatesResponse
-> f ListServerCertificatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ServerCertificateMetadata] -> f [ServerCertificateMetadata])
-> [ServerCertificateMetadata] -> f [ServerCertificateMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListServerCertificatesResponse