{-# 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.DisableKeyRotation
(
DisableKeyRotation (..),
newDisableKeyRotation,
disableKeyRotation_keyId,
DisableKeyRotationResponse (..),
newDisableKeyRotationResponse,
)
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 DisableKeyRotation = DisableKeyRotation'
{
DisableKeyRotation -> Text
keyId :: Prelude.Text
}
deriving (DisableKeyRotation -> DisableKeyRotation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableKeyRotation -> DisableKeyRotation -> Bool
$c/= :: DisableKeyRotation -> DisableKeyRotation -> Bool
== :: DisableKeyRotation -> DisableKeyRotation -> Bool
$c== :: DisableKeyRotation -> DisableKeyRotation -> Bool
Prelude.Eq, ReadPrec [DisableKeyRotation]
ReadPrec DisableKeyRotation
Int -> ReadS DisableKeyRotation
ReadS [DisableKeyRotation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableKeyRotation]
$creadListPrec :: ReadPrec [DisableKeyRotation]
readPrec :: ReadPrec DisableKeyRotation
$creadPrec :: ReadPrec DisableKeyRotation
readList :: ReadS [DisableKeyRotation]
$creadList :: ReadS [DisableKeyRotation]
readsPrec :: Int -> ReadS DisableKeyRotation
$creadsPrec :: Int -> ReadS DisableKeyRotation
Prelude.Read, Int -> DisableKeyRotation -> ShowS
[DisableKeyRotation] -> ShowS
DisableKeyRotation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableKeyRotation] -> ShowS
$cshowList :: [DisableKeyRotation] -> ShowS
show :: DisableKeyRotation -> String
$cshow :: DisableKeyRotation -> String
showsPrec :: Int -> DisableKeyRotation -> ShowS
$cshowsPrec :: Int -> DisableKeyRotation -> ShowS
Prelude.Show, forall x. Rep DisableKeyRotation x -> DisableKeyRotation
forall x. DisableKeyRotation -> Rep DisableKeyRotation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableKeyRotation x -> DisableKeyRotation
$cfrom :: forall x. DisableKeyRotation -> Rep DisableKeyRotation x
Prelude.Generic)
newDisableKeyRotation ::
Prelude.Text ->
DisableKeyRotation
newDisableKeyRotation :: Text -> DisableKeyRotation
newDisableKeyRotation Text
pKeyId_ =
DisableKeyRotation' {$sel:keyId:DisableKeyRotation' :: Text
keyId = Text
pKeyId_}
disableKeyRotation_keyId :: Lens.Lens' DisableKeyRotation Prelude.Text
disableKeyRotation_keyId :: Lens' DisableKeyRotation Text
disableKeyRotation_keyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableKeyRotation' {Text
keyId :: Text
$sel:keyId:DisableKeyRotation' :: DisableKeyRotation -> Text
keyId} -> Text
keyId) (\s :: DisableKeyRotation
s@DisableKeyRotation' {} Text
a -> DisableKeyRotation
s {$sel:keyId:DisableKeyRotation' :: Text
keyId = Text
a} :: DisableKeyRotation)
instance Core.AWSRequest DisableKeyRotation where
type
AWSResponse DisableKeyRotation =
DisableKeyRotationResponse
request :: (Service -> Service)
-> DisableKeyRotation -> Request DisableKeyRotation
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 DisableKeyRotation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableKeyRotation)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DisableKeyRotationResponse
DisableKeyRotationResponse'
instance Prelude.Hashable DisableKeyRotation where
hashWithSalt :: Int -> DisableKeyRotation -> Int
hashWithSalt Int
_salt DisableKeyRotation' {Text
keyId :: Text
$sel:keyId:DisableKeyRotation' :: DisableKeyRotation -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyId
instance Prelude.NFData DisableKeyRotation where
rnf :: DisableKeyRotation -> ()
rnf DisableKeyRotation' {Text
keyId :: Text
$sel:keyId:DisableKeyRotation' :: DisableKeyRotation -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
keyId
instance Data.ToHeaders DisableKeyRotation where
toHeaders :: DisableKeyRotation -> [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.DisableKeyRotation" ::
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 DisableKeyRotation where
toJSON :: DisableKeyRotation -> Value
toJSON DisableKeyRotation' {Text
keyId :: Text
$sel:keyId:DisableKeyRotation' :: DisableKeyRotation -> 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 DisableKeyRotation where
toPath :: DisableKeyRotation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DisableKeyRotation where
toQuery :: DisableKeyRotation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisableKeyRotationResponse = DisableKeyRotationResponse'
{
}
deriving (DisableKeyRotationResponse -> DisableKeyRotationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableKeyRotationResponse -> DisableKeyRotationResponse -> Bool
$c/= :: DisableKeyRotationResponse -> DisableKeyRotationResponse -> Bool
== :: DisableKeyRotationResponse -> DisableKeyRotationResponse -> Bool
$c== :: DisableKeyRotationResponse -> DisableKeyRotationResponse -> Bool
Prelude.Eq, ReadPrec [DisableKeyRotationResponse]
ReadPrec DisableKeyRotationResponse
Int -> ReadS DisableKeyRotationResponse
ReadS [DisableKeyRotationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableKeyRotationResponse]
$creadListPrec :: ReadPrec [DisableKeyRotationResponse]
readPrec :: ReadPrec DisableKeyRotationResponse
$creadPrec :: ReadPrec DisableKeyRotationResponse
readList :: ReadS [DisableKeyRotationResponse]
$creadList :: ReadS [DisableKeyRotationResponse]
readsPrec :: Int -> ReadS DisableKeyRotationResponse
$creadsPrec :: Int -> ReadS DisableKeyRotationResponse
Prelude.Read, Int -> DisableKeyRotationResponse -> ShowS
[DisableKeyRotationResponse] -> ShowS
DisableKeyRotationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableKeyRotationResponse] -> ShowS
$cshowList :: [DisableKeyRotationResponse] -> ShowS
show :: DisableKeyRotationResponse -> String
$cshow :: DisableKeyRotationResponse -> String
showsPrec :: Int -> DisableKeyRotationResponse -> ShowS
$cshowsPrec :: Int -> DisableKeyRotationResponse -> ShowS
Prelude.Show, forall x.
Rep DisableKeyRotationResponse x -> DisableKeyRotationResponse
forall x.
DisableKeyRotationResponse -> Rep DisableKeyRotationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableKeyRotationResponse x -> DisableKeyRotationResponse
$cfrom :: forall x.
DisableKeyRotationResponse -> Rep DisableKeyRotationResponse x
Prelude.Generic)
newDisableKeyRotationResponse ::
DisableKeyRotationResponse
newDisableKeyRotationResponse :: DisableKeyRotationResponse
newDisableKeyRotationResponse =
DisableKeyRotationResponse
DisableKeyRotationResponse'
instance Prelude.NFData DisableKeyRotationResponse where
rnf :: DisableKeyRotationResponse -> ()
rnf DisableKeyRotationResponse
_ = ()