{-# 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.InventoryItemAttribute 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.InventoryAttributeDataType
data InventoryItemAttribute = InventoryItemAttribute'
{
InventoryItemAttribute -> Text
name :: Prelude.Text,
InventoryItemAttribute -> InventoryAttributeDataType
dataType :: InventoryAttributeDataType
}
deriving (InventoryItemAttribute -> InventoryItemAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryItemAttribute -> InventoryItemAttribute -> Bool
$c/= :: InventoryItemAttribute -> InventoryItemAttribute -> Bool
== :: InventoryItemAttribute -> InventoryItemAttribute -> Bool
$c== :: InventoryItemAttribute -> InventoryItemAttribute -> Bool
Prelude.Eq, ReadPrec [InventoryItemAttribute]
ReadPrec InventoryItemAttribute
Int -> ReadS InventoryItemAttribute
ReadS [InventoryItemAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryItemAttribute]
$creadListPrec :: ReadPrec [InventoryItemAttribute]
readPrec :: ReadPrec InventoryItemAttribute
$creadPrec :: ReadPrec InventoryItemAttribute
readList :: ReadS [InventoryItemAttribute]
$creadList :: ReadS [InventoryItemAttribute]
readsPrec :: Int -> ReadS InventoryItemAttribute
$creadsPrec :: Int -> ReadS InventoryItemAttribute
Prelude.Read, Int -> InventoryItemAttribute -> ShowS
[InventoryItemAttribute] -> ShowS
InventoryItemAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryItemAttribute] -> ShowS
$cshowList :: [InventoryItemAttribute] -> ShowS
show :: InventoryItemAttribute -> String
$cshow :: InventoryItemAttribute -> String
showsPrec :: Int -> InventoryItemAttribute -> ShowS
$cshowsPrec :: Int -> InventoryItemAttribute -> ShowS
Prelude.Show, forall x. Rep InventoryItemAttribute x -> InventoryItemAttribute
forall x. InventoryItemAttribute -> Rep InventoryItemAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryItemAttribute x -> InventoryItemAttribute
$cfrom :: forall x. InventoryItemAttribute -> Rep InventoryItemAttribute x
Prelude.Generic)
newInventoryItemAttribute ::
Prelude.Text ->
InventoryAttributeDataType ->
InventoryItemAttribute
newInventoryItemAttribute :: Text -> InventoryAttributeDataType -> InventoryItemAttribute
newInventoryItemAttribute Text
pName_ InventoryAttributeDataType
pDataType_ =
InventoryItemAttribute'
{ $sel:name:InventoryItemAttribute' :: Text
name = Text
pName_,
$sel:dataType:InventoryItemAttribute' :: InventoryAttributeDataType
dataType = InventoryAttributeDataType
pDataType_
}
inventoryItemAttribute_name :: Lens.Lens' InventoryItemAttribute Prelude.Text
inventoryItemAttribute_name :: Lens' InventoryItemAttribute Text
inventoryItemAttribute_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemAttribute' {Text
name :: Text
$sel:name:InventoryItemAttribute' :: InventoryItemAttribute -> Text
name} -> Text
name) (\s :: InventoryItemAttribute
s@InventoryItemAttribute' {} Text
a -> InventoryItemAttribute
s {$sel:name:InventoryItemAttribute' :: Text
name = Text
a} :: InventoryItemAttribute)
inventoryItemAttribute_dataType :: Lens.Lens' InventoryItemAttribute InventoryAttributeDataType
inventoryItemAttribute_dataType :: Lens' InventoryItemAttribute InventoryAttributeDataType
inventoryItemAttribute_dataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryItemAttribute' {InventoryAttributeDataType
dataType :: InventoryAttributeDataType
$sel:dataType:InventoryItemAttribute' :: InventoryItemAttribute -> InventoryAttributeDataType
dataType} -> InventoryAttributeDataType
dataType) (\s :: InventoryItemAttribute
s@InventoryItemAttribute' {} InventoryAttributeDataType
a -> InventoryItemAttribute
s {$sel:dataType:InventoryItemAttribute' :: InventoryAttributeDataType
dataType = InventoryAttributeDataType
a} :: InventoryItemAttribute)
instance Data.FromJSON InventoryItemAttribute where
parseJSON :: Value -> Parser InventoryItemAttribute
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InventoryItemAttribute"
( \Object
x ->
Text -> InventoryAttributeDataType -> InventoryItemAttribute
InventoryItemAttribute'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
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
"DataType")
)
instance Prelude.Hashable InventoryItemAttribute where
hashWithSalt :: Int -> InventoryItemAttribute -> Int
hashWithSalt Int
_salt InventoryItemAttribute' {Text
InventoryAttributeDataType
dataType :: InventoryAttributeDataType
name :: Text
$sel:dataType:InventoryItemAttribute' :: InventoryItemAttribute -> InventoryAttributeDataType
$sel:name:InventoryItemAttribute' :: InventoryItemAttribute -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InventoryAttributeDataType
dataType
instance Prelude.NFData InventoryItemAttribute where
rnf :: InventoryItemAttribute -> ()
rnf InventoryItemAttribute' {Text
InventoryAttributeDataType
dataType :: InventoryAttributeDataType
name :: Text
$sel:dataType:InventoryItemAttribute' :: InventoryItemAttribute -> InventoryAttributeDataType
$sel:name:InventoryItemAttribute' :: InventoryItemAttribute -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InventoryAttributeDataType
dataType