{-# 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.DocumentDB.DescribeCertificates
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of certificate authority (CA) certificates provided by
-- Amazon DocumentDB for this Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.DocumentDB.DescribeCertificates
  ( -- * Creating a Request
    DescribeCertificates (..),
    newDescribeCertificates,

    -- * Request Lenses
    describeCertificates_certificateIdentifier,
    describeCertificates_filters,
    describeCertificates_marker,
    describeCertificates_maxRecords,

    -- * Destructuring the Response
    DescribeCertificatesResponse (..),
    newDescribeCertificatesResponse,

    -- * Response Lenses
    describeCertificatesResponse_certificates,
    describeCertificatesResponse_marker,
    describeCertificatesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeCertificates' smart constructor.
data DescribeCertificates = DescribeCertificates'
  { -- | The user-supplied certificate identifier. If this parameter is
    -- specified, information for only the specified certificate is returned.
    -- If this parameter is omitted, a list of up to @MaxRecords@ certificates
    -- is returned. This parameter is not case sensitive.
    --
    -- Constraints
    --
    -- -   Must match an existing @CertificateIdentifier@.
    DescribeCertificates -> Maybe Text
certificateIdentifier :: Prelude.Maybe Prelude.Text,
    -- | This parameter is not currently supported.
    DescribeCertificates -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous
    -- @DescribeCertificates@ request. If this parameter is specified, the
    -- response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeCertificates -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints:
    --
    -- -   Minimum: 20
    --
    -- -   Maximum: 100
    DescribeCertificates -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeCertificates -> DescribeCertificates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCertificates -> DescribeCertificates -> Bool
$c/= :: DescribeCertificates -> DescribeCertificates -> Bool
== :: DescribeCertificates -> DescribeCertificates -> Bool
$c== :: DescribeCertificates -> DescribeCertificates -> Bool
Prelude.Eq, ReadPrec [DescribeCertificates]
ReadPrec DescribeCertificates
Int -> ReadS DescribeCertificates
ReadS [DescribeCertificates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCertificates]
$creadListPrec :: ReadPrec [DescribeCertificates]
readPrec :: ReadPrec DescribeCertificates
$creadPrec :: ReadPrec DescribeCertificates
readList :: ReadS [DescribeCertificates]
$creadList :: ReadS [DescribeCertificates]
readsPrec :: Int -> ReadS DescribeCertificates
$creadsPrec :: Int -> ReadS DescribeCertificates
Prelude.Read, Int -> DescribeCertificates -> ShowS
[DescribeCertificates] -> ShowS
DescribeCertificates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCertificates] -> ShowS
$cshowList :: [DescribeCertificates] -> ShowS
show :: DescribeCertificates -> String
$cshow :: DescribeCertificates -> String
showsPrec :: Int -> DescribeCertificates -> ShowS
$cshowsPrec :: Int -> DescribeCertificates -> ShowS
Prelude.Show, forall x. Rep DescribeCertificates x -> DescribeCertificates
forall x. DescribeCertificates -> Rep DescribeCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCertificates x -> DescribeCertificates
$cfrom :: forall x. DescribeCertificates -> Rep DescribeCertificates x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCertificates' 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:
--
-- 'certificateIdentifier', 'describeCertificates_certificateIdentifier' - The user-supplied certificate identifier. If this parameter is
-- specified, information for only the specified certificate is returned.
-- If this parameter is omitted, a list of up to @MaxRecords@ certificates
-- is returned. This parameter is not case sensitive.
--
-- Constraints
--
-- -   Must match an existing @CertificateIdentifier@.
--
-- 'filters', 'describeCertificates_filters' - This parameter is not currently supported.
--
-- 'marker', 'describeCertificates_marker' - An optional pagination token provided by a previous
-- @DescribeCertificates@ request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'maxRecords', 'describeCertificates_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints:
--
-- -   Minimum: 20
--
-- -   Maximum: 100
newDescribeCertificates ::
  DescribeCertificates
newDescribeCertificates :: DescribeCertificates
newDescribeCertificates =
  DescribeCertificates'
    { $sel:certificateIdentifier:DescribeCertificates' :: Maybe Text
certificateIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeCertificates' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCertificates' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeCertificates' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing
    }

-- | The user-supplied certificate identifier. If this parameter is
-- specified, information for only the specified certificate is returned.
-- If this parameter is omitted, a list of up to @MaxRecords@ certificates
-- is returned. This parameter is not case sensitive.
--
-- Constraints
--
-- -   Must match an existing @CertificateIdentifier@.
describeCertificates_certificateIdentifier :: Lens.Lens' DescribeCertificates (Prelude.Maybe Prelude.Text)
describeCertificates_certificateIdentifier :: Lens' DescribeCertificates (Maybe Text)
describeCertificates_certificateIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificates' {Maybe Text
certificateIdentifier :: Maybe Text
$sel:certificateIdentifier:DescribeCertificates' :: DescribeCertificates -> Maybe Text
certificateIdentifier} -> Maybe Text
certificateIdentifier) (\s :: DescribeCertificates
s@DescribeCertificates' {} Maybe Text
a -> DescribeCertificates
s {$sel:certificateIdentifier:DescribeCertificates' :: Maybe Text
certificateIdentifier = Maybe Text
a} :: DescribeCertificates)

