{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.InventoryItemAttribute
data InventoryItemSchema = InventoryItemSchema'
{
InventoryItemSchema -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
InventoryItemSchema -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
InventoryItemSchema -> Text
typeName :: Prelude.Text,
InventoryItemSchema -> NonEmpty InventoryItemAttribute
attributes :: Prelude.NonEmpty InventoryItemAttribute
}
deriving (InventoryItemSchema -> InventoryItemSchema -> Bool
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]
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
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. 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'
{ $sel:displayName:InventoryItemSchema' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
$sel:version:InventoryItemSchema' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
$sel:typeName:InventoryItemSchema' :: Text
typeName = Text
pTypeName_,
$sel:attributes:InventoryItemSchema' :: NonEmpty InventoryItemAttribute
attributes = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty InventoryItemAttribute
pAttributes_
}
inventoryItemSchema_displayName :: Lens.Lens' InventoryItemSchema (Prelude.Maybe Prelude.Text)
inventoryItemSchema_displayName :: Lens' InventoryItemSchema (Maybe Text)
inventoryItemSchema_displayName = 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_version :: Lens.Lens' InventoryItemSchema (Prelude.Maybe Prelude.Text)
inventoryItemSchema_version :: Lens' InventoryItemSchema (Maybe Text)
inventoryItemSchema_version = 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_typeName :: Lens.Lens' InventoryItemSchema Prelude.Text
inventoryItemSchema_typeName :: Lens' InventoryItemSchema Text
inventoryItemSchema_typeName = 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 :: Lens' InventoryItemSchema (NonEmpty InventoryItemAttribute)
inventoryItemSchema_attributes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON InventoryItemSchema where
parseJSON :: Value -> Parser InventoryItemSchema
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InventoryItemSchema"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> NonEmpty InventoryItemAttribute
-> InventoryItemSchema
InventoryItemSchema'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DisplayName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TypeName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Attributes")
)
instance Prelude.Hashable InventoryItemSchema where
hashWithSalt :: Int -> InventoryItemSchema -> Int
hashWithSalt Int
_salt InventoryItemSchema' {Maybe Text
NonEmpty InventoryItemAttribute
Text
attributes :: NonEmpty InventoryItemAttribute
typeName :: Text
version :: Maybe Text
displayName :: Maybe Text
$sel:attributes:InventoryItemSchema' :: InventoryItemSchema -> NonEmpty InventoryItemAttribute
$sel:typeName:InventoryItemSchema' :: InventoryItemSchema -> Text
$sel:version:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
$sel:displayName:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
typeName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty InventoryItemAttribute
attributes
instance Prelude.NFData InventoryItemSchema where
rnf :: InventoryItemSchema -> ()
rnf InventoryItemSchema' {Maybe Text
NonEmpty InventoryItemAttribute
Text
attributes :: NonEmpty InventoryItemAttribute
typeName :: Text
version :: Maybe Text
displayName :: Maybe Text
$sel:attributes:InventoryItemSchema' :: InventoryItemSchema -> NonEmpty InventoryItemAttribute
$sel:typeName:InventoryItemSchema' :: InventoryItemSchema -> Text
$sel:version:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
$sel:displayName:InventoryItemSchema' :: InventoryItemSchema -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
typeName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty InventoryItemAttribute
attributes