{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 stores>
-- feature in KMS, which combines the convenience and extensive integration
-- of KMS with the isolation and control of a key store that you own and
-- manage.
--
-- 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 or external key store proxy, 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 used the DisconnectCustomKeyStore
-- operation to disconnect it. Otherwise, the connection state is
-- CONNECTED. If your custom key store connection state is @CONNECTED@ but
-- you are having trouble using it, verify that the backing store is active
-- and available. For an CloudHSM key store, verify that the associated
-- CloudHSM cluster is active and contains the minimum number of HSMs
-- required for the operation, if any. For an external key store, verify
-- that the external key store proxy and its associated external key
-- manager are reachable and enabled.
--
-- For help repairing your CloudHSM key store, see the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html Troubleshooting CloudHSM key stores>.
-- For help repairing your external key store, see the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html Troubleshooting external key stores>.
-- Both topics are 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
--
-- This operation returns paginated results.
module Amazonka.KMS.DescribeCustomKeyStores
  ( -- * Creating a Request
    DescribeCustomKeyStores (..),
    newDescribeCustomKeyStores,

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

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KMS.Types
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
    -- 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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
    -- parameter, but not both.
    DescribeCustomKeyStores -> Maybe Text
customKeyStoreId :: Prelude.Maybe Prelude.Text,
    -- | 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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
    -- parameter, but not both.
    DescribeCustomKeyStores -> Maybe Text
customKeyStoreName :: 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,
    -- | 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
  }
  deriving (DescribeCustomKeyStores -> DescribeCustomKeyStores -> Bool
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]
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
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. 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:
--
-- '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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
-- parameter, but not both.
--
-- '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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
-- parameter, but not both.
--
-- '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.
--
-- '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.
newDescribeCustomKeyStores ::
  DescribeCustomKeyStores
newDescribeCustomKeyStores :: DescribeCustomKeyStores
newDescribeCustomKeyStores =
  DescribeCustomKeyStores'
    { $sel:customKeyStoreId:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customKeyStoreName:DescribeCustomKeyStores' :: Maybe Text
customKeyStoreName = forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeCustomKeyStores' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCustomKeyStores' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing
    }

-- | 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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
-- parameter, but not both.
describeCustomKeyStores_customKeyStoreId :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Text)
describeCustomKeyStores_customKeyStoreId :: Lens' DescribeCustomKeyStores (Maybe Text)
describeCustomKeyStores_customKeyStoreId = 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)

-- | 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, provide either the @CustomKeyStoreId@ or @CustomKeyStoreName@
-- parameter, but not both.
describeCustomKeyStores_customKeyStoreName :: Lens.Lens' DescribeCustomKeyStores (Prelude.Maybe Prelude.Text)
describeCustomKeyStores_customKeyStoreName :: Lens' DescribeCustomKeyStores (Maybe Text)
describeCustomKeyStores_customKeyStoreName = 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 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 :: Lens' DescribeCustomKeyStores (Maybe Natural)
describeCustomKeyStores_limit = 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)

-- | 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 :: Lens' DescribeCustomKeyStores (Maybe Text)
describeCustomKeyStores_marker = 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)

instance Core.AWSPager DescribeCustomKeyStores where
  page :: DescribeCustomKeyStores
-> AWSResponse DescribeCustomKeyStores
-> Maybe DescribeCustomKeyStores
page DescribeCustomKeyStores
rq AWSResponse DescribeCustomKeyStores
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCustomKeyStores
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCustomKeyStoresResponse (Maybe Bool)
describeCustomKeyStoresResponse_truncated
            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. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse DescribeCustomKeyStores
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCustomKeyStoresResponse (Maybe Text)
describeCustomKeyStoresResponse_nextMarker
            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.$ DescribeCustomKeyStores
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeCustomKeyStores (Maybe Text)
describeCustomKeyStores_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCustomKeyStores
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCustomKeyStoresResponse (Maybe Text)
describeCustomKeyStoresResponse_nextMarker
          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 DescribeCustomKeyStores where
  type
    AWSResponse DescribeCustomKeyStores =
      DescribeCustomKeyStoresResponse
  request :: (Service -> Service)
-> DescribeCustomKeyStores -> Request DescribeCustomKeyStores
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeCustomKeyStores
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCustomKeyStores)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [CustomKeyStoresListEntry]
-> Maybe Text
-> Maybe Bool
-> Int
-> DescribeCustomKeyStoresResponse
DescribeCustomKeyStoresResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CustomKeyStores"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextMarker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Truncated")
            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 DescribeCustomKeyStores where
  hashWithSalt :: Int -> DescribeCustomKeyStores -> Int
