{-# 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.ElasticBeanstalk.Types.EventDescription
-- 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.ElasticBeanstalk.Types.EventDescription where

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.EventSeverity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an event.
--
-- /See:/ 'newEventDescription' smart constructor.
data EventDescription = EventDescription'
  { -- | The web service request ID for the activity of this event.
    EventDescription -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The name of the configuration associated with this event.
    EventDescription -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The severity level of this event.
    EventDescription -> Maybe EventSeverity
severity :: Prelude.Maybe EventSeverity,
    -- | The release label for the application version associated with this
    -- event.
    EventDescription -> Maybe Text
versionLabel :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the platform version.
    EventDescription -> Maybe Text
platformArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the environment associated with this event.
    EventDescription -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
    -- | The application associated with the event.
    EventDescription -> Maybe Text
applicationName :: Prelude.Maybe Prelude.Text,
    -- | The date when the event occurred.
    EventDescription -> Maybe ISO8601
eventDate :: Prelude.Maybe Core.ISO8601,
    -- | The event message.
    EventDescription -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (EventDescription -> EventDescription -> Bool
(EventDescription -> EventDescription -> Bool)
-> (EventDescription -> EventDescription -> Bool)
-> Eq EventDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventDescription -> EventDescription -> Bool
$c/= :: EventDescription -> EventDescription -> Bool
== :: EventDescription -> EventDescription -> Bool
$c== :: EventDescription -> EventDescription -> Bool
Prelude.Eq, ReadPrec [EventDescription]
ReadPrec EventDescription
Int -> ReadS EventDescription
ReadS [EventDescription]
(Int -> ReadS EventDescription)
-> ReadS [EventDescription]
-> ReadPrec EventDescription
-> ReadPrec [EventDescription]
-> Read EventDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventDescription]
$creadListPrec :: ReadPrec [EventDescription]
readPrec :: ReadPrec EventDescription
$creadPrec :: ReadPrec EventDescription
readList :: ReadS [EventDescription]
$creadList :: ReadS [EventDescription]
readsPrec :: Int -> ReadS EventDescription
$creadsPrec :: Int -> ReadS EventDescription
Prelude.Read, Int -> EventDescription -> ShowS
[EventDescription] -> ShowS
EventDescription -> String
(Int -> EventDescription -> ShowS)
-> (EventDescription -> String)
-> ([EventDescription] -> ShowS)
-> Show EventDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventDescription] -> ShowS
$cshowList :: [EventDescription] -> ShowS
show :: EventDescription -> String
$cshow :: EventDescription -> String
showsPrec :: Int -> EventDescription -> ShowS
$cshowsPrec :: Int -> EventDescription -> ShowS
Prelude.Show, (forall x. EventDescription -> Rep EventDescription x)
-> (forall x. Rep EventDescription x -> EventDescription)
-> Generic EventDescription
forall x. Rep EventDescription x -> EventDescription
forall x. EventDescription -> Rep EventDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventDescription x -> EventDescription
$cfrom :: forall x. EventDescription -> Rep EventDescription x
Prelude.Generic)

-- |
-- Create a value of 'EventDescription' 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:
--
-- 'requestId', 'eventDescription_requestId' - The web service request ID for the activity of this event.
--
-- 'templateName', 'eventDescription_templateName' - The name of the configuration associated with this event.
--
-- 'severity', 'eventDescription_severity' - The severity level of this event.
--
-- 'versionLabel', 'eventDescription_versionLabel' - The release label for the application version associated with this
-- event.
--
-- 'platformArn', 'eventDescription_platformArn' - The ARN of the platform version.
--
-- 'environmentName', 'eventDescription_environmentName' - The name of the environment associated with this event.
--
-- 'applicationName', 'eventDescription_applicationName' - The application associated with the event.
--
-- 'eventDate', 'eventDescription_eventDate' - The date when the event occurred.
--
-- 'message', 'eventDescription_message' - The event message.
newEventDescription ::
  EventDescription
newEventDescription :: EventDescription
newEventDescription =
  EventDescription' :: Maybe Text
-> Maybe Text
-> Maybe EventSeverity
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> EventDescription
EventDescription'
    { $sel:requestId:EventDescription' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:EventDescription' :: Maybe Text
templateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:severity:EventDescription' :: Maybe EventSeverity
severity = Maybe EventSeverity
forall a. Maybe a
Prelude.Nothing,
      $sel:versionLabel:EventDescription' :: Maybe Text
versionLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platformArn:EventDescription' :: Maybe Text
platformArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentName:EventDescription' :: Maybe Text
environmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationName:EventDescription' :: Maybe Text
applicationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventDate:EventDescription' :: Maybe ISO8601
eventDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:message:EventDescription' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The web service request ID for the activity of this event.
eventDescription_requestId :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_requestId :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_requestId = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
requestId :: Maybe Text
$sel:requestId:EventDescription' :: EventDescription -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:requestId:EventDescription' :: Maybe Text
requestId = Maybe Text
a} :: EventDescription)

-- | The name of the configuration associated with this event.
eventDescription_templateName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_templateName :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_templateName = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
templateName :: Maybe Text
$sel:templateName:EventDescription' :: EventDescription -> Maybe Text
templateName} -> Maybe Text
templateName) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:templateName:EventDescription' :: Maybe Text
templateName = Maybe Text
a} :: EventDescription)

