{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SSMIncidents.Types.RelatedItemsUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.ItemIdentifier
import Amazonka.SSMIncidents.Types.RelatedItem
data RelatedItemsUpdate = RelatedItemsUpdate'
{
RelatedItemsUpdate -> Maybe ItemIdentifier
itemToRemove :: Prelude.Maybe ItemIdentifier,
RelatedItemsUpdate -> Maybe RelatedItem
itemToAdd :: Prelude.Maybe RelatedItem
}
deriving (RelatedItemsUpdate -> RelatedItemsUpdate -> Bool
(RelatedItemsUpdate -> RelatedItemsUpdate -> Bool)
-> (RelatedItemsUpdate -> RelatedItemsUpdate -> Bool)
-> Eq RelatedItemsUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelatedItemsUpdate -> RelatedItemsUpdate -> Bool
$c/= :: RelatedItemsUpdate -> RelatedItemsUpdate -> Bool
== :: RelatedItemsUpdate -> RelatedItemsUpdate -> Bool
$c== :: RelatedItemsUpdate -> RelatedItemsUpdate -> Bool
Prelude.Eq, ReadPrec [RelatedItemsUpdate]
ReadPrec RelatedItemsUpdate
Int -> ReadS RelatedItemsUpdate
ReadS [RelatedItemsUpdate]
(Int -> ReadS RelatedItemsUpdate)
-> ReadS [RelatedItemsUpdate]
-> ReadPrec RelatedItemsUpdate
-> ReadPrec [RelatedItemsUpdate]
-> Read RelatedItemsUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelatedItemsUpdate]
$creadListPrec :: ReadPrec [RelatedItemsUpdate]
readPrec :: ReadPrec RelatedItemsUpdate
$creadPrec :: ReadPrec RelatedItemsUpdate
readList :: ReadS [RelatedItemsUpdate]
$creadList :: ReadS [RelatedItemsUpdate]
readsPrec :: Int -> ReadS RelatedItemsUpdate
$creadsPrec :: Int -> ReadS RelatedItemsUpdate
Prelude.Read, Int -> RelatedItemsUpdate -> ShowS
[RelatedItemsUpdate] -> ShowS
RelatedItemsUpdate -> String
(Int -> RelatedItemsUpdate -> ShowS)
-> (RelatedItemsUpdate -> String)
-> ([RelatedItemsUpdate] -> ShowS)
-> Show RelatedItemsUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelatedItemsUpdate] -> ShowS
$cshowList :: [RelatedItemsUpdate] -> ShowS
show :: RelatedItemsUpdate -> String
$cshow :: RelatedItemsUpdate -> String
showsPrec :: Int -> RelatedItemsUpdate -> ShowS
$cshowsPrec :: Int -> RelatedItemsUpdate -> ShowS
Prelude.Show, (forall x. RelatedItemsUpdate -> Rep RelatedItemsUpdate x)
-> (forall x. Rep RelatedItemsUpdate x -> RelatedItemsUpdate)
-> Generic RelatedItemsUpdate
forall x. Rep RelatedItemsUpdate x -> RelatedItemsUpdate
forall x. RelatedItemsUpdate -> Rep RelatedItemsUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RelatedItemsUpdate x -> RelatedItemsUpdate
$cfrom :: forall x. RelatedItemsUpdate -> Rep RelatedItemsUpdate x
Prelude.Generic)
newRelatedItemsUpdate ::
RelatedItemsUpdate
newRelatedItemsUpdate :: RelatedItemsUpdate
newRelatedItemsUpdate =
RelatedItemsUpdate' :: Maybe ItemIdentifier -> Maybe RelatedItem -> RelatedItemsUpdate
RelatedItemsUpdate'
{ $sel:itemToRemove:RelatedItemsUpdate' :: Maybe ItemIdentifier
itemToRemove = Maybe ItemIdentifier
forall a. Maybe a
Prelude.Nothing,
$sel:itemToAdd:RelatedItemsUpdate' :: Maybe RelatedItem
itemToAdd = Maybe RelatedItem
forall a. Maybe a
Prelude.Nothing
}
relatedItemsUpdate_itemToRemove :: Lens.Lens' RelatedItemsUpdate (Prelude.Maybe ItemIdentifier)
relatedItemsUpdate_itemToRemove :: (Maybe ItemIdentifier -> f (Maybe ItemIdentifier))
-> RelatedItemsUpdate -> f RelatedItemsUpdate
relatedItemsUpdate_itemToRemove = (RelatedItemsUpdate -> Maybe ItemIdentifier)
-> (RelatedItemsUpdate
-> Maybe ItemIdentifier -> RelatedItemsUpdate)
-> Lens
RelatedItemsUpdate
RelatedItemsUpdate
(Maybe ItemIdentifier)
(Maybe ItemIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemsUpdate' {Maybe ItemIdentifier
itemToRemove :: Maybe ItemIdentifier
$sel:itemToRemove:RelatedItemsUpdate' :: RelatedItemsUpdate -> Maybe ItemIdentifier
itemToRemove} -> Maybe ItemIdentifier
itemToRemove) (\s :: RelatedItemsUpdate
s@RelatedItemsUpdate' {} Maybe ItemIdentifier
a -> RelatedItemsUpdate
s {$sel:itemToRemove:RelatedItemsUpdate' :: Maybe ItemIdentifier
itemToRemove = Maybe ItemIdentifier
a} :: RelatedItemsUpdate)
relatedItemsUpdate_itemToAdd :: Lens.Lens' RelatedItemsUpdate (Prelude.Maybe RelatedItem)
relatedItemsUpdate_itemToAdd :: (Maybe RelatedItem -> f (Maybe RelatedItem))
-> RelatedItemsUpdate -> f RelatedItemsUpdate
relatedItemsUpdate_itemToAdd = (RelatedItemsUpdate -> Maybe RelatedItem)
-> (RelatedItemsUpdate -> Maybe RelatedItem -> RelatedItemsUpdate)
-> Lens
RelatedItemsUpdate
RelatedItemsUpdate
(Maybe RelatedItem)
(Maybe RelatedItem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemsUpdate' {Maybe RelatedItem
itemToAdd :: Maybe RelatedItem
$sel:itemToAdd:RelatedItemsUpdate' :: RelatedItemsUpdate -> Maybe RelatedItem
itemToAdd} -> Maybe RelatedItem
itemToAdd) (\s :: RelatedItemsUpdate
s@RelatedItemsUpdate' {} Maybe RelatedItem
a -> RelatedItemsUpdate
s {$sel:itemToAdd:RelatedItemsUpdate' :: Maybe RelatedItem
itemToAdd = Maybe RelatedItem
a} :: RelatedItemsUpdate)
instance Prelude.Hashable RelatedItemsUpdate
instance Prelude.NFData RelatedItemsUpdate
instance Core.ToJSON RelatedItemsUpdate where
toJSON :: RelatedItemsUpdate -> Value
toJSON RelatedItemsUpdate' {Maybe ItemIdentifier
Maybe RelatedItem
itemToAdd :: Maybe RelatedItem
itemToRemove :: Maybe ItemIdentifier
$sel:itemToAdd:RelatedItemsUpdate' :: RelatedItemsUpdate -> Maybe RelatedItem
$sel:itemToRemove:RelatedItemsUpdate' :: RelatedItemsUpdate -> Maybe ItemIdentifier
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"itemToRemove" Text -> ItemIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ItemIdentifier -> Pair) -> Maybe ItemIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ItemIdentifier
itemToRemove,
(Text
"itemToAdd" Text -> RelatedItem -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RelatedItem -> Pair) -> Maybe RelatedItem -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RelatedItem
itemToAdd
]
)