{-# 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.InventoryResultEntity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.InventoryResultItem
data InventoryResultEntity = InventoryResultEntity'
{
InventoryResultEntity -> Maybe (HashMap Text InventoryResultItem)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text InventoryResultItem),
InventoryResultEntity -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (InventoryResultEntity -> InventoryResultEntity -> Bool
(InventoryResultEntity -> InventoryResultEntity -> Bool)
-> (InventoryResultEntity -> InventoryResultEntity -> Bool)
-> Eq InventoryResultEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryResultEntity -> InventoryResultEntity -> Bool
$c/= :: InventoryResultEntity -> InventoryResultEntity -> Bool
== :: InventoryResultEntity -> InventoryResultEntity -> Bool
$c== :: InventoryResultEntity -> InventoryResultEntity -> Bool
Prelude.Eq, ReadPrec [InventoryResultEntity]
ReadPrec InventoryResultEntity
Int -> ReadS InventoryResultEntity
ReadS [InventoryResultEntity]
(Int -> ReadS InventoryResultEntity)
-> ReadS [InventoryResultEntity]
-> ReadPrec InventoryResultEntity
-> ReadPrec [InventoryResultEntity]
-> Read InventoryResultEntity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryResultEntity]
$creadListPrec :: ReadPrec [InventoryResultEntity]
readPrec :: ReadPrec InventoryResultEntity
$creadPrec :: ReadPrec InventoryResultEntity
readList :: ReadS [InventoryResultEntity]
$creadList :: ReadS [InventoryResultEntity]
readsPrec :: Int -> ReadS InventoryResultEntity
$creadsPrec :: Int -> ReadS InventoryResultEntity
Prelude.Read, Int -> InventoryResultEntity -> ShowS
[InventoryResultEntity] -> ShowS
InventoryResultEntity -> String
(Int -> InventoryResultEntity -> ShowS)
-> (InventoryResultEntity -> String)
-> ([InventoryResultEntity] -> ShowS)
-> Show InventoryResultEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryResultEntity] -> ShowS
$cshowList :: [InventoryResultEntity] -> ShowS
show :: InventoryResultEntity -> String
$cshow :: InventoryResultEntity -> String
showsPrec :: Int -> InventoryResultEntity -> ShowS
$cshowsPrec :: Int -> InventoryResultEntity -> ShowS
Prelude.Show, (forall x. InventoryResultEntity -> Rep InventoryResultEntity x)
-> (forall x. Rep InventoryResultEntity x -> InventoryResultEntity)
-> Generic InventoryResultEntity
forall x. Rep InventoryResultEntity x -> InventoryResultEntity
forall x. InventoryResultEntity -> Rep InventoryResultEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryResultEntity x -> InventoryResultEntity
$cfrom :: forall x. InventoryResultEntity -> Rep InventoryResultEntity x
Prelude.Generic)
newInventoryResultEntity ::
InventoryResultEntity
newInventoryResultEntity :: InventoryResultEntity
newInventoryResultEntity =
InventoryResultEntity' :: Maybe (HashMap Text InventoryResultItem)
-> Maybe Text -> InventoryResultEntity
InventoryResultEntity'
{ $sel:data':InventoryResultEntity' :: Maybe (HashMap Text InventoryResultItem)
data' = Maybe (HashMap Text InventoryResultItem)
forall a. Maybe a
Prelude.Nothing,
$sel:id:InventoryResultEntity' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
inventoryResultEntity_data :: Lens.Lens' InventoryResultEntity (Prelude.Maybe (Prelude.HashMap Prelude.Text InventoryResultItem))
inventoryResultEntity_data :: (Maybe (HashMap Text InventoryResultItem)
-> f (Maybe (HashMap Text InventoryResultItem)))
-> InventoryResultEntity -> f InventoryResultEntity
inventoryResultEntity_data = (InventoryResultEntity -> Maybe (HashMap Text InventoryResultItem))
-> (InventoryResultEntity
-> Maybe (HashMap Text InventoryResultItem)
-> InventoryResultEntity)
-> Lens
InventoryResultEntity
InventoryResultEntity
(Maybe (HashMap Text InventoryResultItem))
(Maybe (HashMap Text InventoryResultItem))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultEntity' {Maybe (HashMap Text InventoryResultItem)
data' :: Maybe (HashMap Text InventoryResultItem)
$sel:data':InventoryResultEntity' :: InventoryResultEntity -> Maybe (HashMap Text InventoryResultItem)
data'} -> Maybe (HashMap Text InventoryResultItem)
data') (\s :: InventoryResultEntity
s@InventoryResultEntity' {} Maybe (HashMap Text InventoryResultItem)
a -> InventoryResultEntity
s {$sel:data':InventoryResultEntity' :: Maybe (HashMap Text InventoryResultItem)
data' = Maybe (HashMap Text InventoryResultItem)
a} :: InventoryResultEntity) ((Maybe (HashMap Text InventoryResultItem)
-> f (Maybe (HashMap Text InventoryResultItem)))
-> InventoryResultEntity -> f InventoryResultEntity)
-> ((Maybe (HashMap Text InventoryResultItem)
-> f (Maybe (HashMap Text InventoryResultItem)))
-> Maybe (HashMap Text InventoryResultItem)
-> f (Maybe (HashMap Text InventoryResultItem)))
-> (Maybe (HashMap Text InventoryResultItem)
-> f (Maybe (HashMap Text InventoryResultItem)))
-> InventoryResultEntity
-> f InventoryResultEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text InventoryResultItem)
(HashMap Text InventoryResultItem)
(HashMap Text InventoryResultItem)
(HashMap Text InventoryResultItem)
-> Iso
(Maybe (HashMap Text InventoryResultItem))
(Maybe (HashMap Text InventoryResultItem))
(Maybe (HashMap Text InventoryResultItem))
(Maybe (HashMap Text InventoryResultItem))
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 InventoryResultItem)
(HashMap Text InventoryResultItem)
(HashMap Text InventoryResultItem)
(HashMap Text InventoryResultItem)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
inventoryResultEntity_id :: Lens.Lens' InventoryResultEntity (Prelude.Maybe Prelude.Text)
inventoryResultEntity_id :: (Maybe Text -> f (Maybe Text))
-> InventoryResultEntity -> f InventoryResultEntity
inventoryResultEntity_id = (InventoryResultEntity -> Maybe Text)
-> (InventoryResultEntity -> Maybe Text -> InventoryResultEntity)
-> Lens
InventoryResultEntity
InventoryResultEntity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryResultEntity' {Maybe Text
id :: Maybe Text
$sel:id:InventoryResultEntity' :: InventoryResultEntity -> Maybe Text
id} -> Maybe Text
id) (\s :: InventoryResultEntity
s@InventoryResultEntity' {} Maybe Text
a -> InventoryResultEntity
s {$sel:id:InventoryResultEntity' :: Maybe Text
id = Maybe Text
a} :: InventoryResultEntity)
instance Core.FromJSON InventoryResultEntity where
parseJSON :: Value -> Parser InventoryResultEntity
parseJSON =
String
-> (Object -> Parser InventoryResultEntity)
-> Value
-> Parser InventoryResultEntity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InventoryResultEntity"
( \Object
x ->
Maybe (HashMap Text InventoryResultItem)
-> Maybe Text -> InventoryResultEntity
InventoryResultEntity'
(Maybe (HashMap Text InventoryResultItem)
-> Maybe Text -> InventoryResultEntity)
-> Parser (Maybe (HashMap Text InventoryResultItem))
-> Parser (Maybe Text -> InventoryResultEntity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap Text InventoryResultItem)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Data" Parser (Maybe (Maybe (HashMap Text InventoryResultItem)))
-> Maybe (HashMap Text InventoryResultItem)
-> Parser (Maybe (HashMap Text InventoryResultItem))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text InventoryResultItem)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> InventoryResultEntity)
-> Parser (Maybe Text) -> Parser InventoryResultEntity
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
"Id")
)
instance Prelude.Hashable InventoryResultEntity
instance Prelude.NFData InventoryResultEntity