{-# 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.DescribeHsmConfigurations
-- 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 Amazon Redshift HSM
-- configuration. If no configuration ID is specified, returns information
-- about all the HSM configurations 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 connections 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 connections that have any combination of those values are returned.
--
-- If both tag keys and values are omitted from the request, HSM
-- connections are returned regardless of whether they have tag keys or
-- values associated with them.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeHsmConfigurations
  ( -- * Creating a Request
    DescribeHsmConfigurations (..),
    newDescribeHsmConfigurations,

    -- * Request Lenses
    describeHsmConfigurations_hsmConfigurationIdentifier,
    describeHsmConfigurations_marker,
    describeHsmConfigurations_maxRecords,
    describeHsmConfigurations_tagKeys,
    describeHsmConfigurations_tagValues,

    -- * Destructuring the Response
    DescribeHsmConfigurationsResponse (..),
    newDescribeHsmConfigurationsResponse,

    -- * Response Lenses
    describeHsmConfigurationsResponse_hsmConfigurations,
    describeHsmConfigurationsResponse_marker,
    describeHsmConfigurationsResponse_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:/ 'newDescribeHsmConfigurations' smart constructor.
data DescribeHsmConfigurations = DescribeHsmConfigurations'
  { -- | The identifier of a specific Amazon Redshift HSM configuration to be
    -- described. If no identifier is specified, information is returned for
    -- all HSM configurations owned by your Amazon Web Services account.
    DescribeHsmConfigurations -> Maybe Text
hsmConfigurationIdentifier :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeHsmConfigurations
    -- 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.
    DescribeHsmConfigurations -> 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.
    DescribeHsmConfigurations -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | A tag key or keys for which you want to return all matching HSM
    -- configurations that are associated with the specified key or keys. For
    -- example, suppose that you have HSM configurations 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
    -- configurations that have either or both of these tag keys associated
    -- with them.
    DescribeHsmConfigurations -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching HSM
    -- configurations that are associated with the specified tag value or
    -- values. For example, suppose that you have HSM configurations 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 configurations that have either or both of these tag values
    -- associated with them.
    DescribeHsmConfigurations -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeHsmConfigurations -> DescribeHsmConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHsmConfigurations -> DescribeHsmConfigurations -> Bool
$c/= :: DescribeHsmConfigurations -> DescribeHsmConfigurations -> Bool
== :: DescribeHsmConfigurations -> DescribeHsmConfigurations -> Bool
$c== :: DescribeHsmConfigurations -> DescribeHsmConfigurations -> Bool
Prelude.Eq, ReadPrec [DescribeHsmConfigurations]
ReadPrec DescribeHsmConfigurations
Int -> ReadS DescribeHsmConfigurations
ReadS [DescribeHsmConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHsmConfigurations]
$creadListPrec :: ReadPrec [DescribeHsmConfigurations]
readPrec :: ReadPrec DescribeHsmConfigurations
$creadPrec :: ReadPrec DescribeHsmConfigurations
readList :: ReadS [DescribeHsmConfigurations]
$creadList :: ReadS [DescribeHsmConfigurations]
readsPrec :: Int -> ReadS DescribeHsmConfigurations
$creadsPrec :: Int -> ReadS DescribeHsmConfigurations
Prelude.Read, Int -> DescribeHsmConfigurations -> ShowS
[DescribeHsmConfigurations] -> ShowS
DescribeHsmConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHsmConfigurations] -> ShowS
$cshowList :: [DescribeHsmConfigurations] -> ShowS
show :: DescribeHsmConfigurations -> String
$cshow :: DescribeHsmConfigurations -> String
showsPrec :: Int -> DescribeHsmConfigurations -> ShowS
$cshowsPrec :: Int -> DescribeHsmConfigurations -> ShowS
Prelude.Show, forall x.
Rep DescribeHsmConfigurations x -> DescribeHsmConfigurations
forall x.
DescribeHsmConfigurations -> Rep DescribeHsmConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHsmConfigurations x -> DescribeHsmConfigurations
$cfrom :: forall x.
DescribeHsmConfigurations -> Rep DescribeHsmConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHsmConfigurations' 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:
--
-- 'hsmConfigurationIdentifier', 'describeHsmConfigurations_hsmConfigurationIdentifier' - The identifier of a specific Amazon Redshift HSM configuration to be
-- described. If no identifier is specified, information is returned for
-- all HSM configurations owned by your Amazon Web Services account.
--
-- 'marker', 'describeHsmConfigurations_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeHsmConfigurations
-- 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', 'describeHsmConfigurations_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', 'describeHsmConfigurations_tagKeys' - A tag key or keys for which you want to return all matching HSM
-- configurations that are associated with the specified key or keys. For
-- example, suppose that you have HSM configurations 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
-- configurations that have either or both of these tag keys associated
-- with them.
--
-- 'tagValues', 'describeHsmConfigurations_tagValues' - A tag value or values for which you want to return all matching HSM
-- configurations that are associated with the specified tag value or
-- values. For example, suppose that you have HSM configurations 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 configurations that have either or both of these tag values
-- associated with them.
newDescribeHsmConfigurations ::
  DescribeHsmConfigurations
newDescribeHsmConfigurations :: DescribeHsmConfigurations
newDescribeHsmConfigurations =
  DescribeHsmConfigurations'
    { $sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: Maybe Text
hsmConfigurationIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeHsmConfigurations' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeHsmConfigurations' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeHsmConfigurations' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeHsmConfigurations' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of a specific Amazon Redshift HSM configuration to be
-- described. If no identifier is specified, information is returned for
-- all HSM configurations owned by your Amazon Web Services account.
describeHsmConfigurations_hsmConfigurationIdentifier :: Lens.Lens' DescribeHsmConfigurations (Prelude.Maybe Prelude.Text)
describeHsmConfigurations_hsmConfigurationIdentifier :: Lens' DescribeHsmConfigurations (Maybe Text)
describeHsmConfigurations_hsmConfigurationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurations' {Maybe Text
hsmConfigurationIdentifier :: Maybe Text
$sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
hsmConfigurationIdentifier} -> Maybe Text
hsmConfigurationIdentifier) (\s :: DescribeHsmConfigurations
s@DescribeHsmConfigurations' {} Maybe Text
a -> DescribeHsmConfigurations
s {$sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: Maybe Text
hsmConfigurationIdentifier = Maybe Text
a} :: DescribeHsmConfigurations)

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeHsmConfigurations
-- 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.
describeHsmConfigurations_marker :: Lens.Lens' DescribeHsmConfigurations (Prelude.Maybe Prelude.Text)
describeHsmConfigurations_marker :: Lens' DescribeHsmConfigurations (Maybe Text)
describeHsmConfigurations_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurations' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeHsmConfigurations
s@DescribeHsmConfigurations' {} Maybe Text
a -> DescribeHsmConfigurations
s {$sel:marker:DescribeHsmConfigurations' :: Maybe Text
marker = Maybe Text
a} :: DescribeHsmConfigurations)

