{-# 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.OpsAggregator where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.OpsFilter
data OpsAggregator = OpsAggregator'
{
OpsAggregator -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
OpsAggregator -> Maybe (NonEmpty OpsAggregator)
aggregators :: Prelude.Maybe (Prelude.NonEmpty OpsAggregator),
OpsAggregator -> Maybe (HashMap Text Text)
values :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
OpsAggregator -> Maybe (NonEmpty OpsFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty OpsFilter),
OpsAggregator -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text,
OpsAggregator -> Maybe Text
aggregatorType :: Prelude.Maybe Prelude.Text
}
deriving (OpsAggregator -> OpsAggregator -> Bool
(OpsAggregator -> OpsAggregator -> Bool)
-> (OpsAggregator -> OpsAggregator -> Bool) -> Eq OpsAggregator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsAggregator -> OpsAggregator -> Bool
$c/= :: OpsAggregator -> OpsAggregator -> Bool
== :: OpsAggregator -> OpsAggregator -> Bool
$c== :: OpsAggregator -> OpsAggregator -> Bool
Prelude.Eq, ReadPrec [OpsAggregator]
ReadPrec OpsAggregator
Int -> ReadS OpsAggregator
ReadS [OpsAggregator]
(Int -> ReadS OpsAggregator)
-> ReadS [OpsAggregator]
-> ReadPrec OpsAggregator
-> ReadPrec [OpsAggregator]
-> Read OpsAggregator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsAggregator]
$creadListPrec :: ReadPrec [OpsAggregator]
readPrec :: ReadPrec OpsAggregator
$creadPrec :: ReadPrec OpsAggregator
readList :: ReadS [OpsAggregator]
$creadList :: ReadS [OpsAggregator]
readsPrec :: Int -> ReadS OpsAggregator
$creadsPrec :: Int -> ReadS OpsAggregator
Prelude.Read, Int -> OpsAggregator -> ShowS
[OpsAggregator] -> ShowS
OpsAggregator -> String
(Int -> OpsAggregator -> ShowS)
-> (OpsAggregator -> String)
-> ([OpsAggregator] -> ShowS)
-> Show OpsAggregator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsAggregator] -> ShowS
$cshowList :: [OpsAggregator] -> ShowS
show :: OpsAggregator -> String
$cshow :: OpsAggregator -> String
showsPrec :: Int -> OpsAggregator -> ShowS
$cshowsPrec :: Int -> OpsAggregator -> ShowS
Prelude.Show, (forall x. OpsAggregator -> Rep OpsAggregator x)
-> (forall x. Rep OpsAggregator x -> OpsAggregator)
-> Generic OpsAggregator
forall x. Rep OpsAggregator x -> OpsAggregator
forall x. OpsAggregator -> Rep OpsAggregator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsAggregator x -> OpsAggregator
$cfrom :: forall x. OpsAggregator -> Rep OpsAggregator x
Prelude.Generic)
newOpsAggregator ::
OpsAggregator
newOpsAggregator :: OpsAggregator
newOpsAggregator =
OpsAggregator' :: Maybe Text
-> Maybe (NonEmpty OpsAggregator)
-> Maybe (HashMap Text Text)
-> Maybe (NonEmpty OpsFilter)
-> Maybe Text
-> Maybe Text
-> OpsAggregator
OpsAggregator'
{ $sel:typeName:OpsAggregator' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aggregators:OpsAggregator' :: Maybe (NonEmpty OpsAggregator)
aggregators = Maybe (NonEmpty OpsAggregator)
forall a. Maybe a
Prelude.Nothing,
$sel:values:OpsAggregator' :: Maybe (HashMap Text Text)
values = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:filters:OpsAggregator' :: Maybe (NonEmpty OpsFilter)
filters = Maybe (NonEmpty OpsFilter)
forall a. Maybe a
Prelude.Nothing,
$sel:attributeName:OpsAggregator' :: Maybe Text
attributeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aggregatorType:OpsAggregator' :: Maybe Text
aggregatorType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
opsAggregator_typeName :: Lens.Lens' OpsAggregator (Prelude.Maybe Prelude.Text)
opsAggregator_typeName :: (Maybe Text -> f (Maybe Text)) -> OpsAggregator -> f OpsAggregator
opsAggregator_typeName = (OpsAggregator -> Maybe Text)
-> (OpsAggregator -> Maybe Text -> OpsAggregator)
-> Lens OpsAggregator OpsAggregator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe Text
typeName :: Maybe Text
$sel:typeName:OpsAggregator' :: OpsAggregator -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe Text
a -> OpsAggregator
s {$sel:typeName:OpsAggregator' :: Maybe Text
typeName = Maybe Text
a} :: OpsAggregator)
opsAggregator_aggregators :: Lens.Lens' OpsAggregator (Prelude.Maybe (Prelude.NonEmpty OpsAggregator))
opsAggregator_aggregators :: (Maybe (NonEmpty OpsAggregator)
-> f (Maybe (NonEmpty OpsAggregator)))
-> OpsAggregator -> f OpsAggregator
opsAggregator_aggregators = (OpsAggregator -> Maybe (NonEmpty OpsAggregator))
-> (OpsAggregator
-> Maybe (NonEmpty OpsAggregator) -> OpsAggregator)
-> Lens
OpsAggregator
OpsAggregator
(Maybe (NonEmpty OpsAggregator))
(Maybe (NonEmpty OpsAggregator))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe (NonEmpty OpsAggregator)
aggregators :: Maybe (NonEmpty OpsAggregator)
$sel:aggregators:OpsAggregator' :: OpsAggregator -> Maybe (NonEmpty OpsAggregator)
aggregators} -> Maybe (NonEmpty OpsAggregator)
aggregators) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe (NonEmpty OpsAggregator)
a -> OpsAggregator
s {$sel:aggregators:OpsAggregator' :: Maybe (NonEmpty OpsAggregator)
aggregators = Maybe (NonEmpty OpsAggregator)
a} :: OpsAggregator) ((Maybe (NonEmpty OpsAggregator)
-> f (Maybe (NonEmpty OpsAggregator)))
-> OpsAggregator -> f OpsAggregator)
-> ((Maybe (NonEmpty OpsAggregator)
-> f (Maybe (NonEmpty OpsAggregator)))
-> Maybe (NonEmpty OpsAggregator)
-> f (Maybe (NonEmpty OpsAggregator)))
-> (Maybe (NonEmpty OpsAggregator)
-> f (Maybe (NonEmpty OpsAggregator)))
-> OpsAggregator
-> f OpsAggregator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
-> Iso
(Maybe (NonEmpty OpsAggregator))
(Maybe (NonEmpty OpsAggregator))
(Maybe (NonEmpty OpsAggregator))
(Maybe (NonEmpty OpsAggregator))
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
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
(NonEmpty OpsAggregator)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
opsAggregator_values :: Lens.Lens' OpsAggregator (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
opsAggregator_values :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OpsAggregator -> f OpsAggregator
opsAggregator_values = (OpsAggregator -> Maybe (HashMap Text Text))
-> (OpsAggregator -> Maybe (HashMap Text Text) -> OpsAggregator)
-> Lens
OpsAggregator
OpsAggregator
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe (HashMap Text Text)
values :: Maybe (HashMap Text Text)
$sel:values:OpsAggregator' :: OpsAggregator -> Maybe (HashMap Text Text)
values} -> Maybe (HashMap Text Text)
values) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe (HashMap Text Text)
a -> OpsAggregator
s {$sel:values:OpsAggregator' :: Maybe (HashMap Text Text)
values = Maybe (HashMap Text Text)
a} :: OpsAggregator) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OpsAggregator -> f OpsAggregator)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OpsAggregator
-> f OpsAggregator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
opsAggregator_filters :: Lens.Lens' OpsAggregator (Prelude.Maybe (Prelude.NonEmpty OpsFilter))
opsAggregator_filters :: (Maybe (NonEmpty OpsFilter) -> f (Maybe (NonEmpty OpsFilter)))
-> OpsAggregator -> f OpsAggregator
opsAggregator_filters = (OpsAggregator -> Maybe (NonEmpty OpsFilter))
-> (OpsAggregator -> Maybe (NonEmpty OpsFilter) -> OpsAggregator)
-> Lens
OpsAggregator
OpsAggregator
(Maybe (NonEmpty OpsFilter))
(Maybe (NonEmpty OpsFilter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe (NonEmpty OpsFilter)
filters :: Maybe (NonEmpty OpsFilter)
$sel:filters:OpsAggregator' :: OpsAggregator -> Maybe (NonEmpty OpsFilter)
filters} -> Maybe (NonEmpty OpsFilter)
filters) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe (NonEmpty OpsFilter)
a -> OpsAggregator
s {$sel:filters:OpsAggregator' :: Maybe (NonEmpty OpsFilter)
filters = Maybe (NonEmpty OpsFilter)
a} :: OpsAggregator) ((Maybe (NonEmpty OpsFilter) -> f (Maybe (NonEmpty OpsFilter)))
-> OpsAggregator -> f OpsAggregator)
-> ((Maybe (NonEmpty OpsFilter) -> f (Maybe (NonEmpty OpsFilter)))
-> Maybe (NonEmpty OpsFilter) -> f (Maybe (NonEmpty OpsFilter)))
-> (Maybe (NonEmpty OpsFilter) -> f (Maybe (NonEmpty OpsFilter)))
-> OpsAggregator
-> f OpsAggregator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
-> Iso
(Maybe (NonEmpty OpsFilter))
(Maybe (NonEmpty OpsFilter))
(Maybe (NonEmpty OpsFilter))
(Maybe (NonEmpty OpsFilter))
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
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
(NonEmpty OpsFilter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
opsAggregator_attributeName :: Lens.Lens' OpsAggregator (Prelude.Maybe Prelude.Text)
opsAggregator_attributeName :: (Maybe Text -> f (Maybe Text)) -> OpsAggregator -> f OpsAggregator
opsAggregator_attributeName = (OpsAggregator -> Maybe Text)
-> (OpsAggregator -> Maybe Text -> OpsAggregator)
-> Lens OpsAggregator OpsAggregator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:OpsAggregator' :: OpsAggregator -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe Text
a -> OpsAggregator
s {$sel:attributeName:OpsAggregator' :: Maybe Text
attributeName = Maybe Text
a} :: OpsAggregator)
opsAggregator_aggregatorType :: Lens.Lens' OpsAggregator (Prelude.Maybe Prelude.Text)
opsAggregator_aggregatorType :: (Maybe Text -> f (Maybe Text)) -> OpsAggregator -> f OpsAggregator
opsAggregator_aggregatorType = (OpsAggregator -> Maybe Text)
-> (OpsAggregator -> Maybe Text -> OpsAggregator)
-> Lens OpsAggregator OpsAggregator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsAggregator' {Maybe Text
aggregatorType :: Maybe Text
$sel:aggregatorType:OpsAggregator' :: OpsAggregator -> Maybe Text
aggregatorType} -> Maybe Text
aggregatorType) (\s :: OpsAggregator
s@OpsAggregator' {} Maybe Text
a -> OpsAggregator
s {$sel:aggregatorType:OpsAggregator' :: Maybe Text
aggregatorType = Maybe Text
a} :: OpsAggregator)
instance Prelude.Hashable OpsAggregator
instance Prelude.NFData OpsAggregator
instance Core.ToJSON OpsAggregator where
toJSON :: OpsAggregator -> Value
toJSON OpsAggregator' {Maybe (NonEmpty OpsFilter)
Maybe (NonEmpty OpsAggregator)
Maybe Text
Maybe (HashMap Text Text)
aggregatorType :: Maybe Text
attributeName :: Maybe Text
filters :: Maybe (NonEmpty OpsFilter)
values :: Maybe (HashMap Text Text)
aggregators :: Maybe (NonEmpty OpsAggregator)
typeName :: Maybe Text
$sel:aggregatorType:OpsAggregator' :: OpsAggregator -> Maybe Text
$sel:attributeName:OpsAggregator' :: OpsAggregator -> Maybe Text
$sel:filters:OpsAggregator' :: OpsAggregator -> Maybe (NonEmpty OpsFilter)
$sel:values:OpsAggregator' :: OpsAggregator -> Maybe (HashMap Text Text)
$sel:aggregators:OpsAggregator' :: OpsAggregator -> Maybe (NonEmpty OpsAggregator)
$sel:typeName:OpsAggregator' :: OpsAggregator -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
typeName,
(Text
"Aggregators" Text -> NonEmpty OpsAggregator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty OpsAggregator -> Pair)
-> Maybe (NonEmpty OpsAggregator) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty OpsAggregator)
aggregators,
(Text
"Values" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
values,
(Text
"Filters" Text -> NonEmpty OpsFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty OpsFilter -> Pair)
-> Maybe (NonEmpty OpsFilter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty OpsFilter)
filters,
(Text
"AttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attributeName,
(Text
"AggregatorType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aggregatorType
]
)