{-# 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.Event
-- 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.Event where

import Amazonka.AWSHealth.Types.EventScopeCode
import Amazonka.AWSHealth.Types.EventStatusCode
import Amazonka.AWSHealth.Types.EventTypeCategory
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about an AWS Health event.
--
-- AWS Health events can be public or account-specific:
--
-- -   /Public events/ might be service events that are not specific to an
--     AWS account. For example, if there is an issue with an AWS Region,
--     AWS Health provides information about the event, even if you don\'t
--     use services or resources in that Region.
--
-- -   /Account-specific/ events are specific to either your AWS account or
--     an account in your organization. For example, if there\'s an issue
--     with Amazon Elastic Compute Cloud in a Region that you use, AWS
--     Health provides information about the event and the affected
--     resources in the account.
--
-- You can determine if an event is public or account-specific by using the
-- @eventScopeCode@ parameter. For more information, see
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html#AWSHealth-Type-Event-eventScopeCode eventScopeCode>.
--
-- /See:/ 'newEvent' smart constructor.
data Event = Event'
  { -- | The most recent date and time that the event was updated.
    Event -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | 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@
    Event -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The AWS service that is affected by the event. For example, @EC2@,
    -- @RDS@.
    Event -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the event began.
    Event -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | This parameter specifies if the AWS Health event is a public AWS service
    -- event or an account-specific event.
    --
    -- -   If the @eventScopeCode@ value is @PUBLIC@, then the
    --     @affectedAccounts@ value is always empty.
    --
    -- -   If the @eventScopeCode@ value is @ACCOUNT_SPECIFIC@, then the
    --     @affectedAccounts@ value lists the affected AWS accounts in your
    --     organization. For example, if an event affects a service such as
    --     Amazon Elastic Compute Cloud and you have AWS accounts that use that
    --     service, those account IDs appear in the response.
    --
    -- -   If the @eventScopeCode@ value is @NONE@, then the @eventArn@ that
    --     you specified in the request is invalid or doesn\'t exist.
    Event -> Maybe EventScopeCode
eventScopeCode :: Prelude.Maybe EventScopeCode,
    -- | The unique identifier for the event type. The format is
    -- @AWS_SERVICE_DESCRIPTION @; for example,
    -- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
    Event -> Maybe Text
eventTypeCode :: Prelude.Maybe Prelude.Text,
    -- | The category of the event. Possible values are @issue@,
    -- @scheduledChange@, and @accountNotification@.
    Event -> Maybe EventTypeCategory
eventTypeCategory :: Prelude.Maybe EventTypeCategory,
    -- | The AWS Availability Zone of the event. For example, us-east-1a.
    Event -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the event ended.
    Event -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The AWS Region name of the event.
    Event -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The most recent status of the event. Possible values are @open@,
    -- @closed@, and @upcoming@.
    Event -> Maybe EventStatusCode
statusCode :: Prelude.Maybe EventStatusCode
  }
  deriving (Event -> Event -> Bool
(Event -> Event -> Bool) -> (Event -> Event -> Bool) -> Eq Event
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Event -> Event -> Bool
$c/= :: Event -> Event -> Bool
== :: Event -> Event -> Bool
$c== :: Event -> Event -> Bool
Prelude.Eq, ReadPrec [Event]
ReadPrec Event
Int -> ReadS Event
ReadS [Event]
(Int -> ReadS Event)
-> ReadS [Event]
-> ReadPrec Event
-> ReadPrec [Event]
-> Read Event
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Event]
$creadListPrec :: ReadPrec [Event]
readPrec :: ReadPrec Event
$creadPrec :: ReadPrec Event
readList :: ReadS [Event]
$creadList :: ReadS [Event]
readsPrec :: Int -> ReadS Event
$creadsPrec :: Int -> ReadS Event
Prelude.Read, Int -> Event -> ShowS
[Event] -> ShowS
Event -> String
(Int -> Event -> ShowS)
-> (Event -> String) -> ([Event] -> ShowS) -> Show Event
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Event] -> ShowS
$cshowList :: [Event] -> ShowS
show :: Event -> String
$cshow :: Event -> String
showsPrec :: Int -> Event -> ShowS
$cshowsPrec :: Int -> Event -> ShowS
Prelude.Show, (forall x. Event -> Rep Event x)
-> (forall x. Rep Event x -> Event) -> Generic Event
forall x. Rep Event x -> Event
forall x. Event -> Rep Event x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Event x -> Event
$cfrom :: forall x. Event -> Rep Event x
Prelude.Generic)

