{-# 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.UpdateRelatedItems
(
UpdateRelatedItems (..),
newUpdateRelatedItems,
updateRelatedItems_clientToken,
updateRelatedItems_incidentRecordArn,
updateRelatedItems_relatedItemsUpdate,
UpdateRelatedItemsResponse (..),
newUpdateRelatedItemsResponse,
updateRelatedItemsResponse_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 UpdateRelatedItems = UpdateRelatedItems'
{
UpdateRelatedItems -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateRelatedItems -> Text
incidentRecordArn :: Prelude.Text,
UpdateRelatedItems -> RelatedItemsUpdate
relatedItemsUpdate :: RelatedItemsUpdate
}
deriving (UpdateRelatedItems -> UpdateRelatedItems -> Bool
(UpdateRelatedItems -> UpdateRelatedItems -> Bool)
-> (UpdateRelatedItems -> UpdateRelatedItems -> Bool)
-> Eq UpdateRelatedItems
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRelatedItems -> UpdateRelatedItems -> Bool
$c/= :: UpdateRelatedItems -> UpdateRelatedItems -> Bool
== :: UpdateRelatedItems -> UpdateRelatedItems -> Bool
$c== :: UpdateRelatedItems -> UpdateRelatedItems -> Bool
Prelude.Eq, ReadPrec [UpdateRelatedItems]
ReadPrec UpdateRelatedItems
Int -> ReadS UpdateRelatedItems
ReadS [UpdateRelatedItems]
(Int -> ReadS UpdateRelatedItems)
-> ReadS [UpdateRelatedItems]
-> ReadPrec UpdateRelatedItems
-> ReadPrec [UpdateRelatedItems]
-> Read UpdateRelatedItems
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRelatedItems]
$creadListPrec :: ReadPrec [UpdateRelatedItems]
readPrec :: ReadPrec UpdateRelatedItems
$creadPrec :: ReadPrec UpdateRelatedItems
readList :: ReadS [UpdateRelatedItems]
$creadList :: ReadS [UpdateRelatedItems]
readsPrec :: Int -> ReadS UpdateRelatedItems
$creadsPrec :: Int -> ReadS UpdateRelatedItems
Prelude.Read, Int -> UpdateRelatedItems -> ShowS
[UpdateRelatedItems] -> ShowS
UpdateRelatedItems -> String
(Int -> UpdateRelatedItems -> ShowS)
-> (UpdateRelatedItems -> String)
-> ([UpdateRelatedItems] -> ShowS)
-> Show UpdateRelatedItems
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRelatedItems] -> ShowS
$cshowList :: [UpdateRelatedItems] -> ShowS
show :: UpdateRelatedItems -> String
$cshow :: UpdateRelatedItems -> String
showsPrec :: Int -> UpdateRelatedItems -> ShowS
$cshowsPrec :: Int -> UpdateRelatedItems -> ShowS
Prelude.Show, (forall x. UpdateRelatedItems -> Rep UpdateRelatedItems x)
-> (forall x. Rep UpdateRelatedItems x -> UpdateRelatedItems)
-> Generic UpdateRelatedItems
forall x. Rep UpdateRelatedItems x -> UpdateRelatedItems
forall x. UpdateRelatedItems -> Rep UpdateRelatedItems x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRelatedItems x -> UpdateRelatedItems
$cfrom :: forall x. UpdateRelatedItems -> Rep UpdateRelatedItems x
Prelude.Generic)
newUpdateRelatedItems ::
Prelude.Text ->
RelatedItemsUpdate ->
UpdateRelatedItems
newUpdateRelatedItems :: Text -> RelatedItemsUpdate -> UpdateRelatedItems
newUpdateRelatedItems
Text
pIncidentRecordArn_
RelatedItemsUpdate
pRelatedItemsUpdate_ =
UpdateRelatedItems' :: Maybe Text -> Text -> RelatedItemsUpdate -> UpdateRelatedItems
UpdateRelatedItems'
{ $sel:clientToken:UpdateRelatedItems' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:incidentRecordArn:UpdateRelatedItems' :: Text
incidentRecordArn = Text
pIncidentRecordArn_,
$sel:relatedItemsUpdate:UpdateRelatedItems' :: RelatedItemsUpdate
relatedItemsUpdate = RelatedItemsUpdate
pRelatedItemsUpdate_
}
updateRelatedItems_clientToken :: Lens.Lens' UpdateRelatedItems (Prelude.Maybe Prelude.Text)
updateRelatedItems_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateRelatedItems -> f UpdateRelatedItems
updateRelatedItems_clientToken = (UpdateRelatedItems -> Maybe Text)
-> (UpdateRelatedItems -> Maybe Text -> UpdateRelatedItems)
-> Lens
UpdateRelatedItems UpdateRelatedItems (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRelatedItems' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateRelatedItems' :: UpdateRelatedItems -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateRelatedItems
s@UpdateRelatedItems' {} Maybe Text
a -> UpdateRelatedItems
s {$sel:clientToken:UpdateRelatedItems' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateRelatedItems)
updateRelatedItems_incidentRecordArn :: Lens.Lens' UpdateRelatedItems Prelude.Text
updateRelatedItems_incidentRecordArn :: (Text -> f Text) -> UpdateRelatedItems -> f UpdateRelatedItems
updateRelatedItems_incidentRecordArn = (UpdateRelatedItems -> Text)
-> (UpdateRelatedItems -> Text -> UpdateRelatedItems)
-> Lens UpdateRelatedItems UpdateRelatedItems Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRelatedItems' {Text
incidentRecordArn :: Text
$sel:incidentRecordArn:UpdateRelatedItems' :: UpdateRelatedItems -> Text
incidentRecordArn} -> Text
incidentRecordArn) (\s :: UpdateRelatedItems
s@UpdateRelatedItems' {} Text
a -> UpdateRelatedItems
s {$sel:incidentRecordArn:UpdateRelatedItems' :: Text
incidentRecordArn = Text
a} :: UpdateRelatedItems)
updateRelatedItems_relatedItemsUpdate :: Lens.Lens' UpdateRelatedItems RelatedItemsUpdate
updateRelatedItems_relatedItemsUpdate :: (RelatedItemsUpdate -> f RelatedItemsUpdate)
-> UpdateRelatedItems -> f UpdateRelatedItems
updateRelatedItems_relatedItemsUpdate = (UpdateRelatedItems -> RelatedItemsUpdate)
-> (UpdateRelatedItems -> RelatedItemsUpdate -> UpdateRelatedItems)
-> Lens
UpdateRelatedItems
UpdateRelatedItems
RelatedItemsUpdate
RelatedItemsUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRelatedItems' {RelatedItemsUpdate
relatedItemsUpdate :: RelatedItemsUpdate
$sel:relatedItemsUpdate:UpdateRelatedItems' :: UpdateRelatedItems -> RelatedItemsUpdate
relatedItemsUpdate} -> RelatedItemsUpdate
relatedItemsUpdate) (\s :: UpdateRelatedItems
s@UpdateRelatedItems' {} RelatedItemsUpdate
a -> UpdateRelatedItems
s {$sel:relatedItemsUpdate:UpdateRelatedItems' :: RelatedItemsUpdate
relatedItemsUpdate = RelatedItemsUpdate
a} :: UpdateRelatedItems)
instance Core.AWSRequest UpdateRelatedItems where
type
AWSResponse UpdateRelatedItems =
UpdateRelatedItemsResponse
request :: UpdateRelatedItems -> Request UpdateRelatedItems
request = Service -> UpdateRelatedItems -> Request UpdateRelatedItems
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRelatedItems
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRelatedItems)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateRelatedItems))
-> Logger
-> Service
-> Proxy UpdateRelatedItems
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRelatedItems)))
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 -> UpdateRelatedItemsResponse
UpdateRelatedItemsResponse'
(Int -> UpdateRelatedItemsResponse)
-> Either String Int -> Either String UpdateRelatedItemsResponse
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 UpdateRelatedItems
instance Prelude.NFData UpdateRelatedItems
instance Core.ToHeaders UpdateRelatedItems where
toHeaders :: UpdateRelatedItems -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRelatedItems -> 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 UpdateRelatedItems where
toJSON :: UpdateRelatedItems -> Value
toJSON UpdateRelatedItems' {Maybe Text
Text
RelatedItemsUpdate
relatedItemsUpdate :: RelatedItemsUpdate
incidentRecordArn :: Text
clientToken :: Maybe Text
$sel:relatedItemsUpdate:UpdateRelatedItems' :: UpdateRelatedItems -> RelatedItemsUpdate
$sel:incidentRecordArn:UpdateRelatedItems' :: UpdateRelatedItems -> Text
$sel:clientToken:UpdateRelatedItems' :: UpdateRelatedItems -> 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
"incidentRecordArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
incidentRecordArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"relatedItemsUpdate" Text -> RelatedItemsUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RelatedItemsUpdate
relatedItemsUpdate)
]
)
instance Core.ToPath UpdateRelatedItems where
toPath :: UpdateRelatedItems -> ByteString
toPath = ByteString -> UpdateRelatedItems -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/updateRelatedItems"
instance Core.ToQuery UpdateRelatedItems where
toQuery :: UpdateRelatedItems -> QueryString
toQuery = QueryString -> UpdateRelatedItems -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRelatedItemsResponse = UpdateRelatedItemsResponse'
{
UpdateRelatedItemsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool
(UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool)
-> (UpdateRelatedItemsResponse
-> UpdateRelatedItemsResponse -> Bool)
-> Eq UpdateRelatedItemsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool
$c/= :: UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool
== :: UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool
$c== :: UpdateRelatedItemsResponse -> UpdateRelatedItemsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRelatedItemsResponse]
ReadPrec UpdateRelatedItemsResponse
Int -> ReadS UpdateRelatedItemsResponse
ReadS [UpdateRelatedItemsResponse]
(Int -> ReadS UpdateRelatedItemsResponse)
-> ReadS [UpdateRelatedItemsResponse]
-> ReadPrec UpdateRelatedItemsResponse
-> ReadPrec [UpdateRelatedItemsResponse]
-> Read UpdateRelatedItemsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRelatedItemsResponse]
$creadListPrec :: ReadPrec [UpdateRelatedItemsResponse]
readPrec :: ReadPrec UpdateRelatedItemsResponse
$creadPrec :: ReadPrec UpdateRelatedItemsResponse
readList :: ReadS [UpdateRelatedItemsResponse]
$creadList :: ReadS [UpdateRelatedItemsResponse]
readsPrec :: Int -> ReadS UpdateRelatedItemsResponse
$creadsPrec :: Int -> ReadS UpdateRelatedItemsResponse
Prelude.Read, Int -> UpdateRelatedItemsResponse -> ShowS
[UpdateRelatedItemsResponse] -> ShowS
UpdateRelatedItemsResponse -> String
(Int -> UpdateRelatedItemsResponse -> ShowS)
-> (UpdateRelatedItemsResponse -> String)
-> ([UpdateRelatedItemsResponse] -> ShowS)
-> Show UpdateRelatedItemsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRelatedItemsResponse] -> ShowS
$cshowList :: [UpdateRelatedItemsResponse] -> ShowS
show :: UpdateRelatedItemsResponse -> String
$cshow :: UpdateRelatedItemsResponse -> String
showsPrec :: Int -> UpdateRelatedItemsResponse -> ShowS
$cshowsPrec :: Int -> UpdateRelatedItemsResponse -> ShowS
Prelude.Show, (forall x.
UpdateRelatedItemsResponse -> Rep UpdateRelatedItemsResponse x)
-> (forall x.
Rep UpdateRelatedItemsResponse x -> UpdateRelatedItemsResponse)
-> Generic UpdateRelatedItemsResponse
forall x.
Rep UpdateRelatedItemsResponse x -> UpdateRelatedItemsResponse
forall x.
UpdateRelatedItemsResponse -> Rep UpdateRelatedItemsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRelatedItemsResponse x -> UpdateRelatedItemsResponse
$cfrom :: forall x.
UpdateRelatedItemsResponse -> Rep UpdateRelatedItemsResponse x
Prelude.Generic)
newUpdateRelatedItemsResponse ::
Prelude.Int ->
UpdateRelatedItemsResponse
newUpdateRelatedItemsResponse :: Int -> UpdateRelatedItemsResponse
newUpdateRelatedItemsResponse Int
pHttpStatus_ =
UpdateRelatedItemsResponse' :: Int -> UpdateRelatedItemsResponse
UpdateRelatedItemsResponse'
{ $sel:httpStatus:UpdateRelatedItemsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateRelatedItemsResponse_httpStatus :: Lens.Lens' UpdateRelatedItemsResponse Prelude.Int
updateRelatedItemsResponse_httpStatus :: (Int -> f Int)
-> UpdateRelatedItemsResponse -> f UpdateRelatedItemsResponse
updateRelatedItemsResponse_httpStatus = (UpdateRelatedItemsResponse -> Int)
-> (UpdateRelatedItemsResponse
-> Int -> UpdateRelatedItemsResponse)
-> Lens
UpdateRelatedItemsResponse UpdateRelatedItemsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRelatedItemsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRelatedItemsResponse' :: UpdateRelatedItemsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRelatedItemsResponse
s@UpdateRelatedItemsResponse' {} Int
a -> UpdateRelatedItemsResponse
s {$sel:httpStatus:UpdateRelatedItemsResponse' :: Int
httpStatus = Int
a} :: UpdateRelatedItemsResponse)
instance Prelude.NFData UpdateRelatedItemsResponse