{-# 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.CancelRotateSecret
(
CancelRotateSecret (..),
newCancelRotateSecret,
cancelRotateSecret_secretId,
CancelRotateSecretResponse (..),
newCancelRotateSecretResponse,
cancelRotateSecretResponse_versionId,
cancelRotateSecretResponse_arn,
cancelRotateSecretResponse_name,
cancelRotateSecretResponse_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 CancelRotateSecret = CancelRotateSecret'
{
CancelRotateSecret -> Text
secretId :: Prelude.Text
}
deriving (CancelRotateSecret -> CancelRotateSecret -> Bool
(CancelRotateSecret -> CancelRotateSecret -> Bool)
-> (CancelRotateSecret -> CancelRotateSecret -> Bool)
-> Eq CancelRotateSecret
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelRotateSecret -> CancelRotateSecret -> Bool
$c/= :: CancelRotateSecret -> CancelRotateSecret -> Bool
== :: CancelRotateSecret -> CancelRotateSecret -> Bool
$c== :: CancelRotateSecret -> CancelRotateSecret -> Bool
Prelude.Eq, ReadPrec [CancelRotateSecret]
ReadPrec CancelRotateSecret
Int -> ReadS CancelRotateSecret
ReadS [CancelRotateSecret]
(Int -> ReadS CancelRotateSecret)
-> ReadS [CancelRotateSecret]
-> ReadPrec CancelRotateSecret
-> ReadPrec [CancelRotateSecret]
-> Read CancelRotateSecret
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelRotateSecret]
$creadListPrec :: ReadPrec [CancelRotateSecret]
readPrec :: ReadPrec CancelRotateSecret
$creadPrec :: ReadPrec CancelRotateSecret
readList :: ReadS [CancelRotateSecret]
$creadList :: ReadS [CancelRotateSecret]
readsPrec :: Int -> ReadS CancelRotateSecret
$creadsPrec :: Int -> ReadS CancelRotateSecret
Prelude.Read, Int -> CancelRotateSecret -> ShowS
[CancelRotateSecret] -> ShowS
CancelRotateSecret -> String
(Int -> CancelRotateSecret -> ShowS)
-> (CancelRotateSecret -> String)
-> ([CancelRotateSecret] -> ShowS)
-> Show CancelRotateSecret
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelRotateSecret] -> ShowS
$cshowList :: [CancelRotateSecret] -> ShowS
show :: CancelRotateSecret -> String
$cshow :: CancelRotateSecret -> String
showsPrec :: Int -> CancelRotateSecret -> ShowS
$cshowsPrec :: Int -> CancelRotateSecret -> ShowS
Prelude.Show, (forall x. CancelRotateSecret -> Rep CancelRotateSecret x)
-> (forall x. Rep CancelRotateSecret x -> CancelRotateSecret)
-> Generic CancelRotateSecret
forall x. Rep CancelRotateSecret x -> CancelRotateSecret
forall x. CancelRotateSecret -> Rep CancelRotateSecret x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelRotateSecret x -> CancelRotateSecret
$cfrom :: forall x. CancelRotateSecret -> Rep CancelRotateSecret x
Prelude.Generic)
newCancelRotateSecret ::
Prelude.Text ->
CancelRotateSecret
newCancelRotateSecret :: Text -> CancelRotateSecret
newCancelRotateSecret Text
pSecretId_ =
CancelRotateSecret' :: Text -> CancelRotateSecret
CancelRotateSecret' {$sel:secretId:CancelRotateSecret' :: Text
secretId = Text
pSecretId_}
cancelRotateSecret_secretId :: Lens.Lens' CancelRotateSecret Prelude.Text
cancelRotateSecret_secretId :: (Text -> f Text) -> CancelRotateSecret -> f CancelRotateSecret
cancelRotateSecret_secretId = (CancelRotateSecret -> Text)
-> (CancelRotateSecret -> Text -> CancelRotateSecret)
-> Lens CancelRotateSecret CancelRotateSecret Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelRotateSecret' {Text
secretId :: Text
$sel:secretId:CancelRotateSecret' :: CancelRotateSecret -> Text
secretId} -> Text
secretId) (\s :: CancelRotateSecret
s@CancelRotateSecret' {} Text
a -> CancelRotateSecret
s {$sel:secretId:CancelRotateSecret' :: Text
secretId = Text
a} :: CancelRotateSecret)
instance Core.AWSRequest CancelRotateSecret where
type
AWSResponse CancelRotateSecret =
CancelRotateSecretResponse
request :: CancelRotateSecret -> Request CancelRotateSecret
request = Service -> CancelRotateSecret -> Request CancelRotateSecret
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelRotateSecret
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelRotateSecret)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CancelRotateSecret))
-> Logger
-> Service
-> Proxy CancelRotateSecret
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelRotateSecret)))
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 -> Int -> CancelRotateSecretResponse
CancelRotateSecretResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CancelRotateSecretResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> CancelRotateSecretResponse)
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 -> Int -> CancelRotateSecretResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CancelRotateSecretResponse)
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 -> Int -> CancelRotateSecretResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CancelRotateSecretResponse)
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 (Int -> CancelRotateSecretResponse)
-> Either String Int -> Either String CancelRotateSecretResponse
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 CancelRotateSecret
instance Prelude.NFData CancelRotateSecret
instance Core.ToHeaders CancelRotateSecret where
toHeaders :: CancelRotateSecret -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelRotateSecret -> 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.CancelRotateSecret" ::
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 CancelRotateSecret where
toJSON :: CancelRotateSecret -> Value
toJSON CancelRotateSecret' {Text
secretId :: Text
$sel:secretId:CancelRotateSecret' :: CancelRotateSecret -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SecretId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretId)]
)
instance Core.ToPath CancelRotateSecret where
toPath :: CancelRotateSecret -> ByteString
toPath = ByteString -> CancelRotateSecret -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelRotateSecret where
toQuery :: CancelRotateSecret -> QueryString
toQuery = QueryString -> CancelRotateSecret -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelRotateSecretResponse = CancelRotateSecretResponse'
{
CancelRotateSecretResponse -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
CancelRotateSecretResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CancelRotateSecretResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CancelRotateSecretResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool
(CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool)
-> (CancelRotateSecretResponse
-> CancelRotateSecretResponse -> Bool)
-> Eq CancelRotateSecretResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool
$c/= :: CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool
== :: CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool
$c== :: CancelRotateSecretResponse -> CancelRotateSecretResponse -> Bool
Prelude.Eq, ReadPrec [CancelRotateSecretResponse]
ReadPrec CancelRotateSecretResponse
Int -> ReadS CancelRotateSecretResponse
ReadS [CancelRotateSecretResponse]
(Int -> ReadS CancelRotateSecretResponse)
-> ReadS [CancelRotateSecretResponse]
-> ReadPrec CancelRotateSecretResponse
-> ReadPrec [CancelRotateSecretResponse]
-> Read CancelRotateSecretResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelRotateSecretResponse]
$creadListPrec :: ReadPrec [CancelRotateSecretResponse]
readPrec :: ReadPrec CancelRotateSecretResponse
$creadPrec :: ReadPrec CancelRotateSecretResponse
readList :: ReadS [CancelRotateSecretResponse]
$creadList :: ReadS [CancelRotateSecretResponse]
readsPrec :: Int -> ReadS CancelRotateSecretResponse
$creadsPrec :: Int -> ReadS CancelRotateSecretResponse
Prelude.Read, Int -> CancelRotateSecretResponse -> ShowS
[CancelRotateSecretResponse] -> ShowS
CancelRotateSecretResponse -> String
(Int -> CancelRotateSecretResponse -> ShowS)
-> (CancelRotateSecretResponse -> String)
-> ([CancelRotateSecretResponse] -> ShowS)
-> Show CancelRotateSecretResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelRotateSecretResponse] -> ShowS
$cshowList :: [CancelRotateSecretResponse] -> ShowS
show :: CancelRotateSecretResponse -> String
$cshow :: CancelRotateSecretResponse -> String
showsPrec :: Int -> CancelRotateSecretResponse -> ShowS
$cshowsPrec :: Int -> CancelRotateSecretResponse -> ShowS
Prelude.Show, (forall x.
CancelRotateSecretResponse -> Rep CancelRotateSecretResponse x)
-> (forall x.
Rep CancelRotateSecretResponse x -> CancelRotateSecretResponse)
-> Generic CancelRotateSecretResponse
forall x.
Rep CancelRotateSecretResponse x -> CancelRotateSecretResponse
forall x.
CancelRotateSecretResponse -> Rep CancelRotateSecretResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelRotateSecretResponse x -> CancelRotateSecretResponse
$cfrom :: forall x.
CancelRotateSecretResponse -> Rep CancelRotateSecretResponse x
Prelude.Generic)
newCancelRotateSecretResponse ::
Prelude.Int ->
CancelRotateSecretResponse
newCancelRotateSecretResponse :: Int -> CancelRotateSecretResponse
newCancelRotateSecretResponse Int
pHttpStatus_ =
CancelRotateSecretResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CancelRotateSecretResponse
CancelRotateSecretResponse'
{ $sel:versionId:CancelRotateSecretResponse' :: Maybe Text
versionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CancelRotateSecretResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CancelRotateSecretResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CancelRotateSecretResponse' :: Int
httpStatus = Int
pHttpStatus_
}
cancelRotateSecretResponse_versionId :: Lens.Lens' CancelRotateSecretResponse (Prelude.Maybe Prelude.Text)
cancelRotateSecretResponse_versionId :: (Maybe Text -> f (Maybe Text))
-> CancelRotateSecretResponse -> f CancelRotateSecretResponse
cancelRotateSecretResponse_versionId = (CancelRotateSecretResponse -> Maybe Text)
-> (CancelRotateSecretResponse
-> Maybe Text -> CancelRotateSecretResponse)
-> Lens
CancelRotateSecretResponse
CancelRotateSecretResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelRotateSecretResponse' {Maybe Text
versionId :: Maybe Text
$sel:versionId:CancelRotateSecretResponse' :: CancelRotateSecretResponse -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: CancelRotateSecretResponse
s@CancelRotateSecretResponse' {} Maybe Text
a -> CancelRotateSecretResponse
s {$sel:versionId:CancelRotateSecretResponse' :: Maybe Text
versionId = Maybe Text
a} :: CancelRotateSecretResponse)
cancelRotateSecretResponse_arn :: Lens.Lens' CancelRotateSecretResponse (Prelude.Maybe Prelude.Text)
cancelRotateSecretResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CancelRotateSecretResponse -> f CancelRotateSecretResponse
cancelRotateSecretResponse_arn = (CancelRotateSecretResponse -> Maybe Text)
-> (CancelRotateSecretResponse
-> Maybe Text -> CancelRotateSecretResponse)
-> Lens
CancelRotateSecretResponse
CancelRotateSecretResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelRotateSecretResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CancelRotateSecretResponse' :: CancelRotateSecretResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CancelRotateSecretResponse
s@CancelRotateSecretResponse' {} Maybe Text
a -> CancelRotateSecretResponse
s {$sel:arn:CancelRotateSecretResponse' :: Maybe Text
arn = Maybe Text
a} :: CancelRotateSecretResponse)
cancelRotateSecretResponse_name :: Lens.Lens' CancelRotateSecretResponse (Prelude.Maybe Prelude.Text)
cancelRotateSecretResponse_name :: (Maybe Text -> f (Maybe Text))
-> CancelRotateSecretResponse -> f CancelRotateSecretResponse
cancelRotateSecretResponse_name = (CancelRotateSecretResponse -> Maybe Text)
-> (CancelRotateSecretResponse
-> Maybe Text -> CancelRotateSecretResponse)
-> Lens
CancelRotateSecretResponse
CancelRotateSecretResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelRotateSecretResponse' {Maybe Text
name :: Maybe Text
$sel:name:CancelRotateSecretResponse' :: CancelRotateSecretResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CancelRotateSecretResponse
s@CancelRotateSecretResponse' {} Maybe Text
a -> CancelRotateSecretResponse
s {$sel:name:CancelRotateSecretResponse' :: Maybe Text
name = Maybe Text
a} :: CancelRotateSecretResponse)
cancelRotateSecretResponse_httpStatus :: Lens.Lens' CancelRotateSecretResponse Prelude.Int
cancelRotateSecretResponse_httpStatus :: (Int -> f Int)
-> CancelRotateSecretResponse -> f CancelRotateSecretResponse
cancelRotateSecretResponse_httpStatus = (CancelRotateSecretResponse -> Int)
-> (CancelRotateSecretResponse
-> Int -> CancelRotateSecretResponse)
-> Lens
CancelRotateSecretResponse CancelRotateSecretResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelRotateSecretResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelRotateSecretResponse' :: CancelRotateSecretResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelRotateSecretResponse
s@CancelRotateSecretResponse' {} Int
a -> CancelRotateSecretResponse
s {$sel:httpStatus:CancelRotateSecretResponse' :: Int
httpStatus = Int
a} :: CancelRotateSecretResponse)
instance Prelude.NFData CancelRotateSecretResponse