-- |
-- Create a value of 'Event' 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', 'event_lastUpdatedTime' - The most recent date and time that the event was updated.
--
-- 'arn', 'event_arn' - 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@
--
-- 'service', 'event_service' - The AWS service that is affected by the event. For example, @EC2@,
-- @RDS@.
--
-- 'startTime', 'event_startTime' - The date and time that the event began.
--
-- 'eventScopeCode', 'event_eventScopeCode' - This parameter specifies if the AWS Health event is a public AWS service
-- event or an account-specific event.
--
-- -   If the @eventScopeCode@ value is @PUBLIC@, then the
--     @affectedAccounts@ value is always empty.
--
-- -   If the @eventScopeCode@ value is @ACCOUNT_SPECIFIC@, then the
--     @affectedAccounts@ value lists the affected AWS accounts in your
--     organization. For example, if an event affects a service such as
--     Amazon Elastic Compute Cloud and you have AWS accounts that use that
--     service, those account IDs appear in the response.
--
-- -   If the @eventScopeCode@ value is @NONE@, then the @eventArn@ that
--     you specified in the request is invalid or doesn\'t exist.
--
-- 'eventTypeCode', 'event_eventTypeCode' - The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION @; for example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
--
-- 'eventTypeCategory', 'event_eventTypeCategory' - The category of the event. Possible values are @issue@,
-- @scheduledChange@, and @accountNotification@.
--
-- 'availabilityZone', 'event_availabilityZone' - The AWS Availability Zone of the event. For example, us-east-1a.
--
-- 'endTime', 'event_endTime' - The date and time that the event ended.
--
-- 'region', 'event_region' - The AWS Region name of the event.
--
-- 'statusCode', 'event_statusCode' - The most recent status of the event. Possible values are @open@,
-- @closed@, and @upcoming@.
newEvent ::
  Event
newEvent :: Event
newEvent =
  Event' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe EventScopeCode
-> Maybe Text
-> Maybe EventTypeCategory
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe EventStatusCode
-> Event
Event'
    { $sel:lastUpdatedTime:Event' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Event' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:service:Event' :: Maybe Text
service = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:Event' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:eventScopeCode:Event' :: Maybe EventScopeCode
eventScopeCode = Maybe EventScopeCode
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeCode:Event' :: Maybe Text
eventTypeCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeCategory:Event' :: Maybe EventTypeCategory
eventTypeCategory = Maybe EventTypeCategory
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:Event' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:Event' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Event' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:Event' :: Maybe EventStatusCode
statusCode = Maybe EventStatusCode
forall a. Maybe a
Prelude.Nothing
    }

-- | The most recent date and time that the event was updated.
event_lastUpdatedTime :: Lens.Lens' Event (Prelude.Maybe Prelude.UTCTime)
event_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Event -> f Event
event_lastUpdatedTime = (Event -> Maybe POSIX)
-> (Event -> Maybe POSIX -> Event)
-> Lens Event Event (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Event' :: Event -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Event
s@Event' {} Maybe POSIX
a -> Event
s {$sel:lastUpdatedTime:Event' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Event) ((Maybe POSIX -> f (Maybe POSIX)) -> Event -> f Event)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Event
-> f Event
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 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@
event_arn :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_arn :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_arn = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
arn :: Maybe Text
$sel:arn:Event' :: Event -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:arn:Event' :: Maybe Text
arn = Maybe Text
a} :: Event)