-- | This parameter is not currently supported.
describeCertificates_filters :: Lens.Lens' DescribeCertificates (Prelude.Maybe [Filter])
describeCertificates_filters :: Lens' DescribeCertificates (Maybe [Filter])
describeCertificates_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificates' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeCertificates' :: DescribeCertificates -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeCertificates
s@DescribeCertificates' {} Maybe [Filter]
a -> DescribeCertificates
s {$sel:filters:DescribeCertificates' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeCertificates) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous
-- @DescribeCertificates@ request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeCertificates_marker :: Lens.Lens' DescribeCertificates (Prelude.Maybe Prelude.Text)
describeCertificates_marker :: Lens' DescribeCertificates (Maybe Text)
describeCertificates_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificates' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCertificates' :: DescribeCertificates -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCertificates
s@DescribeCertificates' {} Maybe Text
a -> DescribeCertificates
s {$sel:marker:DescribeCertificates' :: Maybe Text
marker = Maybe Text
a} :: DescribeCertificates)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints:
--
-- -   Minimum: 20
--
-- -   Maximum: 100
describeCertificates_maxRecords :: Lens.Lens' DescribeCertificates (Prelude.Maybe Prelude.Int)
describeCertificates_maxRecords :: Lens' DescribeCertificates (Maybe Int)
describeCertificates_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificates' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeCertificates' :: DescribeCertificates -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeCertificates
s@DescribeCertificates' {} Maybe Int
a -> DescribeCertificates
s {$sel:maxRecords:DescribeCertificates' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeCertificates)

instance Core.AWSPager DescribeCertificates where
  page :: DescribeCertificates
-> AWSResponse DescribeCertificates -> Maybe DescribeCertificates
page DescribeCertificates
rq AWSResponse DescribeCertificates
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCertificatesResponse (Maybe Text)
describeCertificatesResponse_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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCertificatesResponse (Maybe [Certificate])
describeCertificatesResponse_certificates
            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.$ DescribeCertificates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeCertificates (Maybe Text)
describeCertificates_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCertificates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCertificatesResponse (Maybe Text)
describeCertificatesResponse_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 DescribeCertificates where
  type
    AWSResponse DescribeCertificates =
      DescribeCertificatesResponse
  request :: (Service -> Service)
-> DescribeCertificates -> Request DescribeCertificates
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 DescribeCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCertificates)))
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
"DescribeCertificatesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Certificate]
-> Maybe Text -> Int -> DescribeCertificatesResponse
DescribeCertificatesResponse'
            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
"Certificates"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"Certificate")
                        )
            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))
      )

instance Prelude.Hashable DescribeCertificates where
  hashWithSalt :: Int -> DescribeCertificates -> Int
hashWithSalt Int
_salt DescribeCertificates' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
certificateIdentifier :: Maybe Text
$sel:maxRecords:DescribeCertificates' :: DescribeCertificates -> Maybe Int
$sel:marker:DescribeCertificates' :: DescribeCertificates -> Maybe Text
$sel:filters:DescribeCertificates' :: DescribeCertificates -> Maybe [Filter]
$sel:certificateIdentifier:DescribeCertificates' :: DescribeCertificates -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords

instance Prelude.NFData DescribeCertificates where
  rnf :: DescribeCertificates -> ()
rnf DescribeCertificates' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
certificateIdentifier :: Maybe Text
$sel:maxRecords:DescribeCertificates' :: DescribeCertificates -> Maybe Int
$sel:marker:DescribeCertificates' :: DescribeCertificates -> Maybe Text
$sel:filters:DescribeCertificates' :: DescribeCertificates -> Maybe [Filter]
$sel:certificateIdentifier:DescribeCertificates' :: DescribeCertificates -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords

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

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

instance Data.ToQuery DescribeCertificates where
  toQuery :: DescribeCertificates -> QueryString
toQuery DescribeCertificates' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
certificateIdentifier :: Maybe Text
$sel:maxRecords:DescribeCertificates' :: DescribeCertificates -> Maybe Int
$sel:marker:DescribeCertificates' :: DescribeCertificates -> Maybe Text
$sel:filters:DescribeCertificates' :: DescribeCertificates -> Maybe [Filter]
$sel:certificateIdentifier:DescribeCertificates' :: DescribeCertificates -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeCertificates" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"CertificateIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
certificateIdentifier,
        ByteString
"Filters"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords
      ]