hashWithSalt Int
_salt DescribeCustomKeyStores' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
customKeyStoreName :: Maybe Text
customKeyStoreId :: Maybe Text
$sel:marker:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:limit:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Natural
$sel:customKeyStoreName:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:customKeyStoreId:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customKeyStoreId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customKeyStoreName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker

instance Prelude.NFData DescribeCustomKeyStores where
  rnf :: DescribeCustomKeyStores -> ()
rnf DescribeCustomKeyStores' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
customKeyStoreName :: Maybe Text
customKeyStoreId :: Maybe Text
$sel:marker:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:limit:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Natural
$sel:customKeyStoreName:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:customKeyStoreId:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customKeyStoreId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customKeyStoreName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker

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

instance Data.ToJSON DescribeCustomKeyStores where
  toJSON :: DescribeCustomKeyStores -> Value
toJSON DescribeCustomKeyStores' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
customKeyStoreName :: Maybe Text
customKeyStoreId :: Maybe Text
$sel:marker:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:limit:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Natural
$sel:customKeyStoreName:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
$sel:customKeyStoreId:DescribeCustomKeyStores' :: DescribeCustomKeyStores -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CustomKeyStoreId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customKeyStoreId,
            (Key
"CustomKeyStoreName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customKeyStoreName,
            (Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            (Key
"Marker" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker
          ]
      )

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

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

-- | /See:/ 'newDescribeCustomKeyStoresResponse' smart constructor.
data DescribeCustomKeyStoresResponse = DescribeCustomKeyStoresResponse'
  { -- | Contains metadata about each custom key store.
    DescribeCustomKeyStoresResponse -> Maybe [CustomKeyStoresListEntry]
customKeyStores :: Prelude.Maybe [CustomKeyStoresListEntry],
    -- | 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,
    -- | 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,
    -- | The response's http status code.
    DescribeCustomKeyStoresResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCustomKeyStoresResponse
-> DescribeCustomKeyStoresResponse -> Bool
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, Int -> DescribeCustomKeyStoresResponse -> ShowS
[DescribeCustomKeyStoresResponse] -> ShowS
DescribeCustomKeyStoresResponse -> String
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.
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:
--
-- 'customKeyStores', 'describeCustomKeyStoresResponse_customKeyStores' - Contains metadata about each custom key store.
--
-- '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.
--
-- '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.
--
-- 'httpStatus', 'describeCustomKeyStoresResponse_httpStatus' - The response's http status code.
newDescribeCustomKeyStoresResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCustomKeyStoresResponse
newDescribeCustomKeyStoresResponse :: Int -> DescribeCustomKeyStoresResponse
newDescribeCustomKeyStoresResponse Int
pHttpStatus_ =
  DescribeCustomKeyStoresResponse'
    { $sel:customKeyStores:DescribeCustomKeyStoresResponse' :: Maybe [CustomKeyStoresListEntry]
customKeyStores =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:DescribeCustomKeyStoresResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
      $sel:truncated:DescribeCustomKeyStoresResponse' :: Maybe Bool
truncated = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCustomKeyStoresResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Contains metadata about each custom key store.
describeCustomKeyStoresResponse_customKeyStores :: Lens.Lens' DescribeCustomKeyStoresResponse (Prelude.Maybe [CustomKeyStoresListEntry])
describeCustomKeyStoresResponse_customKeyStores :: Lens'
  DescribeCustomKeyStoresResponse (Maybe [CustomKeyStoresListEntry])
describeCustomKeyStoresResponse_customKeyStores = 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) 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

-- | 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 :: Lens' DescribeCustomKeyStoresResponse (Maybe Text)
describeCustomKeyStoresResponse_nextMarker = 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)

-- | 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 :: Lens' DescribeCustomKeyStoresResponse (Maybe Bool)
describeCustomKeyStoresResponse_truncated = 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)

-- | The response's http status code.
describeCustomKeyStoresResponse_httpStatus :: Lens.Lens' DescribeCustomKeyStoresResponse Prelude.Int
describeCustomKeyStoresResponse_httpStatus :: Lens' DescribeCustomKeyStoresResponse Int
describeCustomKeyStoresResponse_httpStatus = 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
  where
  rnf :: DescribeCustomKeyStoresResponse -> ()
rnf DescribeCustomKeyStoresResponse' {Int
Maybe Bool
Maybe [CustomKeyStoresListEntry]
Maybe Text
httpStatus :: Int
truncated :: Maybe Bool
nextMarker :: Maybe Text
customKeyStores :: Maybe [CustomKeyStoresListEntry]
$sel:httpStatus:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Int
$sel:truncated:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe Bool
$sel:nextMarker:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe Text
$sel:customKeyStores:DescribeCustomKeyStoresResponse' :: DescribeCustomKeyStoresResponse -> Maybe [CustomKeyStoresListEntry]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomKeyStoresListEntry]
customKeyStores
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
truncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus