{-# 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.EnableKeyRotation
(
EnableKeyRotation (..),
newEnableKeyRotation,
enableKeyRotation_keyId,
EnableKeyRotationResponse (..),
newEnableKeyRotationResponse,
)
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
data EnableKeyRotation = EnableKeyRotation'
{
EnableKeyRotation -> Text
keyId :: Prelude.Text
}
deriving (EnableKeyRotation -> EnableKeyRotation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableKeyRotation -> EnableKeyRotation -> Bool
$c/= :: EnableKeyRotation -> EnableKeyRotation -> Bool
== :: EnableKeyRotation -> EnableKeyRotation -> Bool
$c== :: EnableKeyRotation -> EnableKeyRotation -> Bool
Prelude.Eq, ReadPrec [EnableKeyRotation]
ReadPrec EnableKeyRotation
Int -> ReadS EnableKeyRotation
ReadS [EnableKeyRotation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableKeyRotation]
$creadListPrec :: ReadPrec [EnableKeyRotation]
readPrec :: ReadPrec EnableKeyRotation
$creadPrec :: ReadPrec EnableKeyRotation
readList :: ReadS [EnableKeyRotation]
$creadList :: ReadS [EnableKeyRotation]
readsPrec :: Int -> ReadS EnableKeyRotation
$creadsPrec :: Int -> ReadS EnableKeyRotation
Prelude.Read, Int -> EnableKeyRotation -> ShowS
[EnableKeyRotation] -> ShowS
EnableKeyRotation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableKeyRotation] -> ShowS
$cshowList :: [EnableKeyRotation] -> ShowS
show :: EnableKeyRotation -> String
$cshow :: EnableKeyRotation -> String
showsPrec :: Int -> EnableKeyRotation -> ShowS
$cshowsPrec :: Int -> EnableKeyRotation -> ShowS
Prelude.Show, forall x. Rep EnableKeyRotation x -> EnableKeyRotation
forall x. EnableKeyRotation -> Rep EnableKeyRotation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableKeyRotation x -> EnableKeyRotation
$cfrom :: forall x. EnableKeyRotation -> Rep EnableKeyRotation x
Prelude.Generic)
newEnableKeyRotation ::
Prelude.Text ->
EnableKeyRotation
newEnableKeyRotation :: Text -> EnableKeyRotation
newEnableKeyRotation Text
pKeyId_ =
EnableKeyRotation' {$sel:keyId:EnableKeyRotation' :: Text
keyId = Text
pKeyId_}
enableKeyRotation_keyId :: Lens.Lens' EnableKeyRotation Prelude.Text
enableKeyRotation_keyId :: Lens' EnableKeyRotation Text
enableKeyRotation_keyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableKeyRotation' {Text
keyId :: Text
$sel:keyId:EnableKeyRotation' :: EnableKeyRotation -> Text
keyId} -> Text
keyId) (\s :: EnableKeyRotation
s@EnableKeyRotation' {} Text
a -> EnableKeyRotation
s {$sel:keyId:EnableKeyRotation' :: Text
keyId = Text
a} :: EnableKeyRotation)
instance Core.AWSRequest EnableKeyRotation where
type
AWSResponse EnableKeyRotation =
EnableKeyRotationResponse
request :: (Service -> Service)
-> EnableKeyRotation -> Request EnableKeyRotation
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 EnableKeyRotation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableKeyRotation)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull EnableKeyRotationResponse
EnableKeyRotationResponse'
instance Prelude.Hashable EnableKeyRotation where
hashWithSalt :: Int -> EnableKeyRotation -> Int
hashWithSalt Int
_salt EnableKeyRotation' {Text
keyId :: Text
$sel:keyId:EnableKeyRotation' :: EnableKeyRotation -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyId
instance Prelude.NFData EnableKeyRotation where
rnf :: EnableKeyRotation -> ()
rnf EnableKeyRotation' {Text
keyId :: Text
$sel:keyId:EnableKeyRotation' :: EnableKeyRotation -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
keyId
instance Data.ToHeaders EnableKeyRotation where
toHeaders :: EnableKeyRotation -> [Header]
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 -> [Header]
Data.=# ( ByteString
"TrentService.EnableKeyRotation" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON EnableKeyRotation where
toJSON :: EnableKeyRotation -> Value
toJSON EnableKeyRotation' {Text
keyId :: Text
$sel:keyId:EnableKeyRotation' :: EnableKeyRotation -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"KeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
keyId)]
)
instance Data.ToPath EnableKeyRotation where
toPath :: EnableKeyRotation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery EnableKeyRotation where
toQuery :: EnableKeyRotation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data EnableKeyRotationResponse = EnableKeyRotationResponse'
{
}
deriving (EnableKeyRotationResponse -> EnableKeyRotationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableKeyRotationResponse -> EnableKeyRotationResponse -> Bool
$c/= :: EnableKeyRotationResponse -> EnableKeyRotationResponse -> Bool
== :: EnableKeyRotationResponse -> EnableKeyRotationResponse -> Bool
$c== :: EnableKeyRotationResponse -> EnableKeyRotationResponse -> Bool
Prelude.Eq, ReadPrec [EnableKeyRotationResponse]
ReadPrec EnableKeyRotationResponse
Int -> ReadS EnableKeyRotationResponse
ReadS [EnableKeyRotationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableKeyRotationResponse]
$creadListPrec :: ReadPrec [EnableKeyRotationResponse]
readPrec :: ReadPrec EnableKeyRotationResponse
$creadPrec :: ReadPrec EnableKeyRotationResponse
readList :: ReadS [EnableKeyRotationResponse]
$creadList :: ReadS [EnableKeyRotationResponse]
readsPrec :: Int -> ReadS EnableKeyRotationResponse
$creadsPrec :: Int -> ReadS EnableKeyRotationResponse
Prelude.Read, Int -> EnableKeyRotationResponse -> ShowS
[EnableKeyRotationResponse] -> ShowS
EnableKeyRotationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableKeyRotationResponse] -> ShowS
$cshowList :: [EnableKeyRotationResponse] -> ShowS
show :: EnableKeyRotationResponse -> String
$cshow :: EnableKeyRotationResponse -> String
showsPrec :: Int -> EnableKeyRotationResponse -> ShowS
$cshowsPrec :: Int -> EnableKeyRotationResponse -> ShowS
Prelude.Show, forall x.
Rep EnableKeyRotationResponse x -> EnableKeyRotationResponse
forall x.
EnableKeyRotationResponse -> Rep EnableKeyRotationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableKeyRotationResponse x -> EnableKeyRotationResponse
$cfrom :: forall x.
EnableKeyRotationResponse -> Rep EnableKeyRotationResponse x
Prelude.Generic)
newEnableKeyRotationResponse ::
EnableKeyRotationResponse
newEnableKeyRotationResponse :: EnableKeyRotationResponse
newEnableKeyRotationResponse =
EnableKeyRotationResponse
EnableKeyRotationResponse'
instance Prelude.NFData EnableKeyRotationResponse where
rnf :: EnableKeyRotationResponse -> ()
rnf EnableKeyRotationResponse
_ = ()