-- | 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.
describeHsmConfigurations_maxRecords :: Lens.Lens' DescribeHsmConfigurations (Prelude.Maybe Prelude.Int)
describeHsmConfigurations_maxRecords :: Lens' DescribeHsmConfigurations (Maybe Int)
describeHsmConfigurations_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurations' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeHsmConfigurations
s@DescribeHsmConfigurations' {} Maybe Int
a -> DescribeHsmConfigurations
s {$sel:maxRecords:DescribeHsmConfigurations' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeHsmConfigurations)

-- | A tag key or keys for which you want to return all matching HSM
-- configurations that are associated with the specified key or keys. For
-- example, suppose that you have HSM configurations 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
-- configurations that have either or both of these tag keys associated
-- with them.
describeHsmConfigurations_tagKeys :: Lens.Lens' DescribeHsmConfigurations (Prelude.Maybe [Prelude.Text])
describeHsmConfigurations_tagKeys :: Lens' DescribeHsmConfigurations (Maybe [Text])
describeHsmConfigurations_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurations' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeHsmConfigurations
s@DescribeHsmConfigurations' {} Maybe [Text]
a -> DescribeHsmConfigurations
s {$sel:tagKeys:DescribeHsmConfigurations' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeHsmConfigurations) 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
-- configurations that are associated with the specified tag value or
-- values. For example, suppose that you have HSM configurations 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 configurations that have either or both of these tag values
-- associated with them.
describeHsmConfigurations_tagValues :: Lens.Lens' DescribeHsmConfigurations (Prelude.Maybe [Prelude.Text])
describeHsmConfigurations_tagValues :: Lens' DescribeHsmConfigurations (Maybe [Text])
describeHsmConfigurations_tagValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurations' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeHsmConfigurations
s@DescribeHsmConfigurations' {} Maybe [Text]
a -> DescribeHsmConfigurations
s {$sel:tagValues:DescribeHsmConfigurations' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeHsmConfigurations) 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 DescribeHsmConfigurations where
  page :: DescribeHsmConfigurations
-> AWSResponse DescribeHsmConfigurations
-> Maybe DescribeHsmConfigurations
page DescribeHsmConfigurations
rq AWSResponse DescribeHsmConfigurations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeHsmConfigurations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeHsmConfigurationsResponse (Maybe Text)
describeHsmConfigurationsResponse_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 DescribeHsmConfigurations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeHsmConfigurationsResponse (Maybe [HsmConfiguration])
describeHsmConfigurationsResponse_hsmConfigurations
            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.$ DescribeHsmConfigurations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeHsmConfigurations (Maybe Text)
describeHsmConfigurations_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeHsmConfigurations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeHsmConfigurationsResponse (Maybe Text)
describeHsmConfigurationsResponse_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 DescribeHsmConfigurations where
  type
    AWSResponse DescribeHsmConfigurations =
      DescribeHsmConfigurationsResponse
  request :: (Service -> Service)
-> DescribeHsmConfigurations -> Request DescribeHsmConfigurations
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 DescribeHsmConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHsmConfigurations)))
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
"DescribeHsmConfigurationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [HsmConfiguration]
-> Maybe Text -> Int -> DescribeHsmConfigurationsResponse
DescribeHsmConfigurationsResponse'
            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
