{-# 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.CreateCustomKeyStore
-- 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)
--
-- Creates a
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>
-- that is associated with an
-- <https://docs.aws.amazon.com/cloudhsm/latest/userguide/clusters.html CloudHSM cluster>
-- that you own and manage.
--
-- 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.
--
-- Before you create the custom key store, you must assemble the required
-- elements, including an CloudHSM cluster that fulfills the requirements
-- for a custom key store. For details about the required elements, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore Assemble the Prerequisites>
-- in the /Key Management Service Developer Guide/.
--
-- When the operation completes successfully, it returns the ID of the new
-- custom key store. Before you can use your new custom key store, you need
-- to use the ConnectCustomKeyStore operation to connect the new key store
-- to its CloudHSM cluster. Even if you are not going to use your custom
-- key store immediately, you might want to connect it to verify that all
-- settings are correct and then disconnect it until you are ready to use
-- it.
--
-- For help with failures, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html Troubleshooting a Custom Key Store>
-- 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:CreateCustomKeyStore>
-- (IAM policy).
--
-- __Related operations:__
--
-- -   ConnectCustomKeyStore
--
-- -   DeleteCustomKeyStore
--
-- -   DescribeCustomKeyStores
--
-- -   DisconnectCustomKeyStore
--
-- -   UpdateCustomKeyStore
module Amazonka.KMS.CreateCustomKeyStore
  ( -- * Creating a Request
    CreateCustomKeyStore (..),
    newCreateCustomKeyStore,

    -- * Request Lenses
    createCustomKeyStore_customKeyStoreName,
    createCustomKeyStore_cloudHsmClusterId,
    createCustomKeyStore_trustAnchorCertificate,
    createCustomKeyStore_keyStorePassword,

    -- * Destructuring the Response
    CreateCustomKeyStoreResponse (..),
    newCreateCustomKeyStoreResponse,

    -- * Response Lenses
    createCustomKeyStoreResponse_customKeyStoreId,
    createCustomKeyStoreResponse_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:/ 'newCreateCustomKeyStore' smart constructor.
data CreateCustomKeyStore = CreateCustomKeyStore'
  { -- | Specifies a friendly name for the custom key store. The name must be
    -- unique in your Amazon Web Services account.
    CreateCustomKeyStore -> Text
customKeyStoreName :: Prelude.Text,
    -- | Identifies the CloudHSM cluster for the custom key store. Enter the
    -- cluster ID of any active CloudHSM cluster that is not already associated
    -- with a custom key store. To find the cluster ID, use the
    -- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
    -- operation.
    CreateCustomKeyStore -> Text
cloudHsmClusterId :: Prelude.Text,
    -- | Enter the content of the trust anchor certificate for the cluster. This
    -- is the content of the @customerCA.crt@ file that you created when you
    -- <https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html initialized the cluster>.
    CreateCustomKeyStore -> Text
trustAnchorCertificate :: Prelude.Text,
    -- | Enter the password of the
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser kmsuser crypto user (CU) account>
    -- in the specified CloudHSM cluster. KMS logs into the cluster as this
    -- user to manage key material on your behalf.
    --
    -- The password must be a string of 7 to 32 characters. Its value is case
    -- sensitive.
    --
    -- This parameter tells KMS the @kmsuser@ account password; it does not
    -- change the password in the CloudHSM cluster.
    CreateCustomKeyStore -> Sensitive Text
keyStorePassword :: Core.Sensitive Prelude.Text
  }
  deriving (CreateCustomKeyStore -> CreateCustomKeyStore -> Bool
(CreateCustomKeyStore -> CreateCustomKeyStore -> Bool)
-> (CreateCustomKeyStore -> CreateCustomKeyStore -> Bool)
-> Eq CreateCustomKeyStore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomKeyStore -> CreateCustomKeyStore -> Bool
$c/= :: CreateCustomKeyStore -> CreateCustomKeyStore -> Bool
== :: CreateCustomKeyStore -> CreateCustomKeyStore -> Bool
$c== :: CreateCustomKeyStore -> CreateCustomKeyStore -> Bool
Prelude.Eq, Int -> CreateCustomKeyStore -> ShowS
[CreateCustomKeyStore] -> ShowS
CreateCustomKeyStore -> String
(Int -> CreateCustomKeyStore -> ShowS)
-> (CreateCustomKeyStore -> String)
-> ([CreateCustomKeyStore] -> ShowS)
-> Show CreateCustomKeyStore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomKeyStore] -> ShowS
$cshowList :: [CreateCustomKeyStore] -> ShowS
show :: CreateCustomKeyStore -> String
$cshow :: CreateCustomKeyStore -> String
showsPrec :: Int -> CreateCustomKeyStore -> ShowS
$cshowsPrec :: Int -> CreateCustomKeyStore -> ShowS
Prelude.Show, (forall x. CreateCustomKeyStore -> Rep CreateCustomKeyStore x)
-> (forall x. Rep CreateCustomKeyStore x -> CreateCustomKeyStore)
-> Generic CreateCustomKeyStore
forall x. Rep CreateCustomKeyStore x -> CreateCustomKeyStore
forall x. CreateCustomKeyStore -> Rep CreateCustomKeyStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCustomKeyStore x -> CreateCustomKeyStore
$cfrom :: forall x. CreateCustomKeyStore -> Rep CreateCustomKeyStore x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomKeyStore' 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', 'createCustomKeyStore_customKeyStoreName' - Specifies a friendly name for the custom key store. The name must be
-- unique in your Amazon Web Services account.
--
-- 'cloudHsmClusterId', 'createCustomKeyStore_cloudHsmClusterId' - Identifies the CloudHSM cluster for the custom key store. Enter the
-- cluster ID of any active CloudHSM cluster that is not already associated
-- with a custom key store. To find the cluster ID, use the
-- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
-- operation.
--
-- 'trustAnchorCertificate', 'createCustomKeyStore_trustAnchorCertificate' - Enter the content of the trust anchor certificate for the cluster. This
-- is the content of the @customerCA.crt@ file that you created when you
-- <https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html initialized the cluster>.
--
-- 'keyStorePassword', 'createCustomKeyStore_keyStorePassword' - Enter the password of the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser kmsuser crypto user (CU) account>
-- in the specified CloudHSM cluster. KMS logs into the cluster as this
-- user to manage key material on your behalf.
--
-- The password must be a string of 7 to 32 characters. Its value is case
-- sensitive.
--
-- This parameter tells KMS the @kmsuser@ account password; it does not
-- change the password in the CloudHSM cluster.
newCreateCustomKeyStore ::
  -- | 'customKeyStoreName'
  Prelude.Text ->
  -- | 'cloudHsmClusterId'
  Prelude.Text ->
  -- | 'trustAnchorCertificate'
  Prelude.Text ->
  -- | 'keyStorePassword'
  Prelude.Text ->
  CreateCustomKeyStore
newCreateCustomKeyStore :: Text -> Text -> Text -> Text -> CreateCustomKeyStore
newCreateCustomKeyStore
  Text
pCustomKeyStoreName_
  Text
pCloudHsmClusterId_
  Text
pTrustAnchorCertificate_
  Text
pKeyStorePassword_ =
    CreateCustomKeyStore' :: Text -> Text -> Text -> Sensitive Text -> CreateCustomKeyStore
CreateCustomKeyStore'
      { $sel:customKeyStoreName:CreateCustomKeyStore' :: Text
customKeyStoreName =
          Text
pCustomKeyStoreName_,
        $sel:cloudHsmClusterId:CreateCustomKeyStore' :: Text
cloudHsmClusterId = Text
pCloudHsmClusterId_,
        $sel:trustAnchorCertificate:CreateCustomKeyStore' :: Text
trustAnchorCertificate = Text
pTrustAnchorCertificate_,
        $sel:keyStorePassword:CreateCustomKeyStore' :: Sensitive Text
keyStorePassword =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pKeyStorePassword_
      }

-- | Specifies a friendly name for the custom key store. The name must be
-- unique in your Amazon Web Services account.
createCustomKeyStore_customKeyStoreName :: Lens.Lens' CreateCustomKeyStore Prelude.Text
createCustomKeyStore_customKeyStoreName :: (Text -> f Text) -> CreateCustomKeyStore -> f CreateCustomKeyStore
createCustomKeyStore_customKeyStoreName = (CreateCustomKeyStore -> Text)
-> (CreateCustomKeyStore -> Text -> CreateCustomKeyStore)
-> Lens CreateCustomKeyStore CreateCustomKeyStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomKeyStore' {Text
customKeyStoreName :: Text
$sel:customKeyStoreName:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
customKeyStoreName} -> Text
customKeyStoreName) (\s :: CreateCustomKeyStore
s@CreateCustomKeyStore' {} Text
a -> CreateCustomKeyStore
s {$sel:customKeyStoreName:CreateCustomKeyStore' :: Text
customKeyStoreName = Text
a} :: CreateCustomKeyStore)

