{-# 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 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 DisableKey = DisableKey'
{
DisableKey -> Text
keyId :: Prelude.Text
}
deriving (DisableKey -> DisableKey -> Bool
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]
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
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. 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' {$sel:keyId:DisableKey' :: Text
keyId = Text
pKeyId_}
disableKey_keyId :: Lens.Lens' DisableKey Prelude.Text
disableKey_keyId :: Lens' DisableKey Text
disableKey_keyId = 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 :: (Service -> Service) -> DisableKey -> Request DisableKey
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 DisableKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DisableKey)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DisableKeyResponse
DisableKeyResponse'
instance Prelude.Hashable DisableKey where
hashWithSalt :: Int -> DisableKey -> Int
hashWithSalt Int
_salt DisableKey' {Text
keyId :: Text
$sel:keyId:DisableKey' :: DisableKey -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyId
instance Prelude.NFData DisableKey where
rnf :: DisableKey -> ()
rnf DisableKey' {Text
keyId :: Text
$sel:keyId:DisableKey' :: DisableKey -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
keyId
instance Data.ToHeaders DisableKey where
toHeaders :: DisableKey -> [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.DisableKey" :: 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 DisableKey where
toJSON :: DisableKey -> Value
toJSON DisableKey' {Text
keyId :: Text
$sel:keyId:DisableKey' :: DisableKey -> 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 DisableKey where
toPath :: DisableKey -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DisableKey where
toQuery :: DisableKey -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisableKeyResponse = DisableKeyResponse'
{
}
deriving (DisableKeyResponse -> DisableKeyResponse -> Bool
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]
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
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. 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 where
rnf :: DisableKeyResponse -> ()
rnf DisableKeyResponse
_ = ()