{-# 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.UpdateCustomKeyStore
-- 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)
--
-- Changes the properties of a custom key store. Use the @CustomKeyStoreId@
-- parameter to identify the custom key store you want to edit. Use the
-- remaining parameters to change the properties of the custom key store.
--
-- You can only update a custom key store that is disconnected. To
-- disconnect the custom key store, use DisconnectCustomKeyStore. To
-- reconnect the custom key store after the update completes, use
-- ConnectCustomKeyStore. To find the connection state of a custom key
-- store, use the DescribeCustomKeyStores operation.
--
-- The @CustomKeyStoreId@ parameter is required in all commands. Use the
-- other parameters of @UpdateCustomKeyStore@ to edit your key store
-- settings.
--
-- -   Use the @NewCustomKeyStoreName@ parameter to change the friendly
--     name of the custom key store to the value that you specify.
--
-- -   Use the @KeyStorePassword@ parameter tell KMS the current password
--     of the
--     <https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser kmsuser crypto user (CU)>
--     in the associated CloudHSM cluster. You can use this parameter to
--     <https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-password fix connection failures>
--     that occur when KMS cannot log into the associated cluster because
--     the @kmsuser@ password has changed. This value does not change the
--     password in the CloudHSM cluster.
--
-- -   Use the @CloudHsmClusterId@ parameter to associate the custom key
--     store with a different, but related, CloudHSM cluster. You can use
--     this parameter to repair a custom key store if its CloudHSM cluster
--     becomes corrupted or is deleted, or when you need to create or
--     restore a cluster from a backup.
--
-- If the operation succeeds, it returns a JSON object with no properties.
--
-- 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.
--
-- __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:UpdateCustomKeyStore>
-- (IAM policy)
--
-- __Related operations:__
--
-- -   ConnectCustomKeyStore
--
-- -   CreateCustomKeyStore
--
-- -   DeleteCustomKeyStore
--
-- -   DescribeCustomKeyStores
--
-- -   DisconnectCustomKeyStore
module Amazonka.KMS.UpdateCustomKeyStore
  ( -- * Creating a Request
    UpdateCustomKeyStore (..),
    newUpdateCustomKeyStore,

    -- * Request Lenses
    updateCustomKeyStore_keyStorePassword,
    updateCustomKeyStore_cloudHsmClusterId,
    updateCustomKeyStore_newCustomKeyStoreName,
    updateCustomKeyStore_customKeyStoreId,

    -- * Destructuring the Response
    UpdateCustomKeyStoreResponse (..),
    newUpdateCustomKeyStoreResponse,

    -- * Response Lenses
    updateCustomKeyStoreResponse_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:/ 'newUpdateCustomKeyStore' smart constructor.
data UpdateCustomKeyStore = UpdateCustomKeyStore'
  { -- | Enter the current password of the @kmsuser@ crypto user (CU) in the
    -- CloudHSM cluster that is associated with the custom key store.
    --
    -- This parameter tells KMS the current password of the @kmsuser@ crypto
    -- user (CU). It does not set or change the password of any users in the
    -- CloudHSM cluster.
    UpdateCustomKeyStore -> Maybe (Sensitive Text)
keyStorePassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Associates the custom key store with a related CloudHSM cluster.
    --
    -- Enter the cluster ID of the cluster that you used to create the custom
    -- key store or a cluster that shares a backup history and has the same
    -- cluster certificate as the original cluster. You cannot use this
    -- parameter to associate a custom key store with an unrelated cluster. In
    -- addition, the replacement cluster must
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore fulfill the requirements>
    -- for a cluster associated with a custom key store. To view the cluster
    -- certificate of a cluster, use the
    -- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
    -- operation.
    UpdateCustomKeyStore -> Maybe Text
cloudHsmClusterId :: Prelude.Maybe Prelude.Text,
    -- | Changes the friendly name of the custom key store to the value that you
    -- specify. The custom key store name must be unique in the Amazon Web
    -- Services account.
    UpdateCustomKeyStore -> Maybe Text
newCustomKeyStoreName' :: Prelude.Maybe Prelude.Text,
    -- | Identifies the custom key store that you want to update. Enter the ID of
    -- the custom key store. To find the ID of a custom key store, use the
    -- DescribeCustomKeyStores operation.
    UpdateCustomKeyStore -> Text
customKeyStoreId :: Prelude.Text
  }
  deriving (UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool
(UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool)
-> (UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool)
-> Eq UpdateCustomKeyStore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool
$c/= :: UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool
== :: UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool
$c== :: UpdateCustomKeyStore -> UpdateCustomKeyStore -> Bool
Prelude.Eq, Int -> UpdateCustomKeyStore -> ShowS
[UpdateCustomKeyStore] -> ShowS
UpdateCustomKeyStore -> String
(Int -> UpdateCustomKeyStore -> ShowS)
-> (UpdateCustomKeyStore -> String)
-> ([UpdateCustomKeyStore] -> ShowS)
-> Show UpdateCustomKeyStore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomKeyStore] -> ShowS
$cshowList :: [UpdateCustomKeyStore] -> ShowS
show :: UpdateCustomKeyStore -> String
$cshow :: UpdateCustomKeyStore -> String
showsPrec :: Int -> UpdateCustomKeyStore -> ShowS
$cshowsPrec :: Int -> UpdateCustomKeyStore -> ShowS
Prelude.Show, (forall x. UpdateCustomKeyStore -> Rep UpdateCustomKeyStore x)
-> (forall x. Rep UpdateCustomKeyStore x -> UpdateCustomKeyStore)
-> Generic UpdateCustomKeyStore
forall x. Rep UpdateCustomKeyStore x -> UpdateCustomKeyStore
forall x. UpdateCustomKeyStore -> Rep UpdateCustomKeyStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCustomKeyStore x -> UpdateCustomKeyStore
$cfrom :: forall x. UpdateCustomKeyStore -> Rep UpdateCustomKeyStore x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomKeyStore' 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:
--
-- 'keyStorePassword', 'updateCustomKeyStore_keyStorePassword' - Enter the current password of the @kmsuser@ crypto user (CU) in the
-- CloudHSM cluster that is associated with the custom key store.
--
-- This parameter tells KMS the current password of the @kmsuser@ crypto
-- user (CU). It does not set or change the password of any users in the
-- CloudHSM cluster.
--
-- 'cloudHsmClusterId', 'updateCustomKeyStore_cloudHsmClusterId' - Associates the custom key store with a related CloudHSM cluster.
--
-- Enter the cluster ID of the cluster that you used to create the custom
-- key store or a cluster that shares a backup history and has the same
-- cluster certificate as the original cluster. You cannot use this
-- parameter to associate a custom key store with an unrelated cluster. In
-- addition, the replacement cluster must
-- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore fulfill the requirements>
-- for a cluster associated with a custom key store. To view the cluster
-- certificate of a cluster, use the
-- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
-- operation.
--
-- 'newCustomKeyStoreName'', 'updateCustomKeyStore_newCustomKeyStoreName' - Changes the friendly name of the custom key store to the value that you
-- specify. The custom key store name must be unique in the Amazon Web
-- Services account.
--
-- 'customKeyStoreId', 'updateCustomKeyStore_customKeyStoreId' - Identifies the custom key store that you want to update. Enter the ID of
-- the custom key store. To find the ID of a custom key store, use the
-- DescribeCustomKeyStores operation.
newUpdateCustomKeyStore ::
  -- | 'customKeyStoreId'
  Prelude.Text ->
  UpdateCustomKeyStore
newUpdateCustomKeyStore :: Text -> UpdateCustomKeyStore
newUpdateCustomKeyStore Text
pCustomKeyStoreId_ =
  UpdateCustomKeyStore' :: Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Text -> UpdateCustomKeyStore
UpdateCustomKeyStore'
    { $sel:keyStorePassword:UpdateCustomKeyStore' :: Maybe (Sensitive Text)
keyStorePassword =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudHsmClusterId:UpdateCustomKeyStore' :: Maybe Text
cloudHsmClusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:newCustomKeyStoreName':UpdateCustomKeyStore' :: Maybe Text
newCustomKeyStoreName' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customKeyStoreId:UpdateCustomKeyStore' :: Text
customKeyStoreId = Text
pCustomKeyStoreId_
    }

-- | Enter the current password of the @kmsuser@ crypto user (CU) in the
-- CloudHSM cluster that is associated with the custom key store.
--
-- This parameter tells KMS the current password of the @kmsuser@ crypto
-- user (CU). It does not set or change the password of any users in the
-- CloudHSM cluster.
updateCustomKeyStore_keyStorePassword :: Lens.Lens' UpdateCustomKeyStore (Prelude.Maybe Prelude.Text)
updateCustomKeyStore_keyStorePassword :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomKeyStore -> f UpdateCustomKeyStore
updateCustomKeyStore_keyStorePassword = (UpdateCustomKeyStore -> Maybe (Sensitive Text))
-> (UpdateCustomKeyStore
    -> Maybe (Sensitive Text) -> UpdateCustomKeyStore)
-> Lens
     UpdateCustomKeyStore
     UpdateCustomKeyStore
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomKeyStore' {Maybe (Sensitive Text)
keyStorePassword :: Maybe (Sensitive Text)
$sel:keyStorePassword:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe (Sensitive Text)
keyStorePassword} -> Maybe (Sensitive Text)
keyStorePassword) (\s :: UpdateCustomKeyStore
s@UpdateCustomKeyStore' {} Maybe (Sensitive Text)
a -> UpdateCustomKeyStore
s {$sel:keyStorePassword:UpdateCustomKeyStore' :: Maybe (Sensitive Text)
keyStorePassword = Maybe (Sensitive Text)
a} :: UpdateCustomKeyStore) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateCustomKeyStore -> f UpdateCustomKeyStore)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateCustomKeyStore
-> f UpdateCustomKeyStore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Associates the custom key store with a related CloudHSM cluster.
--
-- Enter the cluster ID of the cluster that you used to create the custom
-- key store or a cluster that shares a backup history and has the same
-- cluster certificate as the original cluster. You cannot use this
-- parameter to associate a custom key store with an unrelated cluster. In
-- addition, the replacement cluster must
-- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore fulfill the requirements>
-- for a cluster associated with a custom key store. To view the cluster
-- certificate of a cluster, use the
-- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html DescribeClusters>
-- operation.
updateCustomKeyStore_cloudHsmClusterId :: Lens.Lens' UpdateCustomKeyStore (Prelude.Maybe Prelude.Text)
updateCustomKeyStore_cloudHsmClusterId :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomKeyStore -> f UpdateCustomKeyStore
updateCustomKeyStore_cloudHsmClusterId = (UpdateCustomKeyStore -> Maybe Text)
-> (UpdateCustomKeyStore -> Maybe Text -> UpdateCustomKeyStore)
-> Lens
     UpdateCustomKeyStore UpdateCustomKeyStore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomKeyStore' {Maybe Text
