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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.TaskList

-- | Provides details about the @DecisionTaskScheduled@ event.
--
-- /See:/ 'newDecisionTaskScheduledEventAttributes' smart constructor.
data DecisionTaskScheduledEventAttributes = DecisionTaskScheduledEventAttributes'
  { -- | A task priority that, if set, specifies the priority for this decision
    -- task. Valid values are integers that range from Java\'s
    -- @Integer.MIN_VALUE@ (-2147483648) to @Integer.MAX_VALUE@ (2147483647).
    -- Higher numbers indicate higher priority.
    --
    -- For more information about setting task priority, see
    -- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
    -- in the /Amazon SWF Developer Guide/.
    DecisionTaskScheduledEventAttributes -> Maybe Text
taskPriority :: Prelude.Maybe Prelude.Text,
    -- | The maximum duration for this decision task. The task is considered
    -- timed out if it doesn\'t completed within this duration.
    --
    -- The duration is specified in seconds, an integer greater than or equal
    -- to @0@. You can use @NONE@ to specify unlimited duration.
    DecisionTaskScheduledEventAttributes -> Maybe Text
startToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The name of the task list in which the decision task was scheduled.
    DecisionTaskScheduledEventAttributes -> TaskList
taskList :: TaskList
  }
  deriving (DecisionTaskScheduledEventAttributes
-> DecisionTaskScheduledEventAttributes -> Bool
(DecisionTaskScheduledEventAttributes
 -> DecisionTaskScheduledEventAttributes -> Bool)
-> (DecisionTaskScheduledEventAttributes
    -> DecisionTaskScheduledEventAttributes -> Bool)
-> Eq DecisionTaskScheduledEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecisionTaskScheduledEventAttributes
-> DecisionTaskScheduledEventAttributes -> Bool
$c/= :: DecisionTaskScheduledEventAttributes
-> DecisionTaskScheduledEventAttributes -> Bool
== :: DecisionTaskScheduledEventAttributes
-> DecisionTaskScheduledEventAttributes -> Bool
$c== :: DecisionTaskScheduledEventAttributes
-> DecisionTaskScheduledEventAttributes -> Bool
Prelude.Eq, ReadPrec [DecisionTaskScheduledEventAttributes]
ReadPrec DecisionTaskScheduledEventAttributes
Int -> ReadS DecisionTaskScheduledEventAttributes
ReadS [DecisionTaskScheduledEventAttributes]
(Int -> ReadS DecisionTaskScheduledEventAttributes)
-> ReadS [DecisionTaskScheduledEventAttributes]
-> ReadPrec DecisionTaskScheduledEventAttributes
-> ReadPrec [DecisionTaskScheduledEventAttributes]
-> Read DecisionTaskScheduledEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecisionTaskScheduledEventAttributes]
$creadListPrec :: ReadPrec [DecisionTaskScheduledEventAttributes]
readPrec :: ReadPrec DecisionTaskScheduledEventAttributes
$creadPrec :: ReadPrec DecisionTaskScheduledEventAttributes
readList :: ReadS [DecisionTaskScheduledEventAttributes]
$creadList :: ReadS [DecisionTaskScheduledEventAttributes]
readsPrec :: Int -> ReadS DecisionTaskScheduledEventAttributes
$creadsPrec :: Int -> ReadS DecisionTaskScheduledEventAttributes
Prelude.Read, Int -> DecisionTaskScheduledEventAttributes -> ShowS
[DecisionTaskScheduledEventAttributes] -> ShowS
DecisionTaskScheduledEventAttributes -> String
(Int -> DecisionTaskScheduledEventAttributes -> ShowS)
-> (DecisionTaskScheduledEventAttributes -> String)
-> ([DecisionTaskScheduledEventAttributes] -> ShowS)
-> Show DecisionTaskScheduledEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecisionTaskScheduledEventAttributes] -> ShowS
$cshowList :: [DecisionTaskScheduledEventAttributes] -> ShowS
show :: DecisionTaskScheduledEventAttributes -> String
$cshow :: DecisionTaskScheduledEventAttributes -> String
showsPrec :: Int -> DecisionTaskScheduledEventAttributes -> ShowS
$cshowsPrec :: Int -> DecisionTaskScheduledEventAttributes -> ShowS
Prelude.Show, (forall x.
 DecisionTaskScheduledEventAttributes
 -> Rep DecisionTaskScheduledEventAttributes x)
