{-# 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.StopReplicationToReplica
(
StopReplicationToReplica (..),
newStopReplicationToReplica,
stopReplicationToReplica_secretId,
StopReplicationToReplicaResponse (..),
newStopReplicationToReplicaResponse,
stopReplicationToReplicaResponse_arn,
stopReplicationToReplicaResponse_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 StopReplicationToReplica = StopReplicationToReplica'
{
StopReplicationToReplica -> Text
secretId :: Prelude.Text
}
deriving (StopReplicationToReplica -> StopReplicationToReplica -> Bool
(StopReplicationToReplica -> StopReplicationToReplica -> Bool)
-> (StopReplicationToReplica -> StopReplicationToReplica -> Bool)
-> Eq StopReplicationToReplica
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopReplicationToReplica -> StopReplicationToReplica -> Bool
$c/= :: StopReplicationToReplica -> StopReplicationToReplica -> Bool
== :: StopReplicationToReplica -> StopReplicationToReplica -> Bool
$c== :: StopReplicationToReplica -> StopReplicationToReplica -> Bool
Prelude.Eq, ReadPrec [StopReplicationToReplica]
ReadPrec StopReplicationToReplica
Int -> ReadS StopReplicationToReplica
ReadS [StopReplicationToReplica]
(Int -> ReadS StopReplicationToReplica)
-> ReadS [StopReplicationToReplica]
-> ReadPrec StopReplicationToReplica
-> ReadPrec [StopReplicationToReplica]
-> Read StopReplicationToReplica
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopReplicationToReplica]
$creadListPrec :: ReadPrec [StopReplicationToReplica]
readPrec :: ReadPrec StopReplicationToReplica
$creadPrec :: ReadPrec StopReplicationToReplica
readList :: ReadS [StopReplicationToReplica]
$creadList :: ReadS [StopReplicationToReplica]
readsPrec :: Int -> ReadS StopReplicationToReplica
$creadsPrec :: Int -> ReadS StopReplicationToReplica
Prelude.Read, Int -> StopReplicationToReplica -> ShowS
[StopReplicationToReplica] -> ShowS
StopReplicationToReplica -> String
(Int -> StopReplicationToReplica -> ShowS)
-> (StopReplicationToReplica -> String)
-> ([StopReplicationToReplica] -> ShowS)
-> Show StopReplicationToReplica
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopReplicationToReplica] -> ShowS
$cshowList :: [StopReplicationToReplica] -> ShowS
show :: StopReplicationToReplica -> String
$cshow :: StopReplicationToReplica -> String
showsPrec :: Int -> StopReplicationToReplica -> ShowS
$cshowsPrec :: Int -> StopReplicationToReplica -> ShowS
Prelude.Show, (forall x.
StopReplicationToReplica -> Rep StopReplicationToReplica x)
-> (forall x.
Rep StopReplicationToReplica x -> StopReplicationToReplica)
-> Generic StopReplicationToReplica
forall x.
Rep StopReplicationToReplica x -> StopReplicationToReplica
forall x.
StopReplicationToReplica -> Rep StopReplicationToReplica x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopReplicationToReplica x -> StopReplicationToReplica
$cfrom :: forall x.
StopReplicationToReplica -> Rep StopReplicationToReplica x
Prelude.Generic)
newStopReplicationToReplica ::
Prelude.Text ->
StopReplicationToReplica
newStopReplicationToReplica :: Text -> StopReplicationToReplica
newStopReplicationToReplica Text
pSecretId_ =
StopReplicationToReplica' :: Text -> StopReplicationToReplica
StopReplicationToReplica' {$sel:secretId:StopReplicationToReplica' :: Text
secretId = Text
pSecretId_}
stopReplicationToReplica_secretId :: Lens.Lens' StopReplicationToReplica Prelude.Text
stopReplicationToReplica_secretId :: (Text -> f Text)
-> StopReplicationToReplica -> f StopReplicationToReplica
stopReplicationToReplica_secretId = (StopReplicationToReplica -> Text)
-> (StopReplicationToReplica -> Text -> StopReplicationToReplica)
-> Lens StopReplicationToReplica StopReplicationToReplica Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopReplicationToReplica' {Text
secretId :: Text
$sel:secretId:StopReplicationToReplica' :: StopReplicationToReplica -> Text
secretId} -> Text
secretId) (\s :: StopReplicationToReplica
s@StopReplicationToReplica' {} Text
a -> StopReplicationToReplica
s {$sel:secretId:StopReplicationToReplica' :: Text
secretId = Text
a} :: StopReplicationToReplica)
instance Core.AWSRequest StopReplicationToReplica where
type
AWSResponse StopReplicationToReplica =
StopReplicationToReplicaResponse
request :: StopReplicationToReplica -> Request StopReplicationToReplica
request = Service
-> StopReplicationToReplica -> Request StopReplicationToReplica
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopReplicationToReplica
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopReplicationToReplica)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopReplicationToReplica))
-> Logger
-> Service
-> Proxy StopReplicationToReplica
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopReplicationToReplica)))
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 -> Int -> StopReplicationToReplicaResponse
StopReplicationToReplicaResponse'
(Maybe Text -> Int -> StopReplicationToReplicaResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StopReplicationToReplicaResponse)
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
"ARN")
Either String (Int -> StopReplicationToReplicaResponse)
-> Either String Int
-> Either String StopReplicationToReplicaResponse
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 StopReplicationToReplica
instance Prelude.NFData StopReplicationToReplica
instance Core.ToHeaders StopReplicationToReplica where
toHeaders :: StopReplicationToReplica -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopReplicationToReplica -> 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.StopReplicationToReplica" ::
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 StopReplicationToReplica where
toJSON :: StopReplicationToReplica -> Value
toJSON StopReplicationToReplica' {Text
secretId :: Text
$sel:secretId:StopReplicationToReplica' :: StopReplicationToReplica -> 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 StopReplicationToReplica where
toPath :: StopReplicationToReplica -> ByteString
toPath = ByteString -> StopReplicationToReplica -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopReplicationToReplica where
toQuery :: StopReplicationToReplica -> QueryString
toQuery = QueryString -> StopReplicationToReplica -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopReplicationToReplicaResponse = StopReplicationToReplicaResponse'
{
StopReplicationToReplicaResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
StopReplicationToReplicaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool
(StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool)
-> (StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool)
-> Eq StopReplicationToReplicaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool
$c/= :: StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool
== :: StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool
$c== :: StopReplicationToReplicaResponse
-> StopReplicationToReplicaResponse -> Bool
Prelude.Eq, ReadPrec [StopReplicationToReplicaResponse]
ReadPrec StopReplicationToReplicaResponse
Int -> ReadS StopReplicationToReplicaResponse
ReadS [StopReplicationToReplicaResponse]
(Int -> ReadS StopReplicationToReplicaResponse)
-> ReadS [StopReplicationToReplicaResponse]
-> ReadPrec StopReplicationToReplicaResponse
-> ReadPrec [StopReplicationToReplicaResponse]
-> Read StopReplicationToReplicaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopReplicationToReplicaResponse]
$creadListPrec :: ReadPrec [StopReplicationToReplicaResponse]
readPrec :: ReadPrec StopReplicationToReplicaResponse
$creadPrec :: ReadPrec StopReplicationToReplicaResponse
readList :: ReadS [StopReplicationToReplicaResponse]
$creadList :: ReadS [StopReplicationToReplicaResponse]
readsPrec :: Int -> ReadS StopReplicationToReplicaResponse
$creadsPrec :: Int -> ReadS StopReplicationToReplicaResponse
Prelude.Read, Int -> StopReplicationToReplicaResponse -> ShowS
[StopReplicationToReplicaResponse] -> ShowS
StopReplicationToReplicaResponse -> String
(Int -> StopReplicationToReplicaResponse -> ShowS)
-> (StopReplicationToReplicaResponse -> String)
-> ([StopReplicationToReplicaResponse] -> ShowS)
-> Show StopReplicationToReplicaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopReplicationToReplicaResponse] -> ShowS
$cshowList :: [StopReplicationToReplicaResponse] -> ShowS
show :: StopReplicationToReplicaResponse -> String
$cshow :: StopReplicationToReplicaResponse -> String
showsPrec :: Int -> StopReplicationToReplicaResponse -> ShowS
$cshowsPrec :: Int -> StopReplicationToReplicaResponse -> ShowS
Prelude.Show, (forall x.
StopReplicationToReplicaResponse
-> Rep StopReplicationToReplicaResponse x)
-> (forall x.
Rep StopReplicationToReplicaResponse x
-> StopReplicationToReplicaResponse)
-> Generic StopReplicationToReplicaResponse
forall x.
Rep StopReplicationToReplicaResponse x
-> StopReplicationToReplicaResponse
forall x.
StopReplicationToReplicaResponse
-> Rep StopReplicationToReplicaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopReplicationToReplicaResponse x
-> StopReplicationToReplicaResponse
$cfrom :: forall x.
StopReplicationToReplicaResponse
-> Rep StopReplicationToReplicaResponse x
Prelude.Generic)
newStopReplicationToReplicaResponse ::
Prelude.Int ->
StopReplicationToReplicaResponse
newStopReplicationToReplicaResponse :: Int -> StopReplicationToReplicaResponse
newStopReplicationToReplicaResponse Int
pHttpStatus_ =
StopReplicationToReplicaResponse' :: Maybe Text -> Int -> StopReplicationToReplicaResponse
StopReplicationToReplicaResponse'
{ $sel:arn:StopReplicationToReplicaResponse' :: Maybe Text
arn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopReplicationToReplicaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopReplicationToReplicaResponse_arn :: Lens.Lens' StopReplicationToReplicaResponse (Prelude.Maybe Prelude.Text)
stopReplicationToReplicaResponse_arn :: (Maybe Text -> f (Maybe Text))
-> StopReplicationToReplicaResponse
-> f StopReplicationToReplicaResponse
stopReplicationToReplicaResponse_arn = (StopReplicationToReplicaResponse -> Maybe Text)
-> (StopReplicationToReplicaResponse
-> Maybe Text -> StopReplicationToReplicaResponse)
-> Lens
StopReplicationToReplicaResponse
StopReplicationToReplicaResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopReplicationToReplicaResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:StopReplicationToReplicaResponse' :: StopReplicationToReplicaResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StopReplicationToReplicaResponse
s@StopReplicationToReplicaResponse' {} Maybe Text
a -> StopReplicationToReplicaResponse
s {$sel:arn:StopReplicationToReplicaResponse' :: Maybe Text
arn = Maybe Text
a} :: StopReplicationToReplicaResponse)
stopReplicationToReplicaResponse_httpStatus :: Lens.Lens' StopReplicationToReplicaResponse Prelude.Int
stopReplicationToReplicaResponse_httpStatus :: (Int -> f Int)
-> StopReplicationToReplicaResponse
-> f StopReplicationToReplicaResponse
stopReplicationToReplicaResponse_httpStatus = (StopReplicationToReplicaResponse -> Int)
-> (StopReplicationToReplicaResponse
-> Int -> StopReplicationToReplicaResponse)
-> Lens
StopReplicationToReplicaResponse
StopReplicationToReplicaResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopReplicationToReplicaResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopReplicationToReplicaResponse' :: StopReplicationToReplicaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopReplicationToReplicaResponse
s@StopReplicationToReplicaResponse' {} Int
a -> StopReplicationToReplicaResponse
s {$sel:httpStatus:StopReplicationToReplicaResponse' :: Int
httpStatus = Int
a} :: StopReplicationToReplicaResponse)
instance
Prelude.NFData
StopReplicationToReplicaResponse