{-# 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.SSMIncidents.UpdateReplicationSet
(
UpdateReplicationSet (..),
newUpdateReplicationSet,
updateReplicationSet_clientToken,
updateReplicationSet_actions,
updateReplicationSet_arn,
UpdateReplicationSetResponse (..),
newUpdateReplicationSetResponse,
updateReplicationSetResponse_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.SSMIncidents.Types
data UpdateReplicationSet = UpdateReplicationSet'
{
UpdateReplicationSet -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateReplicationSet -> NonEmpty UpdateReplicationSetAction
actions :: Prelude.NonEmpty UpdateReplicationSetAction,
UpdateReplicationSet -> Text
arn :: Prelude.Text
}
deriving (UpdateReplicationSet -> UpdateReplicationSet -> Bool
(UpdateReplicationSet -> UpdateReplicationSet -> Bool)
-> (UpdateReplicationSet -> UpdateReplicationSet -> Bool)
-> Eq UpdateReplicationSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReplicationSet -> UpdateReplicationSet -> Bool
$c/= :: UpdateReplicationSet -> UpdateReplicationSet -> Bool
== :: UpdateReplicationSet -> UpdateReplicationSet -> Bool
$c== :: UpdateReplicationSet -> UpdateReplicationSet -> Bool
Prelude.Eq, ReadPrec [UpdateReplicationSet]
ReadPrec UpdateReplicationSet
Int -> ReadS UpdateReplicationSet
ReadS [UpdateReplicationSet]
(Int -> ReadS UpdateReplicationSet)
-> ReadS [UpdateReplicationSet]
-> ReadPrec UpdateReplicationSet
-> ReadPrec [UpdateReplicationSet]
-> Read UpdateReplicationSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReplicationSet]
$creadListPrec :: ReadPrec [UpdateReplicationSet]
readPrec :: ReadPrec UpdateReplicationSet
$creadPrec :: ReadPrec UpdateReplicationSet
readList :: ReadS [UpdateReplicationSet]
$creadList :: ReadS [UpdateReplicationSet]
readsPrec :: Int -> ReadS UpdateReplicationSet
$creadsPrec :: Int -> ReadS UpdateReplicationSet
Prelude.Read, Int -> UpdateReplicationSet -> ShowS
[UpdateReplicationSet] -> ShowS
UpdateReplicationSet -> String
(Int -> UpdateReplicationSet -> ShowS)
-> (UpdateReplicationSet -> String)
-> ([UpdateReplicationSet] -> ShowS)
-> Show UpdateReplicationSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReplicationSet] -> ShowS
$cshowList :: [UpdateReplicationSet] -> ShowS
show :: UpdateReplicationSet -> String
$cshow :: UpdateReplicationSet -> String
showsPrec :: Int -> UpdateReplicationSet -> ShowS
$cshowsPrec :: Int -> UpdateReplicationSet -> ShowS
Prelude.Show, (forall x. UpdateReplicationSet -> Rep UpdateReplicationSet x)
-> (forall x. Rep UpdateReplicationSet x -> UpdateReplicationSet)
-> Generic UpdateReplicationSet
forall x. Rep UpdateReplicationSet x -> UpdateReplicationSet
forall x. UpdateReplicationSet -> Rep UpdateReplicationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateReplicationSet x -> UpdateReplicationSet
$cfrom :: forall x. UpdateReplicationSet -> Rep UpdateReplicationSet x
Prelude.Generic)
newUpdateReplicationSet ::
Prelude.NonEmpty UpdateReplicationSetAction ->
Prelude.Text ->
UpdateReplicationSet
newUpdateReplicationSet :: NonEmpty UpdateReplicationSetAction -> Text -> UpdateReplicationSet
newUpdateReplicationSet NonEmpty UpdateReplicationSetAction
pActions_ Text
pArn_ =
UpdateReplicationSet' :: Maybe Text
-> NonEmpty UpdateReplicationSetAction
-> Text
-> UpdateReplicationSet
UpdateReplicationSet'
{ $sel:clientToken:UpdateReplicationSet' :: Maybe Text
clientToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:actions:UpdateReplicationSet' :: NonEmpty UpdateReplicationSetAction
actions = Tagged
(NonEmpty UpdateReplicationSetAction)
(Identity (NonEmpty UpdateReplicationSetAction))
-> Tagged
(NonEmpty UpdateReplicationSetAction)
(Identity (NonEmpty UpdateReplicationSetAction))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty UpdateReplicationSetAction)
(Identity (NonEmpty UpdateReplicationSetAction))
-> Tagged
(NonEmpty UpdateReplicationSetAction)
(Identity (NonEmpty UpdateReplicationSetAction)))
-> NonEmpty UpdateReplicationSetAction
-> NonEmpty UpdateReplicationSetAction
forall t b. AReview t b -> b -> t
Lens.# NonEmpty UpdateReplicationSetAction
pActions_,
$sel:arn:UpdateReplicationSet' :: Text
arn = Text
pArn_
}
updateReplicationSet_clientToken :: Lens.Lens' UpdateReplicationSet (Prelude.Maybe Prelude.Text)
updateReplicationSet_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateReplicationSet -> f UpdateReplicationSet
updateReplicationSet_clientToken = (UpdateReplicationSet -> Maybe Text)
-> (UpdateReplicationSet -> Maybe Text -> UpdateReplicationSet)
-> Lens
UpdateReplicationSet UpdateReplicationSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReplicationSet' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateReplicationSet' :: UpdateReplicationSet -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateReplicationSet
s@UpdateReplicationSet' {} Maybe Text
a -> UpdateReplicationSet
s {$sel:clientToken:UpdateReplicationSet' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateReplicationSet)
updateReplicationSet_actions :: Lens.Lens' UpdateReplicationSet (Prelude.NonEmpty UpdateReplicationSetAction)
updateReplicationSet_actions :: (NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> UpdateReplicationSet -> f UpdateReplicationSet
updateReplicationSet_actions = (UpdateReplicationSet -> NonEmpty UpdateReplicationSetAction)
-> (UpdateReplicationSet
-> NonEmpty UpdateReplicationSetAction -> UpdateReplicationSet)
-> Lens
UpdateReplicationSet
UpdateReplicationSet
(NonEmpty UpdateReplicationSetAction)
(NonEmpty UpdateReplicationSetAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReplicationSet' {NonEmpty UpdateReplicationSetAction
actions :: NonEmpty UpdateReplicationSetAction
$sel:actions:UpdateReplicationSet' :: UpdateReplicationSet -> NonEmpty UpdateReplicationSetAction
actions} -> NonEmpty UpdateReplicationSetAction
actions) (\s :: UpdateReplicationSet
s@UpdateReplicationSet' {} NonEmpty UpdateReplicationSetAction
a -> UpdateReplicationSet
s {$sel:actions:UpdateReplicationSet' :: NonEmpty UpdateReplicationSetAction
actions = NonEmpty UpdateReplicationSetAction
a} :: UpdateReplicationSet) ((NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> UpdateReplicationSet -> f UpdateReplicationSet)
-> ((NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> (NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> UpdateReplicationSet
-> f UpdateReplicationSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction))
-> NonEmpty UpdateReplicationSetAction
-> f (NonEmpty UpdateReplicationSetAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateReplicationSet_arn :: Lens.Lens' UpdateReplicationSet Prelude.Text
updateReplicationSet_arn :: (Text -> f Text) -> UpdateReplicationSet -> f UpdateReplicationSet
updateReplicationSet_arn = (UpdateReplicationSet -> Text)
-> (UpdateReplicationSet -> Text -> UpdateReplicationSet)
-> Lens UpdateReplicationSet UpdateReplicationSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReplicationSet' {Text
arn :: Text
$sel:arn:UpdateReplicationSet' :: UpdateReplicationSet -> Text
arn} -> Text
arn) (\s :: UpdateReplicationSet
s@UpdateReplicationSet' {} Text
a -> UpdateReplicationSet
s {$sel:arn:UpdateReplicationSet' :: Text
arn = Text
a} :: UpdateReplicationSet)
instance Core.AWSRequest UpdateReplicationSet where
type
AWSResponse UpdateReplicationSet =
UpdateReplicationSetResponse
request :: UpdateReplicationSet -> Request UpdateReplicationSet
request = Service -> UpdateReplicationSet -> Request UpdateReplicationSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateReplicationSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReplicationSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateReplicationSet))
-> Logger
-> Service
-> Proxy UpdateReplicationSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReplicationSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateReplicationSetResponse
UpdateReplicationSetResponse'
(Int -> UpdateReplicationSetResponse)
-> Either String Int -> Either String UpdateReplicationSetResponse
forall (f :: * -> *) a b. Functor 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 UpdateReplicationSet
instance Prelude.NFData UpdateReplicationSet
instance Core.ToHeaders UpdateReplicationSet where
toHeaders :: UpdateReplicationSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateReplicationSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UpdateReplicationSet where
toJSON :: UpdateReplicationSet -> Value
toJSON UpdateReplicationSet' {Maybe Text
NonEmpty UpdateReplicationSetAction
Text
arn :: Text
actions :: NonEmpty UpdateReplicationSetAction
clientToken :: Maybe Text
$sel:arn:UpdateReplicationSet' :: UpdateReplicationSet -> Text
$sel:actions:UpdateReplicationSet' :: UpdateReplicationSet -> NonEmpty UpdateReplicationSetAction
$sel:clientToken:UpdateReplicationSet' :: UpdateReplicationSet -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"clientToken" 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
clientToken,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"actions" Text -> NonEmpty UpdateReplicationSetAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty UpdateReplicationSetAction
actions),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
]
)
instance Core.ToPath UpdateReplicationSet where
toPath :: UpdateReplicationSet -> ByteString
toPath = ByteString -> UpdateReplicationSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/updateReplicationSet"
instance Core.ToQuery UpdateReplicationSet where
toQuery :: UpdateReplicationSet -> QueryString
toQuery = QueryString -> UpdateReplicationSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateReplicationSetResponse = UpdateReplicationSetResponse'
{
UpdateReplicationSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool
(UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool)
-> (UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool)
-> Eq UpdateReplicationSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool
$c/= :: UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool
== :: UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool
$c== :: UpdateReplicationSetResponse
-> UpdateReplicationSetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateReplicationSetResponse]
ReadPrec UpdateReplicationSetResponse
Int -> ReadS UpdateReplicationSetResponse
ReadS [UpdateReplicationSetResponse]
(Int -> ReadS UpdateReplicationSetResponse)
-> ReadS [UpdateReplicationSetResponse]
-> ReadPrec UpdateReplicationSetResponse
-> ReadPrec [UpdateReplicationSetResponse]
-> Read UpdateReplicationSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReplicationSetResponse]
$creadListPrec :: ReadPrec [UpdateReplicationSetResponse]
readPrec :: ReadPrec UpdateReplicationSetResponse
$creadPrec :: ReadPrec UpdateReplicationSetResponse
readList :: ReadS [UpdateReplicationSetResponse]
$creadList :: ReadS [UpdateReplicationSetResponse]
readsPrec :: Int -> ReadS UpdateReplicationSetResponse
$creadsPrec :: Int -> ReadS UpdateReplicationSetResponse
Prelude.Read, Int -> UpdateReplicationSetResponse -> ShowS
[UpdateReplicationSetResponse] -> ShowS
UpdateReplicationSetResponse -> String
(Int -> UpdateReplicationSetResponse -> ShowS)
-> (UpdateReplicationSetResponse -> String)
-> ([UpdateReplicationSetResponse] -> ShowS)
-> Show UpdateReplicationSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReplicationSetResponse] -> ShowS
$cshowList :: [UpdateReplicationSetResponse] -> ShowS
show :: UpdateReplicationSetResponse -> String
$cshow :: UpdateReplicationSetResponse -> String
showsPrec :: Int -> UpdateReplicationSetResponse -> ShowS
$cshowsPrec :: Int -> UpdateReplicationSetResponse -> ShowS
Prelude.Show, (forall x.
UpdateReplicationSetResponse -> Rep UpdateReplicationSetResponse x)
-> (forall x.
Rep UpdateReplicationSetResponse x -> UpdateReplicationSetResponse)
-> Generic UpdateReplicationSetResponse
forall x.
Rep UpdateReplicationSetResponse x -> UpdateReplicationSetResponse
forall x.
UpdateReplicationSetResponse -> Rep UpdateReplicationSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateReplicationSetResponse x -> UpdateReplicationSetResponse
$cfrom :: forall x.
UpdateReplicationSetResponse -> Rep UpdateReplicationSetResponse x
Prelude.Generic)
newUpdateReplicationSetResponse ::
Prelude.Int ->
UpdateReplicationSetResponse
newUpdateReplicationSetResponse :: Int -> UpdateReplicationSetResponse
newUpdateReplicationSetResponse Int
pHttpStatus_ =
UpdateReplicationSetResponse' :: Int -> UpdateReplicationSetResponse
UpdateReplicationSetResponse'
{ $sel:httpStatus:UpdateReplicationSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateReplicationSetResponse_httpStatus :: Lens.Lens' UpdateReplicationSetResponse Prelude.Int
updateReplicationSetResponse_httpStatus :: (Int -> f Int)
-> UpdateReplicationSetResponse -> f UpdateReplicationSetResponse
updateReplicationSetResponse_httpStatus = (UpdateReplicationSetResponse -> Int)
-> (UpdateReplicationSetResponse
-> Int -> UpdateReplicationSetResponse)
-> Lens
UpdateReplicationSetResponse UpdateReplicationSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReplicationSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateReplicationSetResponse' :: UpdateReplicationSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateReplicationSetResponse
s@UpdateReplicationSetResponse' {} Int
a -> UpdateReplicationSetResponse
s {$sel:httpStatus:UpdateReplicationSetResponse' :: Int
httpStatus = Int
a} :: UpdateReplicationSetResponse)
instance Prelude.NFData UpdateReplicationSetResponse