{-# 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.AffectedEntity where
import Amazonka.AWSHealth.Types.EntityStatusCode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AffectedEntity = AffectedEntity'
{
AffectedEntity -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
AffectedEntity -> Maybe Text
entityValue :: Prelude.Maybe Prelude.Text,
AffectedEntity -> Maybe Text
entityUrl :: Prelude.Maybe Prelude.Text,
AffectedEntity -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
AffectedEntity -> Maybe Text
eventArn :: Prelude.Maybe Prelude.Text,
AffectedEntity -> Maybe Text
entityArn :: Prelude.Maybe Prelude.Text,
AffectedEntity -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AffectedEntity -> Maybe EntityStatusCode
statusCode :: Prelude.Maybe EntityStatusCode
}
deriving (AffectedEntity -> AffectedEntity -> Bool
(AffectedEntity -> AffectedEntity -> Bool)
-> (AffectedEntity -> AffectedEntity -> Bool) -> Eq AffectedEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AffectedEntity -> AffectedEntity -> Bool
$c/= :: AffectedEntity -> AffectedEntity -> Bool
== :: AffectedEntity -> AffectedEntity -> Bool
$c== :: AffectedEntity -> AffectedEntity -> Bool
Prelude.Eq, ReadPrec [AffectedEntity]
ReadPrec AffectedEntity
Int -> ReadS AffectedEntity
ReadS [AffectedEntity]
(Int -> ReadS AffectedEntity)
-> ReadS [AffectedEntity]
-> ReadPrec AffectedEntity
-> ReadPrec [AffectedEntity]
-> Read AffectedEntity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AffectedEntity]
$creadListPrec :: ReadPrec [AffectedEntity]
readPrec :: ReadPrec AffectedEntity
$creadPrec :: ReadPrec AffectedEntity
readList :: ReadS [AffectedEntity]
$creadList :: ReadS [AffectedEntity]
readsPrec :: Int -> ReadS AffectedEntity
$creadsPrec :: Int -> ReadS AffectedEntity
Prelude.Read, Int -> AffectedEntity -> ShowS
[AffectedEntity] -> ShowS
AffectedEntity -> String
(Int -> AffectedEntity -> ShowS)
-> (AffectedEntity -> String)
-> ([AffectedEntity] -> ShowS)
-> Show AffectedEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AffectedEntity] -> ShowS
$cshowList :: [AffectedEntity] -> ShowS
show :: AffectedEntity -> String
$cshow :: AffectedEntity -> String
showsPrec :: Int -> AffectedEntity -> ShowS
$cshowsPrec :: Int -> AffectedEntity -> ShowS
Prelude.Show, (forall x. AffectedEntity -> Rep AffectedEntity x)
-> (forall x. Rep AffectedEntity x -> AffectedEntity)
-> Generic AffectedEntity
forall x. Rep AffectedEntity x -> AffectedEntity
forall x. AffectedEntity -> Rep AffectedEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AffectedEntity x -> AffectedEntity
$cfrom :: forall x. AffectedEntity -> Rep AffectedEntity x
Prelude.Generic)
newAffectedEntity ::
AffectedEntity
newAffectedEntity :: AffectedEntity
newAffectedEntity =
AffectedEntity' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity
AffectedEntity'
{ $sel:lastUpdatedTime:AffectedEntity' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:entityValue:AffectedEntity' :: Maybe Text
entityValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityUrl:AffectedEntity' :: Maybe Text
entityUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:AffectedEntity' :: Maybe Text
awsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventArn:AffectedEntity' :: Maybe Text
eventArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityArn:AffectedEntity' :: Maybe Text
entityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:AffectedEntity' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:AffectedEntity' :: Maybe EntityStatusCode
statusCode = Maybe EntityStatusCode
forall a. Maybe a
Prelude.Nothing
}
affectedEntity_lastUpdatedTime :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.UTCTime)
affectedEntity_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AffectedEntity -> f AffectedEntity
affectedEntity_lastUpdatedTime = (AffectedEntity -> Maybe POSIX)
-> (AffectedEntity -> Maybe POSIX -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:AffectedEntity' :: AffectedEntity -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe POSIX
a -> AffectedEntity
s {$sel:lastUpdatedTime:AffectedEntity' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: AffectedEntity) ((Maybe POSIX -> f (Maybe POSIX))
-> AffectedEntity -> f AffectedEntity)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AffectedEntity
-> f AffectedEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
affectedEntity_entityValue :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.Text)
affectedEntity_entityValue :: (Maybe Text -> f (Maybe Text))
-> AffectedEntity -> f AffectedEntity
affectedEntity_entityValue = (AffectedEntity -> Maybe Text)
-> (AffectedEntity -> Maybe Text -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe Text
entityValue :: Maybe Text
$sel:entityValue:AffectedEntity' :: AffectedEntity -> Maybe Text
entityValue} -> Maybe Text
entityValue) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe Text
a -> AffectedEntity
s {$sel:entityValue:AffectedEntity' :: Maybe Text
entityValue = Maybe Text
a} :: AffectedEntity)
affectedEntity_entityUrl :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.Text)
affectedEntity_entityUrl :: (Maybe Text -> f (Maybe Text))
-> AffectedEntity -> f AffectedEntity
affectedEntity_entityUrl = (AffectedEntity -> Maybe Text)
-> (AffectedEntity -> Maybe Text -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe Text
entityUrl :: Maybe Text
$sel:entityUrl:AffectedEntity' :: AffectedEntity -> Maybe Text
entityUrl} -> Maybe Text
entityUrl) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe Text
a -> AffectedEntity
s {$sel:entityUrl:AffectedEntity' :: Maybe Text
entityUrl = Maybe Text
a} :: AffectedEntity)
affectedEntity_awsAccountId :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.Text)
affectedEntity_awsAccountId :: (Maybe Text -> f (Maybe Text))
-> AffectedEntity -> f AffectedEntity
affectedEntity_awsAccountId = (AffectedEntity -> Maybe Text)
-> (AffectedEntity -> Maybe Text -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:AffectedEntity' :: AffectedEntity -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe Text
a -> AffectedEntity
s {$sel:awsAccountId:AffectedEntity' :: Maybe Text
awsAccountId = Maybe Text
a} :: AffectedEntity)
affectedEntity_eventArn :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.Text)
affectedEntity_eventArn :: (Maybe Text -> f (Maybe Text))
-> AffectedEntity -> f AffectedEntity
affectedEntity_eventArn = (AffectedEntity -> Maybe Text)
-> (AffectedEntity -> Maybe Text -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe Text
eventArn :: Maybe Text
$sel:eventArn:AffectedEntity' :: AffectedEntity -> Maybe Text
eventArn} -> Maybe Text
eventArn) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe Text
a -> AffectedEntity
s {$sel:eventArn:AffectedEntity' :: Maybe Text
eventArn = Maybe Text
a} :: AffectedEntity)
affectedEntity_entityArn :: Lens.Lens' AffectedEntity (Prelude.Maybe Prelude.Text)
affectedEntity_entityArn :: (Maybe Text -> f (Maybe Text))
-> AffectedEntity -> f AffectedEntity
affectedEntity_entityArn = (AffectedEntity -> Maybe Text)
-> (AffectedEntity -> Maybe Text -> AffectedEntity)
-> Lens AffectedEntity AffectedEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe Text
entityArn :: Maybe Text
$sel:entityArn:AffectedEntity' :: AffectedEntity -> Maybe Text
entityArn} -> Maybe Text
entityArn) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe Text
a -> AffectedEntity
s {$sel:entityArn:AffectedEntity' :: Maybe Text
entityArn = Maybe Text
a} :: AffectedEntity)
affectedEntity_tags :: Lens.Lens' AffectedEntity (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
affectedEntity_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AffectedEntity -> f AffectedEntity
affectedEntity_tags = (AffectedEntity -> Maybe (HashMap Text Text))
-> (AffectedEntity -> Maybe (HashMap Text Text) -> AffectedEntity)
-> Lens
AffectedEntity
AffectedEntity
(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 (\AffectedEntity' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AffectedEntity' :: AffectedEntity -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe (HashMap Text Text)
a -> AffectedEntity
s {$sel:tags:AffectedEntity' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AffectedEntity) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AffectedEntity -> f AffectedEntity)
-> ((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)))
-> AffectedEntity
-> f AffectedEntity
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
affectedEntity_statusCode :: Lens.Lens' AffectedEntity (Prelude.Maybe EntityStatusCode)
affectedEntity_statusCode :: (Maybe EntityStatusCode -> f (Maybe EntityStatusCode))
-> AffectedEntity -> f AffectedEntity
affectedEntity_statusCode = (AffectedEntity -> Maybe EntityStatusCode)
-> (AffectedEntity -> Maybe EntityStatusCode -> AffectedEntity)
-> Lens
AffectedEntity
AffectedEntity
(Maybe EntityStatusCode)
(Maybe EntityStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AffectedEntity' {Maybe EntityStatusCode
statusCode :: Maybe EntityStatusCode
$sel:statusCode:AffectedEntity' :: AffectedEntity -> Maybe EntityStatusCode
statusCode} -> Maybe EntityStatusCode
statusCode) (\s :: AffectedEntity
s@AffectedEntity' {} Maybe EntityStatusCode
a -> AffectedEntity
s {$sel:statusCode:AffectedEntity' :: Maybe EntityStatusCode
statusCode = Maybe EntityStatusCode
a} :: AffectedEntity)
instance Core.FromJSON AffectedEntity where
parseJSON :: Value -> Parser AffectedEntity
parseJSON =
String
-> (Object -> Parser AffectedEntity)
-> Value
-> Parser AffectedEntity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AffectedEntity"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity
AffectedEntity'
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
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
"entityValue")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
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
"entityUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
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
"awsAccountId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
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")
Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe EntityStatusCode
-> AffectedEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe EntityStatusCode -> AffectedEntity)
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
"entityArn")
Parser
(Maybe (HashMap Text Text)
-> Maybe EntityStatusCode -> AffectedEntity)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe EntityStatusCode -> AffectedEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe EntityStatusCode -> AffectedEntity)
-> Parser (Maybe EntityStatusCode) -> Parser AffectedEntity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityStatusCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusCode")
)
instance Prelude.Hashable AffectedEntity
instance Prelude.NFData AffectedEntity