{-# 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.KMS.DescribeCustomKeyStores
-- 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)
--
-- Gets information about
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key stores>
-- in the account and Region.
--
-- This operation is part of the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html Custom Key Store feature>
-- feature in KMS, which combines the convenience and extensive integration
-- of KMS with the isolation and control of a single-tenant key store.
--
-- By default, this operation returns information about all custom key
-- stores in the account and Region. To get only information about a
-- particular custom key store, use either the @CustomKeyStoreName@ or
-- @CustomKeyStoreId@ parameter (but not both).
--
-- To determine whether the custom key store is connected to its CloudHSM
-- cluster, use the @ConnectionState@ element in the response. If an
-- attempt to connect the custom key store failed, the @ConnectionState@
-- value is @FAILED@ and the @ConnectionErrorCode@ element in the response
-- indicates the cause of the failure. For help interpreting the
-- @ConnectionErrorCode@, see CustomKeyStoresListEntry.
--
-- Custom key stores have a @DISCONNECTED@ connection state if the key
-- store has never been connected or you use the DisconnectCustomKeyStore
-- operation to disconnect it. If your custom key store state is
-- @CONNECTED@ but you are having trouble using it, make sure that its
-- associated CloudHSM cluster is active and contains the minimum number of
-- HSMs required for the operation, if any.
--
-- For help repairing your custom key store, see the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html Troubleshooting Custom Key Stores>
-- topic in the /Key Management Service Developer Guide/.
--
-- __Cross-account use__: No. You cannot perform this operation on a custom
-- key store in a different Amazon Web Services account.
--
-- __Required permissions__:
-- <https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html kms:DescribeCustomKeyStores>
-- (IAM policy)
--
-- __Related operations:__
--
-- -   ConnectCustomKeyStore
--
-- -   CreateCustomKeyStore
--
-- -   DeleteCustomKeyStore
--
-- -   DisconnectCustomKeyStore
--
-- -   UpdateCustomKeyStore
module Amazonka.KMS.DescribeCustomKeyStores
  ( -- * Creating a Request
    DescribeCustomKeyStores (..),
    newDescribeCustomKeyStores,

    -- * Request Lenses
    describeCustomKeyStores_customKeyStoreName,
    describeCustomKeyStores_marker,
    describeCustomKeyStores_limit,
    describeCustomKeyStores_customKeyStoreId,

    -- * Destructuring the Response
    DescribeCustomKeyStoresResponse (..),
    newDescribeCustomKeyStoresResponse,

    -- * Response Lenses
    describeCustomKeyStoresResponse_truncated,
    describeCustomKeyStoresResponse_nextMarker,
    describeCustomKeyStoresResponse_customKeyStores,
    describeCustomKeyStoresResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KMS.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:/ 'newDescribeCustomKeyStores' smart constructor.
data DescribeCustomKeyStores = DescribeCustomKeyStores'
  { -- | Gets only information about the specified custom key store. Enter the
    -- friendly name of the custom key store.
    --
    -- By default, this operation gets information about all custom key stores
    -- in the account and Region. To limit the output to a particular custom
    -- key store, you can use either the @CustomKeyStoreId@ or
    -- @CustomKeyStoreName@ parameter, but not both.
    DescribeCustomKeyStores -> Maybe Text
customKeyStoreName :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter in a subsequent request after you receive a response
    -- with truncated results. Set it to the value of @NextMarker@ from the
    -- truncated response you just received.
    DescribeCustomKeyStores -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to specify the maximum number of items to return.
    -- When this value is present, KMS does not return more than the specified
    -- number of items, but it might return fewer.
    DescribeCustomKeyStores -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Gets only information about the specified custom key store. Enter the
    -- key store ID.
    --
    -- By default, this operation gets information about all custom key stores
    -- in the account and Region. To limit the output to a particular custom
    -- key store, you can use either the @CustomKeyStoreId@ or
    -- @CustomKeyStoreName@ parameter, but not both.
    DescribeCustomKeyStores -> Maybe Text
customKeyStoreId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
(DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool)
-> (DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool)
-> Eq DescribeCustomKeyStores
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
$c/= :: DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
== :: DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
$c== :: DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
Prelude.Eq, ReadPrec [DescribeCustomKeyStores]
ReadPrec DescribeCustomKeyStores
Int -> ReadS DescribeCustomKeyStores
ReadS [DescribeCustomKeyStores]
(Int -> ReadS DescribeCustomKeyStores)
-> ReadS [DescribeCustomKeyStores]
-> ReadPrec DescribeCustomKeyStores
-> ReadPrec [DescribeCustomKeyStores]
-> Read DescribeCustomKeyStores
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomKeyStores]
$creadListPrec :: ReadPrec [DescribeCustomKeyStores]
readPrec :: ReadPrec DescribeCustomKeyStores
$creadPrec :: ReadPrec DescribeCustomKeyStores
readList :: ReadS [DescribeCustomKeyStores]
$creadList :: ReadS [DescribeCustomKeyStores]
readsPrec :: Int -> ReadS DescribeCustomKeyStores
$creadsPrec :: Int -> ReadS DescribeCustomKeyStores
Prelude.Read, Int -> DescribeCustomKeyStores -> ShowS
[DescribeCustomKeyStores] -> ShowS
DescribeCustomKeyStores -> String
(Int -> DescribeCustomKeyStores -> ShowS)
-> (DescribeCustomKeyStores -> String)
-> ([DescribeCustomKeyStores] -> ShowS)
-> Show DescribeCustomKeyStores
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomKeyStores] -> ShowS
$cshowList :: [DescribeCustomKeyStores] -> ShowS
show :: DescribeCustomKeyStores -> String
$cshow :: DescribeCustomKeyStores -> String
showsPrec :: Int -> DescribeCustomKeyStores -> ShowS
$cshowsPrec :: Int -> DescribeCustomKeyStores -> ShowS
Prelude.Show, (forall x.
 DescribeCustomKeyStores -> Rep DescribeCustomKeyStores x)
