{-# 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.UpdateSecretVersionStage
(
UpdateSecretVersionStage (..),
newUpdateSecretVersionStage,
updateSecretVersionStage_moveToVersionId,
updateSecretVersionStage_removeFromVersionId,
updateSecretVersionStage_secretId,
updateSecretVersionStage_versionStage,
UpdateSecretVersionStageResponse (..),
newUpdateSecretVersionStageResponse,
updateSecretVersionStageResponse_arn,
updateSecretVersionStageResponse_name,
updateSecretVersionStageResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecretsManager.Types
data UpdateSecretVersionStage = UpdateSecretVersionStage'
{
UpdateSecretVersionStage -> Maybe Text
moveToVersionId :: Prelude.Maybe Prelude.Text,
UpdateSecretVersionStage -> Maybe Text
removeFromVersionId :: Prelude.Maybe Prelude.Text,
UpdateSecretVersionStage -> Text
secretId :: Prelude.Text,
UpdateSecretVersionStage -> Text
versionStage :: Prelude.Text
}
deriving (UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
$c/= :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
== :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
$c== :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
Prelude.Eq, ReadPrec [UpdateSecretVersionStage]
ReadPrec UpdateSecretVersionStage
Int -> ReadS UpdateSecretVersionStage
ReadS [UpdateSecretVersionStage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecretVersionStage]
$creadListPrec :: ReadPrec [UpdateSecretVersionStage]
readPrec :: ReadPrec UpdateSecretVersionStage
$creadPrec :: ReadPrec UpdateSecretVersionStage
readList :: ReadS [UpdateSecretVersionStage]
$creadList :: ReadS [UpdateSecretVersionStage]
readsPrec :: Int -> ReadS UpdateSecretVersionStage
$creadsPrec :: Int -> ReadS UpdateSecretVersionStage
Prelude.Read, Int -> UpdateSecretVersionStage -> ShowS
[UpdateSecretVersionStage] -> ShowS
UpdateSecretVersionStage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecretVersionStage] -> ShowS
$cshowList :: [UpdateSecretVersionStage] -> ShowS
show :: UpdateSecretVersionStage -> String
$cshow :: UpdateSecretVersionStage -> String
showsPrec :: Int -> UpdateSecretVersionStage -> ShowS
$cshowsPrec :: Int -> UpdateSecretVersionStage -> ShowS
Prelude.Show, forall x.
Rep UpdateSecretVersionStage x -> UpdateSecretVersionStage
forall x.
UpdateSecretVersionStage -> Rep UpdateSecretVersionStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecretVersionStage x -> UpdateSecretVersionStage
$cfrom :: forall x.
UpdateSecretVersionStage -> Rep UpdateSecretVersionStage x
Prelude.Generic)
newUpdateSecretVersionStage ::
Prelude.Text ->
Prelude.Text ->
UpdateSecretVersionStage
newUpdateSecretVersionStage :: Text -> Text -> UpdateSecretVersionStage
newUpdateSecretVersionStage Text
pSecretId_ Text
pVersionStage_ =
UpdateSecretVersionStage'
{ $sel:moveToVersionId:UpdateSecretVersionStage' :: Maybe Text
moveToVersionId =
forall a. Maybe a
Prelude.Nothing,
$sel:removeFromVersionId:UpdateSecretVersionStage' :: Maybe Text
removeFromVersionId = forall a. Maybe a
Prelude.Nothing,
$sel:secretId:UpdateSecretVersionStage' :: Text
secretId = Text
pSecretId_,
$sel:versionStage:UpdateSecretVersionStage' :: Text
versionStage = Text
pVersionStage_
}
updateSecretVersionStage_moveToVersionId :: Lens.Lens' UpdateSecretVersionStage (Prelude.Maybe Prelude.Text)
updateSecretVersionStage_moveToVersionId :: Lens' UpdateSecretVersionStage (Maybe Text)
updateSecretVersionStage_moveToVersionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Maybe Text
moveToVersionId :: Maybe Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
moveToVersionId} -> Maybe Text
moveToVersionId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Maybe Text
a -> UpdateSecretVersionStage
s {$sel:moveToVersionId:UpdateSecretVersionStage' :: Maybe Text
moveToVersionId = Maybe Text
a} :: UpdateSecretVersionStage)
updateSecretVersionStage_removeFromVersionId :: Lens.Lens' UpdateSecretVersionStage (Prelude.Maybe Prelude.Text)
updateSecretVersionStage_removeFromVersionId :: Lens' UpdateSecretVersionStage (Maybe Text)
updateSecretVersionStage_removeFromVersionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Maybe Text
removeFromVersionId :: Maybe Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
removeFromVersionId} -> Maybe Text
removeFromVersionId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Maybe Text
a -> UpdateSecretVersionStage
s {$sel:removeFromVersionId:UpdateSecretVersionStage' :: Maybe Text
removeFromVersionId = Maybe Text
a} :: UpdateSecretVersionStage)
updateSecretVersionStage_secretId :: Lens.Lens' UpdateSecretVersionStage Prelude.Text
updateSecretVersionStage_secretId :: Lens' UpdateSecretVersionStage Text
updateSecretVersionStage_secretId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Text
secretId :: Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
secretId} -> Text
secretId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Text
a -> UpdateSecretVersionStage
s {$sel:secretId:UpdateSecretVersionStage' :: Text
secretId = Text
a} :: UpdateSecretVersionStage)
updateSecretVersionStage_versionStage :: Lens.Lens' UpdateSecretVersionStage Prelude.Text
updateSecretVersionStage_versionStage :: Lens' UpdateSecretVersionStage Text
updateSecretVersionStage_versionStage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Text
versionStage :: Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
versionStage} -> Text
versionStage) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Text
a -> UpdateSecretVersionStage
s {$sel:versionStage:UpdateSecretVersionStage' :: Text
versionStage = Text
a} :: UpdateSecretVersionStage)
instance Core.AWSRequest UpdateSecretVersionStage where
type
AWSResponse UpdateSecretVersionStage =
UpdateSecretVersionStageResponse
request :: (Service -> Service)
-> UpdateSecretVersionStage -> Request UpdateSecretVersionStage
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 UpdateSecretVersionStage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSecretVersionStage)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> UpdateSecretVersionStageResponse
UpdateSecretVersionStageResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
forall (f :: * -> *) a b. Applicative f => 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 UpdateSecretVersionStage where
hashWithSalt :: Int -> UpdateSecretVersionStage -> Int
hashWithSalt Int
_salt UpdateSecretVersionStage' {Maybe Text
Text
versionStage :: Text
secretId :: Text
removeFromVersionId :: Maybe Text
moveToVersionId :: Maybe Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
moveToVersionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
removeFromVersionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
versionStage
instance Prelude.NFData UpdateSecretVersionStage where
rnf :: UpdateSecretVersionStage -> ()
rnf UpdateSecretVersionStage' {Maybe Text
Text
versionStage :: Text
secretId :: Text
removeFromVersionId :: Maybe Text
moveToVersionId :: Maybe Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
moveToVersionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
removeFromVersionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
versionStage
instance Data.ToHeaders UpdateSecretVersionStage where
toHeaders :: UpdateSecretVersionStage -> 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
"secretsmanager.UpdateSecretVersionStage" ::
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 UpdateSecretVersionStage where
toJSON :: UpdateSecretVersionStage -> Value
toJSON UpdateSecretVersionStage' {Maybe Text
Text
versionStage :: Text
secretId :: Text
removeFromVersionId :: Maybe Text
moveToVersionId :: Maybe Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MoveToVersionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
moveToVersionId,
(Key
"RemoveFromVersionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
removeFromVersionId,
forall a. a -> Maybe a
Prelude.Just (Key
"SecretId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretId),
forall a. a -> Maybe a
Prelude.Just (Key
"VersionStage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
versionStage)
]
)
instance Data.ToPath UpdateSecretVersionStage where
toPath :: UpdateSecretVersionStage -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateSecretVersionStage where
toQuery :: UpdateSecretVersionStage -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateSecretVersionStageResponse = UpdateSecretVersionStageResponse'
{
UpdateSecretVersionStageResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
UpdateSecretVersionStageResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateSecretVersionStageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
$c/= :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
== :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
$c== :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSecretVersionStageResponse]
ReadPrec UpdateSecretVersionStageResponse
Int -> ReadS UpdateSecretVersionStageResponse
ReadS [UpdateSecretVersionStageResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecretVersionStageResponse]
$creadListPrec :: ReadPrec [UpdateSecretVersionStageResponse]
readPrec :: ReadPrec UpdateSecretVersionStageResponse
$creadPrec :: ReadPrec UpdateSecretVersionStageResponse
readList :: ReadS [UpdateSecretVersionStageResponse]
$creadList :: ReadS [UpdateSecretVersionStageResponse]
readsPrec :: Int -> ReadS UpdateSecretVersionStageResponse
$creadsPrec :: Int -> ReadS UpdateSecretVersionStageResponse
Prelude.Read, Int -> UpdateSecretVersionStageResponse -> ShowS
[UpdateSecretVersionStageResponse] -> ShowS
UpdateSecretVersionStageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecretVersionStageResponse] -> ShowS
$cshowList :: [UpdateSecretVersionStageResponse] -> ShowS
show :: UpdateSecretVersionStageResponse -> String
$cshow :: UpdateSecretVersionStageResponse -> String
showsPrec :: Int -> UpdateSecretVersionStageResponse -> ShowS
$cshowsPrec :: Int -> UpdateSecretVersionStageResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateSecretVersionStageResponse x
-> UpdateSecretVersionStageResponse
forall x.
UpdateSecretVersionStageResponse
-> Rep UpdateSecretVersionStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecretVersionStageResponse x
-> UpdateSecretVersionStageResponse
$cfrom :: forall x.
UpdateSecretVersionStageResponse
-> Rep UpdateSecretVersionStageResponse x
Prelude.Generic)
newUpdateSecretVersionStageResponse ::
Prelude.Int ->
UpdateSecretVersionStageResponse
newUpdateSecretVersionStageResponse :: Int -> UpdateSecretVersionStageResponse
newUpdateSecretVersionStageResponse Int
pHttpStatus_ =
UpdateSecretVersionStageResponse'
{ $sel:arn:UpdateSecretVersionStageResponse' :: Maybe Text
arn =
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateSecretVersionStageResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateSecretVersionStageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateSecretVersionStageResponse_arn :: Lens.Lens' UpdateSecretVersionStageResponse (Prelude.Maybe Prelude.Text)
updateSecretVersionStageResponse_arn :: Lens' UpdateSecretVersionStageResponse (Maybe Text)
updateSecretVersionStageResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStageResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateSecretVersionStageResponse
s@UpdateSecretVersionStageResponse' {} Maybe Text
a -> UpdateSecretVersionStageResponse
s {$sel:arn:UpdateSecretVersionStageResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateSecretVersionStageResponse)
updateSecretVersionStageResponse_name :: Lens.Lens' UpdateSecretVersionStageResponse (Prelude.Maybe Prelude.Text)
updateSecretVersionStageResponse_name :: Lens' UpdateSecretVersionStageResponse (Maybe Text)
updateSecretVersionStageResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStageResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateSecretVersionStageResponse
s@UpdateSecretVersionStageResponse' {} Maybe Text
a -> UpdateSecretVersionStageResponse
s {$sel:name:UpdateSecretVersionStageResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateSecretVersionStageResponse)
updateSecretVersionStageResponse_httpStatus :: Lens.Lens' UpdateSecretVersionStageResponse Prelude.Int
updateSecretVersionStageResponse_httpStatus :: Lens' UpdateSecretVersionStageResponse Int
updateSecretVersionStageResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStageResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSecretVersionStageResponse
s@UpdateSecretVersionStageResponse' {} Int
a -> UpdateSecretVersionStageResponse
s {$sel:httpStatus:UpdateSecretVersionStageResponse' :: Int
httpStatus = Int
a} :: UpdateSecretVersionStageResponse)
instance
Prelude.NFData
UpdateSecretVersionStageResponse
where
rnf :: UpdateSecretVersionStageResponse -> ()
rnf UpdateSecretVersionStageResponse' {Int
Maybe Text
httpStatus :: Int
name :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Int
$sel:name:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
$sel:arn:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus