{-# 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.GenerateDataKeyPairWithoutPlaintext
(
GenerateDataKeyPairWithoutPlaintext (..),
newGenerateDataKeyPairWithoutPlaintext,
generateDataKeyPairWithoutPlaintext_encryptionContext,
generateDataKeyPairWithoutPlaintext_grantTokens,
generateDataKeyPairWithoutPlaintext_keyId,
generateDataKeyPairWithoutPlaintext_keyPairSpec,
GenerateDataKeyPairWithoutPlaintextResponse (..),
newGenerateDataKeyPairWithoutPlaintextResponse,
generateDataKeyPairWithoutPlaintextResponse_keyId,
generateDataKeyPairWithoutPlaintextResponse_publicKey,
generateDataKeyPairWithoutPlaintextResponse_keyPairSpec,
generateDataKeyPairWithoutPlaintextResponse_privateKeyCiphertextBlob,
generateDataKeyPairWithoutPlaintextResponse_httpStatus,
)
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 GenerateDataKeyPairWithoutPlaintext = GenerateDataKeyPairWithoutPlaintext'
{
GenerateDataKeyPairWithoutPlaintext -> Maybe (HashMap Text Text)
encryptionContext :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GenerateDataKeyPairWithoutPlaintext -> Maybe [Text]
grantTokens :: Prelude.Maybe [Prelude.Text],
GenerateDataKeyPairWithoutPlaintext -> Text
keyId :: Prelude.Text,
GenerateDataKeyPairWithoutPlaintext -> DataKeyPairSpec
keyPairSpec :: DataKeyPairSpec
}
deriving (GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool
(GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool)
-> (GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool)
-> Eq GenerateDataKeyPairWithoutPlaintext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool
$c/= :: GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool
== :: GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool
$c== :: GenerateDataKeyPairWithoutPlaintext
-> GenerateDataKeyPairWithoutPlaintext -> Bool
Prelude.Eq, ReadPrec [GenerateDataKeyPairWithoutPlaintext]
ReadPrec GenerateDataKeyPairWithoutPlaintext
Int -> ReadS GenerateDataKeyPairWithoutPlaintext
ReadS [GenerateDataKeyPairWithoutPlaintext]
(Int -> ReadS GenerateDataKeyPairWithoutPlaintext)
-> ReadS [GenerateDataKeyPairWithoutPlaintext]
-> ReadPrec GenerateDataKeyPairWithoutPlaintext
-> ReadPrec [GenerateDataKeyPairWithoutPlaintext]
-> Read GenerateDataKeyPairWithoutPlaintext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateDataKeyPairWithoutPlaintext]
$creadListPrec :: ReadPrec [GenerateDataKeyPairWithoutPlaintext]
readPrec :: ReadPrec GenerateDataKeyPairWithoutPlaintext
$creadPrec :: ReadPrec GenerateDataKeyPairWithoutPlaintext
readList :: ReadS [GenerateDataKeyPairWithoutPlaintext]
$creadList :: ReadS [GenerateDataKeyPairWithoutPlaintext]
readsPrec :: Int -> ReadS GenerateDataKeyPairWithoutPlaintext
$creadsPrec :: Int -> ReadS GenerateDataKeyPairWithoutPlaintext
Prelude.Read, Int -> GenerateDataKeyPairWithoutPlaintext -> ShowS
[GenerateDataKeyPairWithoutPlaintext] -> ShowS
GenerateDataKeyPairWithoutPlaintext -> String
(Int -> GenerateDataKeyPairWithoutPlaintext -> ShowS)
-> (GenerateDataKeyPairWithoutPlaintext -> String)
-> ([GenerateDataKeyPairWithoutPlaintext] -> ShowS)
-> Show GenerateDataKeyPairWithoutPlaintext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateDataKeyPairWithoutPlaintext] -> ShowS
$cshowList :: [GenerateDataKeyPairWithoutPlaintext] -> ShowS
show :: GenerateDataKeyPairWithoutPlaintext -> String
$cshow :: GenerateDataKeyPairWithoutPlaintext -> String
showsPrec :: Int -> GenerateDataKeyPairWithoutPlaintext -> ShowS
$cshowsPrec :: Int -> GenerateDataKeyPairWithoutPlaintext -> ShowS
Prelude.Show, (forall x.
GenerateDataKeyPairWithoutPlaintext
-> Rep GenerateDataKeyPairWithoutPlaintext x)
-> (forall x.
Rep GenerateDataKeyPairWithoutPlaintext x
-> GenerateDataKeyPairWithoutPlaintext)
-> Generic GenerateDataKeyPairWithoutPlaintext
forall x.
Rep GenerateDataKeyPairWithoutPlaintext x
-> GenerateDataKeyPairWithoutPlaintext
forall x.
GenerateDataKeyPairWithoutPlaintext
-> Rep GenerateDataKeyPairWithoutPlaintext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateDataKeyPairWithoutPlaintext x
-> GenerateDataKeyPairWithoutPlaintext
$cfrom :: forall x.
GenerateDataKeyPairWithoutPlaintext
-> Rep GenerateDataKeyPairWithoutPlaintext x
Prelude.Generic)
newGenerateDataKeyPairWithoutPlaintext ::
Prelude.Text ->
DataKeyPairSpec ->
GenerateDataKeyPairWithoutPlaintext
newGenerateDataKeyPairWithoutPlaintext :: Text -> DataKeyPairSpec -> GenerateDataKeyPairWithoutPlaintext
newGenerateDataKeyPairWithoutPlaintext
Text
pKeyId_
DataKeyPairSpec
pKeyPairSpec_ =
GenerateDataKeyPairWithoutPlaintext' :: Maybe (HashMap Text Text)
-> Maybe [Text]
-> Text
-> DataKeyPairSpec
-> GenerateDataKeyPairWithoutPlaintext
GenerateDataKeyPairWithoutPlaintext'
{ $sel:encryptionContext:GenerateDataKeyPairWithoutPlaintext' :: Maybe (HashMap Text Text)
encryptionContext =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:grantTokens:GenerateDataKeyPairWithoutPlaintext' :: Maybe [Text]
grantTokens = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:keyId:GenerateDataKeyPairWithoutPlaintext' :: Text
keyId = Text
pKeyId_,
$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintext' :: DataKeyPairSpec
keyPairSpec = DataKeyPairSpec
pKeyPairSpec_
}
generateDataKeyPairWithoutPlaintext_encryptionContext :: Lens.Lens' GenerateDataKeyPairWithoutPlaintext (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
generateDataKeyPairWithoutPlaintext_encryptionContext :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
generateDataKeyPairWithoutPlaintext_encryptionContext = (GenerateDataKeyPairWithoutPlaintext -> Maybe (HashMap Text Text))
-> (GenerateDataKeyPairWithoutPlaintext
-> Maybe (HashMap Text Text)
-> GenerateDataKeyPairWithoutPlaintext)
-> Lens
GenerateDataKeyPairWithoutPlaintext
GenerateDataKeyPairWithoutPlaintext
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintext' {Maybe (HashMap Text Text)
encryptionContext :: Maybe (HashMap Text Text)
$sel:encryptionContext:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Maybe (HashMap Text Text)
encryptionContext} -> Maybe (HashMap Text Text)
encryptionContext) (\s :: GenerateDataKeyPairWithoutPlaintext
s@GenerateDataKeyPairWithoutPlaintext' {} Maybe (HashMap Text Text)
a -> GenerateDataKeyPairWithoutPlaintext
s {$sel:encryptionContext:GenerateDataKeyPairWithoutPlaintext' :: Maybe (HashMap Text Text)
encryptionContext = Maybe (HashMap Text Text)
a} :: GenerateDataKeyPairWithoutPlaintext) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
generateDataKeyPairWithoutPlaintext_grantTokens :: Lens.Lens' GenerateDataKeyPairWithoutPlaintext (Prelude.Maybe [Prelude.Text])
generateDataKeyPairWithoutPlaintext_grantTokens :: (Maybe [Text] -> f (Maybe [Text]))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
generateDataKeyPairWithoutPlaintext_grantTokens = (GenerateDataKeyPairWithoutPlaintext -> Maybe [Text])
-> (GenerateDataKeyPairWithoutPlaintext
-> Maybe [Text] -> GenerateDataKeyPairWithoutPlaintext)
-> Lens
GenerateDataKeyPairWithoutPlaintext
GenerateDataKeyPairWithoutPlaintext
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintext' {Maybe [Text]
grantTokens :: Maybe [Text]
$sel:grantTokens:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Maybe [Text]
grantTokens} -> Maybe [Text]
grantTokens) (\s :: GenerateDataKeyPairWithoutPlaintext
s@GenerateDataKeyPairWithoutPlaintext' {} Maybe [Text]
a -> GenerateDataKeyPairWithoutPlaintext
s {$sel:grantTokens:GenerateDataKeyPairWithoutPlaintext' :: Maybe [Text]
grantTokens = Maybe [Text]
a} :: GenerateDataKeyPairWithoutPlaintext) ((Maybe [Text] -> f (Maybe [Text]))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
generateDataKeyPairWithoutPlaintext_keyId :: Lens.Lens' GenerateDataKeyPairWithoutPlaintext Prelude.Text
generateDataKeyPairWithoutPlaintext_keyId :: (Text -> f Text)
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
generateDataKeyPairWithoutPlaintext_keyId = (GenerateDataKeyPairWithoutPlaintext -> Text)
-> (GenerateDataKeyPairWithoutPlaintext
-> Text -> GenerateDataKeyPairWithoutPlaintext)
-> Lens
GenerateDataKeyPairWithoutPlaintext
GenerateDataKeyPairWithoutPlaintext
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintext' {Text
keyId :: Text
$sel:keyId:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Text
keyId} -> Text
keyId) (\s :: GenerateDataKeyPairWithoutPlaintext
s@GenerateDataKeyPairWithoutPlaintext' {} Text
a -> GenerateDataKeyPairWithoutPlaintext
s {$sel:keyId:GenerateDataKeyPairWithoutPlaintext' :: Text
keyId = Text
a} :: GenerateDataKeyPairWithoutPlaintext)
generateDataKeyPairWithoutPlaintext_keyPairSpec :: Lens.Lens' GenerateDataKeyPairWithoutPlaintext DataKeyPairSpec
generateDataKeyPairWithoutPlaintext_keyPairSpec :: (DataKeyPairSpec -> f DataKeyPairSpec)
-> GenerateDataKeyPairWithoutPlaintext
-> f GenerateDataKeyPairWithoutPlaintext
generateDataKeyPairWithoutPlaintext_keyPairSpec = (GenerateDataKeyPairWithoutPlaintext -> DataKeyPairSpec)
-> (GenerateDataKeyPairWithoutPlaintext
-> DataKeyPairSpec -> GenerateDataKeyPairWithoutPlaintext)
-> Lens
GenerateDataKeyPairWithoutPlaintext
GenerateDataKeyPairWithoutPlaintext
DataKeyPairSpec
DataKeyPairSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintext' {DataKeyPairSpec
keyPairSpec :: DataKeyPairSpec
$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> DataKeyPairSpec
keyPairSpec} -> DataKeyPairSpec
keyPairSpec) (\s :: GenerateDataKeyPairWithoutPlaintext
s@GenerateDataKeyPairWithoutPlaintext' {} DataKeyPairSpec
a -> GenerateDataKeyPairWithoutPlaintext
s {$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintext' :: DataKeyPairSpec
keyPairSpec = DataKeyPairSpec
a} :: GenerateDataKeyPairWithoutPlaintext)
instance
Core.AWSRequest
GenerateDataKeyPairWithoutPlaintext
where
type
AWSResponse GenerateDataKeyPairWithoutPlaintext =
GenerateDataKeyPairWithoutPlaintextResponse
request :: GenerateDataKeyPairWithoutPlaintext
-> Request GenerateDataKeyPairWithoutPlaintext
request = Service
-> GenerateDataKeyPairWithoutPlaintext
-> Request GenerateDataKeyPairWithoutPlaintext
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GenerateDataKeyPairWithoutPlaintext
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GenerateDataKeyPairWithoutPlaintext)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GenerateDataKeyPairWithoutPlaintext))
-> Logger
-> Service
-> Proxy GenerateDataKeyPairWithoutPlaintext
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GenerateDataKeyPairWithoutPlaintext)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Base64
-> Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse'
(Maybe Text
-> Maybe Base64
-> Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Base64
-> Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"KeyId")
Either
String
(Maybe Base64
-> Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse)
-> Either String (Maybe Base64)
-> Either
String
(Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Base64)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PublicKey")
Either
String
(Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse)
-> Either String (Maybe DataKeyPairSpec)
-> Either
String
(Maybe Base64
-> Int -> GenerateDataKeyPairWithoutPlaintextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DataKeyPairSpec)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"KeyPairSpec")
Either
String
(Maybe Base64
-> Int -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Either String (Maybe Base64)
-> Either
String (Int -> GenerateDataKeyPairWithoutPlaintextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Base64)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PrivateKeyCiphertextBlob")
Either String (Int -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Either String Int
-> Either String GenerateDataKeyPairWithoutPlaintextResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GenerateDataKeyPairWithoutPlaintext
instance
Prelude.NFData
GenerateDataKeyPairWithoutPlaintext
instance
Core.ToHeaders
GenerateDataKeyPairWithoutPlaintext
where
toHeaders :: GenerateDataKeyPairWithoutPlaintext -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GenerateDataKeyPairWithoutPlaintext -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"TrentService.GenerateDataKeyPairWithoutPlaintext" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Core.ToJSON
GenerateDataKeyPairWithoutPlaintext
where
toJSON :: GenerateDataKeyPairWithoutPlaintext -> Value
toJSON GenerateDataKeyPairWithoutPlaintext' {Maybe [Text]
Maybe (HashMap Text Text)
Text
DataKeyPairSpec
keyPairSpec :: DataKeyPairSpec
keyId :: Text
grantTokens :: Maybe [Text]
encryptionContext :: Maybe (HashMap Text Text)
$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> DataKeyPairSpec
$sel:keyId:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Text
$sel:grantTokens:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Maybe [Text]
$sel:encryptionContext:GenerateDataKeyPairWithoutPlaintext' :: GenerateDataKeyPairWithoutPlaintext -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EncryptionContext" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
encryptionContext,
(Text
"GrantTokens" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
grantTokens,
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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyPairSpec" Text -> DataKeyPairSpec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataKeyPairSpec
keyPairSpec)
]
)
instance
Core.ToPath
GenerateDataKeyPairWithoutPlaintext
where
toPath :: GenerateDataKeyPairWithoutPlaintext -> ByteString
toPath = ByteString -> GenerateDataKeyPairWithoutPlaintext -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
GenerateDataKeyPairWithoutPlaintext
where
toQuery :: GenerateDataKeyPairWithoutPlaintext -> QueryString
toQuery = QueryString -> GenerateDataKeyPairWithoutPlaintext -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GenerateDataKeyPairWithoutPlaintextResponse = GenerateDataKeyPairWithoutPlaintextResponse'
{
GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64
publicKey :: Prelude.Maybe Core.Base64,
GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe DataKeyPairSpec
keyPairSpec :: Prelude.Maybe DataKeyPairSpec,
GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64
privateKeyCiphertextBlob :: Prelude.Maybe Core.Base64,
GenerateDataKeyPairWithoutPlaintextResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool
(GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool)
-> Eq GenerateDataKeyPairWithoutPlaintextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool
$c/= :: GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool
== :: GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool
$c== :: GenerateDataKeyPairWithoutPlaintextResponse
-> GenerateDataKeyPairWithoutPlaintextResponse -> Bool
Prelude.Eq, ReadPrec [GenerateDataKeyPairWithoutPlaintextResponse]
ReadPrec GenerateDataKeyPairWithoutPlaintextResponse
Int -> ReadS GenerateDataKeyPairWithoutPlaintextResponse
ReadS [GenerateDataKeyPairWithoutPlaintextResponse]
(Int -> ReadS GenerateDataKeyPairWithoutPlaintextResponse)
-> ReadS [GenerateDataKeyPairWithoutPlaintextResponse]
-> ReadPrec GenerateDataKeyPairWithoutPlaintextResponse
-> ReadPrec [GenerateDataKeyPairWithoutPlaintextResponse]
-> Read GenerateDataKeyPairWithoutPlaintextResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateDataKeyPairWithoutPlaintextResponse]
$creadListPrec :: ReadPrec [GenerateDataKeyPairWithoutPlaintextResponse]
readPrec :: ReadPrec GenerateDataKeyPairWithoutPlaintextResponse
$creadPrec :: ReadPrec GenerateDataKeyPairWithoutPlaintextResponse
readList :: ReadS [GenerateDataKeyPairWithoutPlaintextResponse]
$creadList :: ReadS [GenerateDataKeyPairWithoutPlaintextResponse]
readsPrec :: Int -> ReadS GenerateDataKeyPairWithoutPlaintextResponse
$creadsPrec :: Int -> ReadS GenerateDataKeyPairWithoutPlaintextResponse
Prelude.Read, Int -> GenerateDataKeyPairWithoutPlaintextResponse -> ShowS
[GenerateDataKeyPairWithoutPlaintextResponse] -> ShowS
GenerateDataKeyPairWithoutPlaintextResponse -> String
(Int -> GenerateDataKeyPairWithoutPlaintextResponse -> ShowS)
-> (GenerateDataKeyPairWithoutPlaintextResponse -> String)
-> ([GenerateDataKeyPairWithoutPlaintextResponse] -> ShowS)
-> Show GenerateDataKeyPairWithoutPlaintextResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateDataKeyPairWithoutPlaintextResponse] -> ShowS
$cshowList :: [GenerateDataKeyPairWithoutPlaintextResponse] -> ShowS
show :: GenerateDataKeyPairWithoutPlaintextResponse -> String
$cshow :: GenerateDataKeyPairWithoutPlaintextResponse -> String
showsPrec :: Int -> GenerateDataKeyPairWithoutPlaintextResponse -> ShowS
$cshowsPrec :: Int -> GenerateDataKeyPairWithoutPlaintextResponse -> ShowS
Prelude.Show, (forall x.
GenerateDataKeyPairWithoutPlaintextResponse
-> Rep GenerateDataKeyPairWithoutPlaintextResponse x)
-> (forall x.
Rep GenerateDataKeyPairWithoutPlaintextResponse x
-> GenerateDataKeyPairWithoutPlaintextResponse)
-> Generic GenerateDataKeyPairWithoutPlaintextResponse
forall x.
Rep GenerateDataKeyPairWithoutPlaintextResponse x
-> GenerateDataKeyPairWithoutPlaintextResponse
forall x.
GenerateDataKeyPairWithoutPlaintextResponse
-> Rep GenerateDataKeyPairWithoutPlaintextResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateDataKeyPairWithoutPlaintextResponse x
-> GenerateDataKeyPairWithoutPlaintextResponse
$cfrom :: forall x.
GenerateDataKeyPairWithoutPlaintextResponse
-> Rep GenerateDataKeyPairWithoutPlaintextResponse x
Prelude.Generic)
newGenerateDataKeyPairWithoutPlaintextResponse ::
Prelude.Int ->
GenerateDataKeyPairWithoutPlaintextResponse
newGenerateDataKeyPairWithoutPlaintextResponse :: Int -> GenerateDataKeyPairWithoutPlaintextResponse
newGenerateDataKeyPairWithoutPlaintextResponse
Int
pHttpStatus_ =
GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Text
-> Maybe Base64
-> Maybe DataKeyPairSpec
-> Maybe Base64
-> Int
-> GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse'
{ $sel:keyId:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Text
keyId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:publicKey:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Base64
publicKey = Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe DataKeyPairSpec
keyPairSpec = Maybe DataKeyPairSpec
forall a. Maybe a
Prelude.Nothing,
$sel:privateKeyCiphertextBlob:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Base64
privateKeyCiphertextBlob =
Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GenerateDataKeyPairWithoutPlaintextResponse' :: Int
httpStatus = Int
pHttpStatus_
}
generateDataKeyPairWithoutPlaintextResponse_keyId :: Lens.Lens' GenerateDataKeyPairWithoutPlaintextResponse (Prelude.Maybe Prelude.Text)
generateDataKeyPairWithoutPlaintextResponse_keyId :: (Maybe Text -> f (Maybe Text))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
generateDataKeyPairWithoutPlaintextResponse_keyId = (GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Text)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe Text -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Lens
GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintextResponse' {Maybe Text
keyId :: Maybe Text
$sel:keyId:GenerateDataKeyPairWithoutPlaintextResponse' :: GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: GenerateDataKeyPairWithoutPlaintextResponse
s@GenerateDataKeyPairWithoutPlaintextResponse' {} Maybe Text
a -> GenerateDataKeyPairWithoutPlaintextResponse
s {$sel:keyId:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Text
keyId = Maybe Text
a} :: GenerateDataKeyPairWithoutPlaintextResponse)
generateDataKeyPairWithoutPlaintextResponse_publicKey :: Lens.Lens' GenerateDataKeyPairWithoutPlaintextResponse (Prelude.Maybe Prelude.ByteString)
generateDataKeyPairWithoutPlaintextResponse_publicKey :: (Maybe ByteString -> f (Maybe ByteString))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
generateDataKeyPairWithoutPlaintextResponse_publicKey = (GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe Base64 -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Lens
GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse
(Maybe Base64)
(Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintextResponse' {Maybe Base64
publicKey :: Maybe Base64
$sel:publicKey:GenerateDataKeyPairWithoutPlaintextResponse' :: GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64
publicKey} -> Maybe Base64
publicKey) (\s :: GenerateDataKeyPairWithoutPlaintextResponse
s@GenerateDataKeyPairWithoutPlaintextResponse' {} Maybe Base64
a -> GenerateDataKeyPairWithoutPlaintextResponse
s {$sel:publicKey:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Base64
publicKey = Maybe Base64
a} :: GenerateDataKeyPairWithoutPlaintextResponse) ((Maybe Base64 -> f (Maybe Base64))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
(Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64
generateDataKeyPairWithoutPlaintextResponse_keyPairSpec :: Lens.Lens' GenerateDataKeyPairWithoutPlaintextResponse (Prelude.Maybe DataKeyPairSpec)
generateDataKeyPairWithoutPlaintextResponse_keyPairSpec :: (Maybe DataKeyPairSpec -> f (Maybe DataKeyPairSpec))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
generateDataKeyPairWithoutPlaintextResponse_keyPairSpec = (GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe DataKeyPairSpec)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe DataKeyPairSpec
-> GenerateDataKeyPairWithoutPlaintextResponse)
-> Lens
GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse
(Maybe DataKeyPairSpec)
(Maybe DataKeyPairSpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintextResponse' {Maybe DataKeyPairSpec
keyPairSpec :: Maybe DataKeyPairSpec
$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintextResponse' :: GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe DataKeyPairSpec
keyPairSpec} -> Maybe DataKeyPairSpec
keyPairSpec) (\s :: GenerateDataKeyPairWithoutPlaintextResponse
s@GenerateDataKeyPairWithoutPlaintextResponse' {} Maybe DataKeyPairSpec
a -> GenerateDataKeyPairWithoutPlaintextResponse
s {$sel:keyPairSpec:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe DataKeyPairSpec
keyPairSpec = Maybe DataKeyPairSpec
a} :: GenerateDataKeyPairWithoutPlaintextResponse)
generateDataKeyPairWithoutPlaintextResponse_privateKeyCiphertextBlob :: Lens.Lens' GenerateDataKeyPairWithoutPlaintextResponse (Prelude.Maybe Prelude.ByteString)
generateDataKeyPairWithoutPlaintextResponse_privateKeyCiphertextBlob :: (Maybe ByteString -> f (Maybe ByteString))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
generateDataKeyPairWithoutPlaintextResponse_privateKeyCiphertextBlob = (GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> Maybe Base64 -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Lens
GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse
(Maybe Base64)
(Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintextResponse' {Maybe Base64
privateKeyCiphertextBlob :: Maybe Base64
$sel:privateKeyCiphertextBlob:GenerateDataKeyPairWithoutPlaintextResponse' :: GenerateDataKeyPairWithoutPlaintextResponse -> Maybe Base64
privateKeyCiphertextBlob} -> Maybe Base64
privateKeyCiphertextBlob) (\s :: GenerateDataKeyPairWithoutPlaintextResponse
s@GenerateDataKeyPairWithoutPlaintextResponse' {} Maybe Base64
a -> GenerateDataKeyPairWithoutPlaintextResponse
s {$sel:privateKeyCiphertextBlob:GenerateDataKeyPairWithoutPlaintextResponse' :: Maybe Base64
privateKeyCiphertextBlob = Maybe Base64
a} :: GenerateDataKeyPairWithoutPlaintextResponse) ((Maybe Base64 -> f (Maybe Base64))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
(Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64
generateDataKeyPairWithoutPlaintextResponse_httpStatus :: Lens.Lens' GenerateDataKeyPairWithoutPlaintextResponse Prelude.Int
generateDataKeyPairWithoutPlaintextResponse_httpStatus :: (Int -> f Int)
-> GenerateDataKeyPairWithoutPlaintextResponse
-> f GenerateDataKeyPairWithoutPlaintextResponse
generateDataKeyPairWithoutPlaintextResponse_httpStatus = (GenerateDataKeyPairWithoutPlaintextResponse -> Int)
-> (GenerateDataKeyPairWithoutPlaintextResponse
-> Int -> GenerateDataKeyPairWithoutPlaintextResponse)
-> Lens
GenerateDataKeyPairWithoutPlaintextResponse
GenerateDataKeyPairWithoutPlaintextResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateDataKeyPairWithoutPlaintextResponse' {Int
httpStatus :: Int
$sel:httpStatus:GenerateDataKeyPairWithoutPlaintextResponse' :: GenerateDataKeyPairWithoutPlaintextResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GenerateDataKeyPairWithoutPlaintextResponse
s@GenerateDataKeyPairWithoutPlaintextResponse' {} Int
a -> GenerateDataKeyPairWithoutPlaintextResponse
s {$sel:httpStatus:GenerateDataKeyPairWithoutPlaintextResponse' :: Int
httpStatus = Int
a} :: GenerateDataKeyPairWithoutPlaintextResponse)
instance
Prelude.NFData
GenerateDataKeyPairWithoutPlaintextResponse