-> (forall x.
    Rep DescribeCustomKeyStores x -> DescribeCustomKeyStores)
-> Generic DescribeCustomKeyStores
forall x. Rep DescribeCustomKeyStores x -> DescribeCustomKeyStores
forall x. DescribeCustomKeyStores -> Rep DescribeCustomKeyStores x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCustomKeyStores x -> DescribeCustomKeyStores
$cfrom :: forall x. DescribeCustomKeyStores -> Rep DescribeCustomKeyStores x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomKeyStores' 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:
--
-- 'customKeyStoreName', 'describeCustomKeyStores_customKeyStoreName' - Gets only information about the specified custom key store. Enter the
-- friendly name of the custom key store.
--
-- By default, this operation gets information about all custom key stores
-- in the account and Region. To limit the output to a particular custom
-- key store, you can use either the @CustomKeyStoreId@ or
-- @CustomKeyStoreName@ parameter, but not both.
--
-- 'marker', 'describeCustomKeyStores_marker' - Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
--
-- 'limit', 'describeCustomKeyStores_limit' - Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- 'customKeyStoreId', 'describeCustomKeyStores_customKeyStoreId' - Gets only information about the specified custom key store. Enter the
-- key store ID.
--
-- By default, this operation gets information about all custom key stores
-- in the account and Region. To limit the output to a particular custom
-- key store, you can use either the @CustomKeyStoreId@ or
-- @CustomKeyStoreName@ parameter, but not both.
newDescribeCustomKeyStores ::
  DescribeCustomKeyStores
newDescribeCustomKeyStores :: DescribeCustomKeyStores
newDescribeCustomKeyStores =
  DescribeCustomKeyStores' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> DescribeCustomKeyStores
DescribeCustomKeyStores'
    { $sel:customKeyStoreName:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCustomKeyStores' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeCustomKeyStores' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:customKeyStoreId:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Gets only information about the specified custom key store. Enter the
-- friendly name of the custom key store.
--
-- By default, this operation gets information about all custom key stores
-- in the account and Region. To limit the output to a particular custom
-- key store, you can use either the @CustomKeyStoreId@ or
-- @CustomKeyStoreName@ parameter, but not both.
describeCustomKeyStores_customKeyStoreName :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Text)
describeCustomKeyStores_customKeyStoreName :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomKeyStores -> f DescribeCustomKeyStores
describeCustomKeyStores_customKeyStoreName = (DescribeCustomKeyStores -> Maybe Text)
-> (DescribeCustomKeyStores
    -> Maybe Text -> DescribeCustomKeyStores)
