{-# 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.Decrypt
(
Decrypt (..),
newDecrypt,
decrypt_keyId,
decrypt_encryptionContext,
decrypt_grantTokens,
decrypt_encryptionAlgorithm,
decrypt_ciphertextBlob,
DecryptResponse (..),
newDecryptResponse,
decryptResponse_keyId,
decryptResponse_plaintext,
decryptResponse_encryptionAlgorithm,
decryptResponse_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 Decrypt = Decrypt'
{
Decrypt -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
Decrypt -> Maybe (HashMap Text Text)
encryptionContext :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Decrypt -> Maybe [Text]
grantTokens :: Prelude.Maybe [Prelude.Text],
Decrypt -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm :: Prelude.Maybe EncryptionAlgorithmSpec,
Decrypt -> Base64
ciphertextBlob :: Core.Base64
}
deriving (Decrypt -> Decrypt -> Bool
(Decrypt -> Decrypt -> Bool)
-> (Decrypt -> Decrypt -> Bool) -> Eq Decrypt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Decrypt -> Decrypt -> Bool
$c/= :: Decrypt -> Decrypt -> Bool
== :: Decrypt -> Decrypt -> Bool
$c== :: Decrypt -> Decrypt -> Bool
Prelude.Eq, ReadPrec [Decrypt]
ReadPrec Decrypt
Int -> ReadS Decrypt
ReadS [Decrypt]
(Int -> ReadS Decrypt)
-> ReadS [Decrypt]
-> ReadPrec Decrypt
-> ReadPrec [Decrypt]
-> Read Decrypt
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Decrypt]
$creadListPrec :: ReadPrec [Decrypt]
readPrec :: ReadPrec Decrypt
$creadPrec :: ReadPrec Decrypt
readList :: ReadS [Decrypt]
$creadList :: ReadS [Decrypt]
readsPrec :: Int -> ReadS Decrypt
$creadsPrec :: Int -> ReadS Decrypt
Prelude.Read, Int -> Decrypt -> ShowS
[Decrypt] -> ShowS
Decrypt -> String
(Int -> Decrypt -> ShowS)
-> (Decrypt -> String) -> ([Decrypt] -> ShowS) -> Show Decrypt
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Decrypt] -> ShowS
$cshowList :: [Decrypt] -> ShowS
show :: Decrypt -> String
$cshow :: Decrypt -> String
showsPrec :: Int -> Decrypt -> ShowS
$cshowsPrec :: Int -> Decrypt -> ShowS
Prelude.Show, (forall x. Decrypt -> Rep Decrypt x)
-> (forall x. Rep Decrypt x -> Decrypt) -> Generic Decrypt
forall x. Rep Decrypt x -> Decrypt
forall x. Decrypt -> Rep Decrypt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Decrypt x -> Decrypt
$cfrom :: forall x. Decrypt -> Rep Decrypt x
Prelude.Generic)
newDecrypt ::
Prelude.ByteString ->
Decrypt
newDecrypt :: ByteString -> Decrypt
newDecrypt ByteString
pCiphertextBlob_ =
Decrypt' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [Text]
-> Maybe EncryptionAlgorithmSpec
-> Base64
-> Decrypt
Decrypt'
{ $sel:keyId:Decrypt' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionContext:Decrypt' :: Maybe (HashMap Text Text)
encryptionContext = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:grantTokens:Decrypt' :: Maybe [Text]
grantTokens = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionAlgorithm:Decrypt' :: Maybe EncryptionAlgorithmSpec
encryptionAlgorithm = Maybe EncryptionAlgorithmSpec
forall a. Maybe a
Prelude.Nothing,
$sel:ciphertextBlob:Decrypt' :: Base64
ciphertextBlob =
Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64))
-> ByteString -> Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pCiphertextBlob_
}
decrypt_keyId :: Lens.Lens' Decrypt (Prelude.Maybe Prelude.Text)
decrypt_keyId :: (Maybe Text -> f (Maybe Text)) -> Decrypt -> f Decrypt
decrypt_keyId = (Decrypt -> Maybe Text)
-> (Decrypt -> Maybe Text -> Decrypt)
-> Lens Decrypt Decrypt (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Decrypt' {Maybe Text
keyId :: Maybe Text
$sel:keyId:Decrypt' :: Decrypt -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: Decrypt
s@Decrypt' {} Maybe Text
a -> Decrypt
s {$sel:keyId:Decrypt' :: Maybe Text
keyId = Maybe Text
a} :: Decrypt)
decrypt_encryptionContext :: Lens.Lens' Decrypt (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
decrypt_encryptionContext :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Decrypt -> f Decrypt
decrypt_encryptionContext = (Decrypt -> Maybe (HashMap Text Text))
-> (Decrypt -> Maybe (HashMap Text Text) -> Decrypt)
-> Lens
Decrypt
Decrypt
(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 (\Decrypt' {Maybe (HashMap Text Text)
encryptionContext :: Maybe (HashMap Text Text)
$sel:encryptionContext:Decrypt' :: Decrypt -> Maybe (HashMap Text Text)
encryptionContext} -> Maybe (HashMap Text Text)
encryptionContext) (\s :: Decrypt
s@Decrypt' {} Maybe (HashMap Text Text)
a -> Decrypt
s {$sel:encryptionContext:Decrypt' :: Maybe (HashMap Text Text)
encryptionContext = Maybe (HashMap Text Text)
a} :: Decrypt) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Decrypt -> f Decrypt)
-> ((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)))
-> Decrypt
-> f Decrypt
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
decrypt_grantTokens :: Lens.Lens' Decrypt (Prelude.Maybe [Prelude.Text])
decrypt_grantTokens :: (Maybe [Text] -> f (Maybe [Text])) -> Decrypt -> f Decrypt
decrypt_grantTokens = (Decrypt -> Maybe [Text])
-> (Decrypt -> Maybe [Text] -> Decrypt)
-> Lens Decrypt Decrypt (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Decrypt' {Maybe [Text]
grantTokens :: Maybe [Text]
$sel:grantTokens:Decrypt' :: Decrypt -> Maybe [Text]
grantTokens} -> Maybe [Text]
grantTokens) (\s :: Decrypt
s@Decrypt' {} Maybe [Text]
a -> Decrypt
s {$sel:grantTokens:Decrypt' :: Maybe [Text]
grantTokens = Maybe [Text]
a} :: Decrypt) ((Maybe [Text] -> f (Maybe [Text])) -> Decrypt -> f Decrypt)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Decrypt
-> f Decrypt
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
decrypt_encryptionAlgorithm :: Lens.Lens' Decrypt (Prelude.Maybe EncryptionAlgorithmSpec)
decrypt_encryptionAlgorithm :: (Maybe EncryptionAlgorithmSpec
-> f (Maybe EncryptionAlgorithmSpec))
-> Decrypt -> f Decrypt
decrypt_encryptionAlgorithm = (Decrypt -> Maybe EncryptionAlgorithmSpec)
-> (Decrypt -> Maybe EncryptionAlgorithmSpec -> Decrypt)
-> Lens
Decrypt
Decrypt
(Maybe EncryptionAlgorithmSpec)
(Maybe EncryptionAlgorithmSpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Decrypt' {Maybe EncryptionAlgorithmSpec
encryptionAlgorithm :: Maybe EncryptionAlgorithmSpec
$sel:encryptionAlgorithm:Decrypt' :: Decrypt -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm} -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm) (\s :: Decrypt
s@Decrypt' {} Maybe EncryptionAlgorithmSpec
a -> Decrypt
s {$sel:encryptionAlgorithm:Decrypt' :: Maybe EncryptionAlgorithmSpec
encryptionAlgorithm = Maybe EncryptionAlgorithmSpec
a} :: Decrypt)
decrypt_ciphertextBlob :: Lens.Lens' Decrypt Prelude.ByteString
decrypt_ciphertextBlob :: (ByteString -> f ByteString) -> Decrypt -> f Decrypt
decrypt_ciphertextBlob = (Decrypt -> Base64)
-> (Decrypt -> Base64 -> Decrypt)
-> Lens Decrypt Decrypt Base64 Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Decrypt' {Base64
ciphertextBlob :: Base64
$sel:ciphertextBlob:Decrypt' :: Decrypt -> Base64
ciphertextBlob} -> Base64
ciphertextBlob) (\s :: Decrypt
s@Decrypt' {} Base64
a -> Decrypt
s {$sel:ciphertextBlob:Decrypt' :: Base64
ciphertextBlob = Base64
a} :: Decrypt) ((Base64 -> f Base64) -> Decrypt -> f Decrypt)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> Decrypt
-> f Decrypt
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64
instance Core.AWSRequest Decrypt where
type AWSResponse Decrypt = DecryptResponse
request :: Decrypt -> Request Decrypt
request = Service -> Decrypt -> Request Decrypt
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy Decrypt
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse Decrypt)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse Decrypt))
-> Logger
-> Service
-> Proxy Decrypt
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse Decrypt)))
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 (Sensitive Base64)
-> Maybe EncryptionAlgorithmSpec
-> Int
-> DecryptResponse
DecryptResponse'
(Maybe Text
-> Maybe (Sensitive Base64)
-> Maybe EncryptionAlgorithmSpec
-> Int
-> DecryptResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe (Sensitive Base64)
-> Maybe EncryptionAlgorithmSpec -> Int -> DecryptResponse)
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 (Sensitive Base64)
-> Maybe EncryptionAlgorithmSpec -> Int -> DecryptResponse)
-> Either String (Maybe (Sensitive Base64))
-> Either
String (Maybe EncryptionAlgorithmSpec -> Int -> DecryptResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Base64))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Plaintext")
Either
String (Maybe EncryptionAlgorithmSpec -> Int -> DecryptResponse)
-> Either String (Maybe EncryptionAlgorithmSpec)
-> Either String (Int -> DecryptResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EncryptionAlgorithmSpec)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EncryptionAlgorithm")
Either String (Int -> DecryptResponse)
-> Either String Int -> Either String DecryptResponse
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 Decrypt
instance Prelude.NFData Decrypt
instance Core.ToHeaders Decrypt where
toHeaders :: Decrypt -> ResponseHeaders
toHeaders =
ResponseHeaders -> Decrypt -> 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.Decrypt" :: 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 Decrypt where
toJSON :: Decrypt -> Value
toJSON Decrypt' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe EncryptionAlgorithmSpec
Base64
ciphertextBlob :: Base64
encryptionAlgorithm :: Maybe EncryptionAlgorithmSpec
grantTokens :: Maybe [Text]
encryptionContext :: Maybe (HashMap Text Text)
keyId :: Maybe Text
$sel:ciphertextBlob:Decrypt' :: Decrypt -> Base64
$sel:encryptionAlgorithm:Decrypt' :: Decrypt -> Maybe EncryptionAlgorithmSpec
$sel:grantTokens:Decrypt' :: Decrypt -> Maybe [Text]
$sel:encryptionContext:Decrypt' :: Decrypt -> Maybe (HashMap Text Text)
$sel:keyId:Decrypt' :: Decrypt -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KeyId" 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
keyId,
(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,
(Text
"EncryptionAlgorithm" Text -> EncryptionAlgorithmSpec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EncryptionAlgorithmSpec -> Pair)
-> Maybe EncryptionAlgorithmSpec -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CiphertextBlob" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
ciphertextBlob)
]
)
instance Core.ToPath Decrypt where
toPath :: Decrypt -> ByteString
toPath = ByteString -> Decrypt -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery Decrypt where
toQuery :: Decrypt -> QueryString
toQuery = QueryString -> Decrypt -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DecryptResponse = DecryptResponse'
{
DecryptResponse -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
DecryptResponse -> Maybe (Sensitive Base64)
plaintext :: Prelude.Maybe (Core.Sensitive Core.Base64),
DecryptResponse -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm :: Prelude.Maybe EncryptionAlgorithmSpec,
DecryptResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DecryptResponse -> DecryptResponse -> Bool
(DecryptResponse -> DecryptResponse -> Bool)
-> (DecryptResponse -> DecryptResponse -> Bool)
-> Eq DecryptResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecryptResponse -> DecryptResponse -> Bool
$c/= :: DecryptResponse -> DecryptResponse -> Bool
== :: DecryptResponse -> DecryptResponse -> Bool
$c== :: DecryptResponse -> DecryptResponse -> Bool
Prelude.Eq, Int -> DecryptResponse -> ShowS
[DecryptResponse] -> ShowS
DecryptResponse -> String
(Int -> DecryptResponse -> ShowS)
-> (DecryptResponse -> String)
-> ([DecryptResponse] -> ShowS)
-> Show DecryptResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecryptResponse] -> ShowS
$cshowList :: [DecryptResponse] -> ShowS
show :: DecryptResponse -> String
$cshow :: DecryptResponse -> String
showsPrec :: Int -> DecryptResponse -> ShowS
$cshowsPrec :: Int -> DecryptResponse -> ShowS
Prelude.Show, (forall x. DecryptResponse -> Rep DecryptResponse x)
-> (forall x. Rep DecryptResponse x -> DecryptResponse)
-> Generic DecryptResponse
forall x. Rep DecryptResponse x -> DecryptResponse
forall x. DecryptResponse -> Rep DecryptResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DecryptResponse x -> DecryptResponse
$cfrom :: forall x. DecryptResponse -> Rep DecryptResponse x
Prelude.Generic)
newDecryptResponse ::
Prelude.Int ->
DecryptResponse
newDecryptResponse :: Int -> DecryptResponse
newDecryptResponse Int
pHttpStatus_ =
DecryptResponse' :: Maybe Text
-> Maybe (Sensitive Base64)
-> Maybe EncryptionAlgorithmSpec
-> Int
-> DecryptResponse
DecryptResponse'
{ $sel:keyId:DecryptResponse' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:plaintext:DecryptResponse' :: Maybe (Sensitive Base64)
plaintext = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionAlgorithm:DecryptResponse' :: Maybe EncryptionAlgorithmSpec
encryptionAlgorithm = Maybe EncryptionAlgorithmSpec
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DecryptResponse' :: Int
httpStatus = Int
pHttpStatus_
}
decryptResponse_keyId :: Lens.Lens' DecryptResponse (Prelude.Maybe Prelude.Text)
decryptResponse_keyId :: (Maybe Text -> f (Maybe Text))
-> DecryptResponse -> f DecryptResponse
decryptResponse_keyId = (DecryptResponse -> Maybe Text)
-> (DecryptResponse -> Maybe Text -> DecryptResponse)
-> Lens DecryptResponse DecryptResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptResponse' {Maybe Text
keyId :: Maybe Text
$sel:keyId:DecryptResponse' :: DecryptResponse -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: DecryptResponse
s@DecryptResponse' {} Maybe Text
a -> DecryptResponse
s {$sel:keyId:DecryptResponse' :: Maybe Text
keyId = Maybe Text
a} :: DecryptResponse)
decryptResponse_plaintext :: Lens.Lens' DecryptResponse (Prelude.Maybe Prelude.ByteString)
decryptResponse_plaintext :: (Maybe ByteString -> f (Maybe ByteString))
-> DecryptResponse -> f DecryptResponse
decryptResponse_plaintext = (DecryptResponse -> Maybe (Sensitive Base64))
-> (DecryptResponse -> Maybe (Sensitive Base64) -> DecryptResponse)
-> Lens
DecryptResponse
DecryptResponse
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptResponse' {Maybe (Sensitive Base64)
plaintext :: Maybe (Sensitive Base64)
$sel:plaintext:DecryptResponse' :: DecryptResponse -> Maybe (Sensitive Base64)
plaintext} -> Maybe (Sensitive Base64)
plaintext) (\s :: DecryptResponse
s@DecryptResponse' {} Maybe (Sensitive Base64)
a -> DecryptResponse
s {$sel:plaintext:DecryptResponse' :: Maybe (Sensitive Base64)
plaintext = Maybe (Sensitive Base64)
a} :: DecryptResponse) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> DecryptResponse -> f DecryptResponse)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> DecryptResponse
-> f DecryptResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Base64) (Sensitive Base64) ByteString ByteString
-> Iso
(Maybe (Sensitive Base64))
(Maybe (Sensitive 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 (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64)))
-> (Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64))
-> AnIso
(Sensitive Base64) (Sensitive Base64) ByteString ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64)
decryptResponse_encryptionAlgorithm :: Lens.Lens' DecryptResponse (Prelude.Maybe EncryptionAlgorithmSpec)
decryptResponse_encryptionAlgorithm :: (Maybe EncryptionAlgorithmSpec
-> f (Maybe EncryptionAlgorithmSpec))
-> DecryptResponse -> f DecryptResponse
decryptResponse_encryptionAlgorithm = (DecryptResponse -> Maybe EncryptionAlgorithmSpec)
-> (DecryptResponse
-> Maybe EncryptionAlgorithmSpec -> DecryptResponse)
-> Lens
DecryptResponse
DecryptResponse
(Maybe EncryptionAlgorithmSpec)
(Maybe EncryptionAlgorithmSpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptResponse' {Maybe EncryptionAlgorithmSpec
encryptionAlgorithm :: Maybe EncryptionAlgorithmSpec
$sel:encryptionAlgorithm:DecryptResponse' :: DecryptResponse -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm} -> Maybe EncryptionAlgorithmSpec
encryptionAlgorithm) (\s :: DecryptResponse
s@DecryptResponse' {} Maybe EncryptionAlgorithmSpec
a -> DecryptResponse
s {$sel:encryptionAlgorithm:DecryptResponse' :: Maybe EncryptionAlgorithmSpec
encryptionAlgorithm = Maybe EncryptionAlgorithmSpec
a} :: DecryptResponse)
decryptResponse_httpStatus :: Lens.Lens' DecryptResponse Prelude.Int
decryptResponse_httpStatus :: (Int -> f Int) -> DecryptResponse -> f DecryptResponse
decryptResponse_httpStatus = (DecryptResponse -> Int)
-> (DecryptResponse -> Int -> DecryptResponse)
-> Lens DecryptResponse DecryptResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptResponse' {Int
httpStatus :: Int
$sel:httpStatus:DecryptResponse' :: DecryptResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DecryptResponse
s@DecryptResponse' {} Int
a -> DecryptResponse
s {$sel:httpStatus:DecryptResponse' :: Int
httpStatus = Int
a} :: DecryptResponse)
instance Prelude.NFData DecryptResponse