{-# 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.DMS.DescribeCertificates
-- 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)
--
-- Provides a description of the certificate.
--
-- This operation returns paginated results.
module Amazonka.DMS.DescribeCertificates
  ( -- * Creating a Request
    DescribeCertificates (..),
    newDescribeCertificates,

    -- * Request Lenses
    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 Amazonka.DMS.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:/ 'newDescribeCertificates' smart constructor.
data DescribeCertificates = DescribeCertificates'
  { -- | Filters applied to the certificates described in the form of key-value
    -- pairs.
    DescribeCertificates -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous 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: 10
    DescribeCertificates -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeCertificates -> DescribeCertificates -> Bool
(DescribeCertificates -> DescribeCertificates -> Bool)
-> (DescribeCertificates -> DescribeCertificates -> Bool)
-> Eq DescribeCertificates
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]
(Int -> ReadS DescribeCertificates)
-> ReadS [DescribeCertificates]
-> ReadPrec DescribeCertificates
-> ReadPrec [DescribeCertificates]
-> Read 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
(Int -> DescribeCertificates -> ShowS)
-> (DescribeCertificates -> String)
-> ([DescribeCertificates] -> ShowS)
-> Show DescribeCertificates
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. DescribeCertificates -> Rep DescribeCertificates x)
-> (forall x. Rep DescribeCertificates x -> DescribeCertificates)
-> Generic DescribeCertificates
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:
--
-- 'filters', 'describeCertificates_filters' - Filters applied to the certificates described in the form of key-value
-- pairs.
--
-- 'marker', 'describeCertificates_marker' - An optional pagination token provided by a previous 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: 10
newDescribeCertificates ::
  DescribeCertificates
newDescribeCertificates :: DescribeCertificates
newDescribeCertificates =
  DescribeCertificates' :: Maybe [Filter] -> Maybe Text -> Maybe Int -> DescribeCertificates
DescribeCertificates'
    { $sel:filters:DescribeCertificates' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCertificates' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeCertificates' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Filters applied to the certificates described in the form of key-value
-- pairs.
describeCertificates_filters :: Lens.Lens' DescribeCertificates (Prelude.Maybe [Filter])
describeCertificates_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeCertificates -> f DescribeCertificates
describeCertificates_filters = (DescribeCertificates -> Maybe [Filter])
-> (DescribeCertificates -> Maybe [Filter] -> DescribeCertificates)
-> Lens
     DescribeCertificates
     DescribeCertificates
     (Maybe [Filter])
     (Maybe [Filter])
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) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeCertificates -> f DescribeCertificates)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeCertificates
-> f DescribeCertificates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 AnIso [Filter] [Filter] [Filter] [Filter]
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 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeCertificates -> f DescribeCertificates
describeCertificates_marker = (DescribeCertificates -> Maybe Text)
-> (DescribeCertificates -> Maybe Text -> DescribeCertificates)
-> Lens
     DescribeCertificates DescribeCertificates (Maybe Text) (Maybe Text)
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: 10
describeCertificates_maxRecords :: Lens.Lens' DescribeCertificates (Prelude.Maybe Prelude.Int)
describeCertificates_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeCertificates -> f DescribeCertificates
describeCertificates_maxRecords = (DescribeCertificates -> Maybe Int)
-> (DescribeCertificates -> Maybe Int -> DescribeCertificates)
-> Lens
     DescribeCertificates DescribeCertificates (Maybe Int) (Maybe Int)
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCertificates
DescribeCertificatesResponse
rs
            DescribeCertificatesResponse
-> Getting (First Text) DescribeCertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeCertificatesResponse
-> Const (First Text) DescribeCertificatesResponse
Lens' DescribeCertificatesResponse (Maybe Text)
describeCertificatesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeCertificatesResponse
 -> Const (First Text) DescribeCertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeCertificatesResponse 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 DescribeCertificates
forall a. Maybe a
Prelude.Nothing
    | Maybe [Certificate] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCertificates
DescribeCertificatesResponse
rs
            DescribeCertificatesResponse
-> Getting
     (First [Certificate]) DescribeCertificatesResponse [Certificate]