-> Lens
     DescribeCustomKeyStores
     DescribeCustomKeyStores
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStores' {Maybe Text
customKeyStoreName :: Maybe Text
$sel:customKeyStoreName:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
customKeyStoreName} -> Maybe Text
customKeyStoreName) (\s :: DescribeCustomKeyStores
s@DescribeCustomKeyStores' {} Maybe Text
a -> DescribeCustomKeyStores
s {$sel:customKeyStoreName:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreName = Maybe Text
a} :: DescribeCustomKeyStores)

-- | Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
describeCustomKeyStores_marker :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Text)
describeCustomKeyStores_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomKeyStores -> f DescribeCustomKeyStores
describeCustomKeyStores_marker = (DescribeCustomKeyStores -> Maybe Text)
-> (DescribeCustomKeyStores
    -> Maybe Text -> DescribeCustomKeyStores)
-> Lens
     DescribeCustomKeyStores
     DescribeCustomKeyStores
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStores' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCustomKeyStores
s@DescribeCustomKeyStores' {} Maybe Text
a -> DescribeCustomKeyStores
s {$sel:marker:DescribeCustomKeyStores' :: Maybe Text
marker = Maybe Text
a} :: DescribeCustomKeyStores)

-- | Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
describeCustomKeyStores_limit :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Natural)
describeCustomKeyStores_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeCustomKeyStores -> f DescribeCustomKeyStores
describeCustomKeyStores_limit = (DescribeCustomKeyStores -> Maybe Natural)
-> (DescribeCustomKeyStores
    -> Maybe Natural -> DescribeCustomKeyStores)
-> Lens
     DescribeCustomKeyStores
     DescribeCustomKeyStores
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStores' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeCustomKeyStores
s@DescribeCustomKeyStores' {} Maybe Natural
a -> DescribeCustomKeyStores
s {$sel:limit:DescribeCustomKeyStores' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeCustomKeyStores)

-- | Gets only information about the specified custom key store. Enter the
-- key store ID.
--
-- By default, this operation gets information about all custom key stores
-- in the account and Region. To limit the output to a particular custom
-- key store, you can use either the @CustomKeyStoreId@ or
-- @CustomKeyStoreName@ parameter, but not both.
describeCustomKeyStores_customKeyStoreId :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Text)
describeCustomKeyStores_customKeyStoreId :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomKeyStores -> f DescribeCustomKeyStores
describeCustomKeyStores_customKeyStoreId = (DescribeCustomKeyStores -> Maybe Text)
-> (DescribeCustomKeyStores
    -> Maybe Text -> DescribeCustomKeyStores)
-> Lens
     DescribeCustomKeyStores
     DescribeCustomKeyStores
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStores' {Maybe Text
customKeyStoreId :: Maybe Text
$sel:customKeyStoreId:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
customKeyStoreId} -> Maybe Text
customKeyStoreId) (\s :: DescribeCustomKeyStores
s@DescribeCustomKeyStores' {} Maybe Text
a -> DescribeCustomKeyStores
s {$sel:customKeyStoreId:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreId = Maybe Text
a} :: DescribeCustomKeyStores)

instance Core.AWSRequest DescribeCustomKeyStores where
  type
    AWSResponse DescribeCustomKeyStores =
      DescribeCustomKeyStoresResponse
  request :: DescribeCustomKeyStores -> Request DescribeCustomKeyStores
