{-# 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.Redshift.DescribeHsmClientCertificates
-- 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 information about the specified HSM client certificate. If no
-- certificate ID is specified, returns information about all the HSM
-- certificates owned by your Amazon Web Services account.
--
-- If you specify both tag keys and tag values in the same request, Amazon
-- Redshift returns all HSM client certificates that match any combination
-- of the specified keys and values. For example, if you have @owner@ and
-- @environment@ for tag keys, and @admin@ and @test@ for tag values, all
-- HSM client certificates that have any combination of those values are
-- returned.
--
-- If both tag keys and values are omitted from the request, HSM client
-- certificates are returned regardless of whether they have tag keys or
-- values associated with them.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeHsmClientCertificates
  ( -- * Creating a Request
    DescribeHsmClientCertificates (..),
    newDescribeHsmClientCertificates,

    -- * Request Lenses
    describeHsmClientCertificates_hsmClientCertificateIdentifier,
    describeHsmClientCertificates_marker,
    describeHsmClientCertificates_maxRecords,
    describeHsmClientCertificates_tagKeys,
    describeHsmClientCertificates_tagValues,

    -- * Destructuring the Response
    DescribeHsmClientCertificatesResponse (..),
    newDescribeHsmClientCertificatesResponse,

    -- * Response Lenses
    describeHsmClientCertificatesResponse_hsmClientCertificates,
    describeHsmClientCertificatesResponse_marker,
    describeHsmClientCertificatesResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newDescribeHsmClientCertificates' smart constructor.
data DescribeHsmClientCertificates = DescribeHsmClientCertificates'
  { -- | The identifier of a specific HSM client certificate for which you want
    -- information. If no identifier is specified, information is returned for
    -- all HSM client certificates owned by your Amazon Web Services account.
    DescribeHsmClientCertificates -> Maybe Text
hsmClientCertificateIdentifier :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeHsmClientCertificates
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeHsmClientCertificates -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeHsmClientCertificates -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | A tag key or keys for which you want to return all matching HSM client
    -- certificates that are associated with the specified key or keys. For
    -- example, suppose that you have HSM client certificates that are tagged
    -- with keys called @owner@ and @environment@. If you specify both of these
    -- tag keys in the request, Amazon Redshift returns a response with the HSM
    -- client certificates that have either or both of these tag keys
    -- associated with them.
    DescribeHsmClientCertificates -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching HSM
    -- client certificates that are associated with the specified tag value or
    -- values. For example, suppose that you have HSM client certificates that
    -- are tagged with values called @admin@ and @test@. If you specify both of
    -- these tag values in the request, Amazon Redshift returns a response with
    -- the HSM client certificates that have either or both of these tag values
    -- associated with them.
    DescribeHsmClientCertificates -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeHsmClientCertificates
-> DescribeHsmClientCertificates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHsmClientCertificates
-> DescribeHsmClientCertificates -> Bool
$c/= :: DescribeHsmClientCertificates
-> DescribeHsmClientCertificates -> Bool
== :: DescribeHsmClientCertificates
-> DescribeHsmClientCertificates -> Bool
$c== :: DescribeHsmClientCertificates
-> DescribeHsmClientCertificates -> Bool
Prelude.Eq, ReadPrec [DescribeHsmClientCertificates]
ReadPrec DescribeHsmClientCertificates
Int -> ReadS DescribeHsmClientCertificates
ReadS [DescribeHsmClientCertificates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHsmClientCertificates]
$creadListPrec :: ReadPrec [DescribeHsmClientCertificates]
readPrec :: ReadPrec DescribeHsmClientCertificates
$creadPrec :: ReadPrec DescribeHsmClientCertificates
readList :: ReadS [DescribeHsmClientCertificates]
$creadList :: ReadS [DescribeHsmClientCertificates]
readsPrec :: Int -> ReadS DescribeHsmClientCertificates
$creadsPrec :: Int -> ReadS DescribeHsmClientCertificates
Prelude.Read, Int -> DescribeHsmClientCertificates -> ShowS
[DescribeHsmClientCertificates] -> ShowS
DescribeHsmClientCertificates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHsmClientCertificates] -> ShowS
$cshowList :: [DescribeHsmClientCertificates] -> ShowS
show :: DescribeHsmClientCertificates -> String
$cshow :: DescribeHsmClientCertificates -> String
showsPrec :: Int -> DescribeHsmClientCertificates -> ShowS
$cshowsPrec :: Int -> DescribeHsmClientCertificates -> ShowS
Prelude.Show, forall x.
Rep DescribeHsmClientCertificates x
-> DescribeHsmClientCertificates
forall x.
DescribeHsmClientCertificates
-> Rep DescribeHsmClientCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHsmClientCertificates x
-> DescribeHsmClientCertificates
$cfrom :: forall x.
DescribeHsmClientCertificates
-> Rep DescribeHsmClientCertificates x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHsmClientCertificates' 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:
--
-- 'hsmClientCertificateIdentifier', 'describeHsmClientCertificates_hsmClientCertificateIdentifier' - The identifier of a specific HSM client certificate for which you want
-- information. If no identifier is specified, information is returned for
-- all HSM client certificates owned by your Amazon Web Services account.
--
-- 'marker', 'describeHsmClientCertificates_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeHsmClientCertificates
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeHsmClientCertificates_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'tagKeys', 'describeHsmClientCertificates_tagKeys' - A tag key or keys for which you want to return all matching HSM client
-- certificates that are associated with the specified key or keys. For
-- example, suppose that you have HSM client certificates that are tagged
-- with keys called @owner@ and @environment@. If you specify both of these
-- tag keys in the request, Amazon Redshift returns a response with the HSM
-- client certificates that have either or both of these tag keys
-- associated with them.
--
-- 'tagValues', 'describeHsmClientCertificates_tagValues' - A tag value or values for which you want to return all matching HSM
-- client certificates that are associated with the specified tag value or
-- values. For example, suppose that you have HSM client certificates that
-- are tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the HSM client certificates that have either or both of these tag values
-- associated with them.
newDescribeHsmClientCertificates ::
  DescribeHsmClientCertificates
newDescribeHsmClientCertificates :: DescribeHsmClientCertificates
newDescribeHsmClientCertificates =
  DescribeHsmClientCertificates'
    { $sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: Maybe Text
hsmClientCertificateIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeHsmClientCertificates' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeHsmClientCertificates' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeHsmClientCertificates' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeHsmClientCertificates' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of a specific HSM client certificate for which you want
-- information. If no identifier is specified, information is returned for
-- all HSM client certificates owned by your Amazon Web Services account.
describeHsmClientCertificates_hsmClientCertificateIdentifier :: Lens.Lens' DescribeHsmClientCertificates (Prelude.Maybe Prelude.Text)
describeHsmClientCertificates_hsmClientCertificateIdentifier :: Lens' DescribeHsmClientCertificates (Maybe Text)
describeHsmClientCertificates_hsmClientCertificateIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificates' {Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
hsmClientCertificateIdentifier} -> Maybe Text
hsmClientCertificateIdentifier) (\s :: DescribeHsmClientCertificates
s@DescribeHsmClientCertificates' {} Maybe Text
a -> DescribeHsmClientCertificates
s {$sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: Maybe Text
hsmClientCertificateIdentifier = Maybe Text
a} :: DescribeHsmClientCertificates)

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeHsmClientCertificates
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeHsmClientCertificates_marker :: Lens.Lens' DescribeHsmClientCertificates (Prelude.Maybe Prelude.Text)
describeHsmClientCertificates_marker :: Lens' DescribeHsmClientCertificates (Maybe Text)
describeHsmClientCertificates_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificates' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeHsmClientCertificates
s@DescribeHsmClientCertificates' {} Maybe Text
a -> DescribeHsmClientCertificates
s {$sel:marker:DescribeHsmClientCertificates' :: Maybe Text
marker = Maybe Text
a} :: DescribeHsmClientCertificates)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeHsmClientCertificates_maxRecords :: Lens.Lens' DescribeHsmClientCertificates (Prelude.Maybe Prelude.Int)
describeHsmClientCertificates_maxRecords :: Lens' DescribeHsmClientCertificates (Maybe Int)
describeHsmClientCertificates_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificates' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeHsmClientCertificates
s@DescribeHsmClientCertificates' {} Maybe Int
a -> DescribeHsmClientCertificates
s {$sel:maxRecords:DescribeHsmClientCertificates' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeHsmClientCertificates)

-- | A tag key or keys for which you want to return all matching HSM client
-- certificates that are associated with the specified key or keys. For
-- example, suppose that you have HSM client certificates that are tagged
-- with keys called @owner@ and @environment@. If you specify both of these
-- tag keys in the request, Amazon Redshift returns a response with the HSM
-- client certificates that have either or both of these tag keys
-- associated with them.
describeHsmClientCertificates_tagKeys :: Lens.Lens' DescribeHsmClientCertificates (Prelude.Maybe [Prelude.Text])
describeHsmClientCertificates_tagKeys :: Lens' DescribeHsmClientCertificates (Maybe [Text])
describeHsmClientCertificates_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificates' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeHsmClientCertificates
s@DescribeHsmClientCertificates' {} Maybe [Text]
a -> DescribeHsmClientCertificates
s {$sel:tagKeys:DescribeHsmClientCertificates' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeHsmClientCertificates) 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

-- | A tag value or values for which you want to return all matching HSM
-- client certificates that are associated with the specified tag value or
-- values. For example, suppose that you have HSM client certificates that
-- are tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the HSM client certificates that have either or both of these tag values
-- associated with them.
describeHsmClientCertificates_tagValues :: Lens.Lens' DescribeHsmClientCertificates (Prelude.Maybe [Prelude.Text])
describeHsmClientCertificates_tagValues :: Lens' DescribeHsmClientCertificates (Maybe [Text])
describeHsmClientCertificates_tagValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificates' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeHsmClientCertificates
s@DescribeHsmClientCertificates' {} Maybe [Text]
a -> DescribeHsmClientCertificates
s {$sel:tagValues:DescribeHsmClientCertificates' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeHsmClientCertificates) 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

instance Core.AWSPager DescribeHsmClientCertificates where
  page :: DescribeHsmClientCertificates
-> AWSResponse DescribeHsmClientCertificates
-> Maybe DescribeHsmClientCertificates
page DescribeHsmClientCertificates
rq AWSResponse DescribeHsmClientCertificates
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeHsmClientCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeHsmClientCertificatesResponse (Maybe Text)
describeHsmClientCertificatesResponse_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 DescribeHsmClientCertificates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeHsmClientCertificatesResponse
  (Maybe [HsmClientCertificate])
describeHsmClientCertificatesResponse_hsmClientCertificates
            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.$ DescribeHsmClientCertificates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeHsmClientCertificates (Maybe Text)
describeHsmClientCertificates_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeHsmClientCertificates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeHsmClientCertificatesResponse (Maybe Text)
describeHsmClientCertificatesResponse_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
    DescribeHsmClientCertificates
  where
  type
    AWSResponse DescribeHsmClientCertificates =
      DescribeHsmClientCertificatesResponse
  request :: (Service -> Service)
-> DescribeHsmClientCertificates
-> Request DescribeHsmClientCertificates
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 DescribeHsmClientCertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHsmClientCertificates)))
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
"DescribeHsmClientCertificatesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [HsmClientCertificate]
-> Maybe Text -> Int -> DescribeHsmClientCertificatesResponse
DescribeHsmClientCertificatesResponse'
            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
