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