-- | Identifies the CloudHSM cluster for the custom key store. Enter the
-- cluster ID of any active CloudHSM cluster that is not already associated
-- with a custom key store. To find the cluster ID, use the
-- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
-- operation.
createCustomKeyStore_cloudHsmClusterId :: Lens.Lens' CreateCustomKeyStore Prelude.Text
createCustomKeyStore_cloudHsmClusterId :: (Text -> f Text) -> CreateCustomKeyStore -> f CreateCustomKeyStore
createCustomKeyStore_cloudHsmClusterId = (CreateCustomKeyStore -> Text)
-> (CreateCustomKeyStore -> Text -> CreateCustomKeyStore)
-> Lens CreateCustomKeyStore CreateCustomKeyStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomKeyStore' {Text
cloudHsmClusterId :: Text
$sel:cloudHsmClusterId:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
cloudHsmClusterId} -> Text
cloudHsmClusterId) (\s :: CreateCustomKeyStore
s@CreateCustomKeyStore' {} Text
a -> CreateCustomKeyStore
s {$sel:cloudHsmClusterId:CreateCustomKeyStore' :: Text
cloudHsmClusterId = Text
a} :: CreateCustomKeyStore)

-- | Enter the content of the trust anchor certificate for the cluster. This
-- is the content of the @customerCA.crt@ file that you created when you
-- <https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html initialized the cluster>.
createCustomKeyStore_trustAnchorCertificate :: Lens.Lens' CreateCustomKeyStore Prelude.Text
createCustomKeyStore_trustAnchorCertificate :: (Text -> f Text) -> CreateCustomKeyStore -> f CreateCustomKeyStore
createCustomKeyStore_trustAnchorCertificate = (CreateCustomKeyStore -> Text)
-> (CreateCustomKeyStore -> Text -> CreateCustomKeyStore)
-> Lens CreateCustomKeyStore CreateCustomKeyStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomKeyStore' {Text
trustAnchorCertificate :: Text
$sel:trustAnchorCertificate:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
trustAnchorCertificate} -> Text
trustAnchorCertificate) (\s :: CreateCustomKeyStore
s@CreateCustomKeyStore' {} Text
a -> CreateCustomKeyStore
s {$sel:trustAnchorCertificate:CreateCustomKeyStore' :: Text
trustAnchorCertificate = Text
a} :: CreateCustomKeyStore)

