{-# 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.SWF.Types.MarkerRecordedEventAttributes
-- 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.SWF.Types.MarkerRecordedEventAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides the details of the @MarkerRecorded@ event.
--
-- /See:/ 'newMarkerRecordedEventAttributes' smart constructor.
data MarkerRecordedEventAttributes = MarkerRecordedEventAttributes'
  { -- | The details of the marker.
    MarkerRecordedEventAttributes -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
    -- | The name of the marker.
    MarkerRecordedEventAttributes -> Text
markerName :: Prelude.Text,
    -- | The ID of the @DecisionTaskCompleted@ event corresponding to the
    -- decision task that resulted in the @RecordMarker@ decision that
    -- requested this marker. This information can be useful for diagnosing
    -- problems by tracing back the chain of events leading up to this event.
    MarkerRecordedEventAttributes -> Integer
decisionTaskCompletedEventId :: Prelude.Integer
  }
  deriving (MarkerRecordedEventAttributes
-> MarkerRecordedEventAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MarkerRecordedEventAttributes
-> MarkerRecordedEventAttributes -> Bool
$c/= :: MarkerRecordedEventAttributes
-> MarkerRecordedEventAttributes -> Bool
== :: MarkerRecordedEventAttributes
-> MarkerRecordedEventAttributes -> Bool
$c== :: MarkerRecordedEventAttributes
-> MarkerRecordedEventAttributes -> Bool
Prelude.Eq, ReadPrec [MarkerRecordedEventAttributes]
ReadPrec MarkerRecordedEventAttributes
Int -> ReadS MarkerRecordedEventAttributes
ReadS [MarkerRecordedEventAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MarkerRecordedEventAttributes]
$creadListPrec :: ReadPrec [MarkerRecordedEventAttributes]
readPrec :: ReadPrec MarkerRecordedEventAttributes
$creadPrec :: ReadPrec MarkerRecordedEventAttributes
readList :: ReadS [MarkerRecordedEventAttributes]
$creadList :: ReadS [MarkerRecordedEventAttributes]
readsPrec :: Int -> ReadS MarkerRecordedEventAttributes
$creadsPrec :: Int -> ReadS MarkerRecordedEventAttributes
Prelude.Read, Int -> MarkerRecordedEventAttributes -> ShowS
[MarkerRecordedEventAttributes] -> ShowS
MarkerRecordedEventAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MarkerRecordedEventAttributes] -> ShowS
$cshowList :: [MarkerRecordedEventAttributes] -> ShowS
show :: MarkerRecordedEventAttributes -> String
$cshow :: MarkerRecordedEventAttributes -> String
showsPrec :: Int -> MarkerRecordedEventAttributes -> ShowS
$cshowsPrec :: Int -> MarkerRecordedEventAttributes -> ShowS
Prelude.Show, forall x.
Rep MarkerRecordedEventAttributes x
-> MarkerRecordedEventAttributes
forall x.
MarkerRecordedEventAttributes
-> Rep MarkerRecordedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MarkerRecordedEventAttributes x
-> MarkerRecordedEventAttributes
$cfrom :: forall x.
MarkerRecordedEventAttributes
-> Rep MarkerRecordedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'MarkerRecordedEventAttributes' 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:
--
-- 'details', 'markerRecordedEventAttributes_details' - The details of the marker.
--
-- 'markerName', 'markerRecordedEventAttributes_markerName' - The name of the marker.
--
-- 'decisionTaskCompletedEventId', 'markerRecordedEventAttributes_decisionTaskCompletedEventId' - The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @RecordMarker@ decision that
-- requested this marker. This information can be useful for diagnosing
-- problems by tracing back the chain of events leading up to this event.
newMarkerRecordedEventAttributes ::
  -- | 'markerName'
  Prelude.Text ->
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  MarkerRecordedEventAttributes
newMarkerRecordedEventAttributes :: Text -> Integer -> MarkerRecordedEventAttributes
newMarkerRecordedEventAttributes
  Text
pMarkerName_
  Integer
pDecisionTaskCompletedEventId_ =
    MarkerRecordedEventAttributes'
      { $sel:details:MarkerRecordedEventAttributes' :: Maybe Text
details =
          forall a. Maybe a
Prelude.Nothing,
        $sel:markerName:MarkerRecordedEventAttributes' :: Text
markerName = Text
pMarkerName_,
        $sel:decisionTaskCompletedEventId:MarkerRecordedEventAttributes' :: Integer
decisionTaskCompletedEventId =
          Integer
pDecisionTaskCompletedEventId_
      }

-- | The details of the marker.
markerRecordedEventAttributes_details :: Lens.Lens' MarkerRecordedEventAttributes (Prelude.Maybe Prelude.Text)
markerRecordedEventAttributes_details :: Lens' MarkerRecordedEventAttributes (Maybe Text)
markerRecordedEventAttributes_details = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarkerRecordedEventAttributes' {Maybe Text
details :: Maybe Text
$sel:details:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Maybe Text
details} -> Maybe Text
details) (\s :: MarkerRecordedEventAttributes
s@MarkerRecordedEventAttributes' {} Maybe Text
a -> MarkerRecordedEventAttributes
s {$sel:details:MarkerRecordedEventAttributes' :: Maybe Text
details = Maybe Text
a} :: MarkerRecordedEventAttributes)

