{-# 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.FraudDetector.PutKMSEncryptionKey
(
PutKMSEncryptionKey (..),
newPutKMSEncryptionKey,
putKMSEncryptionKey_kmsEncryptionKeyArn,
PutKMSEncryptionKeyResponse (..),
newPutKMSEncryptionKeyResponse,
putKMSEncryptionKeyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutKMSEncryptionKey = PutKMSEncryptionKey'
{
PutKMSEncryptionKey -> Text
kmsEncryptionKeyArn :: Prelude.Text
}
deriving (PutKMSEncryptionKey -> PutKMSEncryptionKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutKMSEncryptionKey -> PutKMSEncryptionKey -> Bool
$c/= :: PutKMSEncryptionKey -> PutKMSEncryptionKey -> Bool
== :: PutKMSEncryptionKey -> PutKMSEncryptionKey -> Bool
$c== :: PutKMSEncryptionKey -> PutKMSEncryptionKey -> Bool
Prelude.Eq, ReadPrec [PutKMSEncryptionKey]
ReadPrec PutKMSEncryptionKey
Int -> ReadS PutKMSEncryptionKey
ReadS [PutKMSEncryptionKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutKMSEncryptionKey]
$creadListPrec :: ReadPrec [PutKMSEncryptionKey]
readPrec :: ReadPrec PutKMSEncryptionKey
$creadPrec :: ReadPrec PutKMSEncryptionKey
readList :: ReadS [PutKMSEncryptionKey]
$creadList :: ReadS [PutKMSEncryptionKey]
readsPrec :: Int -> ReadS PutKMSEncryptionKey
$creadsPrec :: Int -> ReadS PutKMSEncryptionKey
Prelude.Read, Int -> PutKMSEncryptionKey -> ShowS
[PutKMSEncryptionKey] -> ShowS
PutKMSEncryptionKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutKMSEncryptionKey] -> ShowS
$cshowList :: [PutKMSEncryptionKey] -> ShowS
show :: PutKMSEncryptionKey -> String
$cshow :: PutKMSEncryptionKey -> String
showsPrec :: Int -> PutKMSEncryptionKey -> ShowS
$cshowsPrec :: Int -> PutKMSEncryptionKey -> ShowS
Prelude.Show, forall x. Rep PutKMSEncryptionKey x -> PutKMSEncryptionKey
forall x. PutKMSEncryptionKey -> Rep PutKMSEncryptionKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutKMSEncryptionKey x -> PutKMSEncryptionKey
$cfrom :: forall x. PutKMSEncryptionKey -> Rep PutKMSEncryptionKey x
Prelude.Generic)
newPutKMSEncryptionKey ::
Prelude.Text ->
PutKMSEncryptionKey
newPutKMSEncryptionKey :: Text -> PutKMSEncryptionKey
newPutKMSEncryptionKey Text
pKmsEncryptionKeyArn_ =
PutKMSEncryptionKey'
{ $sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: Text
kmsEncryptionKeyArn =
Text
pKmsEncryptionKeyArn_
}
putKMSEncryptionKey_kmsEncryptionKeyArn :: Lens.Lens' PutKMSEncryptionKey Prelude.Text
putKMSEncryptionKey_kmsEncryptionKeyArn :: Lens' PutKMSEncryptionKey Text
putKMSEncryptionKey_kmsEncryptionKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKMSEncryptionKey' {Text
kmsEncryptionKeyArn :: Text
$sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: PutKMSEncryptionKey -> Text
kmsEncryptionKeyArn} -> Text
kmsEncryptionKeyArn) (\s :: PutKMSEncryptionKey
s@PutKMSEncryptionKey' {} Text
a -> PutKMSEncryptionKey
s {$sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: Text
kmsEncryptionKeyArn = Text
a} :: PutKMSEncryptionKey)
instance Core.AWSRequest PutKMSEncryptionKey where
type
AWSResponse PutKMSEncryptionKey =
PutKMSEncryptionKeyResponse
request :: (Service -> Service)
-> PutKMSEncryptionKey -> Request PutKMSEncryptionKey
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 PutKMSEncryptionKey
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutKMSEncryptionKey)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutKMSEncryptionKeyResponse
PutKMSEncryptionKeyResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutKMSEncryptionKey where
hashWithSalt :: Int -> PutKMSEncryptionKey -> Int
hashWithSalt Int
_salt PutKMSEncryptionKey' {Text
kmsEncryptionKeyArn :: Text
$sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: PutKMSEncryptionKey -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
kmsEncryptionKeyArn
instance Prelude.NFData PutKMSEncryptionKey where
rnf :: PutKMSEncryptionKey -> ()
rnf PutKMSEncryptionKey' {Text
kmsEncryptionKeyArn :: Text
$sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: PutKMSEncryptionKey -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
kmsEncryptionKeyArn
instance Data.ToHeaders PutKMSEncryptionKey where
toHeaders :: PutKMSEncryptionKey -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"AWSHawksNestServiceFacade.PutKMSEncryptionKey" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutKMSEncryptionKey where
toJSON :: PutKMSEncryptionKey -> Value
toJSON PutKMSEncryptionKey' {Text
kmsEncryptionKeyArn :: Text
$sel:kmsEncryptionKeyArn:PutKMSEncryptionKey' :: PutKMSEncryptionKey -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"kmsEncryptionKeyArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
kmsEncryptionKeyArn)
]
)
instance Data.ToPath PutKMSEncryptionKey where
toPath :: PutKMSEncryptionKey -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutKMSEncryptionKey where
toQuery :: PutKMSEncryptionKey -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutKMSEncryptionKeyResponse = PutKMSEncryptionKeyResponse'
{
PutKMSEncryptionKeyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutKMSEncryptionKeyResponse -> PutKMSEncryptionKeyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutKMSEncryptionKeyResponse -> PutKMSEncryptionKeyResponse -> Bool
$c/= :: PutKMSEncryptionKeyResponse -> PutKMSEncryptionKeyResponse -> Bool
== :: PutKMSEncryptionKeyResponse -> PutKMSEncryptionKeyResponse -> Bool
$c== :: PutKMSEncryptionKeyResponse -> PutKMSEncryptionKeyResponse -> Bool
Prelude.Eq, ReadPrec [PutKMSEncryptionKeyResponse]
ReadPrec PutKMSEncryptionKeyResponse
Int -> ReadS PutKMSEncryptionKeyResponse
ReadS [PutKMSEncryptionKeyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutKMSEncryptionKeyResponse]
$creadListPrec :: ReadPrec [PutKMSEncryptionKeyResponse]
readPrec :: ReadPrec PutKMSEncryptionKeyResponse
$creadPrec :: ReadPrec PutKMSEncryptionKeyResponse
readList :: ReadS [PutKMSEncryptionKeyResponse]
$creadList :: ReadS [PutKMSEncryptionKeyResponse]
readsPrec :: Int -> ReadS PutKMSEncryptionKeyResponse
$creadsPrec :: Int -> ReadS PutKMSEncryptionKeyResponse
Prelude.Read, Int -> PutKMSEncryptionKeyResponse -> ShowS
[PutKMSEncryptionKeyResponse] -> ShowS
PutKMSEncryptionKeyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutKMSEncryptionKeyResponse] -> ShowS
$cshowList :: [PutKMSEncryptionKeyResponse] -> ShowS
show :: PutKMSEncryptionKeyResponse -> String
$cshow :: PutKMSEncryptionKeyResponse -> String
showsPrec :: Int -> PutKMSEncryptionKeyResponse -> ShowS
$cshowsPrec :: Int -> PutKMSEncryptionKeyResponse -> ShowS
Prelude.Show, forall x.
Rep PutKMSEncryptionKeyResponse x -> PutKMSEncryptionKeyResponse
forall x.
PutKMSEncryptionKeyResponse -> Rep PutKMSEncryptionKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutKMSEncryptionKeyResponse x -> PutKMSEncryptionKeyResponse
$cfrom :: forall x.
PutKMSEncryptionKeyResponse -> Rep PutKMSEncryptionKeyResponse x
Prelude.Generic)
newPutKMSEncryptionKeyResponse ::
Prelude.Int ->
PutKMSEncryptionKeyResponse
newPutKMSEncryptionKeyResponse :: Int -> PutKMSEncryptionKeyResponse
newPutKMSEncryptionKeyResponse Int
pHttpStatus_ =
PutKMSEncryptionKeyResponse'
{ $sel:httpStatus:PutKMSEncryptionKeyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putKMSEncryptionKeyResponse_httpStatus :: Lens.Lens' PutKMSEncryptionKeyResponse Prelude.Int
putKMSEncryptionKeyResponse_httpStatus :: Lens' PutKMSEncryptionKeyResponse Int
putKMSEncryptionKeyResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKMSEncryptionKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutKMSEncryptionKeyResponse' :: PutKMSEncryptionKeyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutKMSEncryptionKeyResponse
s@PutKMSEncryptionKeyResponse' {} Int
a -> PutKMSEncryptionKeyResponse
s {$sel:httpStatus:PutKMSEncryptionKeyResponse' :: Int
httpStatus = Int
a} :: PutKMSEncryptionKeyResponse)
instance Prelude.NFData PutKMSEncryptionKeyResponse where
rnf :: PutKMSEncryptionKeyResponse -> ()
rnf PutKMSEncryptionKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutKMSEncryptionKeyResponse' :: PutKMSEncryptionKeyResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus