{-# 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.OrganizationEvent
-- 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.OrganizationEvent 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 event, returned by the
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEventsForOrganization.html DescribeEventsForOrganization>
-- operation.
--
-- /See:/ 'newOrganizationEvent' smart constructor.
data OrganizationEvent = OrganizationEvent'
  { -- | The most recent date and time that the event was updated.
    OrganizationEvent -> 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@
    OrganizationEvent -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The AWS service that is affected by the event, such as EC2 and RDS.
    OrganizationEvent -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the event began.
    OrganizationEvent -> 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.
    OrganizationEvent -> 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@.
    OrganizationEvent -> Maybe Text
eventTypeCode :: Prelude.Maybe Prelude.Text,
    -- | The category of the event type.
    OrganizationEvent -> Maybe EventTypeCategory
eventTypeCategory :: Prelude.Maybe EventTypeCategory,
    -- | The date and time that the event ended.
    OrganizationEvent -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The AWS Region name of the event.
    OrganizationEvent -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The most recent status of the event. Possible values are @open@,
    -- @closed@, and @upcoming@.
    OrganizationEvent -> Maybe EventStatusCode
statusCode :: Prelude.Maybe EventStatusCode
  }
  deriving (OrganizationEvent -> OrganizationEvent -> Bool
(OrganizationEvent -> OrganizationEvent -> Bool)
-> (OrganizationEvent -> OrganizationEvent -> Bool)
-> Eq OrganizationEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationEvent -> OrganizationEvent -> Bool
$c/= :: OrganizationEvent -> OrganizationEvent -> Bool
== :: OrganizationEvent -> OrganizationEvent -> Bool
$c== :: OrganizationEvent -> OrganizationEvent -> Bool
Prelude.Eq, ReadPrec [OrganizationEvent]
ReadPrec OrganizationEvent
Int -> ReadS OrganizationEvent
ReadS [OrganizationEvent]
(Int -> ReadS OrganizationEvent)
-> ReadS [OrganizationEvent]
-> ReadPrec OrganizationEvent
-> ReadPrec [OrganizationEvent]
-> Read OrganizationEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationEvent]
$creadListPrec :: ReadPrec [OrganizationEvent]
readPrec :: ReadPrec OrganizationEvent
$creadPrec :: ReadPrec OrganizationEvent
readList :: ReadS [OrganizationEvent]
$creadList :: ReadS [OrganizationEvent]
readsPrec :: Int -> ReadS OrganizationEvent
$creadsPrec :: Int -> ReadS OrganizationEvent
Prelude.Read, Int -> OrganizationEvent -> ShowS
[OrganizationEvent] -> ShowS
OrganizationEvent -> String
(Int -> OrganizationEvent -> ShowS)
-> (OrganizationEvent -> String)
-> ([OrganizationEvent] -> ShowS)
-> Show OrganizationEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationEvent] -> ShowS
$cshowList :: [OrganizationEvent] -> ShowS
show :: OrganizationEvent -> String
$cshow :: OrganizationEvent -> String
showsPrec :: Int -> OrganizationEvent -> ShowS
$cshowsPrec :: Int -> OrganizationEvent -> ShowS
Prelude.Show, (forall x. OrganizationEvent -> Rep OrganizationEvent x)
-> (forall x. Rep OrganizationEvent x -> OrganizationEvent)
-> Generic OrganizationEvent
forall x. Rep OrganizationEvent x -> OrganizationEvent
forall x. OrganizationEvent -> Rep OrganizationEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OrganizationEvent x -> OrganizationEvent
$cfrom :: forall x. OrganizationEvent -> Rep OrganizationEvent x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationEvent' 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', 'organizationEvent_lastUpdatedTime' - The most recent date and time that the event was updated.
--
-- 'arn', 'organizationEvent_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', 'organizationEvent_service' - The AWS service that is affected by the event, such as EC2 and RDS.
--
-- 'startTime', 'organizationEvent_startTime' - The date and time that the event began.
--
-- 'eventScopeCode', 'organizationEvent_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', 'organizationEvent_eventTypeCode' - The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION@. For example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
--
-- 'eventTypeCategory', 'organizationEvent_eventTypeCategory' - The category of the event type.
--
-- 'endTime', 'organizationEvent_endTime' - The date and time that the event ended.
--
-- 'region', 'organizationEvent_region' - The AWS Region name of the event.
--
-- 'statusCode', 'organizationEvent_statusCode' - The most recent status of the event. Possible values are @open@,
-- @closed@, and @upcoming@.
newOrganizationEvent ::
  OrganizationEvent
