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

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.EventCode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Log entry describing an event that involves GameLift resources (such as
-- a fleet). In addition to tracking activity, event codes and messages can
-- provide additional information for troubleshooting and debugging
-- problems.
--
-- __Related actions__
--
-- DescribeFleetEvents
--
-- /See:/ 'newEvent' smart constructor.
data Event = Event'
  { -- | A unique identifier for an event resource, such as a fleet ID.
    Event -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | Location of stored logs with additional detail that is related to the
    -- event. This is useful for debugging issues. The URL is valid for 15
    -- minutes. You can also access fleet creation logs through the GameLift
    -- console.
    Event -> Maybe Text
preSignedLogUrl :: Prelude.Maybe Prelude.Text,
    -- | Time stamp indicating when this event occurred. Format is a number
    -- expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    Event -> Maybe POSIX
eventTime :: Prelude.Maybe Core.POSIX,
    -- | Additional information related to the event.
    Event -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The type of event being logged.
    --
    -- __Fleet creation events (ordered by fleet creation activity):__
    --
    -- -   FLEET_CREATED -- A fleet resource was successfully created with a
    --     status of @NEW@. Event messaging includes the fleet ID.
    --
    -- -   FLEET_STATE_DOWNLOADING -- Fleet status changed from @NEW@ to
    --     @DOWNLOADING@. The compressed build has started downloading to a
    --     fleet instance for installation.
    --
    -- -   FLEET_BINARY_DOWNLOAD_FAILED -- The build failed to download to the
    --     fleet instance.
    --
    -- -   FLEET_CREATION_EXTRACTING_BUILD – The game server build was
    --     successfully downloaded to an instance, and the build files are now
    --     being extracted from the uploaded build and saved to an instance.
    --     Failure at this stage prevents a fleet from moving to @ACTIVE@
    --     status. Logs for this stage display a list of the files that are
    --     extracted and saved on the instance. Access the logs by using the
    --     URL in /PreSignedLogUrl/.
    --
    -- -   FLEET_CREATION_RUNNING_INSTALLER – The game server build files were
    --     successfully extracted, and the GameLift is now running the build\'s
    --     install script (if one is included). Failure in this stage prevents
    --     a fleet from moving to @ACTIVE@ status. Logs for this stage list the
    --     installation steps and whether or not the install completed
    --     successfully. Access the logs by using the URL in /PreSignedLogUrl/.
    --
    -- -   FLEET_CREATION_VALIDATING_RUNTIME_CONFIG -- The build process was
    --     successful, and the GameLift is now verifying that the game server
    --     launch paths, which are specified in the fleet\'s runtime
    --     configuration, exist. If any listed launch path exists, GameLift
    --     tries to launch a game server process and waits for the process to
    --     report ready. Failures in this stage prevent a fleet from moving to
    --     @ACTIVE@ status. Logs for this stage list the launch paths in the
    --     runtime configuration and indicate whether each is found. Access the
    --     logs by using the URL in /PreSignedLogUrl/.
    --
    -- -   FLEET_STATE_VALIDATING -- Fleet status changed from @DOWNLOADING@ to
    --     @VALIDATING@.
    --
    -- -   FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the runtime
    --     configuration failed because the executable specified in a launch
    --     path does not exist on the instance.
    --
    -- -   FLEET_STATE_BUILDING -- Fleet status changed from @VALIDATING@ to
    --     @BUILDING@.
    --
    -- -   FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the
    --     runtime configuration failed because the executable specified in a
    --     launch path failed to run on the fleet instance.
    --
    -- -   FLEET_STATE_ACTIVATING -- Fleet status changed from @BUILDING@ to
    --     @ACTIVATING@.
    --
    -- -   FLEET_ACTIVATION_FAILED - The fleet failed to successfully complete
    --     one of the steps in the fleet activation process. This event code
    --     indicates that the game build was successfully downloaded to a fleet
    --     instance, built, and validated, but was not able to start a server
    --     process. Learn more at
    --     <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation Debug Fleet Creation Issues>
    --
    -- -   FLEET_STATE_ACTIVE -- The fleet\'s status changed from @ACTIVATING@
    --     to @ACTIVE@. The fleet is now ready to host game sessions.
    --
    -- __VPC peering events:__
    --
    -- -   FLEET_VPC_PEERING_SUCCEEDED -- A VPC peering connection has been
    --     established between the VPC for an GameLift fleet and a VPC in your
    --     AWS account.
    --
    -- -   FLEET_VPC_PEERING_FAILED -- A requested VPC peering connection has
    --     failed. Event details and status information (see
    --     DescribeVpcPeeringConnections) provide additional detail. A common
    --     reason for peering failure is that the two VPCs have overlapping
    --     CIDR blocks of IPv4 addresses. To resolve this, change the CIDR
    --     block for the VPC in your AWS account. For more information on VPC
    --     peering failures, see
    --     <https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html>
    --
    -- -   FLEET_VPC_PEERING_DELETED -- A VPC peering connection has been
    --     successfully deleted.
    --
    -- __Spot instance events:__
    --
    -- -   INSTANCE_INTERRUPTED -- A spot instance was interrupted by EC2 with
    --     a two-minute notification.
    --
    -- __Other fleet events:__
    --
    -- -   FLEET_SCALING_EVENT -- A change was made to the fleet\'s capacity
    --     settings (desired instances, minimum\/maximum scaling limits). Event
    --     messaging includes the new capacity settings.
    --
    -- -   FLEET_NEW_GAME_SESSION_PROTECTION_POLICY_UPDATED -- A change was
    --     made to the fleet\'s game session protection policy setting. Event
    --     messaging includes both the old and new policy setting.
    --
    -- -   FLEET_DELETED -- A request to delete a fleet was initiated.
    --
    -- -   GENERIC_EVENT -- An unspecified event has occurred.
    Event -> Maybe EventCode
eventCode :: Prelude.Maybe EventCode,
    -- | A unique identifier for a fleet event.
    Event -> Maybe Text
eventId :: Prelude.Maybe Prelude.Text
  }
  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:
--
-- 'resourceId', 'event_resourceId' - A unique identifier for an event resource, such as a fleet ID.
--
-- 'preSignedLogUrl', 'event_preSignedLogUrl' - Location of stored logs with additional detail that is related to the
-- event. This is useful for debugging issues. The URL is valid for 15
-- minutes. You can also access fleet creation logs through the GameLift
-- console.
--
-- 'eventTime', 'event_eventTime' - Time stamp indicating when this event occurred. Format is a number
-- expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'message', 'event_message' - Additional information related to the event.
--
-- 'eventCode', 'event_eventCode' - The type of event being logged.
--
-- __Fleet creation events (ordered by fleet creation activity):__
--
-- -   FLEET_CREATED -- A fleet resource was successfully created with a
--     status of @NEW@. Event messaging includes the fleet ID.
--
-- -   FLEET_STATE_DOWNLOADING -- Fleet status changed from @NEW@ to
--     @DOWNLOADING@. The compressed build has started downloading to a
--     fleet instance for installation.
--
-- -   FLEET_BINARY_DOWNLOAD_FAILED -- The build failed to download to the
--     fleet instance.
--
-- -   FLEET_CREATION_EXTRACTING_BUILD – The game server build was
--     successfully downloaded to an instance, and the build files are now
--     being extracted from the uploaded build and saved to an instance.
--     Failure at this stage prevents a fleet from moving to @ACTIVE@
--     status. Logs for this stage display a list of the files that are
--     extracted and saved on the instance. Access the logs by using the
--     URL in /PreSignedLogUrl/.
--
-- -   FLEET_CREATION_RUNNING_INSTALLER – The game server build files were
--     successfully extracted, and the GameLift is now running the build\'s
--     install script (if one is included). Failure in this stage prevents
--     a fleet from moving to @ACTIVE@ status. Logs for this stage list the
--     installation steps and whether or not the install completed
--     successfully. Access the logs by using the URL in /PreSignedLogUrl/.
--
-- -   FLEET_CREATION_VALIDATING_RUNTIME_CONFIG -- The build process was
--     successful, and the GameLift is now verifying that the game server
--     launch paths, which are specified in the fleet\'s runtime
--     configuration, exist. If any listed launch path exists, GameLift
--     tries to launch a game server process and waits for the process to
--     report ready. Failures in this stage prevent a fleet from moving to
--     @ACTIVE@ status. Logs for this stage list the launch paths in the
--     runtime configuration and indicate whether each is found. Access the
--     logs by using the URL in /PreSignedLogUrl/.
--
-- -   FLEET_STATE_VALIDATING -- Fleet status changed from @DOWNLOADING@ to
--     @VALIDATING@.
--
-- -   FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the runtime
--     configuration failed because the executable specified in a launch
--     path does not exist on the instance.
--
-- -   FLEET_STATE_BUILDING -- Fleet status changed from @VALIDATING@ to
--     @BUILDING@.
--
-- -   FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the
--     runtime configuration failed because the executable specified in a
--     launch path failed to run on the fleet instance.
--
-- -   FLEET_STATE_ACTIVATING -- Fleet status changed from @BUILDING@ to
--     @ACTIVATING@.
--
-- -   FLEET_ACTIVATION_FAILED - The fleet failed to successfully complete
--     one of the steps in the fleet activation process. This event code
--     indicates that the game build was successfully downloaded to a fleet
--     instance, built, and validated, but was not able to start a server
--     process. Learn more at
--     <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation Debug Fleet Creation Issues>
--
-- -   FLEET_STATE_ACTIVE -- The fleet\'s status changed from @ACTIVATING@
--     to @ACTIVE@. The fleet is now ready to host game sessions.
--
-- __VPC peering events:__
--
-- -   FLEET_VPC_PEERING_SUCCEEDED -- A VPC peering connection has been
--     established between the VPC for an GameLift fleet and a VPC in your
--     AWS account.
--
-- -   FLEET_VPC_PEERING_FAILED -- A requested VPC peering connection has
--     failed. Event details and status information (see
--     DescribeVpcPeeringConnections) provide additional detail. A common
--     reason for peering failure is that the two VPCs have overlapping
--     CIDR blocks of IPv4 addresses. To resolve this, change the CIDR
--     block for the VPC in your AWS account. For more information on VPC
--     peering failures, see
--     <https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html>
--
-- -   FLEET_VPC_PEERING_DELETED -- A VPC peering connection has been
--     successfully deleted.
--
-- __Spot instance events:__
--
-- -   INSTANCE_INTERRUPTED -- A spot instance was interrupted by EC2 with
--     a two-minute notification.
--
-- __Other fleet events:__
--
-- -   FLEET_SCALING_EVENT -- A change was made to the fleet\'s capacity
--     settings (desired instances, minimum\/maximum scaling limits). Event
--     messaging includes the new capacity settings.
--
-- -   FLEET_NEW_GAME_SESSION_PROTECTION_POLICY_UPDATED -- A change was
--     made to the fleet\'s game session protection policy setting. Event
--     messaging includes both the old and new policy setting.
--
-- -   FLEET_DELETED -- A request to delete a fleet was initiated.
--
-- -   GENERIC_EVENT -- An unspecified event has occurred.
--
-- 'eventId', 'event_eventId' - A unique identifier for a fleet event.
newEvent ::
  Event