"HsmClientCertificates"
                            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
"HsmClientCertificate")
                        )
            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
    DescribeHsmClientCertificates
  where
  hashWithSalt :: Int -> DescribeHsmClientCertificates -> Int
hashWithSalt Int
_salt DescribeHsmClientCertificates' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:tagKeys:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:maxRecords:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Int
$sel:marker:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
$sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hsmClientCertificateIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagValues

instance Prelude.NFData DescribeHsmClientCertificates where
  rnf :: DescribeHsmClientCertificates -> ()
rnf DescribeHsmClientCertificates' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:tagKeys:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:maxRecords:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Int
$sel:marker:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
$sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hsmClientCertificateIdentifier
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagValues

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

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

instance Data.ToQuery DescribeHsmClientCertificates where
  toQuery :: DescribeHsmClientCertificates -> QueryString
toQuery DescribeHsmClientCertificates' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:tagKeys:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe [Text]
$sel:maxRecords:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Int
$sel:marker:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
$sel:hsmClientCertificateIdentifier:DescribeHsmClientCertificates' :: DescribeHsmClientCertificates -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeHsmClientCertificates" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"HsmClientCertificateIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
hsmClientCertificateIdentifier,
        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,
        ByteString
"TagKeys"
          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
"TagKey" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
        ByteString