-- | The AWS service that is affected by the event. For example, @EC2@,
-- @RDS@.
event_service :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_service :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_service = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
service :: Maybe Text
$sel:service:Event' :: Event -> Maybe Text
service} -> Maybe Text
service) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:service:Event' :: Maybe Text
service = Maybe Text
a} :: Event)

-- | The date and time that the event began.
event_startTime :: Lens.Lens' Event (Prelude.Maybe Prelude.UTCTime)
event_startTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Event -> f Event
event_startTime = (Event -> Maybe POSIX)
-> (Event -> Maybe POSIX -> Event)
-> Lens Event Event (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Event' :: Event -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Event
s@Event' {} Maybe POSIX
a -> Event
s {$sel:startTime:Event' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Event) ((Maybe POSIX -> f (Maybe POSIX)) -> Event -> f Event)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Event
-> f Event
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

-- | This parameter specifies if the AWS Health event is a public AWS service
-- event or an account-specific event.
--
-- -   If the @eventScopeCode@ value is @PUBLIC@, then the
--     @affectedAccounts@ value is always empty.
--
-- -   If the @eventScopeCode@ value is @ACCOUNT_SPECIFIC@, then the
--     @affectedAccounts@ value lists the affected AWS accounts in your
--     organization. For example, if an event affects a service such as
--     Amazon Elastic Compute Cloud and you have AWS accounts that use that
--     service, those account IDs appear in the response.
--
-- -   If the @eventScopeCode@ value is @NONE@, then the @eventArn@ that
--     you specified in the request is invalid or doesn\'t exist.
event_eventScopeCode :: Lens.Lens' Event (Prelude.Maybe EventScopeCode)
event_eventScopeCode :: (Maybe EventScopeCode -> f (Maybe EventScopeCode))
-> Event -> f Event
event_eventScopeCode = (Event -> Maybe EventScopeCode)
-> (Event -> Maybe EventScopeCode -> Event)
-> Lens Event Event (Maybe EventScopeCode) (Maybe EventScopeCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe EventScopeCode
eventScopeCode :: Maybe EventScopeCode
$sel:eventScopeCode:Event' :: Event -> Maybe EventScopeCode
eventScopeCode} -> Maybe EventScopeCode
eventScopeCode) (\s :: Event
s@Event' {} Maybe EventScopeCode
a -> Event
s {$sel:eventScopeCode:Event' :: Maybe EventScopeCode
eventScopeCode = Maybe EventScopeCode
a} :: Event)

-- | The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION @; for example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
event_eventTypeCode :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_eventTypeCode :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_eventTypeCode = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
eventTypeCode :: Maybe Text
$sel:eventTypeCode:Event' :: Event -> Maybe Text
eventTypeCode} -> Maybe Text
eventTypeCode) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:eventTypeCode:Event' :: Maybe Text
eventTypeCode = Maybe Text
a} :: Event)

-- | The category of the event. Possible values are @issue@,
-- @scheduledChange@, and @accountNotification@.
event_eventTypeCategory :: Lens.Lens' Event (Prelude.Maybe EventTypeCategory)
event_eventTypeCategory :: (Maybe EventTypeCategory -> f (Maybe EventTypeCategory))
-> Event -> f Event
event_eventTypeCategory = (Event -> Maybe EventTypeCategory)
-> (Event -> Maybe EventTypeCategory -> Event)
-> Lens
     Event Event (Maybe EventTypeCategory) (Maybe EventTypeCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe EventTypeCategory
eventTypeCategory :: Maybe EventTypeCategory
$sel:eventTypeCategory:Event' :: Event -> Maybe EventTypeCategory
eventTypeCategory} -> Maybe EventTypeCategory
eventTypeCategory) (\s :: Event
s@Event' {} Maybe EventTypeCategory
a -> Event
s {$sel:eventTypeCategory:Event' :: Maybe EventTypeCategory
eventTypeCategory = Maybe EventTypeCategory
a} :: Event)

