{-# 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.SecretsManager.CreateSecret
(
CreateSecret (..),
newCreateSecret,
createSecret_addReplicaRegions,
createSecret_secretBinary,
createSecret_kmsKeyId,
createSecret_forceOverwriteReplicaSecret,
createSecret_secretString,
createSecret_clientRequestToken,
createSecret_description,
createSecret_tags,
createSecret_name,
CreateSecretResponse (..),
newCreateSecretResponse,
createSecretResponse_versionId,
createSecretResponse_arn,
createSecretResponse_name,
createSecretResponse_replicationStatus,
createSecretResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecretsManager.Types
data CreateSecret = CreateSecret'
{
CreateSecret -> Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions :: Prelude.Maybe (Prelude.NonEmpty ReplicaRegionType),
CreateSecret -> Maybe (Sensitive Base64)
secretBinary :: Prelude.Maybe (Core.Sensitive Core.Base64),
CreateSecret -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
CreateSecret -> Maybe Bool
forceOverwriteReplicaSecret :: Prelude.Maybe Prelude.Bool,
CreateSecret -> Maybe (Sensitive Text)
secretString :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateSecret -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
CreateSecret -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateSecret -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateSecret -> Text
name :: Prelude.Text
}
deriving (CreateSecret -> CreateSecret -> Bool
(CreateSecret -> CreateSecret -> Bool)
-> (CreateSecret -> CreateSecret -> Bool) -> Eq CreateSecret
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecret -> CreateSecret -> Bool
$c/= :: CreateSecret -> CreateSecret -> Bool
== :: CreateSecret -> CreateSecret -> Bool
$c== :: CreateSecret -> CreateSecret -> Bool
Prelude.Eq, Int -> CreateSecret -> ShowS
[CreateSecret] -> ShowS
CreateSecret -> String
(Int -> CreateSecret -> ShowS)
-> (CreateSecret -> String)
-> ([CreateSecret] -> ShowS)
-> Show CreateSecret
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecret] -> ShowS
$cshowList :: [CreateSecret] -> ShowS
show :: CreateSecret -> String
$cshow :: CreateSecret -> String
showsPrec :: Int -> CreateSecret -> ShowS
$cshowsPrec :: Int -> CreateSecret -> ShowS
Prelude.Show, (forall x. CreateSecret -> Rep CreateSecret x)
-> (forall x. Rep CreateSecret x -> CreateSecret)
-> Generic CreateSecret
forall x. Rep CreateSecret x -> CreateSecret
forall x. CreateSecret -> Rep CreateSecret x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSecret x -> CreateSecret
$cfrom :: forall x. CreateSecret -> Rep CreateSecret x
Prelude.Generic)
newCreateSecret ::
Prelude.Text ->
CreateSecret
newCreateSecret :: Text -> CreateSecret
newCreateSecret Text
pName_ =
CreateSecret' :: Maybe (NonEmpty ReplicaRegionType)
-> Maybe (Sensitive Base64)
-> Maybe Text
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> CreateSecret
CreateSecret'
{ $sel:addReplicaRegions:CreateSecret' :: Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions = Maybe (NonEmpty ReplicaRegionType)
forall a. Maybe a
Prelude.Nothing,
$sel:secretBinary:CreateSecret' :: Maybe (Sensitive Base64)
secretBinary = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:CreateSecret' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:forceOverwriteReplicaSecret:CreateSecret' :: Maybe Bool
forceOverwriteReplicaSecret = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:secretString:CreateSecret' :: Maybe (Sensitive Text)
secretString = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:CreateSecret' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateSecret' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateSecret' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateSecret' :: Text
name = Text
pName_
}
createSecret_addReplicaRegions :: Lens.Lens' CreateSecret (Prelude.Maybe (Prelude.NonEmpty ReplicaRegionType))
createSecret_addReplicaRegions :: (Maybe (NonEmpty ReplicaRegionType)
-> f (Maybe (NonEmpty ReplicaRegionType)))
-> CreateSecret -> f CreateSecret
createSecret_addReplicaRegions = (CreateSecret -> Maybe (NonEmpty ReplicaRegionType))
-> (CreateSecret
-> Maybe (NonEmpty ReplicaRegionType) -> CreateSecret)
-> Lens
CreateSecret
CreateSecret
(Maybe (NonEmpty ReplicaRegionType))
(Maybe (NonEmpty ReplicaRegionType))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions :: Maybe (NonEmpty ReplicaRegionType)
$sel:addReplicaRegions:CreateSecret' :: CreateSecret -> Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions} -> Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions) (\s :: CreateSecret
s@CreateSecret' {} Maybe (NonEmpty ReplicaRegionType)
a -> CreateSecret
s {$sel:addReplicaRegions:CreateSecret' :: Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions = Maybe (NonEmpty ReplicaRegionType)
a} :: CreateSecret) ((Maybe (NonEmpty ReplicaRegionType)
-> f (Maybe (NonEmpty ReplicaRegionType)))
-> CreateSecret -> f CreateSecret)
-> ((Maybe (NonEmpty ReplicaRegionType)
-> f (Maybe (NonEmpty ReplicaRegionType)))
-> Maybe (NonEmpty ReplicaRegionType)
-> f (Maybe (NonEmpty ReplicaRegionType)))
-> (Maybe (NonEmpty ReplicaRegionType)
-> f (Maybe (NonEmpty ReplicaRegionType)))
-> CreateSecret
-> f CreateSecret
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
-> Iso
(Maybe (NonEmpty ReplicaRegionType))
(Maybe (NonEmpty ReplicaRegionType))
(Maybe (NonEmpty ReplicaRegionType))
(Maybe (NonEmpty ReplicaRegionType))
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
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
(NonEmpty ReplicaRegionType)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecret_secretBinary :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.ByteString)
createSecret_secretBinary :: (Maybe ByteString -> f (Maybe ByteString))
-> CreateSecret -> f CreateSecret
createSecret_secretBinary = (CreateSecret -> Maybe (Sensitive Base64))
-> (CreateSecret -> Maybe (Sensitive Base64) -> CreateSecret)
-> Lens
CreateSecret
CreateSecret
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe (Sensitive Base64)
secretBinary :: Maybe (Sensitive Base64)
$sel:secretBinary:CreateSecret' :: CreateSecret -> Maybe (Sensitive Base64)
secretBinary} -> Maybe (Sensitive Base64)
secretBinary) (\s :: CreateSecret
s@CreateSecret' {} Maybe (Sensitive Base64)
a -> CreateSecret
s {$sel:secretBinary:CreateSecret' :: Maybe (Sensitive Base64)
secretBinary = Maybe (Sensitive Base64)
a} :: CreateSecret) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> CreateSecret -> f CreateSecret)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> CreateSecret
-> f CreateSecret
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)
createSecret_kmsKeyId :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.Text)
createSecret_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> CreateSecret -> f CreateSecret
createSecret_kmsKeyId = (CreateSecret -> Maybe Text)
-> (CreateSecret -> Maybe Text -> CreateSecret)
-> Lens CreateSecret CreateSecret (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateSecret' :: CreateSecret -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateSecret
s@CreateSecret' {} Maybe Text
a -> CreateSecret
s {$sel:kmsKeyId:CreateSecret' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateSecret)
createSecret_forceOverwriteReplicaSecret :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.Bool)
createSecret_forceOverwriteReplicaSecret :: (Maybe Bool -> f (Maybe Bool)) -> CreateSecret -> f CreateSecret
createSecret_forceOverwriteReplicaSecret = (CreateSecret -> Maybe Bool)
-> (CreateSecret -> Maybe Bool -> CreateSecret)
-> Lens CreateSecret CreateSecret (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe Bool
forceOverwriteReplicaSecret :: Maybe Bool
$sel:forceOverwriteReplicaSecret:CreateSecret' :: CreateSecret -> Maybe Bool
forceOverwriteReplicaSecret} -> Maybe Bool
forceOverwriteReplicaSecret) (\s :: CreateSecret
s@CreateSecret' {} Maybe Bool
a -> CreateSecret
s {$sel:forceOverwriteReplicaSecret:CreateSecret' :: Maybe Bool
forceOverwriteReplicaSecret = Maybe Bool
a} :: CreateSecret)
createSecret_secretString :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.Text)
createSecret_secretString :: (Maybe Text -> f (Maybe Text)) -> CreateSecret -> f CreateSecret
createSecret_secretString = (CreateSecret -> Maybe (Sensitive Text))
-> (CreateSecret -> Maybe (Sensitive Text) -> CreateSecret)
-> Lens
CreateSecret
CreateSecret
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe (Sensitive Text)
secretString :: Maybe (Sensitive Text)
$sel:secretString:CreateSecret' :: CreateSecret -> Maybe (Sensitive Text)
secretString} -> Maybe (Sensitive Text)
secretString) (\s :: CreateSecret
s@CreateSecret' {} Maybe (Sensitive Text)
a -> CreateSecret
s {$sel:secretString:CreateSecret' :: Maybe (Sensitive Text)
secretString = Maybe (Sensitive Text)
a} :: CreateSecret) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateSecret -> f CreateSecret)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateSecret
-> f CreateSecret
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
createSecret_clientRequestToken :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.Text)
createSecret_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateSecret -> f CreateSecret
createSecret_clientRequestToken = (CreateSecret -> Maybe Text)
-> (CreateSecret -> Maybe Text -> CreateSecret)
-> Lens CreateSecret CreateSecret (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateSecret' :: CreateSecret -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateSecret
s@CreateSecret' {} Maybe Text
a -> CreateSecret
s {$sel:clientRequestToken:CreateSecret' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateSecret)
createSecret_description :: Lens.Lens' CreateSecret (Prelude.Maybe Prelude.Text)
createSecret_description :: (Maybe Text -> f (Maybe Text)) -> CreateSecret -> f CreateSecret
createSecret_description = (CreateSecret -> Maybe Text)
-> (CreateSecret -> Maybe Text -> CreateSecret)
-> Lens CreateSecret CreateSecret (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe Text
description :: Maybe Text
$sel:description:CreateSecret' :: CreateSecret -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateSecret
s@CreateSecret' {} Maybe Text
a -> CreateSecret
s {$sel:description:CreateSecret' :: Maybe Text
description = Maybe Text
a} :: CreateSecret)
createSecret_tags :: Lens.Lens' CreateSecret (Prelude.Maybe [Tag])
createSecret_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateSecret -> f CreateSecret
createSecret_tags = (CreateSecret -> Maybe [Tag])
-> (CreateSecret -> Maybe [Tag] -> CreateSecret)
-> Lens CreateSecret CreateSecret (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateSecret' :: CreateSecret -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateSecret
s@CreateSecret' {} Maybe [Tag]
a -> CreateSecret
s {$sel:tags:CreateSecret' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateSecret) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSecret -> f CreateSecret)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSecret
-> f CreateSecret
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecret_name :: Lens.Lens' CreateSecret Prelude.Text
createSecret_name :: (Text -> f Text) -> CreateSecret -> f CreateSecret
createSecret_name = (CreateSecret -> Text)
-> (CreateSecret -> Text -> CreateSecret)
-> Lens CreateSecret CreateSecret Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecret' {Text
name :: Text
$sel:name:CreateSecret' :: CreateSecret -> Text
name} -> Text
name) (\s :: CreateSecret
s@CreateSecret' {} Text
a -> CreateSecret
s {$sel:name:CreateSecret' :: Text
name = Text
a} :: CreateSecret)
instance Core.AWSRequest CreateSecret where
type AWSResponse CreateSecret = CreateSecretResponse
request :: CreateSecret -> Request CreateSecret
request = Service -> CreateSecret -> Request CreateSecret
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSecret
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateSecret)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateSecret))
-> Logger
-> Service
-> Proxy CreateSecret
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateSecret)))
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 Text
-> Maybe Text
-> Maybe [ReplicationStatusType]
-> Int
-> CreateSecretResponse
CreateSecretResponse'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ReplicationStatusType]
-> Int
-> CreateSecretResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe [ReplicationStatusType]
-> Int
-> CreateSecretResponse)
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
"VersionId")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe [ReplicationStatusType]
-> Int
-> CreateSecretResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe [ReplicationStatusType] -> Int -> CreateSecretResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ARN")
Either
String
(Maybe Text
-> Maybe [ReplicationStatusType] -> Int -> CreateSecretResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ReplicationStatusType] -> Int -> CreateSecretResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
Either
String
(Maybe [ReplicationStatusType] -> Int -> CreateSecretResponse)
-> Either String (Maybe [ReplicationStatusType])
-> Either String (Int -> CreateSecretResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ReplicationStatusType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReplicationStatus"
Either String (Maybe (Maybe [ReplicationStatusType]))
-> Maybe [ReplicationStatusType]
-> Either String (Maybe [ReplicationStatusType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReplicationStatusType]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> CreateSecretResponse)
-> Either String Int -> Either String CreateSecretResponse
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 CreateSecret
instance Prelude.NFData CreateSecret
instance Core.ToHeaders CreateSecret where
toHeaders :: CreateSecret -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateSecret -> 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
"secretsmanager.CreateSecret" ::
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 CreateSecret where
toJSON :: CreateSecret -> Value
toJSON CreateSecret' {Maybe Bool
Maybe [Tag]
Maybe (NonEmpty ReplicaRegionType)
Maybe Text
Maybe (Sensitive Text)
Maybe (Sensitive Base64)
Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
clientRequestToken :: Maybe Text
secretString :: Maybe (Sensitive Text)
forceOverwriteReplicaSecret :: Maybe Bool
kmsKeyId :: Maybe Text
secretBinary :: Maybe (Sensitive Base64)
addReplicaRegions :: Maybe (NonEmpty ReplicaRegionType)
$sel:name:CreateSecret' :: CreateSecret -> Text
$sel:tags:CreateSecret' :: CreateSecret -> Maybe [Tag]
$sel:description:CreateSecret' :: CreateSecret -> Maybe Text
$sel:clientRequestToken:CreateSecret' :: CreateSecret -> Maybe Text
$sel:secretString:CreateSecret' :: CreateSecret -> Maybe (Sensitive Text)
$sel:forceOverwriteReplicaSecret:CreateSecret' :: CreateSecret -> Maybe Bool
$sel:kmsKeyId:CreateSecret' :: CreateSecret -> Maybe Text
$sel:secretBinary:CreateSecret' :: CreateSecret -> Maybe (Sensitive Base64)
$sel:addReplicaRegions:CreateSecret' :: CreateSecret -> Maybe (NonEmpty ReplicaRegionType)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AddReplicaRegions" Text -> NonEmpty ReplicaRegionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty ReplicaRegionType -> Pair)
-> Maybe (NonEmpty ReplicaRegionType) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ReplicaRegionType)
addReplicaRegions,
(Text
"SecretBinary" Text -> Sensitive Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Base64 -> Pair)
-> Maybe (Sensitive Base64) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Base64)
secretBinary,
(Text
"KmsKeyId" 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
kmsKeyId,
(Text
"ForceOverwriteReplicaSecret" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
forceOverwriteReplicaSecret,
(Text
"SecretString" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
secretString,
(Text
"ClientRequestToken" 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
clientRequestToken,
(Text
"Description" 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
description,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)
instance Core.ToPath CreateSecret where
toPath :: CreateSecret -> ByteString
toPath = ByteString -> CreateSecret -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateSecret where
toQuery :: CreateSecret -> QueryString
toQuery = QueryString -> CreateSecret -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateSecretResponse = CreateSecretResponse'
{
CreateSecretResponse -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
CreateSecretResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateSecretResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateSecretResponse -> Maybe [ReplicationStatusType]
replicationStatus :: Prelude.Maybe [ReplicationStatusType],
CreateSecretResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSecretResponse -> CreateSecretResponse -> Bool
(CreateSecretResponse -> CreateSecretResponse -> Bool)
-> (CreateSecretResponse -> CreateSecretResponse -> Bool)
-> Eq CreateSecretResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecretResponse -> CreateSecretResponse -> Bool
$c/= :: CreateSecretResponse -> CreateSecretResponse -> Bool
== :: CreateSecretResponse -> CreateSecretResponse -> Bool
$c== :: CreateSecretResponse -> CreateSecretResponse -> Bool
Prelude.Eq, ReadPrec [CreateSecretResponse]
ReadPrec CreateSecretResponse
Int -> ReadS CreateSecretResponse
ReadS [CreateSecretResponse]
(Int -> ReadS CreateSecretResponse)
-> ReadS [CreateSecretResponse]
-> ReadPrec CreateSecretResponse
-> ReadPrec [CreateSecretResponse]
-> Read CreateSecretResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSecretResponse]
$creadListPrec :: ReadPrec [CreateSecretResponse]
readPrec :: ReadPrec CreateSecretResponse
$creadPrec :: ReadPrec CreateSecretResponse
readList :: ReadS [CreateSecretResponse]
$creadList :: ReadS [CreateSecretResponse]
readsPrec :: Int -> ReadS CreateSecretResponse
$creadsPrec :: Int -> ReadS CreateSecretResponse
Prelude.Read, Int -> CreateSecretResponse -> ShowS
[CreateSecretResponse] -> ShowS
CreateSecretResponse -> String
(Int -> CreateSecretResponse -> ShowS)
-> (CreateSecretResponse -> String)
-> ([CreateSecretResponse] -> ShowS)
-> Show CreateSecretResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecretResponse] -> ShowS
$cshowList :: [CreateSecretResponse] -> ShowS
show :: CreateSecretResponse -> String
$cshow :: CreateSecretResponse -> String
showsPrec :: Int -> CreateSecretResponse -> ShowS
$cshowsPrec :: Int -> CreateSecretResponse -> ShowS
Prelude.Show, (forall x. CreateSecretResponse -> Rep CreateSecretResponse x)
-> (forall x. Rep CreateSecretResponse x -> CreateSecretResponse)
-> Generic CreateSecretResponse
forall x. Rep CreateSecretResponse x -> CreateSecretResponse
forall x. CreateSecretResponse -> Rep CreateSecretResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSecretResponse x -> CreateSecretResponse
$cfrom :: forall x. CreateSecretResponse -> Rep CreateSecretResponse x
Prelude.Generic)
newCreateSecretResponse ::
Prelude.Int ->
CreateSecretResponse
newCreateSecretResponse :: Int -> CreateSecretResponse
newCreateSecretResponse Int
pHttpStatus_ =
CreateSecretResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ReplicationStatusType]
-> Int
-> CreateSecretResponse
CreateSecretResponse'
{ $sel:versionId:CreateSecretResponse' :: Maybe Text
versionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CreateSecretResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateSecretResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replicationStatus:CreateSecretResponse' :: Maybe [ReplicationStatusType]
replicationStatus = Maybe [ReplicationStatusType]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateSecretResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createSecretResponse_versionId :: Lens.Lens' CreateSecretResponse (Prelude.Maybe Prelude.Text)
createSecretResponse_versionId :: (Maybe Text -> f (Maybe Text))
-> CreateSecretResponse -> f CreateSecretResponse
createSecretResponse_versionId = (CreateSecretResponse -> Maybe Text)
-> (CreateSecretResponse -> Maybe Text -> CreateSecretResponse)
-> Lens
CreateSecretResponse CreateSecretResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecretResponse' {Maybe Text
versionId :: Maybe Text
$sel:versionId:CreateSecretResponse' :: CreateSecretResponse -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: CreateSecretResponse
s@CreateSecretResponse' {} Maybe Text
a -> CreateSecretResponse
s {$sel:versionId:CreateSecretResponse' :: Maybe Text
versionId = Maybe Text
a} :: CreateSecretResponse)
createSecretResponse_arn :: Lens.Lens' CreateSecretResponse (Prelude.Maybe Prelude.Text)
createSecretResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateSecretResponse -> f CreateSecretResponse
createSecretResponse_arn = (CreateSecretResponse -> Maybe Text)
-> (CreateSecretResponse -> Maybe Text -> CreateSecretResponse)
-> Lens
CreateSecretResponse CreateSecretResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecretResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateSecretResponse' :: CreateSecretResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateSecretResponse
s@CreateSecretResponse' {} Maybe Text
a -> CreateSecretResponse
s {$sel:arn:CreateSecretResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateSecretResponse)
createSecretResponse_name :: Lens.Lens' CreateSecretResponse (Prelude.Maybe Prelude.Text)
createSecretResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateSecretResponse -> f CreateSecretResponse
createSecretResponse_name = (CreateSecretResponse -> Maybe Text)
-> (CreateSecretResponse -> Maybe Text -> CreateSecretResponse)
-> Lens
CreateSecretResponse CreateSecretResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecretResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateSecretResponse' :: CreateSecretResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateSecretResponse
s@CreateSecretResponse' {} Maybe Text
a -> CreateSecretResponse
s {$sel:name:CreateSecretResponse' :: Maybe Text
name = Maybe Text
a} :: CreateSecretResponse)
createSecretResponse_replicationStatus :: Lens.Lens' CreateSecretResponse (Prelude.Maybe [ReplicationStatusType])
createSecretResponse_replicationStatus :: (Maybe [ReplicationStatusType]
-> f (Maybe [ReplicationStatusType]))
-> CreateSecretResponse -> f CreateSecretResponse
createSecretResponse_replicationStatus = (CreateSecretResponse -> Maybe [ReplicationStatusType])
-> (CreateSecretResponse
-> Maybe [ReplicationStatusType] -> CreateSecretResponse)
-> Lens
CreateSecretResponse
CreateSecretResponse
(Maybe [ReplicationStatusType])
(Maybe [ReplicationStatusType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecretResponse' {Maybe [ReplicationStatusType]
replicationStatus :: Maybe [ReplicationStatusType]
$sel:replicationStatus:CreateSecretResponse' :: CreateSecretResponse -> Maybe [ReplicationStatusType]
replicationStatus} -> Maybe [ReplicationStatusType]
replicationStatus) (\s :: CreateSecretResponse
s@CreateSecretResponse' {} Maybe [ReplicationStatusType]
a -> CreateSecretResponse
s {$sel:replicationStatus:CreateSecretResponse' :: Maybe [ReplicationStatusType]
replicationStatus = Maybe [ReplicationStatusType]
a} :: CreateSecretResponse) ((Maybe [ReplicationStatusType]
-> f (Maybe [ReplicationStatusType]))
-> CreateSecretResponse -> f CreateSecretResponse)
-> ((Maybe [ReplicationStatusType]
-> f (Maybe [ReplicationStatusType]))
-> Maybe [ReplicationStatusType]
-> f (Maybe [ReplicationStatusType]))
-> (Maybe [ReplicationStatusType]
-> f (Maybe [ReplicationStatusType]))
-> CreateSecretResponse
-> f CreateSecretResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ReplicationStatusType]
[ReplicationStatusType]
[ReplicationStatusType]
[ReplicationStatusType]
-> Iso
(Maybe [ReplicationStatusType])
(Maybe [ReplicationStatusType])
(Maybe [ReplicationStatusType])
(Maybe [ReplicationStatusType])
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
[ReplicationStatusType]
[ReplicationStatusType]
[ReplicationStatusType]
[ReplicationStatusType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecretResponse_httpStatus :: Lens.Lens' CreateSecretResponse Prelude.Int
createSecretResponse_httpStatus :: (Int -> f Int) -> CreateSecretResponse -> f CreateSecretResponse
createSecretResponse_httpStatus = (CreateSecretResponse -> Int)
-> (CreateSecretResponse -> Int -> CreateSecretResponse)
-> Lens CreateSecretResponse CreateSecretResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecretResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSecretResponse' :: CreateSecretResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSecretResponse
s@CreateSecretResponse' {} Int
a -> CreateSecretResponse
s {$sel:httpStatus:CreateSecretResponse' :: Int
httpStatus = Int
a} :: CreateSecretResponse)
instance Prelude.NFData CreateSecretResponse