{-# 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.InventoryItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InventoryItem = InventoryItem'
{
InventoryItem -> Maybe (HashMap Text Text)
context :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
InventoryItem -> Maybe Text
contentHash :: Prelude.Maybe Prelude.Text,
InventoryItem -> Maybe [HashMap Text Text]
content :: Prelude.Maybe [Prelude.HashMap Prelude.Text Prelude.Text],
InventoryItem -> Text
typeName :: Prelude.Text,
InventoryItem -> Text
schemaVersion :: Prelude.Text,
InventoryItem -> Text
captureTime :: Prelude.Text
}
deriving (InventoryItem -> InventoryItem -> Bool
(InventoryItem -> InventoryItem -> Bool)
-> (InventoryItem -> InventoryItem -> Bool) -> Eq InventoryItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryItem -> InventoryItem -> Bool
$c/= :: InventoryItem -> InventoryItem -> Bool
== :: InventoryItem -> InventoryItem -> Bool
$c== :: InventoryItem -> InventoryItem -> Bool
Prelude.Eq, ReadPrec [InventoryItem]
ReadPrec InventoryItem
Int -> ReadS InventoryItem
ReadS [InventoryItem]
(Int -> ReadS InventoryItem)
-> ReadS [InventoryItem]
-> ReadPrec InventoryItem
-> ReadPrec [InventoryItem]
-> Read InventoryItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryItem]
$creadListPrec :: ReadPrec [InventoryItem]
readPrec :: ReadPrec InventoryItem
$creadPrec :: ReadPrec InventoryItem
readList :: ReadS [InventoryItem]
$creadList :: ReadS [InventoryItem]
readsPrec :: Int -> ReadS InventoryItem
$creadsPrec :: Int -> ReadS InventoryItem
Prelude.Read, Int -> InventoryItem -> ShowS
[InventoryItem] -> ShowS
InventoryItem -> String
(Int -> InventoryItem -> ShowS)
-> (InventoryItem -> String)
-> ([InventoryItem] -> ShowS)
-> Show InventoryItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryItem] -> ShowS
$cshowList :: [InventoryItem] -> ShowS
show :: InventoryItem -> String
$cshow :: InventoryItem -> String
showsPrec :: Int -> InventoryItem -> ShowS
$cshowsPrec :: Int -> InventoryItem -> ShowS
Prelude.Show, (forall x. InventoryItem -> Rep InventoryItem x)
-> (forall x. Rep InventoryItem x -> InventoryItem)
-> Generic InventoryItem
forall x. Rep InventoryItem x -> InventoryItem
forall x. InventoryItem -> Rep InventoryItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryItem x -> InventoryItem
$cfrom :: forall x. InventoryItem -> Rep InventoryItem x
Prelude.Generic)
newInventoryItem ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
InventoryItem
newInventoryItem :: Text -> Text -> Text -> InventoryItem
newInventoryItem
Text
pTypeName_
Text
pSchemaVersion_
Text
pCaptureTime_ =
InventoryItem' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe [HashMap Text Text]
-> Text
-> Text
-> Text
-> InventoryItem
InventoryItem'
{ $sel:context:InventoryItem' :: Maybe (HashMap Text Text)
context = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:contentHash:InventoryItem' :: Maybe Text
contentHash = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:content:InventoryItem' :: Maybe [HashMap Text Text]
content = Maybe [HashMap Text Text]
forall a. Maybe a
Prelude.Nothing,
$sel:typeName:InventoryItem' :: Text
typeName = Text
pTypeName_,
$sel:schemaVersion:InventoryItem' :: Text
schemaVersion = Text
pSchemaVersion_,
$sel:captureTime:InventoryItem' :: Text
captureTime = Text
pCaptureTime_
}
inventoryItem_context :: Lens.Lens' InventoryItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
inventoryItem_context :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InventoryItem -> f InventoryItem
inventoryItem_context = (InventoryItem -> Maybe (HashMap Text Text))
-> (InventoryItem -> Maybe (HashMap Text Text) -> InventoryItem)
-> Lens
InventoryItem
InventoryItem
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Maybe (HashMap Text Text)
context :: Maybe (HashMap Text Text)
$sel:context:InventoryItem' :: InventoryItem -> Maybe (HashMap Text Text)
context} -> Maybe (HashMap Text Text)
context) (\s :: InventoryItem
s@InventoryItem' {} Maybe (HashMap Text Text)
a -> InventoryItem
s {$sel:context:InventoryItem' :: Maybe (HashMap Text Text)
context = Maybe (HashMap Text Text)
a} :: InventoryItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InventoryItem -> f InventoryItem)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InventoryItem
-> f InventoryItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
inventoryItem_contentHash :: Lens.Lens' InventoryItem (Prelude.Maybe Prelude.Text)
inventoryItem_contentHash :: (Maybe Text -> f (Maybe Text)) -> InventoryItem -> f InventoryItem
inventoryItem_contentHash = (InventoryItem -> Maybe Text)
-> (InventoryItem -> Maybe Text -> InventoryItem)
-> Lens InventoryItem InventoryItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Maybe Text
contentHash :: Maybe Text
$sel:contentHash:InventoryItem' :: InventoryItem -> Maybe Text
contentHash} -> Maybe Text
contentHash) (\s :: InventoryItem
s@InventoryItem' {} Maybe Text
a -> InventoryItem
s {$sel:contentHash:InventoryItem' :: Maybe Text
contentHash = Maybe Text
a} :: InventoryItem)
inventoryItem_content :: Lens.Lens' InventoryItem (Prelude.Maybe [Prelude.HashMap Prelude.Text Prelude.Text])
inventoryItem_content :: (Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> InventoryItem -> f InventoryItem
inventoryItem_content = (InventoryItem -> Maybe [HashMap Text Text])
-> (InventoryItem -> Maybe [HashMap Text Text] -> InventoryItem)
-> Lens
InventoryItem
InventoryItem
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Maybe [HashMap Text Text]
content :: Maybe [HashMap Text Text]
$sel:content:InventoryItem' :: InventoryItem -> Maybe [HashMap Text Text]
content} -> Maybe [HashMap Text Text]
content) (\s :: InventoryItem
s@InventoryItem' {} Maybe [HashMap Text Text]
a -> InventoryItem
s {$sel:content:InventoryItem' :: Maybe [HashMap Text Text]
content = Maybe [HashMap Text Text]
a} :: InventoryItem) ((Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> InventoryItem -> f InventoryItem)
-> ((Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> (Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> InventoryItem
-> f InventoryItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
-> Iso
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
inventoryItem_typeName :: Lens.Lens' InventoryItem Prelude.Text
inventoryItem_typeName :: (Text -> f Text) -> InventoryItem -> f InventoryItem
inventoryItem_typeName = (InventoryItem -> Text)
-> (InventoryItem -> Text -> InventoryItem)
-> Lens InventoryItem InventoryItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Text
typeName :: Text
$sel:typeName:InventoryItem' :: InventoryItem -> Text
typeName} -> Text
typeName) (\s :: InventoryItem
s@InventoryItem' {} Text
a -> InventoryItem
s {$sel:typeName:InventoryItem' :: Text
typeName = Text
a} :: InventoryItem)
inventoryItem_schemaVersion :: Lens.Lens' InventoryItem Prelude.Text
inventoryItem_schemaVersion :: (Text -> f Text) -> InventoryItem -> f InventoryItem
inventoryItem_schemaVersion = (InventoryItem -> Text)
-> (InventoryItem -> Text -> InventoryItem)
-> Lens InventoryItem InventoryItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Text
schemaVersion :: Text
$sel:schemaVersion:InventoryItem' :: InventoryItem -> Text
schemaVersion} -> Text
schemaVersion) (\s :: InventoryItem
s@InventoryItem' {} Text
a -> InventoryItem
s {$sel:schemaVersion:InventoryItem' :: Text
schemaVersion = Text
a} :: InventoryItem)
inventoryItem_captureTime :: Lens.Lens' InventoryItem Prelude.Text
inventoryItem_captureTime :: (Text -> f Text) -> InventoryItem -> f InventoryItem
inventoryItem_captureTime = (InventoryItem -> Text)
-> (InventoryItem -> Text -> InventoryItem)
-> Lens InventoryItem InventoryItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItem' {Text
captureTime :: Text
$sel:captureTime:InventoryItem' :: InventoryItem -> Text
captureTime} -> Text
captureTime) (\s :: InventoryItem
s@InventoryItem' {} Text
a -> InventoryItem
s {$sel:captureTime:InventoryItem' :: Text
captureTime = Text
a} :: InventoryItem)
instance Prelude.Hashable InventoryItem
instance Prelude.NFData InventoryItem
instance Core.ToJSON InventoryItem where
toJSON :: InventoryItem -> Value
toJSON InventoryItem' {Maybe [HashMap Text Text]
Maybe Text
Maybe (HashMap Text Text)
Text
captureTime :: Text
schemaVersion :: Text
typeName :: Text
content :: Maybe [HashMap Text Text]
contentHash :: Maybe Text
context :: Maybe (HashMap Text Text)
$sel:captureTime:InventoryItem' :: InventoryItem -> Text
$sel:schemaVersion:InventoryItem' :: InventoryItem -> Text
$sel:typeName:InventoryItem' :: InventoryItem -> Text
$sel:content:InventoryItem' :: InventoryItem -> Maybe [HashMap Text Text]
$sel:contentHash:InventoryItem' :: InventoryItem -> Maybe Text
$sel:context:InventoryItem' :: InventoryItem -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Context" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
context,
(Text
"ContentHash" 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
contentHash,
(Text
"Content" Text -> [HashMap Text Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([HashMap Text Text] -> Pair)
-> Maybe [HashMap Text Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HashMap Text Text]
content,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
typeName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SchemaVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schemaVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CaptureTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
captureTime)
]
)