request = Service
-> DescribeCustomKeyStores -> Request DescribeCustomKeyStores
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeCustomKeyStores
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCustomKeyStores)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeCustomKeyStores))
-> Logger
-> Service
-> Proxy DescribeCustomKeyStores
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCustomKeyStores)))
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 Bool
-> Maybe Text
-> Maybe [CustomKeyStoresListEntry]
-> Int
-> DescribeCustomKeyStoresResponse
DescribeCustomKeyStoresResponse'
            (Maybe Bool
 -> Maybe Text
 -> Maybe [CustomKeyStoresListEntry]
 -> Int
 -> DescribeCustomKeyStoresResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [CustomKeyStoresListEntry]
      -> Int
      -> DescribeCustomKeyStoresResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Truncated")
            Either
  String
  (Maybe Text
   -> Maybe [CustomKeyStoresListEntry]
   -> Int
   -> DescribeCustomKeyStoresResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [CustomKeyStoresListEntry]
      -> Int -> DescribeCustomKeyStoresResponse)
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
"NextMarker")
            Either
  String
  (Maybe [CustomKeyStoresListEntry]
   -> Int -> DescribeCustomKeyStoresResponse)
-> Either String (Maybe [CustomKeyStoresListEntry])
-> Either String (Int -> DescribeCustomKeyStoresResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [CustomKeyStoresListEntry]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CustomKeyStores"
                            Either String (Maybe (Maybe [CustomKeyStoresListEntry]))
-> Maybe [CustomKeyStoresListEntry]
-> Either String (Maybe [CustomKeyStoresListEntry])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CustomKeyStoresListEntry]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeCustomKeyStoresResponse)
-> Either String Int
-> Either String DescribeCustomKeyStoresResponse
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 DescribeCustomKeyStores

instance Prelude.NFData DescribeCustomKeyStores

instance Core.ToHeaders DescribeCustomKeyStores where
  toHeaders :: DescribeCustomKeyStores -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeCustomKeyStores -> 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
"TrentService.DescribeCustomKeyStores" ::
                          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 DescribeCustomKeyStores where
  toJSON :: DescribeCustomKeyStores -> Value
toJSON DescribeCustomKeyStores' {Maybe Natural
Maybe Text
customKeyStoreId :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
customKeyStoreName :: Maybe Text
$sel:customKeyStoreId:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:limit:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Natural
$sel:marker:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:customKeyStoreName:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CustomKeyStoreName" 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
customKeyStoreName,
            (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
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            (Text
"CustomKeyStoreId" 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
customKeyStoreId
          ]
      )

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

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

-- | /See:/ 'newDescribeCustomKeyStoresResponse' smart constructor.
data DescribeCustomKeyStoresResponse = DescribeCustomKeyStoresResponse'
  { -- | A flag that indicates whether there are more items in the list. When
    -- this value is true, the list in this response is truncated. To get more
    -- items, pass the value of the @NextMarker@ element in thisresponse to the
    -- @Marker@ parameter in a subsequent request.
    DescribeCustomKeyStoresResponse -> Maybe Bool
truncated :: Prelude.Maybe Prelude.Bool,
    -- | When @Truncated@ is true, this element is present and contains the value
    -- to use for the @Marker@ parameter in a subsequent request.
    DescribeCustomKeyStoresResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | Contains metadata about each custom key store.
    DescribeCustomKeyStoresResponse -> Maybe [CustomKeyStoresListEntry]
customKeyStores :: Prelude.Maybe [CustomKeyStoresListEntry],
    -- | The response's http status code.
    DescribeCustomKeyStoresResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
(DescribeCustomKeyStoresResponse
 -> DescribeCustomKeyStoresResponse -> Bool)
-> (DescribeCustomKeyStoresResponse
    -> DescribeCustomKeyStoresResponse -> Bool)
-> Eq DescribeCustomKeyStoresResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
$c/= :: DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
== :: DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
$c== :: DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCustomKeyStoresResponse]
ReadPrec DescribeCustomKeyStoresResponse
Int -> ReadS DescribeCustomKeyStoresResponse
ReadS [DescribeCustomKeyStoresResponse]
(Int -> ReadS DescribeCustomKeyStoresResponse)
-> ReadS [DescribeCustomKeyStoresResponse]
-> ReadPrec DescribeCustomKeyStoresResponse
-> ReadPrec [DescribeCustomKeyStoresResponse]
-> Read DescribeCustomKeyStoresResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomKeyStoresResponse]
$creadListPrec :: ReadPrec [DescribeCustomKeyStoresResponse]
readPrec :: ReadPrec DescribeCustomKeyStoresResponse
$creadPrec :: ReadPrec DescribeCustomKeyStoresResponse
readList :: ReadS [DescribeCustomKeyStoresResponse]
$creadList :: ReadS [DescribeCustomKeyStoresResponse]
readsPrec :: Int -> ReadS DescribeCustomKeyStoresResponse
$creadsPrec :: Int -> ReadS DescribeCustomKeyStoresResponse
Prelude.Read, Int -> DescribeCustomKeyStoresResponse -> ShowS
[DescribeCustomKeyStoresResponse] -> ShowS
DescribeCustomKeyStoresResponse -> String
(Int -> DescribeCustomKeyStoresResponse -> ShowS)
-> (DescribeCustomKeyStoresResponse -> String)
-> ([DescribeCustomKeyStoresResponse] -> ShowS)
-> Show DescribeCustomKeyStoresResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomKeyStoresResponse] -> ShowS
$cshowList :: [DescribeCustomKeyStoresResponse] -> ShowS
show :: DescribeCustomKeyStoresResponse -> String
$cshow :: DescribeCustomKeyStoresResponse -> String
showsPrec :: Int -> DescribeCustomKeyStoresResponse -> ShowS
$cshowsPrec :: Int -> DescribeCustomKeyStoresResponse -> ShowS
Prelude.Show, (forall x.
 DescribeCustomKeyStoresResponse
 -> Rep DescribeCustomKeyStoresResponse x)
