{-# 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.UpdateKeyDescription
(
UpdateKeyDescription (..),
newUpdateKeyDescription,
updateKeyDescription_keyId,
updateKeyDescription_description,
UpdateKeyDescriptionResponse (..),
newUpdateKeyDescriptionResponse,
)
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 UpdateKeyDescription = UpdateKeyDescription'
{
UpdateKeyDescription -> Text
keyId :: Prelude.Text,
UpdateKeyDescription -> Text
description :: Prelude.Text
}
deriving (UpdateKeyDescription -> UpdateKeyDescription -> Bool
(UpdateKeyDescription -> UpdateKeyDescription -> Bool)
-> (UpdateKeyDescription -> UpdateKeyDescription -> Bool)
-> Eq UpdateKeyDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateKeyDescription -> UpdateKeyDescription -> Bool
$c/= :: UpdateKeyDescription -> UpdateKeyDescription -> Bool
== :: UpdateKeyDescription -> UpdateKeyDescription -> Bool
$c== :: UpdateKeyDescription -> UpdateKeyDescription -> Bool
Prelude.Eq, ReadPrec [UpdateKeyDescription]
ReadPrec UpdateKeyDescription
Int -> ReadS UpdateKeyDescription
ReadS [UpdateKeyDescription]
(Int -> ReadS UpdateKeyDescription)
-> ReadS [UpdateKeyDescription]
-> ReadPrec UpdateKeyDescription
-> ReadPrec [UpdateKeyDescription]
-> Read UpdateKeyDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateKeyDescription]
$creadListPrec :: ReadPrec [UpdateKeyDescription]
readPrec :: ReadPrec UpdateKeyDescription
$creadPrec :: ReadPrec UpdateKeyDescription
readList :: ReadS [UpdateKeyDescription]
$creadList :: ReadS [UpdateKeyDescription]
readsPrec :: Int -> ReadS UpdateKeyDescription
$creadsPrec :: Int -> ReadS UpdateKeyDescription
Prelude.Read, Int -> UpdateKeyDescription -> ShowS
[UpdateKeyDescription] -> ShowS
UpdateKeyDescription -> String
(Int -> UpdateKeyDescription -> ShowS)
-> (UpdateKeyDescription -> String)
-> ([UpdateKeyDescription] -> ShowS)
-> Show UpdateKeyDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateKeyDescription] -> ShowS
$cshowList :: [UpdateKeyDescription] -> ShowS
show :: UpdateKeyDescription -> String
$cshow :: UpdateKeyDescription -> String
showsPrec :: Int -> UpdateKeyDescription -> ShowS
$cshowsPrec :: Int -> UpdateKeyDescription -> ShowS
Prelude.Show, (forall x. UpdateKeyDescription -> Rep UpdateKeyDescription x)
-> (forall x. Rep UpdateKeyDescription x -> UpdateKeyDescription)
-> Generic UpdateKeyDescription
forall x. Rep UpdateKeyDescription x -> UpdateKeyDescription
forall x. UpdateKeyDescription -> Rep UpdateKeyDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateKeyDescription x -> UpdateKeyDescription
$cfrom :: forall x. UpdateKeyDescription -> Rep UpdateKeyDescription x
Prelude.Generic)
newUpdateKeyDescription ::
Prelude.Text ->
Prelude.Text ->
UpdateKeyDescription
newUpdateKeyDescription :: Text -> Text -> UpdateKeyDescription
newUpdateKeyDescription Text
pKeyId_ Text
pDescription_ =
UpdateKeyDescription' :: Text -> Text -> UpdateKeyDescription
UpdateKeyDescription'
{ $sel:keyId:UpdateKeyDescription' :: Text
keyId = Text
pKeyId_,
$sel:description:UpdateKeyDescription' :: Text
description = Text
pDescription_
}
updateKeyDescription_keyId :: Lens.Lens' UpdateKeyDescription Prelude.Text
updateKeyDescription_keyId :: (Text -> f Text) -> UpdateKeyDescription -> f UpdateKeyDescription
updateKeyDescription_keyId = (UpdateKeyDescription -> Text)
-> (UpdateKeyDescription -> Text -> UpdateKeyDescription)
-> Lens UpdateKeyDescription UpdateKeyDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateKeyDescription' {Text
keyId :: Text
$sel:keyId:UpdateKeyDescription' :: UpdateKeyDescription -> Text
keyId} -> Text
keyId) (\s :: UpdateKeyDescription
s@UpdateKeyDescription' {} Text
a -> UpdateKeyDescription
s {$sel:keyId:UpdateKeyDescription' :: Text
keyId = Text
a} :: UpdateKeyDescription)
updateKeyDescription_description :: Lens.Lens' UpdateKeyDescription Prelude.Text
updateKeyDescription_description :: (Text -> f Text) -> UpdateKeyDescription -> f UpdateKeyDescription
updateKeyDescription_description = (UpdateKeyDescription -> Text)
-> (UpdateKeyDescription -> Text -> UpdateKeyDescription)
-> Lens UpdateKeyDescription UpdateKeyDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateKeyDescription' {Text
description :: Text
$sel:description:UpdateKeyDescription' :: UpdateKeyDescription -> Text
description} -> Text
description) (\s :: UpdateKeyDescription
s@UpdateKeyDescription' {} Text
a -> UpdateKeyDescription
s {$sel:description:UpdateKeyDescription' :: Text
description = Text
a} :: UpdateKeyDescription)
instance Core.AWSRequest UpdateKeyDescription where
type
AWSResponse UpdateKeyDescription =
UpdateKeyDescriptionResponse
request :: UpdateKeyDescription -> Request UpdateKeyDescription
request = Service -> UpdateKeyDescription -> Request UpdateKeyDescription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateKeyDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateKeyDescription)))
response =
AWSResponse UpdateKeyDescription
-> Logger
-> Service
-> Proxy UpdateKeyDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateKeyDescription)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateKeyDescription
UpdateKeyDescriptionResponse
UpdateKeyDescriptionResponse'
instance Prelude.Hashable UpdateKeyDescription
instance Prelude.NFData UpdateKeyDescription
instance Core.ToHeaders UpdateKeyDescription where
toHeaders :: UpdateKeyDescription -> [Header]
toHeaders =
[Header] -> UpdateKeyDescription -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"TrentService.UpdateKeyDescription" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateKeyDescription where
toJSON :: UpdateKeyDescription -> Value
toJSON UpdateKeyDescription' {Text
description :: Text
keyId :: Text
$sel:description:UpdateKeyDescription' :: UpdateKeyDescription -> Text
$sel:keyId:UpdateKeyDescription' :: UpdateKeyDescription -> 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
"KeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description)
]
)
instance Core.ToPath UpdateKeyDescription where
toPath :: UpdateKeyDescription -> ByteString
toPath = ByteString -> UpdateKeyDescription -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateKeyDescription where
toQuery :: UpdateKeyDescription -> QueryString
toQuery = QueryString -> UpdateKeyDescription -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateKeyDescriptionResponse = UpdateKeyDescriptionResponse'
{
}
deriving (UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool
(UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool)
-> (UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool)
-> Eq UpdateKeyDescriptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool
$c/= :: UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool
== :: UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool
$c== :: UpdateKeyDescriptionResponse
-> UpdateKeyDescriptionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateKeyDescriptionResponse]
ReadPrec UpdateKeyDescriptionResponse
Int -> ReadS UpdateKeyDescriptionResponse
ReadS [UpdateKeyDescriptionResponse]
(Int -> ReadS UpdateKeyDescriptionResponse)
-> ReadS [UpdateKeyDescriptionResponse]
-> ReadPrec UpdateKeyDescriptionResponse
-> ReadPrec [UpdateKeyDescriptionResponse]
-> Read UpdateKeyDescriptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateKeyDescriptionResponse]
$creadListPrec :: ReadPrec [UpdateKeyDescriptionResponse]
readPrec :: ReadPrec UpdateKeyDescriptionResponse
$creadPrec :: ReadPrec UpdateKeyDescriptionResponse
readList :: ReadS [UpdateKeyDescriptionResponse]
$creadList :: ReadS [UpdateKeyDescriptionResponse]
readsPrec :: Int -> ReadS UpdateKeyDescriptionResponse
$creadsPrec :: Int -> ReadS UpdateKeyDescriptionResponse
Prelude.Read, Int -> UpdateKeyDescriptionResponse -> ShowS
[UpdateKeyDescriptionResponse] -> ShowS
UpdateKeyDescriptionResponse -> String
(Int -> UpdateKeyDescriptionResponse -> ShowS)
-> (UpdateKeyDescriptionResponse -> String)
-> ([UpdateKeyDescriptionResponse] -> ShowS)
-> Show UpdateKeyDescriptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateKeyDescriptionResponse] -> ShowS
$cshowList :: [UpdateKeyDescriptionResponse] -> ShowS
show :: UpdateKeyDescriptionResponse -> String
$cshow :: UpdateKeyDescriptionResponse -> String
showsPrec :: Int -> UpdateKeyDescriptionResponse -> ShowS
$cshowsPrec :: Int -> UpdateKeyDescriptionResponse -> ShowS
Prelude.Show, (forall x.
UpdateKeyDescriptionResponse -> Rep UpdateKeyDescriptionResponse x)
-> (forall x.
Rep UpdateKeyDescriptionResponse x -> UpdateKeyDescriptionResponse)
-> Generic UpdateKeyDescriptionResponse
forall x.
Rep UpdateKeyDescriptionResponse x -> UpdateKeyDescriptionResponse
forall x.
UpdateKeyDescriptionResponse -> Rep UpdateKeyDescriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateKeyDescriptionResponse x -> UpdateKeyDescriptionResponse
$cfrom :: forall x.
UpdateKeyDescriptionResponse -> Rep UpdateKeyDescriptionResponse x
Prelude.Generic)
newUpdateKeyDescriptionResponse ::
UpdateKeyDescriptionResponse
newUpdateKeyDescriptionResponse :: UpdateKeyDescriptionResponse
newUpdateKeyDescriptionResponse =
UpdateKeyDescriptionResponse
UpdateKeyDescriptionResponse'
instance Prelude.NFData UpdateKeyDescriptionResponse