"HsmConfigurations"
                            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
"HsmConfiguration")
                        )
            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 DescribeHsmConfigurations where
  hashWithSalt :: Int -> DescribeHsmConfigurations -> Int
hashWithSalt Int
_salt DescribeHsmConfigurations' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmConfigurationIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:tagKeys:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:maxRecords:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Int
$sel:marker:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
$sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hsmConfigurationIdentifier
      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 DescribeHsmConfigurations where
  rnf :: DescribeHsmConfigurations -> ()
rnf DescribeHsmConfigurations' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmConfigurationIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:tagKeys:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:maxRecords:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Int
$sel:marker:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
$sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hsmConfigurationIdentifier
      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 DescribeHsmConfigurations where
  toHeaders :: DescribeHsmConfigurations -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DescribeHsmConfigurations where
  toQuery :: DescribeHsmConfigurations -> QueryString
toQuery DescribeHsmConfigurations' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
hsmConfigurationIdentifier :: Maybe Text
$sel:tagValues:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:tagKeys:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe [Text]
$sel:maxRecords:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Int
$sel:marker:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
$sel:hsmConfigurationIdentifier:DescribeHsmConfigurations' :: DescribeHsmConfigurations -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeHsmConfigurations" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"HsmConfigurationIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
hsmConfigurationIdentifier,
        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:/ 'newDescribeHsmConfigurationsResponse' smart constructor.