-> (forall x.
    Rep DecisionTaskScheduledEventAttributes x
    -> DecisionTaskScheduledEventAttributes)
-> Generic DecisionTaskScheduledEventAttributes
forall x.
Rep DecisionTaskScheduledEventAttributes x
-> DecisionTaskScheduledEventAttributes
forall x.
DecisionTaskScheduledEventAttributes
-> Rep DecisionTaskScheduledEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DecisionTaskScheduledEventAttributes x
-> DecisionTaskScheduledEventAttributes
$cfrom :: forall x.
DecisionTaskScheduledEventAttributes
-> Rep DecisionTaskScheduledEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'DecisionTaskScheduledEventAttributes' 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:
--
-- 'taskPriority', 'decisionTaskScheduledEventAttributes_taskPriority' - A task priority that, if set, specifies the priority for this decision
-- task. Valid values are integers that range from Java\'s
-- @Integer.MIN_VALUE@ (-2147483648) to @Integer.MAX_VALUE@ (2147483647).
-- Higher numbers indicate higher priority.
--
-- For more information about setting task priority, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
-- in the /Amazon SWF Developer Guide/.
--
-- 'startToCloseTimeout', 'decisionTaskScheduledEventAttributes_startToCloseTimeout' - The maximum duration for this decision task. The task is considered
-- timed out if it doesn\'t completed within this duration.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- 'taskList', 'decisionTaskScheduledEventAttributes_taskList' - The name of the task list in which the decision task was scheduled.
newDecisionTaskScheduledEventAttributes ::
  -- | 'taskList'
  TaskList ->
  DecisionTaskScheduledEventAttributes
newDecisionTaskScheduledEventAttributes :: TaskList -> DecisionTaskScheduledEventAttributes
newDecisionTaskScheduledEventAttributes TaskList
pTaskList_ =
  DecisionTaskScheduledEventAttributes' :: Maybe Text
-> Maybe Text -> TaskList -> DecisionTaskScheduledEventAttributes
DecisionTaskScheduledEventAttributes'
    { $sel:taskPriority:DecisionTaskScheduledEventAttributes' :: Maybe Text
taskPriority =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startToCloseTimeout:DecisionTaskScheduledEventAttributes' :: Maybe Text
startToCloseTimeout = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskList:DecisionTaskScheduledEventAttributes' :: TaskList
taskList = TaskList
pTaskList_
    }

-- | A task priority that, if set, specifies the priority for this decision
-- task. Valid values are integers that range from Java\'s
-- @Integer.MIN_VALUE@ (-2147483648) to @Integer.MAX_VALUE@ (2147483647).
-- Higher numbers indicate higher priority.
--
-- For more information about setting task priority, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
-- in the /Amazon SWF Developer Guide/.
decisionTaskScheduledEventAttributes_taskPriority :: Lens.Lens' DecisionTaskScheduledEventAttributes (Prelude.Maybe Prelude.Text)
decisionTaskScheduledEventAttributes_taskPriority :: (Maybe Text -> f (Maybe Text))
-> DecisionTaskScheduledEventAttributes
-> f DecisionTaskScheduledEventAttributes
decisionTaskScheduledEventAttributes_taskPriority = (DecisionTaskScheduledEventAttributes -> Maybe Text)
-> (DecisionTaskScheduledEventAttributes
    -> Maybe Text -> DecisionTaskScheduledEventAttributes)
-> Lens
     DecisionTaskScheduledEventAttributes
     DecisionTaskScheduledEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecisionTaskScheduledEventAttributes' {Maybe Text
taskPriority :: Maybe Text
$sel:taskPriority:DecisionTaskScheduledEventAttributes' :: DecisionTaskScheduledEventAttributes -> Maybe Text
taskPriority} -> Maybe Text
taskPriority) (\s :: DecisionTaskScheduledEventAttributes
s@DecisionTaskScheduledEventAttributes' {} Maybe Text
a -> DecisionTaskScheduledEventAttributes
s {$sel:taskPriority:DecisionTaskScheduledEventAttributes' :: Maybe Text
taskPriority = Maybe Text
a} :: DecisionTaskScheduledEventAttributes)