-- | The severity level of this event.
eventDescription_severity :: Lens.Lens' EventDescription (Prelude.Maybe EventSeverity)
eventDescription_severity :: (Maybe EventSeverity -> f (Maybe EventSeverity))
-> EventDescription -> f EventDescription
eventDescription_severity = (EventDescription -> Maybe EventSeverity)
-> (EventDescription -> Maybe EventSeverity -> EventDescription)
-> Lens
     EventDescription
     EventDescription
     (Maybe EventSeverity)
     (Maybe EventSeverity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe EventSeverity
severity :: Maybe EventSeverity
$sel:severity:EventDescription' :: EventDescription -> Maybe EventSeverity
severity} -> Maybe EventSeverity
severity) (\s :: EventDescription
s@EventDescription' {} Maybe EventSeverity
a -> EventDescription
s {$sel:severity:EventDescription' :: Maybe EventSeverity
severity = Maybe EventSeverity
a} :: EventDescription)

-- | The release label for the application version associated with this
-- event.
eventDescription_versionLabel :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_versionLabel :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_versionLabel = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
versionLabel :: Maybe Text
$sel:versionLabel:EventDescription' :: EventDescription -> Maybe Text
versionLabel} -> Maybe Text
versionLabel) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:versionLabel:EventDescription' :: Maybe Text
versionLabel = Maybe Text
a} :: EventDescription)

-- | The ARN of the platform version.
eventDescription_platformArn :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_platformArn :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_platformArn = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
platformArn :: Maybe Text
$sel:platformArn:EventDescription' :: EventDescription -> Maybe Text
platformArn} -> Maybe Text
platformArn) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:platformArn:EventDescription' :: Maybe Text
platformArn = Maybe Text
a} :: EventDescription)

-- | The name of the environment associated with this event.
eventDescription_environmentName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_environmentName :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_environmentName = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:EventDescription' :: EventDescription -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:environmentName:EventDescription' :: Maybe Text
environmentName = Maybe Text
a} :: EventDescription)

-- | The application associated with the event.
eventDescription_applicationName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_applicationName :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_applicationName = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
applicationName :: Maybe Text
$sel:applicationName:EventDescription' :: EventDescription -> Maybe Text
applicationName} -> Maybe Text
applicationName) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:applicationName:EventDescription' :: Maybe Text
applicationName = Maybe Text
a} :: EventDescription)

-- | The date when the event occurred.
eventDescription_eventDate :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.UTCTime)
eventDescription_eventDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventDescription -> f EventDescription
eventDescription_eventDate = (EventDescription -> Maybe ISO8601)
-> (EventDescription -> Maybe ISO8601 -> EventDescription)
-> Lens
     EventDescription EventDescription (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe ISO8601
eventDate :: Maybe ISO8601
$sel:eventDate:EventDescription' :: EventDescription -> Maybe ISO8601
eventDate} -> Maybe ISO8601
eventDate) (\s :: EventDescription
s@EventDescription' {} Maybe ISO8601
a -> EventDescription
s {$sel:eventDate:EventDescription' :: Maybe ISO8601
eventDate = Maybe ISO8601
a} :: EventDescription) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> EventDescription -> f EventDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventDescription
-> f EventDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The event message.
eventDescription_message :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_message :: (Maybe Text -> f (Maybe Text))
-> EventDescription -> f EventDescription
eventDescription_message = (EventDescription -> Maybe Text)
-> (EventDescription -> Maybe Text -> EventDescription)
-> Lens EventDescription EventDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDescription' {Maybe Text
message :: Maybe Text
$sel:message:EventDescription' :: EventDescription -> Maybe Text
message} -> Maybe Text
message) (\s :: EventDescription
s@EventDescription' {} Maybe Text
a -> EventDescription
s {$sel:message:EventDescription' :: Maybe Text
message = Maybe Text
a} :: EventDescription)

instance Core.FromXML EventDescription where
  parseXML :: [Node] -> Either String EventDescription
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe EventSeverity
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> EventDescription
EventDescription'
      (Maybe Text
 -> Maybe Text
 -> Maybe EventSeverity
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> EventDescription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe EventSeverity
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> EventDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequestId")
      Either
  String
  (Maybe Text
   -> Maybe EventSeverity
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> EventDescription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe EventSeverity
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TemplateName")
      Either
  String
  (Maybe EventSeverity
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> EventDescription)
-> Either String (Maybe EventSeverity)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe EventSeverity)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Severity")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> EventDescription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VersionLabel")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> EventDescription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe ISO8601 -> Maybe Text -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PlatformArn")
      Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe ISO8601 -> Maybe Text -> EventDescription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe ISO8601 -> Maybe Text -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EnvironmentName")
      Either
  String
  (Maybe Text -> Maybe ISO8601 -> Maybe Text -> EventDescription)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> Maybe Text -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ApplicationName")
      Either String (Maybe ISO8601 -> Maybe Text -> EventDescription)
-> Either String (Maybe ISO8601)
-> Either String (Maybe Text -> EventDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EventDate")
      Either String (Maybe Text -> EventDescription)
-> Either String (Maybe Text) -> Either String EventDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Message")

instance Prelude.Hashable EventDescription

instance Prelude.NFData EventDescription