newOrganizationEvent :: OrganizationEvent
newOrganizationEvent =
  OrganizationEvent' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe EventScopeCode
-> Maybe Text
-> Maybe EventTypeCategory
-> Maybe POSIX
-> Maybe Text
-> Maybe EventStatusCode
-> OrganizationEvent
OrganizationEvent'
    { $sel:lastUpdatedTime:OrganizationEvent' :: Maybe POSIX
lastUpdatedTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:OrganizationEvent' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:service:OrganizationEvent' :: Maybe Text
service = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:OrganizationEvent' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:eventScopeCode:OrganizationEvent' :: Maybe EventScopeCode
eventScopeCode = Maybe EventScopeCode
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeCode:OrganizationEvent' :: Maybe Text
eventTypeCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeCategory:OrganizationEvent' :: Maybe EventTypeCategory
eventTypeCategory = Maybe EventTypeCategory
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:OrganizationEvent' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:region:OrganizationEvent' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:OrganizationEvent' :: Maybe EventStatusCode
statusCode = Maybe EventStatusCode
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

-- | The category of the event type.
organizationEvent_eventTypeCategory :: Lens.Lens' OrganizationEvent (Prelude.Maybe EventTypeCategory)
organizationEvent_eventTypeCategory :: (Maybe EventTypeCategory -> f (Maybe EventTypeCategory))
-> OrganizationEvent -> f OrganizationEvent
organizationEvent_eventTypeCategory = (OrganizationEvent -> Maybe EventTypeCategory)
-> (OrganizationEvent
    -> Maybe EventTypeCategory -> OrganizationEvent)
-> Lens
     OrganizationEvent
     OrganizationEvent
     (Maybe EventTypeCategory)
     (Maybe EventTypeCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationEvent' {Maybe EventTypeCategory
eventTypeCategory :: Maybe EventTypeCategory
$sel:eventTypeCategory:OrganizationEvent' :: OrganizationEvent -> Maybe EventTypeCategory
eventTypeCategory} -> Maybe EventTypeCategory
eventTypeCategory) (\s :: OrganizationEvent
s@OrganizationEvent' {} Maybe EventTypeCategory
a -> OrganizationEvent
s {$sel:eventTypeCategory:OrganizationEvent' :: Maybe EventTypeCategory
eventTypeCategory = Maybe EventTypeCategory
a} :: OrganizationEvent)

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

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

instance Core.FromJSON OrganizationEvent where
  parseJSON :: Value -> Parser OrganizationEvent
parseJSON =
    String
-> (Object -> Parser OrganizationEvent)
-> Value
-> Parser OrganizationEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OrganizationEvent"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe EventScopeCode
-> Maybe Text
-> Maybe EventTypeCategory
-> Maybe POSIX
-> Maybe Text
-> Maybe EventStatusCode
-> OrganizationEvent
OrganizationEvent'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe EventScopeCode
 -> Maybe Text
 -> Maybe EventTypeCategory
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe EventStatusCode
 -> OrganizationEvent)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe EventScopeCode
      -> Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe EventScopeCode)
-> Parser
     (Maybe Text
      -> Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe EventTypeCategory
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventStatusCode
      -> OrganizationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe EventStatusCode
   -> OrganizationEvent)
-> Parser (Maybe EventTypeCategory)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe EventStatusCode -> OrganizationEvent)
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 POSIX
   -> Maybe Text -> Maybe EventStatusCode -> OrganizationEvent)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe EventStatusCode -> OrganizationEvent)
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 -> OrganizationEvent)
-> Parser (Maybe Text)
-> Parser (Maybe EventStatusCode -> OrganizationEvent)
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 -> OrganizationEvent)
-> Parser (Maybe EventStatusCode) -> Parser OrganizationEvent
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 OrganizationEvent

instance Prelude.NFData OrganizationEvent