-> (forall x.
    Rep DescribeCustomKeyStoresResponse x
    -> DescribeCustomKeyStoresResponse)
-> Generic DescribeCustomKeyStoresResponse
forall x.
Rep DescribeCustomKeyStoresResponse x
-> DescribeCustomKeyStoresResponse
forall x.
DescribeCustomKeyStoresResponse
-> Rep DescribeCustomKeyStoresResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomKeyStoresResponse x
-> DescribeCustomKeyStoresResponse
$cfrom :: forall x.
DescribeCustomKeyStoresResponse
-> Rep DescribeCustomKeyStoresResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomKeyStoresResponse' 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:
--
-- 'truncated', 'describeCustomKeyStoresResponse_truncated' - A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
--
-- 'nextMarker', 'describeCustomKeyStoresResponse_nextMarker' - When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
--
-- 'customKeyStores', 'describeCustomKeyStoresResponse_customKeyStores' - Contains metadata about each custom key store.
--
-- 'httpStatus', 'describeCustomKeyStoresResponse_httpStatus' - The response's http status code.
newDescribeCustomKeyStoresResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCustomKeyStoresResponse
newDescribeCustomKeyStoresResponse :: Int -> DescribeCustomKeyStoresResponse
newDescribeCustomKeyStoresResponse Int
pHttpStatus_ =
  DescribeCustomKeyStoresResponse' :: Maybe Bool
-> Maybe Text
-> Maybe [CustomKeyStoresListEntry]
-> Int
-> DescribeCustomKeyStoresResponse
DescribeCustomKeyStoresResponse'
    { $sel:truncated:DescribeCustomKeyStoresResponse' :: Maybe Bool
truncated =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:DescribeCustomKeyStoresResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customKeyStores:DescribeCustomKeyStoresResponse' :: Maybe [CustomKeyStoresListEntry]
customKeyStores = Maybe [CustomKeyStoresListEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCustomKeyStoresResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
describeCustomKeyStoresResponse_truncated :: Lens.Lens' DescribeCustomKeyStoresResponse (Prelude.Maybe Prelude.Bool)
describeCustomKeyStoresResponse_truncated :: (Maybe Bool -> f (Maybe Bool))
-> DescribeCustomKeyStoresResponse
-> f DescribeCustomKeyStoresResponse
describeCustomKeyStoresResponse_truncated = (DescribeCustomKeyStoresResponse -> Maybe Bool)
-> (DescribeCustomKeyStoresResponse
    -> Maybe Bool -> DescribeCustomKeyStoresResponse)
-> Lens
     DescribeCustomKeyStoresResponse
     DescribeCustomKeyStoresResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStoresResponse' {Maybe Bool
truncated :: Maybe Bool
$sel:truncated:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe Bool
truncated} -> Maybe Bool
truncated) (\s :: DescribeCustomKeyStoresResponse
s@DescribeCustomKeyStoresResponse' {} Maybe Bool
a -> DescribeCustomKeyStoresResponse
s {$sel:truncated:DescribeCustomKeyStoresResponse' :: Maybe Bool
truncated = Maybe Bool
a} :: DescribeCustomKeyStoresResponse)

