{-# 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 #-}
module Amazonka.KMS.UpdateCustomKeyStore
(
UpdateCustomKeyStore (..),
newUpdateCustomKeyStore,
updateCustomKeyStore_keyStorePassword,
updateCustomKeyStore_cloudHsmClusterId,
updateCustomKeyStore_newCustomKeyStoreName,
updateCustomKeyStore_customKeyStoreId,
UpdateCustomKeyStoreResponse (..),
newUpdateCustomKeyStoreResponse,
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
data UpdateCustomKeyStore = UpdateCustomKeyStore'
{
UpdateCustomKeyStore -> Maybe (Sensitive Text)
keyStorePassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
UpdateCustomKeyStore -> Maybe Text
cloudHsmClusterId :: Prelude.Maybe Prelude.Text,
UpdateCustomKeyStore -> Maybe Text
newCustomKeyStoreName' :: Prelude.Maybe Prelude.Text,
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)
newUpdateCustomKeyStore ::
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_
}
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
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)
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)
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
data UpdateCustomKeyStoreResponse = UpdateCustomKeyStoreResponse'
{
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)
newUpdateCustomKeyStoreResponse ::
Prelude.Int ->
UpdateCustomKeyStoreResponse
newUpdateCustomKeyStoreResponse :: Int -> UpdateCustomKeyStoreResponse
newUpdateCustomKeyStoreResponse Int
pHttpStatus_ =
UpdateCustomKeyStoreResponse' :: Int -> UpdateCustomKeyStoreResponse
UpdateCustomKeyStoreResponse'
{ $sel:httpStatus:UpdateCustomKeyStoreResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
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