{-# 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.SSM.Types.RelatedOpsItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RelatedOpsItem = RelatedOpsItem'
{
RelatedOpsItem -> Text
opsItemId :: Prelude.Text
}
deriving (RelatedOpsItem -> RelatedOpsItem -> Bool
(RelatedOpsItem -> RelatedOpsItem -> Bool)
-> (RelatedOpsItem -> RelatedOpsItem -> Bool) -> Eq RelatedOpsItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelatedOpsItem -> RelatedOpsItem -> Bool
$c/= :: RelatedOpsItem -> RelatedOpsItem -> Bool
== :: RelatedOpsItem -> RelatedOpsItem -> Bool
$c== :: RelatedOpsItem -> RelatedOpsItem -> Bool
Prelude.Eq, ReadPrec [RelatedOpsItem]
ReadPrec RelatedOpsItem
Int -> ReadS RelatedOpsItem
ReadS [RelatedOpsItem]
(Int -> ReadS RelatedOpsItem)
-> ReadS [RelatedOpsItem]
-> ReadPrec RelatedOpsItem
-> ReadPrec [RelatedOpsItem]
-> Read RelatedOpsItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelatedOpsItem]
$creadListPrec :: ReadPrec [RelatedOpsItem]
readPrec :: ReadPrec RelatedOpsItem
$creadPrec :: ReadPrec RelatedOpsItem
readList :: ReadS [RelatedOpsItem]
$creadList :: ReadS [RelatedOpsItem]
readsPrec :: Int -> ReadS RelatedOpsItem
$creadsPrec :: Int -> ReadS RelatedOpsItem
Prelude.Read, Int -> RelatedOpsItem -> ShowS
[RelatedOpsItem] -> ShowS
RelatedOpsItem -> String
(Int -> RelatedOpsItem -> ShowS)
-> (RelatedOpsItem -> String)
-> ([RelatedOpsItem] -> ShowS)
-> Show RelatedOpsItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelatedOpsItem] -> ShowS
$cshowList :: [RelatedOpsItem] -> ShowS
show :: RelatedOpsItem -> String
$cshow :: RelatedOpsItem -> String
showsPrec :: Int -> RelatedOpsItem -> ShowS
$cshowsPrec :: Int -> RelatedOpsItem -> ShowS
Prelude.Show, (forall x. RelatedOpsItem -> Rep RelatedOpsItem x)
-> (forall x. Rep RelatedOpsItem x -> RelatedOpsItem)
-> Generic RelatedOpsItem
forall x. Rep RelatedOpsItem x -> RelatedOpsItem
forall x. RelatedOpsItem -> Rep RelatedOpsItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RelatedOpsItem x -> RelatedOpsItem
$cfrom :: forall x. RelatedOpsItem -> Rep RelatedOpsItem x
Prelude.Generic)
newRelatedOpsItem ::
Prelude.Text ->
RelatedOpsItem
newRelatedOpsItem :: Text -> RelatedOpsItem
newRelatedOpsItem Text
pOpsItemId_ =
RelatedOpsItem' :: Text -> RelatedOpsItem
RelatedOpsItem' {$sel:opsItemId:RelatedOpsItem' :: Text
opsItemId = Text
pOpsItemId_}
relatedOpsItem_opsItemId :: Lens.Lens' RelatedOpsItem Prelude.Text
relatedOpsItem_opsItemId :: (Text -> f Text) -> RelatedOpsItem -> f RelatedOpsItem
relatedOpsItem_opsItemId = (RelatedOpsItem -> Text)
-> (RelatedOpsItem -> Text -> RelatedOpsItem)
-> Lens RelatedOpsItem RelatedOpsItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedOpsItem' {Text
opsItemId :: Text
$sel:opsItemId:RelatedOpsItem' :: RelatedOpsItem -> Text
opsItemId} -> Text
opsItemId) (\s :: RelatedOpsItem
s@RelatedOpsItem' {} Text
a -> RelatedOpsItem
s {$sel:opsItemId:RelatedOpsItem' :: Text
opsItemId = Text
a} :: RelatedOpsItem)
instance Core.FromJSON RelatedOpsItem where
parseJSON :: Value -> Parser RelatedOpsItem
parseJSON =
String
-> (Object -> Parser RelatedOpsItem)
-> Value
-> Parser RelatedOpsItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RelatedOpsItem"
( \Object
x ->
Text -> RelatedOpsItem
RelatedOpsItem' (Text -> RelatedOpsItem) -> Parser Text -> Parser RelatedOpsItem
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OpsItemId")
)
instance Prelude.Hashable RelatedOpsItem
instance Prelude.NFData RelatedOpsItem
instance Core.ToJSON RelatedOpsItem where
toJSON :: RelatedOpsItem -> Value
toJSON RelatedOpsItem' {Text
opsItemId :: Text
$sel:opsItemId:RelatedOpsItem' :: RelatedOpsItem -> 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
"OpsItemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
opsItemId)]
)