-> Maybe [Certificate]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Certificate]
 -> Const (First [Certificate]) (Maybe [Certificate]))
-> DescribeCertificatesResponse
-> Const (First [Certificate]) DescribeCertificatesResponse
Lens' DescribeCertificatesResponse (Maybe [Certificate])
describeCertificatesResponse_certificates
              ((Maybe [Certificate]
  -> Const (First [Certificate]) (Maybe [Certificate]))
 -> DescribeCertificatesResponse
 -> Const (First [Certificate]) DescribeCertificatesResponse)
-> (([Certificate] -> Const (First [Certificate]) [Certificate])
    -> Maybe [Certificate]
    -> Const (First [Certificate]) (Maybe [Certificate]))
-> Getting
     (First [Certificate]) DescribeCertificatesResponse [Certificate]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Certificate] -> Const (First [Certificate]) [Certificate])
-> Maybe [Certificate]
-> Const (First [Certificate]) (Maybe [Certificate])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeCertificates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeCertificates -> Maybe DescribeCertificates
forall a. a -> Maybe a
Prelude.Just (DescribeCertificates -> Maybe DescribeCertificates)
-> DescribeCertificates -> Maybe DescribeCertificates
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeCertificates
rq
          DescribeCertificates
-> (DescribeCertificates -> DescribeCertificates)
-> DescribeCertificates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeCertificates -> Identity DescribeCertificates
Lens
  DescribeCertificates DescribeCertificates (Maybe Text) (Maybe Text)
describeCertificates_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeCertificates -> Identity DescribeCertificates)
-> Maybe Text -> DescribeCertificates -> DescribeCertificates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCertificates
DescribeCertificatesResponse
rs
          DescribeCertificatesResponse
-> Getting (First Text) DescribeCertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeCertificatesResponse
-> Const (First Text) DescribeCertificatesResponse
Lens' DescribeCertificatesResponse (Maybe Text)
describeCertificatesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeCertificatesResponse
 -> Const (First Text) DescribeCertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeCertificatesResponse 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 DescribeCertificates where
  type
    AWSResponse DescribeCertificates =
      DescribeCertificatesResponse
  request :: DescribeCertificates -> Request DescribeCertificates
request = Service -> DescribeCertificates -> Request DescribeCertificates
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCertificates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeCertificates))
-> Logger
-> Service
-> Proxy DescribeCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCertificates)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Certificate]
-> Maybe Text -> Int -> DescribeCertificatesResponse
DescribeCertificatesResponse'
            (Maybe [Certificate]
 -> Maybe Text -> Int -> DescribeCertificatesResponse)
-> Either String (Maybe [Certificate])
-> Either
     String (Maybe Text -> Int -> DescribeCertificatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Certificate]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Certificates" Either String (Maybe (Maybe [Certificate]))
-> Maybe [Certificate] -> Either String (Maybe [Certificate])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Certificate]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeCertificatesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeCertificatesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Marker")
            Either String (Int -> DescribeCertificatesResponse)
-> Either String Int -> Either String DescribeCertificatesResponse
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))
      )

instance Prelude.Hashable DescribeCertificates

instance Prelude.NFData DescribeCertificates

instance Core.ToHeaders DescribeCertificates where
  toHeaders :: DescribeCertificates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeCertificates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.DescribeCertificates" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeCertificates where
  toJSON :: DescribeCertificates -> Value
toJSON DescribeCertificates' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:maxRecords:DescribeCertificates' :: DescribeCertificates -> Maybe Int
$sel:marker:DescribeCertificates' :: DescribeCertificates -> Maybe Text
$sel:filters:DescribeCertificates' :: DescribeCertificates -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"Marker" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker,
            (Text
"MaxRecords" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxRecords
          ]
      )

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

instance Core.ToQuery DescribeCertificates where
  toQuery :: DescribeCertificates -> QueryString
toQuery = QueryString -> DescribeCertificates -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeCertificatesResponse' smart constructor.
data DescribeCertificatesResponse = DescribeCertificatesResponse'
  { -- | The Secure Sockets Layer (SSL) certificates associated with the
    -- replication instance.
    DescribeCertificatesResponse -> Maybe [Certificate]
certificates :: Prelude.Maybe [Certificate],
    -- | The pagination token.
    DescribeCertificatesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCertificatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCertificatesResponse
-> DescribeCertificatesResponse -> Bool
(DescribeCertificatesResponse
 -> DescribeCertificatesResponse -> Bool)
-> (DescribeCertificatesResponse
    -> DescribeCertificatesResponse -> Bool)
-> Eq DescribeCertificatesResponse
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]
(Int -> ReadS DescribeCertificatesResponse)
-> ReadS [DescribeCertificatesResponse]
-> ReadPrec DescribeCertificatesResponse
-> ReadPrec [DescribeCertificatesResponse]
-> Read 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
(Int -> DescribeCertificatesResponse -> ShowS)
-> (DescribeCertificatesResponse -> String)
-> ([DescribeCertificatesResponse] -> ShowS)
-> Show DescribeCertificatesResponse
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.
 DescribeCertificatesResponse -> Rep DescribeCertificatesResponse x)
-> (forall x.
    Rep DescribeCertificatesResponse x -> DescribeCertificatesResponse)
-> Generic DescribeCertificatesResponse
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' - The Secure Sockets Layer (SSL) certificates associated with the
-- replication instance.
--
-- 'marker', 'describeCertificatesResponse_marker' - The pagination token.
--
-- 'httpStatus', 'describeCertificatesResponse_httpStatus' - The response's http status code.
newDescribeCertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCertificatesResponse
newDescribeCertificatesResponse :: Int -> DescribeCertificatesResponse
newDescribeCertificatesResponse Int
pHttpStatus_ =
  DescribeCertificatesResponse' :: Maybe [Certificate]
-> Maybe Text -> Int -> DescribeCertificatesResponse
DescribeCertificatesResponse'
    { $sel:certificates:DescribeCertificatesResponse' :: Maybe [Certificate]
certificates =
        Maybe [Certificate]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCertificatesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Secure Sockets Layer (SSL) certificates associated with the
-- replication instance.
describeCertificatesResponse_certificates :: Lens.Lens' DescribeCertificatesResponse (Prelude.Maybe [Certificate])
describeCertificatesResponse_certificates :: (Maybe [Certificate] -> f (Maybe [Certificate]))
-> DescribeCertificatesResponse -> f DescribeCertificatesResponse
describeCertificatesResponse_certificates = (DescribeCertificatesResponse -> Maybe [Certificate])
-> (DescribeCertificatesResponse
    -> Maybe [Certificate] -> DescribeCertificatesResponse)
-> Lens' DescribeCertificatesResponse (Maybe [Certificate])
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) ((Maybe [Certificate] -> f (Maybe [Certificate]))
 -> DescribeCertificatesResponse -> f DescribeCertificatesResponse)
-> ((Maybe [Certificate] -> f (Maybe [Certificate]))
    -> Maybe [Certificate] -> f (Maybe [Certificate]))
-> (Maybe [Certificate] -> f (Maybe [Certificate]))
-> DescribeCertificatesResponse
-> f DescribeCertificatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Certificate] [Certificate] [Certificate] [Certificate]
-> Iso
     (Maybe [Certificate])
     (Maybe [Certificate])
     (Maybe [Certificate])
     (Maybe [Certificate])
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 AnIso [Certificate] [Certificate] [Certificate] [Certificate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token.
describeCertificatesResponse_marker :: Lens.Lens' DescribeCertificatesResponse (Prelude.Maybe Prelude.Text)
describeCertificatesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeCertificatesResponse -> f DescribeCertificatesResponse
describeCertificatesResponse_marker = (DescribeCertificatesResponse -> Maybe Text)
-> (DescribeCertificatesResponse
    -> Maybe Text -> DescribeCertificatesResponse)
-> Lens' DescribeCertificatesResponse (Maybe Text)
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 :: (Int -> f Int)
-> DescribeCertificatesResponse -> f DescribeCertificatesResponse
describeCertificatesResponse_httpStatus = (DescribeCertificatesResponse -> Int)
-> (DescribeCertificatesResponse
    -> Int -> DescribeCertificatesResponse)
-> Lens
     DescribeCertificatesResponse DescribeCertificatesResponse Int Int
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