cloudHsmClusterId :: Maybe Text
$sel:cloudHsmClusterId:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe Text
cloudHsmClusterId} -> Maybe Text
cloudHsmClusterId) (\s :: UpdateCustomKeyStore
s@UpdateCustomKeyStore' {} Maybe Text
a -> UpdateCustomKeyStore
s {$sel:cloudHsmClusterId:UpdateCustomKeyStore' :: Maybe Text
cloudHsmClusterId = Maybe Text
a} :: UpdateCustomKeyStore)

-- | Changes the friendly name of the custom key store to the value that you
-- specify. The custom key store name must be unique in the Amazon Web
-- Services account.
updateCustomKeyStore_newCustomKeyStoreName :: Lens.Lens' UpdateCustomKeyStore (Prelude.Maybe Prelude.Text)
updateCustomKeyStore_newCustomKeyStoreName :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomKeyStore -> f UpdateCustomKeyStore
updateCustomKeyStore_newCustomKeyStoreName = (UpdateCustomKeyStore -> Maybe Text)
-> (UpdateCustomKeyStore -> Maybe Text -> UpdateCustomKeyStore)
-> Lens
     UpdateCustomKeyStore UpdateCustomKeyStore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomKeyStore' {Maybe Text
newCustomKeyStoreName' :: Maybe Text
$sel:newCustomKeyStoreName':UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe Text
newCustomKeyStoreName'} -> Maybe Text
newCustomKeyStoreName') (\s :: UpdateCustomKeyStore
s@UpdateCustomKeyStore' {} Maybe Text
a -> UpdateCustomKeyStore
s {$sel:newCustomKeyStoreName':UpdateCustomKeyStore' :: Maybe Text
newCustomKeyStoreName' = Maybe Text
a} :: UpdateCustomKeyStore)