-- | Enter the password of the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser kmsuser crypto user (CU) account>
-- in the specified CloudHSM cluster. KMS logs into the cluster as this
-- user to manage key material on your behalf.
--
-- The password must be a string of 7 to 32 characters. Its value is case
-- sensitive.
--
-- This parameter tells KMS the @kmsuser@ account password; it does not
-- change the password in the CloudHSM cluster.
createCustomKeyStore_keyStorePassword :: Lens.Lens' CreateCustomKeyStore Prelude.Text
createCustomKeyStore_keyStorePassword :: (Text -> f Text) -> CreateCustomKeyStore -> f CreateCustomKeyStore
createCustomKeyStore_keyStorePassword = (CreateCustomKeyStore -> Sensitive Text)
-> (CreateCustomKeyStore -> Sensitive Text -> CreateCustomKeyStore)
-> Lens
     CreateCustomKeyStore
     CreateCustomKeyStore
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomKeyStore' {Sensitive Text
keyStorePassword :: Sensitive Text
$sel:keyStorePassword:CreateCustomKeyStore' :: CreateCustomKeyStore -> Sensitive Text
keyStorePassword} -> Sensitive Text
keyStorePassword) (\s :: CreateCustomKeyStore
s@CreateCustomKeyStore' {} Sensitive Text
a -> CreateCustomKeyStore
s {$sel:keyStorePassword:CreateCustomKeyStore' :: Sensitive Text
keyStorePassword = Sensitive Text
a} :: CreateCustomKeyStore) ((Sensitive Text -> f (Sensitive Text))
 -> CreateCustomKeyStore -> f CreateCustomKeyStore)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateCustomKeyStore
-> f CreateCustomKeyStore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSRequest CreateCustomKeyStore where
  type
    AWSResponse CreateCustomKeyStore =
      CreateCustomKeyStoreResponse
  request :: CreateCustomKeyStore -> Request CreateCustomKeyStore
request = Service -> CreateCustomKeyStore -> Request CreateCustomKeyStore
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomKeyStore)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCustomKeyStore))
-> Logger
-> Service
-> Proxy CreateCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomKeyStore)))
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 Text -> Int -> CreateCustomKeyStoreResponse
CreateCustomKeyStoreResponse'
            (Maybe Text -> Int -> CreateCustomKeyStoreResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateCustomKeyStoreResponse)
forall (f :: * -> *) a b. Functor 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
"CustomKeyStoreId")
            Either String (Int -> CreateCustomKeyStoreResponse)
-> Either String Int -> Either String CreateCustomKeyStoreResponse
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 CreateCustomKeyStore

instance Prelude.NFData CreateCustomKeyStore

instance Core.ToHeaders CreateCustomKeyStore where
  toHeaders :: CreateCustomKeyStore -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCustomKeyStore -> 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.CreateCustomKeyStore" ::
                          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 CreateCustomKeyStore where
  toJSON :: CreateCustomKeyStore -> Value
toJSON CreateCustomKeyStore' {Text
Sensitive Text
keyStorePassword :: Sensitive Text
trustAnchorCertificate :: Text
cloudHsmClusterId :: Text
customKeyStoreName :: Text
$sel:keyStorePassword:CreateCustomKeyStore' :: CreateCustomKeyStore -> Sensitive Text
$sel:trustAnchorCertificate:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
$sel:cloudHsmClusterId:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
$sel:customKeyStoreName:CreateCustomKeyStore' :: CreateCustomKeyStore -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CustomKeyStoreName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
customKeyStoreName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CloudHsmClusterId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cloudHsmClusterId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TrustAnchorCertificate"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
trustAnchorCertificate
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"KeyStorePassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
keyStorePassword)
          ]
      )

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

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

-- | /See:/ 'newCreateCustomKeyStoreResponse' smart constructor.
data CreateCustomKeyStoreResponse = CreateCustomKeyStoreResponse'
  { -- | A unique identifier for the new custom key store.
    CreateCustomKeyStoreResponse -> Maybe Text
customKeyStoreId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateCustomKeyStoreResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCustomKeyStoreResponse
-> CreateCustomKeyStoreResponse -> Bool
(CreateCustomKeyStoreResponse
 -> CreateCustomKeyStoreResponse -> Bool)
-> (CreateCustomKeyStoreResponse
    -> CreateCustomKeyStoreResponse -> Bool)
-> Eq CreateCustomKeyStoreResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomKeyStoreResponse
-> CreateCustomKeyStoreResponse -> Bool
$c/= :: CreateCustomKeyStoreResponse
-> CreateCustomKeyStoreResponse -> Bool
== :: CreateCustomKeyStoreResponse
-> CreateCustomKeyStoreResponse -> Bool
$c== :: CreateCustomKeyStoreResponse
-> CreateCustomKeyStoreResponse -> Bool
Prelude.Eq, ReadPrec [CreateCustomKeyStoreResponse]
ReadPrec CreateCustomKeyStoreResponse
Int -> ReadS CreateCustomKeyStoreResponse
ReadS [CreateCustomKeyStoreResponse]
(Int -> ReadS CreateCustomKeyStoreResponse)
-> ReadS [CreateCustomKeyStoreResponse]
-> ReadPrec CreateCustomKeyStoreResponse
-> ReadPrec [CreateCustomKeyStoreResponse]
-> Read CreateCustomKeyStoreResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomKeyStoreResponse]
$creadListPrec :: ReadPrec [CreateCustomKeyStoreResponse]
readPrec :: ReadPrec CreateCustomKeyStoreResponse
$creadPrec :: ReadPrec CreateCustomKeyStoreResponse
readList :: ReadS [CreateCustomKeyStoreResponse]
$creadList :: ReadS [CreateCustomKeyStoreResponse]
readsPrec :: Int -> ReadS CreateCustomKeyStoreResponse
$creadsPrec :: Int -> ReadS CreateCustomKeyStoreResponse
Prelude.Read, Int -> CreateCustomKeyStoreResponse -> ShowS
[CreateCustomKeyStoreResponse] -> ShowS
CreateCustomKeyStoreResponse -> String
(Int -> CreateCustomKeyStoreResponse -> ShowS)
-> (CreateCustomKeyStoreResponse -> String)
-> ([CreateCustomKeyStoreResponse] -> ShowS)
-> Show CreateCustomKeyStoreResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomKeyStoreResponse] -> ShowS
$cshowList :: [CreateCustomKeyStoreResponse] -> ShowS
show :: CreateCustomKeyStoreResponse -> String
$cshow :: CreateCustomKeyStoreResponse -> String
showsPrec :: Int -> CreateCustomKeyStoreResponse -> ShowS
$cshowsPrec :: Int -> CreateCustomKeyStoreResponse -> ShowS
Prelude.Show, (forall x.
 CreateCustomKeyStoreResponse -> Rep CreateCustomKeyStoreResponse x)