"TagValues"
          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
"TagValue" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues)
      ]

-- |
--
-- /See:/ 'newDescribeHsmClientCertificatesResponse' smart constructor.
data DescribeHsmClientCertificatesResponse = DescribeHsmClientCertificatesResponse'
  { -- | A list of the identifiers for one or more HSM client certificates used
    -- by Amazon Redshift clusters to store and retrieve database encryption
    -- keys in an HSM.
    DescribeHsmClientCertificatesResponse
-> Maybe [HsmClientCertificate]
hsmClientCertificates :: Prelude.Maybe [HsmClientCertificate],
    -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeHsmClientCertificatesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeHsmClientCertificatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeHsmClientCertificatesResponse
-> DescribeHsmClientCertificatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHsmClientCertificatesResponse
-> DescribeHsmClientCertificatesResponse -> Bool
$c/= :: DescribeHsmClientCertificatesResponse
-> DescribeHsmClientCertificatesResponse -> Bool
== :: DescribeHsmClientCertificatesResponse
-> DescribeHsmClientCertificatesResponse -> Bool
$c== :: DescribeHsmClientCertificatesResponse
-> DescribeHsmClientCertificatesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHsmClientCertificatesResponse]
ReadPrec DescribeHsmClientCertificatesResponse
Int -> ReadS DescribeHsmClientCertificatesResponse
ReadS [DescribeHsmClientCertificatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHsmClientCertificatesResponse]
$creadListPrec :: ReadPrec [DescribeHsmClientCertificatesResponse]
readPrec :: ReadPrec DescribeHsmClientCertificatesResponse
$creadPrec :: ReadPrec DescribeHsmClientCertificatesResponse
readList :: ReadS [DescribeHsmClientCertificatesResponse]
$creadList :: ReadS [DescribeHsmClientCertificatesResponse]
readsPrec :: Int -> ReadS DescribeHsmClientCertificatesResponse
$creadsPrec :: Int -> ReadS DescribeHsmClientCertificatesResponse
Prelude.Read, Int -> DescribeHsmClientCertificatesResponse -> ShowS
[DescribeHsmClientCertificatesResponse] -> ShowS
DescribeHsmClientCertificatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHsmClientCertificatesResponse] -> ShowS
$cshowList :: [DescribeHsmClientCertificatesResponse] -> ShowS
show :: DescribeHsmClientCertificatesResponse -> String
$cshow :: DescribeHsmClientCertificatesResponse -> String
showsPrec :: Int -> DescribeHsmClientCertificatesResponse -> ShowS
$cshowsPrec :: Int -> DescribeHsmClientCertificatesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeHsmClientCertificatesResponse x
-> DescribeHsmClientCertificatesResponse
forall x.
DescribeHsmClientCertificatesResponse
-> Rep DescribeHsmClientCertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHsmClientCertificatesResponse x
-> DescribeHsmClientCertificatesResponse
$cfrom :: forall x.
DescribeHsmClientCertificatesResponse
-> Rep DescribeHsmClientCertificatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHsmClientCertificatesResponse' 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:
--
-- 'hsmClientCertificates', 'describeHsmClientCertificatesResponse_hsmClientCertificates' - A list of the identifiers for one or more HSM client certificates used
-- by Amazon Redshift clusters to store and retrieve database encryption
-- keys in an HSM.
--
-- 'marker', 'describeHsmClientCertificatesResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'httpStatus', 'describeHsmClientCertificatesResponse_httpStatus' - The response's http status code.
newDescribeHsmClientCertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeHsmClientCertificatesResponse
newDescribeHsmClientCertificatesResponse :: Int -> DescribeHsmClientCertificatesResponse
newDescribeHsmClientCertificatesResponse Int
pHttpStatus_ =
  DescribeHsmClientCertificatesResponse'
    { $sel:hsmClientCertificates:DescribeHsmClientCertificatesResponse' :: Maybe [HsmClientCertificate]
hsmClientCertificates =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeHsmClientCertificatesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeHsmClientCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the identifiers for one or more HSM client certificates used
-- by Amazon Redshift clusters to store and retrieve database encryption
-- keys in an HSM.
describeHsmClientCertificatesResponse_hsmClientCertificates :: Lens.Lens' DescribeHsmClientCertificatesResponse (Prelude.Maybe [HsmClientCertificate])
describeHsmClientCertificatesResponse_hsmClientCertificates :: Lens'
  DescribeHsmClientCertificatesResponse
  (Maybe [HsmClientCertificate])
describeHsmClientCertificatesResponse_hsmClientCertificates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificatesResponse' {Maybe [HsmClientCertificate]
hsmClientCertificates :: Maybe [HsmClientCertificate]
$sel:hsmClientCertificates:DescribeHsmClientCertificatesResponse' :: DescribeHsmClientCertificatesResponse
-> Maybe [HsmClientCertificate]
hsmClientCertificates} -> Maybe [HsmClientCertificate]
hsmClientCertificates) (\s :: DescribeHsmClientCertificatesResponse
s@DescribeHsmClientCertificatesResponse' {} Maybe [HsmClientCertificate]
a -> DescribeHsmClientCertificatesResponse
s {$sel:hsmClientCertificates:DescribeHsmClientCertificatesResponse' :: Maybe [HsmClientCertificate]
hsmClientCertificates = Maybe [HsmClientCertificate]
a} :: DescribeHsmClientCertificatesResponse) 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

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeHsmClientCertificatesResponse_marker :: Lens.Lens' DescribeHsmClientCertificatesResponse (Prelude.Maybe Prelude.Text)
describeHsmClientCertificatesResponse_marker :: Lens' DescribeHsmClientCertificatesResponse (Maybe Text)
describeHsmClientCertificatesResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmClientCertificatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeHsmClientCertificatesResponse' :: DescribeHsmClientCertificatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeHsmClientCertificatesResponse
s@DescribeHsmClientCertificatesResponse' {} Maybe Text
a -> DescribeHsmClientCertificatesResponse
s {$sel:marker:DescribeHsmClientCertificatesResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeHsmClientCertificatesResponse)

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

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