-- | The name of the marker.
markerRecordedEventAttributes_markerName :: Lens.Lens' MarkerRecordedEventAttributes Prelude.Text
markerRecordedEventAttributes_markerName :: Lens' MarkerRecordedEventAttributes Text
markerRecordedEventAttributes_markerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarkerRecordedEventAttributes' {Text
markerName :: Text
$sel:markerName:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Text
markerName} -> Text
markerName) (\s :: MarkerRecordedEventAttributes
s@MarkerRecordedEventAttributes' {} Text
a -> MarkerRecordedEventAttributes
s {$sel:markerName:MarkerRecordedEventAttributes' :: Text
markerName = Text
a} :: MarkerRecordedEventAttributes)

-- | The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @RecordMarker@ decision that
-- requested this marker. This information can be useful for diagnosing
-- problems by tracing back the chain of events leading up to this event.
markerRecordedEventAttributes_decisionTaskCompletedEventId :: Lens.Lens' MarkerRecordedEventAttributes Prelude.Integer
markerRecordedEventAttributes_decisionTaskCompletedEventId :: Lens' MarkerRecordedEventAttributes Integer
markerRecordedEventAttributes_decisionTaskCompletedEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarkerRecordedEventAttributes' {Integer
decisionTaskCompletedEventId :: Integer
$sel:decisionTaskCompletedEventId:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Integer
decisionTaskCompletedEventId} -> Integer
decisionTaskCompletedEventId) (\s :: MarkerRecordedEventAttributes
s@MarkerRecordedEventAttributes' {} Integer
a -> MarkerRecordedEventAttributes
s {$sel:decisionTaskCompletedEventId:MarkerRecordedEventAttributes' :: Integer
decisionTaskCompletedEventId = Integer
a} :: MarkerRecordedEventAttributes)

instance Data.FromJSON MarkerRecordedEventAttributes where
  parseJSON :: Value -> Parser MarkerRecordedEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MarkerRecordedEventAttributes"
      ( \Object
x ->
          Maybe Text -> Text -> Integer -> MarkerRecordedEventAttributes
MarkerRecordedEventAttributes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"details")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"markerName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"decisionTaskCompletedEventId")
      )

instance
  Prelude.Hashable
    MarkerRecordedEventAttributes
  where
  hashWithSalt :: Int -> MarkerRecordedEventAttributes -> Int
hashWithSalt Int
_salt MarkerRecordedEventAttributes' {Integer
Maybe Text
Text
decisionTaskCompletedEventId :: Integer
markerName :: Text
details :: Maybe Text
$sel:decisionTaskCompletedEventId:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Integer
$sel:markerName:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Text
$sel:details:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
details
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
markerName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
decisionTaskCompletedEventId

instance Prelude.NFData MarkerRecordedEventAttributes where
  rnf :: MarkerRecordedEventAttributes -> ()
rnf MarkerRecordedEventAttributes' {Integer
Maybe Text
Text
decisionTaskCompletedEventId :: Integer
markerName :: Text
details :: Maybe Text
$sel:decisionTaskCompletedEventId:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Integer
$sel:markerName:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Text
$sel:details:MarkerRecordedEventAttributes' :: MarkerRecordedEventAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
details
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
markerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
decisionTaskCompletedEventId