-- | Identifies the custom key store that you want to update. Enter the ID of
-- the custom key store. To find the ID of a custom key store, use the
-- DescribeCustomKeyStores operation.
updateCustomKeyStore_customKeyStoreId :: Lens.Lens' UpdateCustomKeyStore Prelude.Text
updateCustomKeyStore_customKeyStoreId :: (Text -> f Text) -> UpdateCustomKeyStore -> f UpdateCustomKeyStore
updateCustomKeyStore_customKeyStoreId = (UpdateCustomKeyStore -> Text)
-> (UpdateCustomKeyStore -> Text -> UpdateCustomKeyStore)
-> Lens UpdateCustomKeyStore UpdateCustomKeyStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Text
customKeyStoreId} -> Text
customKeyStoreId) (\s :: UpdateCustomKeyStore
s@UpdateCustomKeyStore' {} Text
a -> UpdateCustomKeyStore
s {$sel:customKeyStoreId:UpdateCustomKeyStore' :: Text
customKeyStoreId = Text
a} :: UpdateCustomKeyStore)

instance Core.AWSRequest UpdateCustomKeyStore where
  type
    AWSResponse UpdateCustomKeyStore =
      UpdateCustomKeyStoreResponse
  request :: UpdateCustomKeyStore -> Request UpdateCustomKeyStore