-- | /See:/ 'newDescribeCertificatesResponse' smart constructor.
data DescribeCertificatesResponse = DescribeCertificatesResponse'
  { -- | A list of certificates for this Amazon Web Services account.
    DescribeCertificatesResponse -> Maybe [Certificate]
certificates :: Prelude.Maybe [Certificate],
    -- | An optional pagination token provided if the number of records retrieved
    -- is greater than @MaxRecords@. If this parameter is specified, the marker
    -- specifies the next record in the list. Including the value of @Marker@
    -- in the next call to @DescribeCertificates@ results in the next page of
    -- certificates.
    DescribeCertificatesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCertificatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
$c/= :: DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
== :: DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
$c== :: DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCertificatesResponse]
ReadPrec DescribeCertificatesResponse
Int -> ReadS DescribeCertificatesResponse
ReadS [DescribeCertificatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCertificatesResponse]
$creadListPrec :: ReadPrec [DescribeCertificatesResponse]
readPrec :: ReadPrec DescribeCertificatesResponse
$creadPrec :: ReadPrec DescribeCertificatesResponse
readList :: ReadS [DescribeCertificatesResponse]
$creadList :: ReadS [DescribeCertificatesResponse]
readsPrec :: Int -> ReadS DescribeCertificatesResponse
$creadsPrec :: Int -> ReadS DescribeCertificatesResponse
Prelude.Read, Int -> DescribeCertificatesResponse -> ShowS
[DescribeCertificatesResponse] -> ShowS
DescribeCertificatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCertificatesResponse] -> ShowS
$cshowList :: [DescribeCertificatesResponse] -> ShowS
show :: DescribeCertificatesResponse -> String
$cshow :: DescribeCertificatesResponse -> String
showsPrec :: Int -> DescribeCertificatesResponse -> ShowS
$cshowsPrec :: Int -> DescribeCertificatesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeCertificatesResponse x -> DescribeCertificatesResponse
forall x.
DescribeCertificatesResponse -> Rep DescribeCertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCertificatesResponse x -> DescribeCertificatesResponse
$cfrom :: forall x.
DescribeCertificatesResponse -> Rep DescribeCertificatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCertificatesResponse' 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:
--
-- 'certificates', 'describeCertificatesResponse_certificates' - A list of certificates for this Amazon Web Services account.
--
-- 'marker', 'describeCertificatesResponse_marker' - An optional pagination token provided if the number of records retrieved
-- is greater than @MaxRecords@. If this parameter is specified, the marker
-- specifies the next record in the list. Including the value of @Marker@
-- in the next call to @DescribeCertificates@ results in the next page of
-- certificates.
--
-- 'httpStatus', 'describeCertificatesResponse_httpStatus' - The response's http status code.
newDescribeCertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCertificatesResponse
newDescribeCertificatesResponse :: Int -> DescribeCertificatesResponse
newDescribeCertificatesResponse Int
pHttpStatus_ =
  DescribeCertificatesResponse'
    { $sel:certificates:DescribeCertificatesResponse' :: Maybe [Certificate]
certificates =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCertificatesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of certificates for this Amazon Web Services account.
describeCertificatesResponse_certificates :: Lens.Lens' DescribeCertificatesResponse (Prelude.Maybe [Certificate])
describeCertificatesResponse_certificates :: Lens' DescribeCertificatesResponse (Maybe [Certificate])
describeCertificatesResponse_certificates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificatesResponse' {Maybe [Certificate]
certificates :: Maybe [Certificate]
$sel:certificates:DescribeCertificatesResponse' :: DescribeCertificatesResponse -> Maybe [Certificate]
certificates} -> Maybe [Certificate]
certificates) (\s :: DescribeCertificatesResponse
s@DescribeCertificatesResponse' {} Maybe [Certificate]
a -> DescribeCertificatesResponse
s {$sel:certificates:DescribeCertificatesResponse' :: Maybe [Certificate]
certificates = Maybe [Certificate]
a} :: DescribeCertificatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided if the number of records retrieved
-- is greater than @MaxRecords@. If this parameter is specified, the marker
-- specifies the next record in the list. Including the value of @Marker@
-- in the next call to @DescribeCertificates@ results in the next page of
-- certificates.
describeCertificatesResponse_marker :: Lens.Lens' DescribeCertificatesResponse (Prelude.Maybe Prelude.Text)
describeCertificatesResponse_marker :: Lens' DescribeCertificatesResponse (Maybe Text)
describeCertificatesResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCertificatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCertificatesResponse' :: DescribeCertificatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCertificatesResponse
s@DescribeCertificatesResponse' {} Maybe Text
a -> DescribeCertificatesResponse
s {$sel:marker:DescribeCertificatesResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeCertificatesResponse)

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

instance Prelude.NFData DescribeCertificatesResponse where
  rnf :: DescribeCertificatesResponse -> ()
rnf DescribeCertificatesResponse' {Int
Maybe [Certificate]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
certificates :: Maybe [Certificate]
$sel:httpStatus:DescribeCertificatesResponse' :: DescribeCertificatesResponse -> Int
$sel:marker:DescribeCertificatesResponse' :: DescribeCertificatesResponse -> Maybe Text
$sel:certificates:DescribeCertificatesResponse' :: DescribeCertificatesResponse -> Maybe [Certificate]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Certificate]
certificates
      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