{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AWSHealth.Types.AffectedEntity
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about an entity that is affected by a Health event.
--
-- /See:/ 'newAffectedEntity' smart constructor.
data AffectedEntity = AffectedEntity'
  { -- | The most recent time that the entity was updated.
    AffectedEntity -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the affected entity.
    AffectedEntity -> Maybe Text
entityValue :: Prelude.Maybe Prelude.Text,
    -- | The URL of the affected entity.
    AffectedEntity -> Maybe Text
entityUrl :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit AWS account number that contains the affected entity.
    AffectedEntity -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the event. The event ARN has the
    -- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
    -- format.
    --
    -- For example, an event ARN might look like the following:
    --
    -- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
    AffectedEntity -> Maybe Text
eventArn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the entity. Format:
    -- @arn:aws:health:entity-region:aws-account:entity\/entity-id @. Example:
    -- @arn:aws:health:us-east-1:111222333444:entity\/AVh5GGT7ul1arKr1sE1K@
    AffectedEntity -> Maybe Text
entityArn :: Prelude.Maybe Prelude.Text,
    -- | A map of entity tags attached to the affected entity.
    --
    -- Currently, the @tags@ property isn\'t supported.
    AffectedEntity -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The most recent status of the entity affected by the event. The possible
    -- values are @IMPAIRED@, @UNIMPAIRED@, and @UNKNOWN@.
    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)

-- |
-- Create a value of 'AffectedEntity' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastUpdatedTime', 'affectedEntity_lastUpdatedTime' - The most recent time that the entity was updated.
--
-- 'entityValue', 'affectedEntity_entityValue' - The ID of the affected entity.
--
-- 'entityUrl', 'affectedEntity_entityUrl' - The URL of the affected entity.
--
-- 'awsAccountId', 'affectedEntity_awsAccountId' - The 12-digit AWS account number that contains the affected entity.
--
-- 'eventArn', 'affectedEntity_eventArn' - The unique identifier for the event. The event ARN has the
-- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
-- format.
--
-- For example, an event ARN might look like the following:
--
-- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
--
-- 'entityArn', 'affectedEntity_entityArn' - The unique identifier for the entity. Format:
-- @arn:aws:health:entity-region:aws-account:entity\/entity-id @. Example:
-- @arn:aws:health:us-east-1:111222333444:entity\/AVh5GGT7ul1arKr1sE1K@
--
-- 'tags', 'affectedEntity_tags' - A map of entity tags attached to the affected entity.
--
-- Currently, the @tags@ property isn\'t supported.
--
-- 'statusCode', 'affectedEntity_statusCode' - The most recent status of the entity affected by the event. The possible
-- values are @IMPAIRED@, @UNIMPAIRED@, and @UNKNOWN@.
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
    }

-- | The most recent time that the entity was updated.
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

-- | The ID of the affected entity.
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)

-- | The URL of the affected entity.
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)

-- | The 12-digit AWS account number that contains the affected entity.
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)

-- | The unique identifier for the event. The event ARN has the
-- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
-- format.
--
-- For example, an event ARN might look like the following:
--
-- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
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)

-- | The unique identifier for the entity. Format:
-- @arn:aws:health:entity-region:aws-account:entity\/entity-id @. Example:
-- @arn:aws:health:us-east-1:111222333444:entity\/AVh5GGT7ul1arKr1sE1K@
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)

-- | A map of entity tags attached to the affected entity.
--
-- Currently, the @tags@ property isn\'t supported.
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

-- | The most recent status of the entity affected by the event. The possible
-- values are @IMPAIRED@, @UNIMPAIRED@, and @UNKNOWN@.
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