-- | The AWS Availability Zone of the event. For example, us-east-1a.
event_availabilityZone :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_availabilityZone = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:Event' :: Event -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:availabilityZone:Event' :: Maybe Text
availabilityZone = Maybe Text
a} :: Event)

-- | The date and time that the event ended.
event_endTime :: Lens.Lens' Event (Prelude.Maybe Prelude.UTCTime)
event_endTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Event -> f Event
event_endTime = (Event -> Maybe POSIX)
-> (Event -> Maybe POSIX -> Event)
-> Lens Event Event (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:Event' :: Event -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: Event
s@Event' {} Maybe POSIX
a -> Event
s {$sel:endTime:Event' :: Maybe POSIX
endTime = Maybe POSIX
a} :: Event) ((Maybe POSIX -> f (Maybe POSIX)) -> Event -> f Event)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Event
-> f Event
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 AWS Region name of the event.
event_region :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_region :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_region = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
region :: Maybe Text
$sel:region:Event' :: Event -> Maybe Text
region} -> Maybe Text
region) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:region:Event' :: Maybe Text
region = Maybe Text
a} :: Event)

-- | The most recent status of the event. Possible values are @open@,
-- @closed@, and @upcoming@.
event_statusCode :: Lens.Lens' Event (Prelude.Maybe EventStatusCode)
event_statusCode :: (Maybe EventStatusCode -> f (Maybe EventStatusCode))
-> Event -> f Event
event_statusCode = (Event -> Maybe EventStatusCode)
-> (Event -> Maybe EventStatusCode -> Event)
-> Lens Event Event (Maybe EventStatusCode) (Maybe EventStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe EventStatusCode
statusCode :: Maybe EventStatusCode
$sel:statusCode:Event' :: Event -> Maybe EventStatusCode
statusCode} -> Maybe EventStatusCode
statusCode) (\s :: Event
s@Event' {} Maybe EventStatusCode
a -> Event
s {$sel:statusCode:Event' :: Maybe EventStatusCode
statusCode = Maybe EventStatusCode
a} :: Event)

instance Core.FromJSON Event where
  parseJSON :: Value -> Parser Event
parseJSON =
    String -> (Object -> Parser Event) -> Value -> Parser Event
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Event"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe EventScopeCode
-> Maybe Text
-> Maybe EventTypeCategory
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe EventStatusCode
-> Event
Event'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe EventScopeCode
 -> Maybe Text
 -> Maybe EventTypeCategory
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe EventStatusCode
 -> Event)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
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 POSIX
   -> Maybe EventScopeCode
   -> Maybe Text
   -> Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
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
"arn")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe EventScopeCode
   -> Maybe Text
   -> Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
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
"service")
            Parser
  (Maybe POSIX
   -> Maybe EventScopeCode
   -> Maybe Text
   -> Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
forall (f :: * -> *) a b. Applicative f => 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
"startTime")
            Parser
  (Maybe EventScopeCode
   -> Maybe Text
   -> Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe EventScopeCode)
-> Parser
     (Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventScopeCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventScopeCode")
            Parser
  (Maybe Text
   -> Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe EventTypeCategory
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> Event)
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
"eventTypeCode")
            Parser
  (Maybe EventTypeCategory
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> Event)
-> Parser (Maybe EventTypeCategory)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe EventStatusCode -> Event)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventTypeCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventTypeCategory")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe EventStatusCode -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe EventStatusCode -> Event)
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
"availabilityZone")
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe EventStatusCode -> Event)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe EventStatusCode -> Event)
forall (f :: * -> *) a b. Applicative f => 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
"endTime")
            Parser (Maybe Text -> Maybe EventStatusCode -> Event)
-> Parser (Maybe Text) -> Parser (Maybe EventStatusCode -> Event)
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
"region")
            Parser (Maybe EventStatusCode -> Event)
-> Parser (Maybe EventStatusCode) -> Parser Event
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventStatusCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusCode")
      )

instance Prelude.Hashable Event

instance Prelude.NFData Event