request = Service -> UpdateCustomKeyStore -> Request UpdateCustomKeyStore
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCustomKeyStore)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateCustomKeyStore))
-> Logger
-> Service
-> Proxy UpdateCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCustomKeyStore)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateCustomKeyStoreResponse
UpdateCustomKeyStoreResponse'
            (Int -> UpdateCustomKeyStoreResponse)
-> Either String Int -> Either String UpdateCustomKeyStoreResponse
forall (f :: * -> *) a b. Functor 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 UpdateCustomKeyStore

instance Prelude.NFData UpdateCustomKeyStore

instance Core.ToHeaders UpdateCustomKeyStore where
  toHeaders :: UpdateCustomKeyStore -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateCustomKeyStore -> 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.UpdateCustomKeyStore" ::
                          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 UpdateCustomKeyStore where
  toJSON :: UpdateCustomKeyStore -> Value
toJSON UpdateCustomKeyStore' {Maybe Text
Maybe (Sensitive Text)
Text
customKeyStoreId :: Text
newCustomKeyStoreName' :: Maybe Text
cloudHsmClusterId :: Maybe Text
keyStorePassword :: Maybe (Sensitive Text)
$sel:customKeyStoreId:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Text
$sel:newCustomKeyStoreName':UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe Text
$sel:cloudHsmClusterId:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe Text
$sel:keyStorePassword:UpdateCustomKeyStore' :: UpdateCustomKeyStore -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KeyStorePassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
keyStorePassword,
            (Text
"CloudHsmClusterId" 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
cloudHsmClusterId,
            (Text
"NewCustomKeyStoreName" 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
newCustomKeyStoreName',
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CustomKeyStoreId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
customKeyStoreId)
          ]
      )

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

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

