{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticBeanstalk.Types.EventDescription where

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

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

-- | The application associated with the event.
eventDescription_applicationName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_applicationName :: Lens' EventDescription (Maybe Text)
eventDescription_applicationName = 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 name of the environment associated with this event.
eventDescription_environmentName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_environmentName :: Lens' EventDescription (Maybe Text)
eventDescription_environmentName = 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 date when the event occurred.
eventDescription_eventDate :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.UTCTime)
eventDescription_eventDate :: Lens' EventDescription (Maybe UTCTime)
eventDescription_eventDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The event message.
eventDescription_message :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_message :: Lens' EventDescription (Maybe Text)
eventDescription_message = 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)

-- | The ARN of the platform version.
eventDescription_platformArn :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_platformArn :: Lens' EventDescription (Maybe Text)
eventDescription_platformArn = 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 web service request ID for the activity of this event.
eventDescription_requestId :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_requestId :: Lens' EventDescription (Maybe Text)
eventDescription_requestId = 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 severity level of this event.
eventDescription_severity :: Lens.Lens' EventDescription (Prelude.Maybe EventSeverity)
eventDescription_severity :: Lens' EventDescription (Maybe EventSeverity)
eventDescription_severity = 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 name of the configuration associated with this event.
eventDescription_templateName :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_templateName :: Lens' EventDescription (Maybe Text)
eventDescription_templateName = 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 release label for the application version associated with this
-- event.
eventDescription_versionLabel :: Lens.Lens' EventDescription (Prelude.Maybe Prelude.Text)
eventDescription_versionLabel :: Lens' EventDescription (Maybe Text)
eventDescription_versionLabel = 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)

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

instance Prelude.Hashable EventDescription where
  hashWithSalt :: Int -> EventDescription -> Int
hashWithSalt Int
_salt EventDescription' {Maybe Text
Maybe ISO8601
Maybe EventSeverity
versionLabel :: Maybe Text
templateName :: Maybe Text
severity :: Maybe EventSeverity
requestId :: Maybe Text
platformArn :: Maybe Text
message :: Maybe Text
eventDate :: Maybe ISO8601
environmentName :: Maybe Text
applicationName :: Maybe Text
$sel:versionLabel:EventDescription' :: EventDescription -> Maybe Text
$sel:templateName:EventDescription' :: EventDescription -> Maybe Text
$sel:severity:EventDescription' :: EventDescription -> Maybe EventSeverity
$sel:requestId:EventDescription' :: EventDescription -> Maybe Text
$sel:platformArn:EventDescription' :: EventDescription -> Maybe Text
$sel:message:EventDescription' :: EventDescription -> Maybe Text
$sel:eventDate:EventDescription' :: EventDescription -> Maybe ISO8601
$sel:environmentName:EventDescription' :: EventDescription -> Maybe Text
$sel:applicationName:EventDescription' :: EventDescription -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
environmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
eventDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventSeverity
severity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionLabel

instance Prelude.NFData EventDescription where
  rnf :: EventDescription -> ()
rnf EventDescription' {Maybe Text
Maybe ISO8601
Maybe EventSeverity
versionLabel :: Maybe Text
templateName :: Maybe Text
severity :: Maybe EventSeverity
requestId :: Maybe Text
platformArn :: Maybe Text
message :: Maybe Text
eventDate :: Maybe ISO8601
environmentName :: Maybe Text
applicationName :: Maybe Text
$sel:versionLabel:EventDescription' :: EventDescription -> Maybe Text
$sel:templateName:EventDescription' :: EventDescription -> Maybe Text
$sel:severity:EventDescription' :: EventDescription -> Maybe EventSeverity
$sel:requestId:EventDescription' :: EventDescription -> Maybe Text
$sel:platformArn:EventDescription' :: EventDescription -> Maybe Text
$sel:message:EventDescription' :: EventDescription -> Maybe Text
$sel:eventDate:EventDescription' :: EventDescription -> Maybe ISO8601
$sel:environmentName:EventDescription' :: EventDescription -> Maybe Text
$sel:applicationName:EventDescription' :: EventDescription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
environmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
eventDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EventSeverity
severity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionLabel