{-# 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.InventoryGroup 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.InventoryFilter
data InventoryGroup = InventoryGroup'
{
InventoryGroup -> Text
name :: Prelude.Text,
InventoryGroup -> NonEmpty InventoryFilter
filters :: Prelude.NonEmpty InventoryFilter
}
deriving (InventoryGroup -> InventoryGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryGroup -> InventoryGroup -> Bool
$c/= :: InventoryGroup -> InventoryGroup -> Bool
== :: InventoryGroup -> InventoryGroup -> Bool
$c== :: InventoryGroup -> InventoryGroup -> Bool
Prelude.Eq, ReadPrec [InventoryGroup]
ReadPrec InventoryGroup
Int -> ReadS InventoryGroup
ReadS [InventoryGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryGroup]
$creadListPrec :: ReadPrec [InventoryGroup]
readPrec :: ReadPrec InventoryGroup
$creadPrec :: ReadPrec InventoryGroup
readList :: ReadS [InventoryGroup]
$creadList :: ReadS [InventoryGroup]
readsPrec :: Int -> ReadS InventoryGroup
$creadsPrec :: Int -> ReadS InventoryGroup
Prelude.Read, Int -> InventoryGroup -> ShowS
[InventoryGroup] -> ShowS
InventoryGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryGroup] -> ShowS
$cshowList :: [InventoryGroup] -> ShowS
show :: InventoryGroup -> String
$cshow :: InventoryGroup -> String
showsPrec :: Int -> InventoryGroup -> ShowS
$cshowsPrec :: Int -> InventoryGroup -> ShowS
Prelude.Show, forall x. Rep InventoryGroup x -> InventoryGroup
forall x. InventoryGroup -> Rep InventoryGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InventoryGroup x -> InventoryGroup
$cfrom :: forall x. InventoryGroup -> Rep InventoryGroup x
Prelude.Generic)
newInventoryGroup ::
Prelude.Text ->
Prelude.NonEmpty InventoryFilter ->
InventoryGroup
newInventoryGroup :: Text -> NonEmpty InventoryFilter -> InventoryGroup
newInventoryGroup Text
pName_ NonEmpty InventoryFilter
pFilters_ =
InventoryGroup'
{ $sel:name:InventoryGroup' :: Text
name = Text
pName_,
$sel:filters:InventoryGroup' :: NonEmpty InventoryFilter
filters = 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 InventoryFilter
pFilters_
}
inventoryGroup_name :: Lens.Lens' InventoryGroup Prelude.Text
inventoryGroup_name :: Lens' InventoryGroup Text
inventoryGroup_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryGroup' {Text
name :: Text
$sel:name:InventoryGroup' :: InventoryGroup -> Text
name} -> Text
name) (\s :: InventoryGroup
s@InventoryGroup' {} Text
a -> InventoryGroup
s {$sel:name:InventoryGroup' :: Text
name = Text
a} :: InventoryGroup)
inventoryGroup_filters :: Lens.Lens' InventoryGroup (Prelude.NonEmpty InventoryFilter)
inventoryGroup_filters :: Lens' InventoryGroup (NonEmpty InventoryFilter)
inventoryGroup_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryGroup' {NonEmpty InventoryFilter
filters :: NonEmpty InventoryFilter
$sel:filters:InventoryGroup' :: InventoryGroup -> NonEmpty InventoryFilter
filters} -> NonEmpty InventoryFilter
filters) (\s :: InventoryGroup
s@InventoryGroup' {} NonEmpty InventoryFilter
a -> InventoryGroup
s {$sel:filters:InventoryGroup' :: NonEmpty InventoryFilter
filters = NonEmpty InventoryFilter
a} :: InventoryGroup) 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 Prelude.Hashable InventoryGroup where
hashWithSalt :: Int -> InventoryGroup -> Int
hashWithSalt Int
_salt InventoryGroup' {NonEmpty InventoryFilter
Text
filters :: NonEmpty InventoryFilter
name :: Text
$sel:filters:InventoryGroup' :: InventoryGroup -> NonEmpty InventoryFilter
$sel:name:InventoryGroup' :: InventoryGroup -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty InventoryFilter
filters
instance Prelude.NFData InventoryGroup where
rnf :: InventoryGroup -> ()
rnf InventoryGroup' {NonEmpty InventoryFilter
Text
filters :: NonEmpty InventoryFilter
name :: Text
$sel:filters:InventoryGroup' :: InventoryGroup -> NonEmpty InventoryFilter
$sel:name:InventoryGroup' :: InventoryGroup -> 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 NonEmpty InventoryFilter
filters
instance Data.ToJSON InventoryGroup where
toJSON :: InventoryGroup -> Value
toJSON InventoryGroup' {NonEmpty InventoryFilter
Text
filters :: NonEmpty InventoryFilter
name :: Text
$sel:filters:InventoryGroup' :: InventoryGroup -> NonEmpty InventoryFilter
$sel:name:InventoryGroup' :: InventoryGroup -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty InventoryFilter
filters)
]
)