-- | When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
describeCustomKeyStoresResponse_nextMarker :: Lens.Lens' DescribeCustomKeyStoresResponse (Prelude.Maybe Prelude.Text)
describeCustomKeyStoresResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomKeyStoresResponse
-> f DescribeCustomKeyStoresResponse
describeCustomKeyStoresResponse_nextMarker = (DescribeCustomKeyStoresResponse -> Maybe Text)
-> (DescribeCustomKeyStoresResponse
    -> Maybe Text -> DescribeCustomKeyStoresResponse)
-> Lens
     DescribeCustomKeyStoresResponse
     DescribeCustomKeyStoresResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStoresResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: DescribeCustomKeyStoresResponse
s@DescribeCustomKeyStoresResponse' {} Maybe Text
a -> DescribeCustomKeyStoresResponse
s {$sel:nextMarker:DescribeCustomKeyStoresResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: DescribeCustomKeyStoresResponse)

-- | Contains metadata about each custom key store.
describeCustomKeyStoresResponse_customKeyStores :: Lens.Lens' DescribeCustomKeyStoresResponse (Prelude.Maybe [CustomKeyStoresListEntry])
describeCustomKeyStoresResponse_customKeyStores :: (Maybe [CustomKeyStoresListEntry]
 -> f (Maybe [CustomKeyStoresListEntry]))
-> DescribeCustomKeyStoresResponse
-> f DescribeCustomKeyStoresResponse
describeCustomKeyStoresResponse_customKeyStores = (DescribeCustomKeyStoresResponse
 -> Maybe [CustomKeyStoresListEntry])
-> (DescribeCustomKeyStoresResponse
    -> Maybe [CustomKeyStoresListEntry]
    -> DescribeCustomKeyStoresResponse)
-> Lens
     DescribeCustomKeyStoresResponse
     DescribeCustomKeyStoresResponse
     (Maybe [CustomKeyStoresListEntry])
     (Maybe [CustomKeyStoresListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomKeyStoresResponse' {Maybe [CustomKeyStoresListEntry]
customKeyStores :: Maybe [CustomKeyStoresListEntry]
$sel:customKeyStores:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe [CustomKeyStoresListEntry]
customKeyStores} -> Maybe [CustomKeyStoresListEntry]
customKeyStores) (\s :: DescribeCustomKeyStoresResponse
s@DescribeCustomKeyStoresResponse' {} Maybe [CustomKeyStoresListEntry]
a -> DescribeCustomKeyStoresResponse
s {$sel:customKeyStores:DescribeCustomKeyStoresResponse' :: Maybe [CustomKeyStoresListEntry]
customKeyStores = Maybe [CustomKeyStoresListEntry]
a} :: DescribeCustomKeyStoresResponse) ((Maybe [CustomKeyStoresListEntry]
  -> f (Maybe [CustomKeyStoresListEntry]))
 -> DescribeCustomKeyStoresResponse
 -> f DescribeCustomKeyStoresResponse)
-> ((Maybe [CustomKeyStoresListEntry]
     -> f (Maybe [CustomKeyStoresListEntry]))
    -> Maybe [CustomKeyStoresListEntry]
    -> f (Maybe [CustomKeyStoresListEntry]))
-> (Maybe [CustomKeyStoresListEntry]
    -> f (Maybe [CustomKeyStoresListEntry]))
-> DescribeCustomKeyStoresResponse
-> f DescribeCustomKeyStoresResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
-> Iso
     (Maybe [CustomKeyStoresListEntry])
     (Maybe [CustomKeyStoresListEntry])
     (Maybe [CustomKeyStoresListEntry])
     (Maybe [CustomKeyStoresListEntry])
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
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
  [CustomKeyStoresListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeCustomKeyStoresResponse