{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_marker,
    listServerCertificates_maxItems,
    listServerCertificates_pathPrefix,

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

    -- * Response Lenses
    listServerCertificatesResponse_isTruncated,
    listServerCertificatesResponse_marker,
    listServerCertificatesResponse_httpStatus,
    listServerCertificatesResponse_serverCertificateMetadataList,
  )
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:/ 'newListServerCertificates' smart constructor.
data ListServerCertificates = 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 -> 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,
    -- | 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
  }
  deriving (ListServerCertificates -> ListServerCertificates -> Bool
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]
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
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. 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:
--
-- '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.
--
-- '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.
newListServerCertificates ::
  ListServerCertificates
newListServerCertificates :: ListServerCertificates
newListServerCertificates =
  ListServerCertificates'
    { $sel:marker:ListServerCertificates' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListServerCertificates' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:pathPrefix:ListServerCertificates' :: Maybe Text
pathPrefix = 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.
listServerCertificates_marker :: Lens.Lens' ListServerCertificates (Prelude.Maybe Prelude.Text)
listServerCertificates_marker :: Lens' ListServerCertificates (Maybe Text)
listServerCertificates_marker = 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 :: Lens' ListServerCertificates (Maybe Natural)
listServerCertificates_maxItems = 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)

-- | 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 :: Lens' ListServerCertificates (Maybe Text)
listServerCertificates_pathPrefix = 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)

instance Core.AWSPager ListServerCertificates where
  page :: ListServerCertificates
-> AWSResponse ListServerCertificates
-> Maybe ListServerCertificates
page ListServerCertificates
rq AWSResponse ListServerCertificates
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListServerCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Bool)
listServerCertificatesResponse_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 ListServerCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_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.$ ListServerCertificates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListServerCertificates (Maybe Text)
listServerCertificates_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListServerCertificates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_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 ListServerCertificates where
  type
    AWSResponse ListServerCertificates =
      ListServerCertificatesResponse
  request :: (Service -> Service)
-> ListServerCertificates -> Request ListServerCertificates
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 ListServerCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListServerCertificates)))
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
"ListServerCertificatesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text
-> Int
-> [ServerCertificateMetadata]
-> ListServerCertificatesResponse
ListServerCertificatesResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"ServerCertificateMetadataList"
                            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 a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListServerCertificates where
  hashWithSalt :: Int -> ListServerCertificates -> Int
hashWithSalt Int
_salt ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> 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
pathPrefix

instance Prelude.NFData ListServerCertificates where
  rnf :: ListServerCertificates -> ()
rnf ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> 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
pathPrefix

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

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

instance Data.ToQuery ListServerCertificates where
  toQuery :: ListServerCertificates -> QueryString
toQuery ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListServerCertificates" :: 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
"PathPrefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
pathPrefix
      ]

-- | Contains the response to a successful ListServerCertificates request.
--
-- /See:/ 'newListServerCertificatesResponse' smart constructor.
data ListServerCertificatesResponse = 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 -> 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.
    ListServerCertificatesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListServerCertificatesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of server certificates.
    ListServerCertificatesResponse -> [ServerCertificateMetadata]
serverCertificateMetadataList :: [ServerCertificateMetadata]
  }
  deriving (ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
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]
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
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.
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:
--
-- '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.
--
-- '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.
--
-- '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'
    { $sel:isTruncated:ListServerCertificatesResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListServerCertificatesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServerCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: [ServerCertificateMetadata]
serverCertificateMetadataList =
        forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 :: Lens' ListServerCertificatesResponse (Maybe Bool)
listServerCertificatesResponse_isTruncated = 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)

-- | 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 :: Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_marker = 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)

-- | The response's http status code.
listServerCertificatesResponse_httpStatus :: Lens.Lens' ListServerCertificatesResponse Prelude.Int
listServerCertificatesResponse_httpStatus :: Lens' ListServerCertificatesResponse Int
listServerCertificatesResponse_httpStatus = 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 :: Lens' ListServerCertificatesResponse [ServerCertificateMetadata]
listServerCertificatesResponse_serverCertificateMetadataList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListServerCertificatesResponse
  where
  rnf :: ListServerCertificatesResponse -> ()
rnf ListServerCertificatesResponse' {Int
[ServerCertificateMetadata]
Maybe Bool
Maybe Text
serverCertificateMetadataList :: [ServerCertificateMetadata]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> [ServerCertificateMetadata]
$sel:httpStatus:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Int
$sel:marker:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Text
$sel:isTruncated:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ServerCertificateMetadata]
serverCertificateMetadataList