-- | /See:/ 'newUpdateCustomKeyStoreResponse' smart constructor.
data UpdateCustomKeyStoreResponse = UpdateCustomKeyStoreResponse'
  { -- | The response's http status code.
    UpdateCustomKeyStoreResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCustomKeyStoreResponse
-> UpdateCustomKeyStoreResponse -> Bool
(UpdateCustomKeyStoreResponse
 -> UpdateCustomKeyStoreResponse -> Bool)
-> (UpdateCustomKeyStoreResponse
    -> UpdateCustomKeyStoreResponse -> Bool)
-> Eq UpdateCustomKeyStoreResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomKeyStoreResponse
-> UpdateCustomKeyStoreResponse -> Bool
$c/= :: UpdateCustomKeyStoreResponse
-> UpdateCustomKeyStoreResponse -> Bool
== :: UpdateCustomKeyStoreResponse
-> UpdateCustomKeyStoreResponse -> Bool
$c== :: UpdateCustomKeyStoreResponse
-> UpdateCustomKeyStoreResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCustomKeyStoreResponse]
ReadPrec UpdateCustomKeyStoreResponse
Int -> ReadS UpdateCustomKeyStoreResponse
ReadS [UpdateCustomKeyStoreResponse]
(Int -> ReadS UpdateCustomKeyStoreResponse)
-> ReadS [UpdateCustomKeyStoreResponse]
-> ReadPrec UpdateCustomKeyStoreResponse
-> ReadPrec [UpdateCustomKeyStoreResponse]
-> Read UpdateCustomKeyStoreResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomKeyStoreResponse]
$creadListPrec :: ReadPrec [UpdateCustomKeyStoreResponse]
readPrec :: ReadPrec UpdateCustomKeyStoreResponse
$creadPrec :: ReadPrec UpdateCustomKeyStoreResponse
readList :: ReadS [UpdateCustomKeyStoreResponse]
$creadList :: ReadS [UpdateCustomKeyStoreResponse]
readsPrec :: Int -> ReadS UpdateCustomKeyStoreResponse
$creadsPrec :: Int -> ReadS UpdateCustomKeyStoreResponse
Prelude.Read, Int -> UpdateCustomKeyStoreResponse -> ShowS
[UpdateCustomKeyStoreResponse] -> ShowS
UpdateCustomKeyStoreResponse -> String
(Int -> UpdateCustomKeyStoreResponse -> ShowS)
-> (UpdateCustomKeyStoreResponse -> String)
-> ([UpdateCustomKeyStoreResponse] -> ShowS)
-> Show UpdateCustomKeyStoreResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomKeyStoreResponse] -> ShowS
$cshowList :: [UpdateCustomKeyStoreResponse] -> ShowS
show :: UpdateCustomKeyStoreResponse -> String
$cshow :: UpdateCustomKeyStoreResponse -> String
showsPrec :: Int -> UpdateCustomKeyStoreResponse -> ShowS
$cshowsPrec :: Int -> UpdateCustomKeyStoreResponse -> ShowS
Prelude.Show, (forall x.
 UpdateCustomKeyStoreResponse -> Rep UpdateCustomKeyStoreResponse x)
-> (forall x.
    Rep UpdateCustomKeyStoreResponse x -> UpdateCustomKeyStoreResponse)
-> Generic UpdateCustomKeyStoreResponse
forall x.
Rep UpdateCustomKeyStoreResponse x -> UpdateCustomKeyStoreResponse
forall x.
UpdateCustomKeyStoreResponse -> Rep UpdateCustomKeyStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomKeyStoreResponse x -> UpdateCustomKeyStoreResponse
$cfrom :: forall x.
UpdateCustomKeyStoreResponse -> Rep UpdateCustomKeyStoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomKeyStoreResponse' 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:
--
-- 'httpStatus', 'updateCustomKeyStoreResponse_httpStatus' - The response's http status code.
newUpdateCustomKeyStoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCustomKeyStoreResponse
newUpdateCustomKeyStoreResponse :: Int -> UpdateCustomKeyStoreResponse
newUpdateCustomKeyStoreResponse Int
pHttpStatus_ =
  UpdateCustomKeyStoreResponse' :: Int -> UpdateCustomKeyStoreResponse
UpdateCustomKeyStoreResponse'
    { $sel:httpStatus:UpdateCustomKeyStoreResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData UpdateCustomKeyStoreResponse