{-# 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.AWSHealth.Types.EventAggregate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventAggregate = EventAggregate'
{
EventAggregate -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
EventAggregate -> Maybe Text
aggregateValue :: Prelude.Maybe Prelude.Text
}
deriving (EventAggregate -> EventAggregate -> Bool
(EventAggregate -> EventAggregate -> Bool)
-> (EventAggregate -> EventAggregate -> Bool) -> Eq EventAggregate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventAggregate -> EventAggregate -> Bool
$c/= :: EventAggregate -> EventAggregate -> Bool
== :: EventAggregate -> EventAggregate -> Bool
$c== :: EventAggregate -> EventAggregate -> Bool
Prelude.Eq, ReadPrec [EventAggregate]
ReadPrec EventAggregate
Int -> ReadS EventAggregate
ReadS [EventAggregate]
(Int -> ReadS EventAggregate)
-> ReadS [EventAggregate]
-> ReadPrec EventAggregate
-> ReadPrec [EventAggregate]
-> Read EventAggregate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventAggregate]
$creadListPrec :: ReadPrec [EventAggregate]
readPrec :: ReadPrec EventAggregate
$creadPrec :: ReadPrec EventAggregate
readList :: ReadS [EventAggregate]
$creadList :: ReadS [EventAggregate]
readsPrec :: Int -> ReadS EventAggregate
$creadsPrec :: Int -> ReadS EventAggregate
Prelude.Read, Int -> EventAggregate -> ShowS
[EventAggregate] -> ShowS
EventAggregate -> String
(Int -> EventAggregate -> ShowS)
-> (EventAggregate -> String)
-> ([EventAggregate] -> ShowS)
-> Show EventAggregate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventAggregate] -> ShowS
$cshowList :: [EventAggregate] -> ShowS
show :: EventAggregate -> String
$cshow :: EventAggregate -> String
showsPrec :: Int -> EventAggregate -> ShowS
$cshowsPrec :: Int -> EventAggregate -> ShowS
Prelude.Show, (forall x. EventAggregate -> Rep EventAggregate x)
-> (forall x. Rep EventAggregate x -> EventAggregate)
-> Generic EventAggregate
forall x. Rep EventAggregate x -> EventAggregate
forall x. EventAggregate -> Rep EventAggregate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventAggregate x -> EventAggregate
$cfrom :: forall x. EventAggregate -> Rep EventAggregate x
Prelude.Generic)
newEventAggregate ::
EventAggregate
newEventAggregate :: EventAggregate
newEventAggregate =
EventAggregate' :: Maybe Int -> Maybe Text -> EventAggregate
EventAggregate'
{ $sel:count:EventAggregate' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:aggregateValue:EventAggregate' :: Maybe Text
aggregateValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eventAggregate_count :: Lens.Lens' EventAggregate (Prelude.Maybe Prelude.Int)
eventAggregate_count :: (Maybe Int -> f (Maybe Int)) -> EventAggregate -> f EventAggregate
eventAggregate_count = (EventAggregate -> Maybe Int)
-> (EventAggregate -> Maybe Int -> EventAggregate)
-> Lens EventAggregate EventAggregate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventAggregate' {Maybe Int
count :: Maybe Int
$sel:count:EventAggregate' :: EventAggregate -> Maybe Int
count} -> Maybe Int
count) (\s :: EventAggregate
s@EventAggregate' {} Maybe Int
a -> EventAggregate
s {$sel:count:EventAggregate' :: Maybe Int
count = Maybe Int
a} :: EventAggregate)
eventAggregate_aggregateValue :: Lens.Lens' EventAggregate (Prelude.Maybe Prelude.Text)
eventAggregate_aggregateValue :: (Maybe Text -> f (Maybe Text))
-> EventAggregate -> f EventAggregate
eventAggregate_aggregateValue = (EventAggregate -> Maybe Text)
-> (EventAggregate -> Maybe Text -> EventAggregate)
-> Lens EventAggregate EventAggregate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventAggregate' {Maybe Text
aggregateValue :: Maybe Text
$sel:aggregateValue:EventAggregate' :: EventAggregate -> Maybe Text
aggregateValue} -> Maybe Text
aggregateValue) (\s :: EventAggregate
s@EventAggregate' {} Maybe Text
a -> EventAggregate
s {$sel:aggregateValue:EventAggregate' :: Maybe Text
aggregateValue = Maybe Text
a} :: EventAggregate)
instance Core.FromJSON EventAggregate where
parseJSON :: Value -> Parser EventAggregate
parseJSON =
String
-> (Object -> Parser EventAggregate)
-> Value
-> Parser EventAggregate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventAggregate"
( \Object
x ->
Maybe Int -> Maybe Text -> EventAggregate
EventAggregate'
(Maybe Int -> Maybe Text -> EventAggregate)
-> Parser (Maybe Int) -> Parser (Maybe Text -> EventAggregate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser (Maybe Text -> EventAggregate)
-> Parser (Maybe Text) -> Parser EventAggregate
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
"aggregateValue")
)
instance Prelude.Hashable EventAggregate
instance Prelude.NFData EventAggregate