newEvent :: Event
newEvent =
  Event' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe EventCode
-> Maybe Text
-> Event
Event'
    { $sel:resourceId:Event' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preSignedLogUrl:Event' :: Maybe Text
preSignedLogUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTime:Event' :: Maybe POSIX
eventTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:message:Event' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventCode:Event' :: Maybe EventCode
eventCode = Maybe EventCode
forall a. Maybe a
Prelude.Nothing,
      $sel:eventId:Event' :: Maybe Text
eventId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for an event resource, such as a fleet ID.
event_resourceId :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_resourceId :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_resourceId = (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
resourceId :: Maybe Text
$sel:resourceId:Event' :: Event -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:resourceId:Event' :: Maybe Text
resourceId = Maybe Text
a} :: Event)

-- | Location of stored logs with additional detail that is related to the
-- event. This is useful for debugging issues. The URL is valid for 15
-- minutes. You can also access fleet creation logs through the GameLift
-- console.
event_preSignedLogUrl :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_preSignedLogUrl :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_preSignedLogUrl = (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
preSignedLogUrl :: Maybe Text
$sel:preSignedLogUrl:Event' :: Event -> Maybe Text
preSignedLogUrl} -> Maybe Text
preSignedLogUrl) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:preSignedLogUrl:Event' :: Maybe Text
preSignedLogUrl = Maybe Text
a} :: Event)