data DescribeHsmConfigurationsResponse = DescribeHsmConfigurationsResponse'
  { -- | A list of @HsmConfiguration@ objects.
    DescribeHsmConfigurationsResponse -> Maybe [HsmConfiguration]
hsmConfigurations :: Prelude.Maybe [HsmConfiguration],
    -- | 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.
    DescribeHsmConfigurationsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeHsmConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeHsmConfigurationsResponse
-> DescribeHsmConfigurationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHsmConfigurationsResponse
-> DescribeHsmConfigurationsResponse -> Bool
$c/= :: DescribeHsmConfigurationsResponse
-> DescribeHsmConfigurationsResponse -> Bool
== :: DescribeHsmConfigurationsResponse
-> DescribeHsmConfigurationsResponse -> Bool
$c== :: DescribeHsmConfigurationsResponse
-> DescribeHsmConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHsmConfigurationsResponse]
ReadPrec DescribeHsmConfigurationsResponse
Int -> ReadS DescribeHsmConfigurationsResponse
ReadS [DescribeHsmConfigurationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHsmConfigurationsResponse]
$creadListPrec :: ReadPrec [DescribeHsmConfigurationsResponse]
readPrec :: ReadPrec DescribeHsmConfigurationsResponse
$creadPrec :: ReadPrec DescribeHsmConfigurationsResponse
readList :: ReadS [DescribeHsmConfigurationsResponse]
$creadList :: ReadS [DescribeHsmConfigurationsResponse]
readsPrec :: Int -> ReadS DescribeHsmConfigurationsResponse
$creadsPrec :: Int -> ReadS DescribeHsmConfigurationsResponse
Prelude.Read, Int -> DescribeHsmConfigurationsResponse -> ShowS
[DescribeHsmConfigurationsResponse] -> ShowS
DescribeHsmConfigurationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHsmConfigurationsResponse] -> ShowS
$cshowList :: [DescribeHsmConfigurationsResponse] -> ShowS
show :: DescribeHsmConfigurationsResponse -> String
$cshow :: DescribeHsmConfigurationsResponse -> String
showsPrec :: Int -> DescribeHsmConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeHsmConfigurationsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeHsmConfigurationsResponse x
-> DescribeHsmConfigurationsResponse
forall x.
DescribeHsmConfigurationsResponse
-> Rep DescribeHsmConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHsmConfigurationsResponse x
-> DescribeHsmConfigurationsResponse
$cfrom :: forall x.
DescribeHsmConfigurationsResponse
-> Rep DescribeHsmConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHsmConfigurationsResponse' 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:
--
-- 'hsmConfigurations', 'describeHsmConfigurationsResponse_hsmConfigurations' - A list of @HsmConfiguration@ objects.
--
-- 'marker', 'describeHsmConfigurationsResponse_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', 'describeHsmConfigurationsResponse_httpStatus' - The response's http status code.
newDescribeHsmConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeHsmConfigurationsResponse
newDescribeHsmConfigurationsResponse :: Int -> DescribeHsmConfigurationsResponse
newDescribeHsmConfigurationsResponse Int
pHttpStatus_ =
  DescribeHsmConfigurationsResponse'
    { $sel:hsmConfigurations:DescribeHsmConfigurationsResponse' :: Maybe [HsmConfiguration]
hsmConfigurations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeHsmConfigurationsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeHsmConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of @HsmConfiguration@ objects.
describeHsmConfigurationsResponse_hsmConfigurations :: Lens.Lens' DescribeHsmConfigurationsResponse (Prelude.Maybe [HsmConfiguration])
describeHsmConfigurationsResponse_hsmConfigurations :: Lens' DescribeHsmConfigurationsResponse (Maybe [HsmConfiguration])
describeHsmConfigurationsResponse_hsmConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurationsResponse' {Maybe [HsmConfiguration]
hsmConfigurations :: Maybe [HsmConfiguration]
$sel:hsmConfigurations:DescribeHsmConfigurationsResponse' :: DescribeHsmConfigurationsResponse -> Maybe [HsmConfiguration]
hsmConfigurations} -> Maybe [HsmConfiguration]
hsmConfigurations) (\s :: DescribeHsmConfigurationsResponse
s@DescribeHsmConfigurationsResponse' {} Maybe [HsmConfiguration]
a -> DescribeHsmConfigurationsResponse
s {$sel:hsmConfigurations:DescribeHsmConfigurationsResponse' :: Maybe [HsmConfiguration]
hsmConfigurations = Maybe [HsmConfiguration]
a} :: DescribeHsmConfigurationsResponse) 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.
describeHsmConfigurationsResponse_marker :: Lens.Lens' DescribeHsmConfigurationsResponse (Prelude.Maybe Prelude.Text)
describeHsmConfigurationsResponse_marker :: Lens' DescribeHsmConfigurationsResponse (Maybe Text)
describeHsmConfigurationsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHsmConfigurationsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeHsmConfigurationsResponse' :: DescribeHsmConfigurationsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeHsmConfigurationsResponse
s@DescribeHsmConfigurationsResponse' {} Maybe Text
a -> DescribeHsmConfigurationsResponse
s {$sel:marker:DescribeHsmConfigurationsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeHsmConfigurationsResponse)

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

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