-> (forall x.
    Rep CreateCustomKeyStoreResponse x -> CreateCustomKeyStoreResponse)
-> Generic CreateCustomKeyStoreResponse
forall x.
Rep CreateCustomKeyStoreResponse x -> CreateCustomKeyStoreResponse
forall x.
CreateCustomKeyStoreResponse -> Rep CreateCustomKeyStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomKeyStoreResponse x -> CreateCustomKeyStoreResponse
$cfrom :: forall x.
CreateCustomKeyStoreResponse -> Rep CreateCustomKeyStoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomKeyStoreResponse' 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', 'createCustomKeyStoreResponse_customKeyStoreId' - A unique identifier for the new custom key store.
--
-- 'httpStatus', 'createCustomKeyStoreResponse_httpStatus' - The response's http status code.
newCreateCustomKeyStoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCustomKeyStoreResponse
newCreateCustomKeyStoreResponse :: Int -> CreateCustomKeyStoreResponse
newCreateCustomKeyStoreResponse Int
pHttpStatus_ =
  CreateCustomKeyStoreResponse' :: Maybe Text -> Int -> CreateCustomKeyStoreResponse
CreateCustomKeyStoreResponse'
    { $sel:customKeyStoreId:CreateCustomKeyStoreResponse' :: Maybe Text
customKeyStoreId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCustomKeyStoreResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A unique identifier for the new custom key store.
createCustomKeyStoreResponse_customKeyStoreId :: Lens.Lens' CreateCustomKeyStoreResponse (Prelude.Maybe Prelude.Text)
createCustomKeyStoreResponse_customKeyStoreId :: (Maybe Text -> f (Maybe Text))
-> CreateCustomKeyStoreResponse -> f CreateCustomKeyStoreResponse
createCustomKeyStoreResponse_customKeyStoreId = (CreateCustomKeyStoreResponse -> Maybe Text)
-> (CreateCustomKeyStoreResponse
    -> Maybe Text -> CreateCustomKeyStoreResponse)
-> Lens
     CreateCustomKeyStoreResponse
     CreateCustomKeyStoreResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomKeyStoreResponse' {Maybe Text
customKeyStoreId :: Maybe Text
$sel:customKeyStoreId:CreateCustomKeyStoreResponse' :: CreateCustomKeyStoreResponse -> Maybe Text
customKeyStoreId} -> Maybe Text
customKeyStoreId) (\s :: CreateCustomKeyStoreResponse
s@CreateCustomKeyStoreResponse' {} Maybe Text
a -> CreateCustomKeyStoreResponse
s {$sel:customKeyStoreId:CreateCustomKeyStoreResponse' :: Maybe Text
customKeyStoreId = Maybe Text
a} :: CreateCustomKeyStoreResponse)

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

instance Prelude.NFData CreateCustomKeyStoreResponse