-- | Time stamp indicating when this event occurred. Format is a number
-- expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
event_eventTime :: Lens.Lens' Event (Prelude.Maybe Prelude.UTCTime)
event_eventTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Event -> f Event
event_eventTime = (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
eventTime :: Maybe POSIX
$sel:eventTime:Event' :: Event -> Maybe POSIX
eventTime} -> Maybe POSIX
eventTime) (\s :: Event
s@Event' {} Maybe POSIX
a -> Event
s {$sel:eventTime:Event' :: Maybe POSIX
eventTime = 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

-- | Additional information related to the event.
event_message :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_message :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_message = (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
message :: Maybe Text
$sel:message:Event' :: Event -> Maybe Text
message} -> Maybe Text
message) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:message:Event' :: Maybe Text
message = Maybe Text
a} :: Event)

-- | The type of event being logged.
--
-- __Fleet creation events (ordered by fleet creation activity):__
--
-- -   FLEET_CREATED -- A fleet resource was successfully created with a
--     status of @NEW@. Event messaging includes the fleet ID.
--
-- -   FLEET_STATE_DOWNLOADING -- Fleet status changed from @NEW@ to
--     @DOWNLOADING@. The compressed build has started downloading to a
--     fleet instance for installation.
--
-- -   FLEET_BINARY_DOWNLOAD_FAILED -- The build failed to download to the
--     fleet instance.
--
-- -   FLEET_CREATION_EXTRACTING_BUILD – The game server build was
--     successfully downloaded to an instance, and the build files are now
--     being extracted from the uploaded build and saved to an instance.
--     Failure at this stage prevents a fleet from moving to @ACTIVE@
--     status. Logs for this stage display a list of the files that are
--     extracted and saved on the instance. Access the logs by using the
--     URL in /PreSignedLogUrl/.
--
-- -   FLEET_CREATION_RUNNING_INSTALLER – The game server build files were
--     successfully extracted, and the GameLift is now running the build\'s
--     install script (if one is included). Failure in this stage prevents
--     a fleet from moving to @ACTIVE@ status. Logs for this stage list the
--     installation steps and whether or not the install completed
--     successfully. Access the logs by using the URL in /PreSignedLogUrl/.
--
-- -   FLEET_CREATION_VALIDATING_RUNTIME_CONFIG -- The build process was
--     successful, and the GameLift is now verifying that the game server
--     launch paths, which are specified in the fleet\'s runtime
--     configuration, exist. If any listed launch path exists, GameLift
--     tries to launch a game server process and waits for the process to
--     report ready. Failures in this stage prevent a fleet from moving to
--     @ACTIVE@ status. Logs for this stage list the launch paths in the
--     runtime configuration and indicate whether each is found. Access the
--     logs by using the URL in /PreSignedLogUrl/.
--
-- -   FLEET_STATE_VALIDATING -- Fleet status changed from @DOWNLOADING@ to
--     @VALIDATING@.
--
-- -   FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the runtime
--     configuration failed because the executable specified in a launch
--     path does not exist on the instance.
--
-- -   FLEET_STATE_BUILDING -- Fleet status changed from @VALIDATING@ to
--     @BUILDING@.
--
-- -   FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the
--     runtime configuration failed because the executable specified in a
--     launch path failed to run on the fleet instance.
--
-- -   FLEET_STATE_ACTIVATING -- Fleet status changed from @BUILDING@ to
--     @ACTIVATING@.
--
-- -   FLEET_ACTIVATION_FAILED - The fleet failed to successfully complete
--     one of the steps in the fleet activation process. This event code
--     indicates that the game build was successfully downloaded to a fleet
--     instance, built, and validated, but was not able to start a server
--     process. Learn more at
--     <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation Debug Fleet Creation Issues>
--
-- -   FLEET_STATE_ACTIVE -- The fleet\'s status changed from @ACTIVATING@
--     to @ACTIVE@. The fleet is now ready to host game sessions.
--
-- __VPC peering events:__
--
-- -   FLEET_VPC_PEERING_SUCCEEDED -- A VPC peering connection has been
--     established between the VPC for an GameLift fleet and a VPC in your
--     AWS account.
--
-- -   FLEET_VPC_PEERING_FAILED -- A requested VPC peering connection has
--     failed. Event details and status information (see
--     DescribeVpcPeeringConnections) provide additional detail. A common
--     reason for peering failure is that the two VPCs have overlapping
--     CIDR blocks of IPv4 addresses. To resolve this, change the CIDR
--     block for the VPC in your AWS account. For more information on VPC
--     peering failures, see
--     <https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html>
--
-- -   FLEET_VPC_PEERING_DELETED -- A VPC peering connection has been
--     successfully deleted.
--
-- __Spot instance events:__
--
-- -   INSTANCE_INTERRUPTED -- A spot instance was interrupted by EC2 with
--     a two-minute notification.
--
-- __Other fleet events:__
--
-- -   FLEET_SCALING_EVENT -- A change was made to the fleet\'s capacity
--     settings (desired instances, minimum\/maximum scaling limits). Event
--     messaging includes the new capacity settings.
--
-- -   FLEET_NEW_GAME_SESSION_PROTECTION_POLICY_UPDATED -- A change was
--     made to the fleet\'s game session protection policy setting. Event
--     messaging includes both the old and new policy setting.
--
-- -   FLEET_DELETED -- A request to delete a fleet was initiated.
--
-- -   GENERIC_EVENT -- An unspecified event has occurred.
event_eventCode :: Lens.Lens' Event (Prelude.Maybe EventCode)
event_eventCode :: (Maybe EventCode -> f (Maybe EventCode)) -> Event -> f Event
event_eventCode = (Event -> Maybe EventCode)
-> (Event -> Maybe EventCode -> Event)
-> Lens Event Event (Maybe EventCode) (Maybe EventCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe EventCode
eventCode :: Maybe EventCode
$sel:eventCode:Event' :: Event -> Maybe EventCode
eventCode} -> Maybe EventCode
eventCode) (\s :: Event
s@Event' {} Maybe EventCode
a -> Event
s {$sel:eventCode:Event' :: Maybe EventCode
eventCode = Maybe EventCode
a} :: Event)

