{-# 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.DisableKey
(
DisableKey (..),
newDisableKey,
disableKey_keyId,
DisableKeyResponse (..),
newDisableKeyResponse,
)
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 DisableKey = DisableKey'
{
DisableKey -> Text
keyId :: Prelude.Text
}
deriving (DisableKey -> DisableKey -> Bool
(DisableKey -> DisableKey -> Bool)
-> (DisableKey -> DisableKey -> Bool) -> Eq DisableKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableKey -> DisableKey -> Bool
$c/= :: DisableKey -> DisableKey -> Bool
== :: DisableKey -> DisableKey -> Bool
$c== :: DisableKey -> DisableKey -> Bool
Prelude.Eq, ReadPrec [DisableKey]
ReadPrec DisableKey
Int -> ReadS DisableKey
ReadS [DisableKey]
(Int -> ReadS DisableKey)
-> ReadS [DisableKey]
-> ReadPrec DisableKey
-> ReadPrec [DisableKey]
-> Read DisableKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableKey]
$creadListPrec :: ReadPrec [DisableKey]
readPrec :: ReadPrec DisableKey
$creadPrec :: ReadPrec DisableKey
readList :: ReadS [DisableKey]
$creadList :: ReadS [DisableKey]
readsPrec :: Int -> ReadS DisableKey
$creadsPrec :: Int -> ReadS DisableKey
Prelude.Read, Int -> DisableKey -> ShowS
[DisableKey] -> ShowS
DisableKey -> String
(Int -> DisableKey -> ShowS)
-> (DisableKey -> String)
-> ([DisableKey] -> ShowS)
-> Show DisableKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableKey] -> ShowS
$cshowList :: [DisableKey] -> ShowS
show :: DisableKey -> String
$cshow :: DisableKey -> String
showsPrec :: Int -> DisableKey -> ShowS
$cshowsPrec :: Int -> DisableKey -> ShowS
Prelude.Show, (forall x. DisableKey -> Rep DisableKey x)
-> (forall x. Rep DisableKey x -> DisableKey) -> Generic DisableKey
forall x. Rep DisableKey x -> DisableKey
forall x. DisableKey -> Rep DisableKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableKey x -> DisableKey
$cfrom :: forall x. DisableKey -> Rep DisableKey x
Prelude.Generic)
newDisableKey ::
Prelude.Text ->
DisableKey
newDisableKey :: Text -> DisableKey
newDisableKey Text
pKeyId_ = DisableKey' :: Text -> DisableKey
DisableKey' {$sel:keyId:DisableKey' :: Text
keyId = Text
pKeyId_}
disableKey_keyId :: Lens.Lens' DisableKey Prelude.Text
disableKey_keyId :: (Text -> f Text) -> DisableKey -> f DisableKey
disableKey_keyId = (DisableKey -> Text)
-> (DisableKey -> Text -> DisableKey)
-> Lens DisableKey DisableKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableKey' {Text
keyId :: Text
$sel:keyId:DisableKey' :: DisableKey -> Text
keyId} -> Text
keyId) (\s :: DisableKey
s@DisableKey' {} Text
a -> DisableKey
s {$sel:keyId:DisableKey' :: Text
keyId = Text
a} :: DisableKey)
instance Core.AWSRequest DisableKey where
type AWSResponse DisableKey = DisableKeyResponse
request :: DisableKey -> Request DisableKey
request = Service -> DisableKey -> Request DisableKey
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisableKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DisableKey)))
response = AWSResponse DisableKey
-> Logger
-> Service
-> Proxy DisableKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DisableKey)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DisableKey
DisableKeyResponse
DisableKeyResponse'
instance Prelude.Hashable DisableKey
instance Prelude.NFData DisableKey
instance Core.ToHeaders DisableKey where
toHeaders :: DisableKey -> [Header]
toHeaders =
[Header] -> DisableKey -> [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.DisableKey" :: 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 DisableKey where
toJSON :: DisableKey -> Value
toJSON DisableKey' {Text
keyId :: Text
$sel:keyId:DisableKey' :: DisableKey -> 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)]
)
instance Core.ToPath DisableKey where
toPath :: DisableKey -> ByteString
toPath = ByteString -> DisableKey -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisableKey where
toQuery :: DisableKey -> QueryString
toQuery = QueryString -> DisableKey -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisableKeyResponse = DisableKeyResponse'
{
}
deriving (DisableKeyResponse -> DisableKeyResponse -> Bool
(DisableKeyResponse -> DisableKeyResponse -> Bool)
-> (DisableKeyResponse -> DisableKeyResponse -> Bool)
-> Eq DisableKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableKeyResponse -> DisableKeyResponse -> Bool
$c/= :: DisableKeyResponse -> DisableKeyResponse -> Bool
== :: DisableKeyResponse -> DisableKeyResponse -> Bool
$c== :: DisableKeyResponse -> DisableKeyResponse -> Bool
Prelude.Eq, ReadPrec [DisableKeyResponse]
ReadPrec DisableKeyResponse
Int -> ReadS DisableKeyResponse
ReadS [DisableKeyResponse]
(Int -> ReadS DisableKeyResponse)
-> ReadS [DisableKeyResponse]
-> ReadPrec DisableKeyResponse
-> ReadPrec [DisableKeyResponse]
-> Read DisableKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableKeyResponse]
$creadListPrec :: ReadPrec [DisableKeyResponse]
readPrec :: ReadPrec DisableKeyResponse
$creadPrec :: ReadPrec DisableKeyResponse
readList :: ReadS [DisableKeyResponse]
$creadList :: ReadS [DisableKeyResponse]
readsPrec :: Int -> ReadS DisableKeyResponse
$creadsPrec :: Int -> ReadS DisableKeyResponse
Prelude.Read, Int -> DisableKeyResponse -> ShowS
[DisableKeyResponse] -> ShowS
DisableKeyResponse -> String
(Int -> DisableKeyResponse -> ShowS)
-> (DisableKeyResponse -> String)
-> ([DisableKeyResponse] -> ShowS)
-> Show DisableKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableKeyResponse] -> ShowS
$cshowList :: [DisableKeyResponse] -> ShowS
show :: DisableKeyResponse -> String
$cshow :: DisableKeyResponse -> String
showsPrec :: Int -> DisableKeyResponse -> ShowS
$cshowsPrec :: Int -> DisableKeyResponse -> ShowS
Prelude.Show, (forall x. DisableKeyResponse -> Rep DisableKeyResponse x)
-> (forall x. Rep DisableKeyResponse x -> DisableKeyResponse)
-> Generic DisableKeyResponse
forall x. Rep DisableKeyResponse x -> DisableKeyResponse
forall x. DisableKeyResponse -> Rep DisableKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableKeyResponse x -> DisableKeyResponse
$cfrom :: forall x. DisableKeyResponse -> Rep DisableKeyResponse x
Prelude.Generic)
newDisableKeyResponse ::
DisableKeyResponse
newDisableKeyResponse :: DisableKeyResponse
newDisableKeyResponse = DisableKeyResponse
DisableKeyResponse'
instance Prelude.NFData DisableKeyResponse