-- | The maximum duration for this decision task. The task is considered
-- timed out if it doesn\'t completed within this duration.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
decisionTaskScheduledEventAttributes_startToCloseTimeout :: Lens.Lens' DecisionTaskScheduledEventAttributes (Prelude.Maybe Prelude.Text)
decisionTaskScheduledEventAttributes_startToCloseTimeout :: (Maybe Text -> f (Maybe Text))
-> DecisionTaskScheduledEventAttributes
-> f DecisionTaskScheduledEventAttributes
decisionTaskScheduledEventAttributes_startToCloseTimeout = (DecisionTaskScheduledEventAttributes -> Maybe Text)
-> (DecisionTaskScheduledEventAttributes
    -> Maybe Text -> DecisionTaskScheduledEventAttributes)
-> Lens
     DecisionTaskScheduledEventAttributes
     DecisionTaskScheduledEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecisionTaskScheduledEventAttributes' {Maybe Text
startToCloseTimeout :: Maybe Text
$sel:startToCloseTimeout:DecisionTaskScheduledEventAttributes' :: DecisionTaskScheduledEventAttributes -> Maybe Text
startToCloseTimeout} -> Maybe Text
startToCloseTimeout) (\s :: DecisionTaskScheduledEventAttributes
s@DecisionTaskScheduledEventAttributes' {} Maybe Text
a -> DecisionTaskScheduledEventAttributes
s {$sel:startToCloseTimeout:DecisionTaskScheduledEventAttributes' :: Maybe Text
startToCloseTimeout = Maybe Text
a} :: DecisionTaskScheduledEventAttributes)

-- | The name of the task list in which the decision task was scheduled.
decisionTaskScheduledEventAttributes_taskList :: Lens.Lens' DecisionTaskScheduledEventAttributes TaskList
decisionTaskScheduledEventAttributes_taskList :: (TaskList -> f TaskList)
-> DecisionTaskScheduledEventAttributes
-> f DecisionTaskScheduledEventAttributes
decisionTaskScheduledEventAttributes_taskList = (DecisionTaskScheduledEventAttributes -> TaskList)
-> (DecisionTaskScheduledEventAttributes
    -> TaskList -> DecisionTaskScheduledEventAttributes)
-> Lens
     DecisionTaskScheduledEventAttributes
     DecisionTaskScheduledEventAttributes
     TaskList
     TaskList
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecisionTaskScheduledEventAttributes' {TaskList
taskList :: TaskList
$sel:taskList:DecisionTaskScheduledEventAttributes' :: DecisionTaskScheduledEventAttributes -> TaskList
taskList} -> TaskList
taskList) (\s :: DecisionTaskScheduledEventAttributes
s@DecisionTaskScheduledEventAttributes' {} TaskList
a -> DecisionTaskScheduledEventAttributes
s {$sel:taskList:DecisionTaskScheduledEventAttributes' :: TaskList
taskList = TaskList
a} :: DecisionTaskScheduledEventAttributes)

instance
  Core.FromJSON
    DecisionTaskScheduledEventAttributes
  where
  parseJSON :: Value -> Parser DecisionTaskScheduledEventAttributes
parseJSON =
    String
-> (Object -> Parser DecisionTaskScheduledEventAttributes)
-> Value
-> Parser DecisionTaskScheduledEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DecisionTaskScheduledEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> TaskList -> DecisionTaskScheduledEventAttributes
DecisionTaskScheduledEventAttributes'
            (Maybe Text
 -> Maybe Text -> TaskList -> DecisionTaskScheduledEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> TaskList -> DecisionTaskScheduledEventAttributes)
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
"taskPriority")
            Parser
  (Maybe Text -> TaskList -> DecisionTaskScheduledEventAttributes)
-> Parser (Maybe Text)
-> Parser (TaskList -> DecisionTaskScheduledEventAttributes)
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
"startToCloseTimeout")
            Parser (TaskList -> DecisionTaskScheduledEventAttributes)
-> Parser TaskList -> Parser DecisionTaskScheduledEventAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TaskList
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"taskList")
      )

instance
  Prelude.Hashable
    DecisionTaskScheduledEventAttributes

instance
  Prelude.NFData
    DecisionTaskScheduledEventAttributes