-- | A unique identifier for a fleet event.
event_eventId :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_eventId :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_eventId = (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
eventId :: Maybe Text
$sel:eventId:Event' :: Event -> Maybe Text
eventId} -> Maybe Text
eventId) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:eventId:Event' :: Maybe Text
eventId = Maybe Text
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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe EventCode
-> Maybe Text
-> Event
Event'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe EventCode
 -> Maybe Text
 -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe EventCode
      -> Maybe Text
      -> Event)
forall (f :: * -> *) a b. Functor 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
"ResourceId")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe EventCode
   -> Maybe Text
   -> Event)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe EventCode -> Maybe Text -> 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
"PreSignedLogUrl")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe EventCode -> Maybe Text -> Event)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe EventCode -> Maybe Text -> 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
"EventTime")
            Parser (Maybe Text -> Maybe EventCode -> Maybe Text -> Event)
-> Parser (Maybe Text)
-> Parser (Maybe EventCode -> Maybe Text -> 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
"Message")
            Parser (Maybe EventCode -> Maybe Text -> Event)
-> Parser (Maybe EventCode) -> Parser (Maybe Text -> Event)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventCode")
            Parser (Maybe Text -> Event) -> Parser (Maybe Text) -> Parser 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
"EventId")
      )

instance Prelude.Hashable Event

instance Prelude.NFData Event