{-# 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.InventoryResultItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InventoryResultItem = InventoryResultItem'
{
InventoryResultItem -> Maybe Text
contentHash :: Prelude.Maybe Prelude.Text,
InventoryResultItem -> Maybe Text
captureTime :: Prelude.Maybe Prelude.Text,
InventoryResultItem -> Text
typeName :: Prelude.Text,
InventoryResultItem -> Text
schemaVersion :: Prelude.Text,
InventoryResultItem -> [HashMap Text Text]
content :: [Prelude.HashMap Prelude.Text Prelude.Text]
}
deriving (InventoryResultItem -> InventoryResultItem -> Bool
(InventoryResultItem -> InventoryResultItem -> Bool)
-> (InventoryResultItem -> InventoryResultItem -> Bool)
-> Eq InventoryResultItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryResultItem -> InventoryResultItem -> Bool
$c/= :: InventoryResultItem -> InventoryResultItem -> Bool
== :: InventoryResultItem -> InventoryResultItem -> Bool
$c== :: InventoryResultItem -> InventoryResultItem -> Bool
Prelude.Eq, ReadPrec [InventoryResultItem]
ReadPrec InventoryResultItem
Int -> ReadS InventoryResultItem
ReadS [InventoryResultItem]
(Int -> ReadS InventoryResultItem)
-> ReadS [InventoryResultItem]
-> ReadPrec InventoryResultItem
-> ReadPrec [InventoryResultItem]
-> Read InventoryResultItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryResultItem]
$creadListPrec :: ReadPrec [InventoryResultItem]
readPrec :: ReadPrec InventoryResultItem
$creadPrec :: ReadPrec InventoryResultItem
readList :: ReadS [InventoryResultItem]
$creadList :: ReadS [InventoryResultItem]
readsPrec :: Int -> ReadS InventoryResultItem
$creadsPrec :: Int -> ReadS InventoryResultItem
Prelude.Read, Int -> InventoryResultItem -> ShowS
[InventoryResultItem] -> ShowS
InventoryResultItem -> String
(Int -> InventoryResultItem -> ShowS)
-> (InventoryResultItem -> String)
-> ([InventoryResultItem] -> ShowS)
-> Show InventoryResultItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryResultItem] -> ShowS
$cshowList :: [InventoryResultItem] -> ShowS
show :: InventoryResultItem -> String
$cshow :: InventoryResultItem -> String
showsPrec :: Int -> InventoryResultItem -> ShowS
$cshowsPrec :: Int -> InventoryResultItem -> ShowS
Prelude.Show, (forall x. InventoryResultItem -> Rep InventoryResultItem x)
-> (forall x. Rep InventoryResultItem x -> InventoryResultItem)
-> Generic InventoryResultItem
forall x. Rep InventoryResultItem x -> InventoryResultItem
forall x. InventoryResultItem -> Rep InventoryResultItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryResultItem x -> InventoryResultItem
$cfrom :: forall x. InventoryResultItem -> Rep InventoryResultItem x
Prelude.Generic)
newInventoryResultItem ::
Prelude.Text ->
Prelude.Text ->
InventoryResultItem
newInventoryResultItem :: Text -> Text -> InventoryResultItem
newInventoryResultItem Text
pTypeName_ Text
pSchemaVersion_ =
InventoryResultItem' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> [HashMap Text Text]
-> InventoryResultItem
InventoryResultItem'
{ $sel:contentHash:InventoryResultItem' :: Maybe Text
contentHash = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:captureTime:InventoryResultItem' :: Maybe Text
captureTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:typeName:InventoryResultItem' :: Text
typeName = Text
pTypeName_,
$sel:schemaVersion:InventoryResultItem' :: Text
schemaVersion = Text
pSchemaVersion_,
$sel:content:InventoryResultItem' :: [HashMap Text Text]
content = [HashMap Text Text]
forall a. Monoid a => a
Prelude.mempty
}
inventoryResultItem_contentHash :: Lens.Lens' InventoryResultItem (Prelude.Maybe Prelude.Text)
inventoryResultItem_contentHash :: (Maybe Text -> f (Maybe Text))
-> InventoryResultItem -> f InventoryResultItem
inventoryResultItem_contentHash = (InventoryResultItem -> Maybe Text)
-> (InventoryResultItem -> Maybe Text -> InventoryResultItem)
-> Lens
InventoryResultItem InventoryResultItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultItem' {Maybe Text
contentHash :: Maybe Text
$sel:contentHash:InventoryResultItem' :: InventoryResultItem -> Maybe Text
contentHash} -> Maybe Text
contentHash) (\s :: InventoryResultItem
s@InventoryResultItem' {} Maybe Text
a -> InventoryResultItem
s {$sel:contentHash:InventoryResultItem' :: Maybe Text
contentHash = Maybe Text
a} :: InventoryResultItem)
inventoryResultItem_captureTime :: Lens.Lens' InventoryResultItem (Prelude.Maybe Prelude.Text)
inventoryResultItem_captureTime :: (Maybe Text -> f (Maybe Text))
-> InventoryResultItem -> f InventoryResultItem
inventoryResultItem_captureTime = (InventoryResultItem -> Maybe Text)
-> (InventoryResultItem -> Maybe Text -> InventoryResultItem)
-> Lens
InventoryResultItem InventoryResultItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultItem' {Maybe Text
captureTime :: Maybe Text
$sel:captureTime:InventoryResultItem' :: InventoryResultItem -> Maybe Text
captureTime} -> Maybe Text
captureTime) (\s :: InventoryResultItem
s@InventoryResultItem' {} Maybe Text
a -> InventoryResultItem
s {$sel:captureTime:InventoryResultItem' :: Maybe Text
captureTime = Maybe Text
a} :: InventoryResultItem)
inventoryResultItem_typeName :: Lens.Lens' InventoryResultItem Prelude.Text
inventoryResultItem_typeName :: (Text -> f Text) -> InventoryResultItem -> f InventoryResultItem
inventoryResultItem_typeName = (InventoryResultItem -> Text)
-> (InventoryResultItem -> Text -> InventoryResultItem)
-> Lens InventoryResultItem InventoryResultItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultItem' {Text
typeName :: Text
$sel:typeName:InventoryResultItem' :: InventoryResultItem -> Text
typeName} -> Text
typeName) (\s :: InventoryResultItem
s@InventoryResultItem' {} Text
a -> InventoryResultItem
s {$sel:typeName:InventoryResultItem' :: Text
typeName = Text
a} :: InventoryResultItem)
inventoryResultItem_schemaVersion :: Lens.Lens' InventoryResultItem Prelude.Text
inventoryResultItem_schemaVersion :: (Text -> f Text) -> InventoryResultItem -> f InventoryResultItem
inventoryResultItem_schemaVersion = (InventoryResultItem -> Text)
-> (InventoryResultItem -> Text -> InventoryResultItem)
-> Lens InventoryResultItem InventoryResultItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultItem' {Text
schemaVersion :: Text
$sel:schemaVersion:InventoryResultItem' :: InventoryResultItem -> Text
schemaVersion} -> Text
schemaVersion) (\s :: InventoryResultItem
s@InventoryResultItem' {} Text
a -> InventoryResultItem
s {$sel:schemaVersion:InventoryResultItem' :: Text
schemaVersion = Text
a} :: InventoryResultItem)
inventoryResultItem_content :: Lens.Lens' InventoryResultItem [Prelude.HashMap Prelude.Text Prelude.Text]
inventoryResultItem_content :: ([HashMap Text Text] -> f [HashMap Text Text])
-> InventoryResultItem -> f InventoryResultItem
inventoryResultItem_content = (InventoryResultItem -> [HashMap Text Text])
-> (InventoryResultItem
-> [HashMap Text Text] -> InventoryResultItem)
-> Lens
InventoryResultItem
InventoryResultItem
[HashMap Text Text]
[HashMap Text Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultItem' {[HashMap Text Text]
content :: [HashMap Text Text]
$sel:content:InventoryResultItem' :: InventoryResultItem -> [HashMap Text Text]
content} -> [HashMap Text Text]
content) (\s :: InventoryResultItem
s@InventoryResultItem' {} [HashMap Text Text]
a -> InventoryResultItem
s {$sel:content:InventoryResultItem' :: [HashMap Text Text]
content = [HashMap Text Text]
a} :: InventoryResultItem) (([HashMap Text Text] -> f [HashMap Text Text])
-> InventoryResultItem -> f InventoryResultItem)
-> (([HashMap Text Text] -> f [HashMap Text Text])
-> [HashMap Text Text] -> f [HashMap Text Text])
-> ([HashMap Text Text] -> f [HashMap Text Text])
-> InventoryResultItem
-> f InventoryResultItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HashMap Text Text] -> f [HashMap Text Text])
-> [HashMap Text Text] -> f [HashMap Text Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON InventoryResultItem where
parseJSON :: Value -> Parser InventoryResultItem
parseJSON =
String
-> (Object -> Parser InventoryResultItem)
-> Value
-> Parser InventoryResultItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InventoryResultItem"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> Text
-> [HashMap Text Text]
-> InventoryResultItem
InventoryResultItem'
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> [HashMap Text Text]
-> InventoryResultItem)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Text -> Text -> [HashMap Text Text] -> InventoryResultItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentHash")
Parser
(Maybe Text
-> Text -> Text -> [HashMap Text Text] -> InventoryResultItem)
-> Parser (Maybe Text)
-> Parser
(Text -> Text -> [HashMap Text Text] -> InventoryResultItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CaptureTime")
Parser (Text -> Text -> [HashMap Text Text] -> InventoryResultItem)
-> Parser Text
-> Parser (Text -> [HashMap Text Text] -> InventoryResultItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TypeName")
Parser (Text -> [HashMap Text Text] -> InventoryResultItem)
-> Parser Text
-> Parser ([HashMap Text Text] -> InventoryResultItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SchemaVersion")
Parser ([HashMap Text Text] -> InventoryResultItem)
-> Parser [HashMap Text Text] -> Parser InventoryResultItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [HashMap Text Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Content" Parser (Maybe [HashMap Text Text])
-> [HashMap Text Text] -> Parser [HashMap Text Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [HashMap Text Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable InventoryResultItem
instance Prelude.NFData InventoryResultItem