{-# 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.InventoryItemSchema where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.InventoryItemAttribute
data InventoryItemSchema = InventoryItemSchema'
{
InventoryItemSchema -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
InventoryItemSchema -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
InventoryItemSchema -> Text
typeName :: Prelude.Text,
InventoryItemSchema -> NonEmpty InventoryItemAttribute
attributes :: Prelude.NonEmpty InventoryItemAttribute
}
deriving (InventoryItemSchema -> InventoryItemSchema -> Bool
(InventoryItemSchema -> InventoryItemSchema -> Bool)
-> (InventoryItemSchema -> InventoryItemSchema -> Bool)
-> Eq InventoryItemSchema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryItemSchema -> InventoryItemSchema -> Bool
$c/= :: InventoryItemSchema -> InventoryItemSchema -> Bool
== :: InventoryItemSchema -> InventoryItemSchema -> Bool
$c== :: InventoryItemSchema -> InventoryItemSchema -> Bool
Prelude.Eq, ReadPrec [InventoryItemSchema]
ReadPrec InventoryItemSchema
Int -> ReadS InventoryItemSchema
ReadS [InventoryItemSchema]
(Int -> ReadS InventoryItemSchema)
-> ReadS [InventoryItemSchema]
-> ReadPrec InventoryItemSchema
-> ReadPrec [InventoryItemSchema]
-> Read InventoryItemSchema
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryItemSchema]
$creadListPrec :: ReadPrec [InventoryItemSchema]
readPrec :: ReadPrec InventoryItemSchema
$creadPrec :: ReadPrec InventoryItemSchema
readList :: ReadS [InventoryItemSchema]
$creadList :: ReadS [InventoryItemSchema]
readsPrec :: Int -> ReadS InventoryItemSchema
$creadsPrec :: Int -> ReadS InventoryItemSchema
Prelude.Read, Int -> InventoryItemSchema -> ShowS
[InventoryItemSchema] -> ShowS
InventoryItemSchema -> String
(Int -> InventoryItemSchema -> ShowS)
-> (InventoryItemSchema -> String)
-> ([InventoryItemSchema] -> ShowS)
-> Show InventoryItemSchema
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryItemSchema] -> ShowS
$cshowList :: [InventoryItemSchema] -> ShowS
show :: InventoryItemSchema -> String
$cshow :: InventoryItemSchema -> String
showsPrec :: Int -> InventoryItemSchema -> ShowS
$cshowsPrec :: Int -> InventoryItemSchema -> ShowS
Prelude.Show, (forall x. InventoryItemSchema -> Rep InventoryItemSchema x)
-> (forall x. Rep InventoryItemSchema x -> InventoryItemSchema)
-> Generic InventoryItemSchema
forall x. Rep InventoryItemSchema x -> InventoryItemSchema
forall x. InventoryItemSchema -> Rep InventoryItemSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryItemSchema x -> InventoryItemSchema
$cfrom :: forall x. InventoryItemSchema -> Rep InventoryItemSchema x
Prelude.Generic)
newInventoryItemSchema ::
Prelude.Text ->
Prelude.NonEmpty InventoryItemAttribute ->
InventoryItemSchema
newInventoryItemSchema :: Text -> NonEmpty InventoryItemAttribute -> InventoryItemSchema
newInventoryItemSchema Text
pTypeName_ NonEmpty InventoryItemAttribute
pAttributes_ =
InventoryItemSchema' :: Maybe Text
-> Maybe Text
-> Text
-> NonEmpty InventoryItemAttribute
-> InventoryItemSchema
InventoryItemSchema'
{ $sel:version:InventoryItemSchema' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:displayName:InventoryItemSchema' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:typeName:InventoryItemSchema' :: Text
typeName = Text
pTypeName_,
$sel:attributes:InventoryItemSchema' :: NonEmpty InventoryItemAttribute
attributes = Tagged
(NonEmpty InventoryItemAttribute)
(Identity (NonEmpty InventoryItemAttribute))
-> Tagged
(NonEmpty InventoryItemAttribute)
(Identity (NonEmpty InventoryItemAttribute))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty InventoryItemAttribute)
(Identity (NonEmpty InventoryItemAttribute))
-> Tagged
(NonEmpty InventoryItemAttribute)
(Identity (NonEmpty InventoryItemAttribute)))
-> NonEmpty InventoryItemAttribute
-> NonEmpty InventoryItemAttribute
forall t b. AReview t b -> b -> t
Lens.# NonEmpty InventoryItemAttribute
pAttributes_
}
inventoryItemSchema_version :: Lens.Lens' InventoryItemSchema (Prelude.Maybe Prelude.Text)
inventoryItemSchema_version :: (Maybe Text -> f (Maybe Text))
-> InventoryItemSchema -> f InventoryItemSchema
inventoryItemSchema_version = (InventoryItemSchema -> Maybe Text)
-> (InventoryItemSchema -> Maybe Text -> InventoryItemSchema)
-> Lens
InventoryItemSchema InventoryItemSchema (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemSchema' {Maybe Text
version :: Maybe Text
$sel:version:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
version} -> Maybe Text
version) (\s :: InventoryItemSchema
s@InventoryItemSchema' {} Maybe Text
a -> InventoryItemSchema
s {$sel:version:InventoryItemSchema' :: Maybe Text
version = Maybe Text
a} :: InventoryItemSchema)
inventoryItemSchema_displayName :: Lens.Lens' InventoryItemSchema (Prelude.Maybe Prelude.Text)
inventoryItemSchema_displayName :: (Maybe Text -> f (Maybe Text))
-> InventoryItemSchema -> f InventoryItemSchema
inventoryItemSchema_displayName = (InventoryItemSchema -> Maybe Text)
-> (InventoryItemSchema -> Maybe Text -> InventoryItemSchema)
-> Lens
InventoryItemSchema InventoryItemSchema (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemSchema' {Maybe Text
displayName :: Maybe Text
$sel:displayName:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: InventoryItemSchema
s@InventoryItemSchema' {} Maybe Text
a -> InventoryItemSchema
s {$sel:displayName:InventoryItemSchema' :: Maybe Text
displayName = Maybe Text
a} :: InventoryItemSchema)
inventoryItemSchema_typeName :: Lens.Lens' InventoryItemSchema Prelude.Text
inventoryItemSchema_typeName :: (Text -> f Text) -> InventoryItemSchema -> f InventoryItemSchema
inventoryItemSchema_typeName = (InventoryItemSchema -> Text)
-> (InventoryItemSchema -> Text -> InventoryItemSchema)
-> Lens InventoryItemSchema InventoryItemSchema Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemSchema' {Text
typeName :: Text
$sel:typeName:InventoryItemSchema' :: InventoryItemSchema -> Text
typeName} -> Text
typeName) (\s :: InventoryItemSchema
s@InventoryItemSchema' {} Text
a -> InventoryItemSchema
s {$sel:typeName:InventoryItemSchema' :: Text
typeName = Text
a} :: InventoryItemSchema)
inventoryItemSchema_attributes :: Lens.Lens' InventoryItemSchema (Prelude.NonEmpty InventoryItemAttribute)
inventoryItemSchema_attributes :: (NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> InventoryItemSchema -> f InventoryItemSchema
inventoryItemSchema_attributes = (InventoryItemSchema -> NonEmpty InventoryItemAttribute)
-> (InventoryItemSchema
-> NonEmpty InventoryItemAttribute -> InventoryItemSchema)
-> Lens
InventoryItemSchema
InventoryItemSchema
(NonEmpty InventoryItemAttribute)
(NonEmpty InventoryItemAttribute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemSchema' {NonEmpty InventoryItemAttribute
attributes :: NonEmpty InventoryItemAttribute
$sel:attributes:InventoryItemSchema' :: InventoryItemSchema -> NonEmpty InventoryItemAttribute
attributes} -> NonEmpty InventoryItemAttribute
attributes) (\s :: InventoryItemSchema
s@InventoryItemSchema' {} NonEmpty InventoryItemAttribute
a -> InventoryItemSchema
s {$sel:attributes:InventoryItemSchema' :: NonEmpty InventoryItemAttribute
attributes = NonEmpty InventoryItemAttribute
a} :: InventoryItemSchema) ((NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> InventoryItemSchema -> f InventoryItemSchema)
-> ((NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> (NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> InventoryItemSchema
-> f InventoryItemSchema
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute))
-> NonEmpty InventoryItemAttribute
-> f (NonEmpty InventoryItemAttribute)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON InventoryItemSchema where
parseJSON :: Value -> Parser InventoryItemSchema
parseJSON =
String
-> (Object -> Parser InventoryItemSchema)
-> Value
-> Parser InventoryItemSchema
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InventoryItemSchema"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> NonEmpty InventoryItemAttribute
-> InventoryItemSchema
InventoryItemSchema'
(Maybe Text
-> Maybe Text
-> Text
-> NonEmpty InventoryItemAttribute
-> InventoryItemSchema)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Text -> NonEmpty InventoryItemAttribute -> InventoryItemSchema)
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
"Version")
Parser
(Maybe Text
-> Text -> NonEmpty InventoryItemAttribute -> InventoryItemSchema)
-> Parser (Maybe Text)
-> Parser
(Text -> NonEmpty InventoryItemAttribute -> InventoryItemSchema)
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
"DisplayName")
Parser
(Text -> NonEmpty InventoryItemAttribute -> InventoryItemSchema)
-> Parser Text
-> Parser (NonEmpty InventoryItemAttribute -> InventoryItemSchema)
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 (NonEmpty InventoryItemAttribute -> InventoryItemSchema)
-> Parser (NonEmpty InventoryItemAttribute)
-> Parser InventoryItemSchema
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty InventoryItemAttribute)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Attributes")
)
instance Prelude.Hashable InventoryItemSchema
instance Prelude.NFData InventoryItemSchema