{-# 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.StepFunctions.Types.ActivityScheduledEventDetails
-- 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.StepFunctions.Types.ActivityScheduledEventDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.StepFunctions.Types.HistoryEventExecutionDataDetails

-- | Contains details about an activity scheduled during an execution.
--
-- /See:/ 'newActivityScheduledEventDetails' smart constructor.
data ActivityScheduledEventDetails = ActivityScheduledEventDetails'
  { -- | The maximum allowed duration between two heartbeats for the activity
    -- task.
    ActivityScheduledEventDetails -> Maybe Integer
heartbeatInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | Contains details about the input for an execution history event.
    ActivityScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
inputDetails :: Prelude.Maybe HistoryEventExecutionDataDetails,
    -- | The JSON data input to the activity task. Length constraints apply to
    -- the payload size, and are expressed as bytes in UTF-8 encoding.
    ActivityScheduledEventDetails -> Maybe (Sensitive Text)
input :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The maximum allowed duration of the activity task.
    ActivityScheduledEventDetails -> Maybe Integer
timeoutInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon Resource Name (ARN) of the scheduled activity.
    ActivityScheduledEventDetails -> Text
resource :: Prelude.Text
  }
  deriving (ActivityScheduledEventDetails
-> ActivityScheduledEventDetails -> Bool
(ActivityScheduledEventDetails
 -> ActivityScheduledEventDetails -> Bool)
-> (ActivityScheduledEventDetails
    -> ActivityScheduledEventDetails -> Bool)
-> Eq ActivityScheduledEventDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityScheduledEventDetails
-> ActivityScheduledEventDetails -> Bool
$c/= :: ActivityScheduledEventDetails
-> ActivityScheduledEventDetails -> Bool
== :: ActivityScheduledEventDetails
-> ActivityScheduledEventDetails -> Bool
$c== :: ActivityScheduledEventDetails
-> ActivityScheduledEventDetails -> Bool
Prelude.Eq, Int -> ActivityScheduledEventDetails -> ShowS
[ActivityScheduledEventDetails] -> ShowS
ActivityScheduledEventDetails -> String
(Int -> ActivityScheduledEventDetails -> ShowS)
-> (ActivityScheduledEventDetails -> String)
-> ([ActivityScheduledEventDetails] -> ShowS)
-> Show ActivityScheduledEventDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityScheduledEventDetails] -> ShowS
$cshowList :: [ActivityScheduledEventDetails] -> ShowS
show :: ActivityScheduledEventDetails -> String
$cshow :: ActivityScheduledEventDetails -> String
showsPrec :: Int -> ActivityScheduledEventDetails -> ShowS
$cshowsPrec :: Int -> ActivityScheduledEventDetails -> ShowS
Prelude.Show, (forall x.
 ActivityScheduledEventDetails
 -> Rep ActivityScheduledEventDetails x)
-> (forall x.
    Rep ActivityScheduledEventDetails x
    -> ActivityScheduledEventDetails)
-> Generic ActivityScheduledEventDetails
forall x.
Rep ActivityScheduledEventDetails x
-> ActivityScheduledEventDetails
forall x.
ActivityScheduledEventDetails
-> Rep ActivityScheduledEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ActivityScheduledEventDetails x
-> ActivityScheduledEventDetails
$cfrom :: forall x.
ActivityScheduledEventDetails
-> Rep ActivityScheduledEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'ActivityScheduledEventDetails' 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:
--
-- 'heartbeatInSeconds', 'activityScheduledEventDetails_heartbeatInSeconds' - The maximum allowed duration between two heartbeats for the activity
-- task.
--
-- 'inputDetails', 'activityScheduledEventDetails_inputDetails' - Contains details about the input for an execution history event.
--
-- 'input', 'activityScheduledEventDetails_input' - The JSON data input to the activity task. Length constraints apply to
-- the payload size, and are expressed as bytes in UTF-8 encoding.
--
-- 'timeoutInSeconds', 'activityScheduledEventDetails_timeoutInSeconds' - The maximum allowed duration of the activity task.
--
-- 'resource', 'activityScheduledEventDetails_resource' - The Amazon Resource Name (ARN) of the scheduled activity.
newActivityScheduledEventDetails ::
  -- | 'resource'
  Prelude.Text ->
  ActivityScheduledEventDetails
newActivityScheduledEventDetails :: Text -> ActivityScheduledEventDetails
newActivityScheduledEventDetails Text
pResource_ =
  ActivityScheduledEventDetails' :: Maybe Integer
-> Maybe HistoryEventExecutionDataDetails
-> Maybe (Sensitive Text)
-> Maybe Integer
-> Text
-> ActivityScheduledEventDetails
ActivityScheduledEventDetails'
    { $sel:heartbeatInSeconds:ActivityScheduledEventDetails' :: Maybe Integer
heartbeatInSeconds =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:inputDetails:ActivityScheduledEventDetails' :: Maybe HistoryEventExecutionDataDetails
inputDetails = Maybe HistoryEventExecutionDataDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:input:ActivityScheduledEventDetails' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:ActivityScheduledEventDetails' :: Maybe Integer
timeoutInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:resource:ActivityScheduledEventDetails' :: Text
resource = Text
pResource_
    }

-- | The maximum allowed duration between two heartbeats for the activity
-- task.
activityScheduledEventDetails_heartbeatInSeconds :: Lens.Lens' ActivityScheduledEventDetails (Prelude.Maybe Prelude.Integer)
activityScheduledEventDetails_heartbeatInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> ActivityScheduledEventDetails -> f ActivityScheduledEventDetails
activityScheduledEventDetails_heartbeatInSeconds = (ActivityScheduledEventDetails -> Maybe Integer)
-> (ActivityScheduledEventDetails
    -> Maybe Integer -> ActivityScheduledEventDetails)
-> Lens
     ActivityScheduledEventDetails
     ActivityScheduledEventDetails
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityScheduledEventDetails' {Maybe Integer
heartbeatInSeconds :: Maybe Integer
$sel:heartbeatInSeconds:ActivityScheduledEventDetails' :: ActivityScheduledEventDetails -> Maybe Integer
heartbeatInSeconds} -> Maybe Integer
heartbeatInSeconds) (\s :: ActivityScheduledEventDetails
s@ActivityScheduledEventDetails' {} Maybe Integer
a -> ActivityScheduledEventDetails
s {$sel:heartbeatInSeconds:ActivityScheduledEventDetails' :: Maybe Integer
heartbeatInSeconds = Maybe Integer
a} :: ActivityScheduledEventDetails)

-- | Contains details about the input for an execution history event.
activityScheduledEventDetails_inputDetails :: Lens.Lens' ActivityScheduledEventDetails (Prelude.Maybe HistoryEventExecutionDataDetails)
activityScheduledEventDetails_inputDetails :: (Maybe HistoryEventExecutionDataDetails
 -> f (Maybe HistoryEventExecutionDataDetails))
-> ActivityScheduledEventDetails -> f ActivityScheduledEventDetails
activityScheduledEventDetails_inputDetails = (ActivityScheduledEventDetails
 -> Maybe HistoryEventExecutionDataDetails)
-> (ActivityScheduledEventDetails
    -> Maybe HistoryEventExecutionDataDetails
    -> ActivityScheduledEventDetails)
-> Lens
     ActivityScheduledEventDetails
     ActivityScheduledEventDetails
     (Maybe HistoryEventExecutionDataDetails)
     (Maybe HistoryEventExecutionDataDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityScheduledEventDetails' {Maybe HistoryEventExecutionDataDetails
inputDetails :: Maybe HistoryEventExecutionDataDetails
$sel:inputDetails:ActivityScheduledEventDetails' :: ActivityScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
inputDetails} -> Maybe HistoryEventExecutionDataDetails
inputDetails) (\s :: ActivityScheduledEventDetails
s@ActivityScheduledEventDetails' {} Maybe HistoryEventExecutionDataDetails
a -> ActivityScheduledEventDetails
s {$sel:inputDetails:ActivityScheduledEventDetails' :: Maybe HistoryEventExecutionDataDetails
inputDetails = Maybe HistoryEventExecutionDataDetails
a} :: ActivityScheduledEventDetails)

-- | The JSON data input to the activity task. Length constraints apply to
-- the payload size, and are expressed as bytes in UTF-8 encoding.
activityScheduledEventDetails_input :: Lens.Lens' ActivityScheduledEventDetails (Prelude.Maybe Prelude.Text)
activityScheduledEventDetails_input :: (Maybe Text -> f (Maybe Text))
-> ActivityScheduledEventDetails -> f ActivityScheduledEventDetails
activityScheduledEventDetails_input = (ActivityScheduledEventDetails -> Maybe (Sensitive Text))
-> (ActivityScheduledEventDetails
    -> Maybe (Sensitive Text) -> ActivityScheduledEventDetails)
-> Lens
     ActivityScheduledEventDetails
     ActivityScheduledEventDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityScheduledEventDetails' {Maybe (Sensitive Text)
input :: Maybe (Sensitive Text)
$sel:input:ActivityScheduledEventDetails' :: ActivityScheduledEventDetails -> Maybe (Sensitive Text)
input} -> Maybe (Sensitive Text)
input) (\s :: ActivityScheduledEventDetails
s@ActivityScheduledEventDetails' {} Maybe (Sensitive Text)
a -> ActivityScheduledEventDetails
s {$sel:input:ActivityScheduledEventDetails' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
a} :: ActivityScheduledEventDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ActivityScheduledEventDetails
 -> f ActivityScheduledEventDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ActivityScheduledEventDetails
-> f ActivityScheduledEventDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The maximum allowed duration of the activity task.
activityScheduledEventDetails_timeoutInSeconds :: Lens.Lens' ActivityScheduledEventDetails (Prelude.Maybe Prelude.Integer)
activityScheduledEventDetails_timeoutInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> ActivityScheduledEventDetails -> f ActivityScheduledEventDetails
activityScheduledEventDetails_timeoutInSeconds = (ActivityScheduledEventDetails -> Maybe Integer)
-> (ActivityScheduledEventDetails
    -> Maybe Integer -> ActivityScheduledEventDetails)
-> Lens
     ActivityScheduledEventDetails
     ActivityScheduledEventDetails
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityScheduledEventDetails' {Maybe Integer
timeoutInSeconds :: Maybe Integer
$sel:timeoutInSeconds:ActivityScheduledEventDetails' :: ActivityScheduledEventDetails -> Maybe Integer
timeoutInSeconds} -> Maybe Integer
timeoutInSeconds) (\s :: ActivityScheduledEventDetails
s@ActivityScheduledEventDetails' {} Maybe Integer
a -> ActivityScheduledEventDetails
s {$sel:timeoutInSeconds:ActivityScheduledEventDetails' :: Maybe Integer
timeoutInSeconds = Maybe Integer
a} :: ActivityScheduledEventDetails)

-- | The Amazon Resource Name (ARN) of the scheduled activity.
activityScheduledEventDetails_resource :: Lens.Lens' ActivityScheduledEventDetails Prelude.Text
activityScheduledEventDetails_resource :: (Text -> f Text)
-> ActivityScheduledEventDetails -> f ActivityScheduledEventDetails
activityScheduledEventDetails_resource = (ActivityScheduledEventDetails -> Text)
-> (ActivityScheduledEventDetails
    -> Text -> ActivityScheduledEventDetails)
-> Lens
     ActivityScheduledEventDetails
     ActivityScheduledEventDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityScheduledEventDetails' {Text
resource :: Text
$sel:resource:ActivityScheduledEventDetails' :: ActivityScheduledEventDetails -> Text
resource} -> Text
resource) (\s :: ActivityScheduledEventDetails
s@ActivityScheduledEventDetails' {} Text
a -> ActivityScheduledEventDetails
s {$sel:resource:ActivityScheduledEventDetails' :: Text
resource = Text
a} :: ActivityScheduledEventDetails)

instance Core.FromJSON ActivityScheduledEventDetails where
  parseJSON :: Value -> Parser ActivityScheduledEventDetails
parseJSON =
    String
-> (Object -> Parser ActivityScheduledEventDetails)
-> Value
-> Parser ActivityScheduledEventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActivityScheduledEventDetails"
      ( \Object
x ->
          Maybe Integer
-> Maybe HistoryEventExecutionDataDetails
-> Maybe (Sensitive Text)
-> Maybe Integer
-> Text
-> ActivityScheduledEventDetails
ActivityScheduledEventDetails'
            (Maybe Integer
 -> Maybe HistoryEventExecutionDataDetails
 -> Maybe (Sensitive Text)
 -> Maybe Integer
 -> Text
 -> ActivityScheduledEventDetails)
-> Parser (Maybe Integer)
-> Parser
     (Maybe HistoryEventExecutionDataDetails
      -> Maybe (Sensitive Text)
      -> Maybe Integer
      -> Text
      -> ActivityScheduledEventDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"heartbeatInSeconds")
            Parser
  (Maybe HistoryEventExecutionDataDetails
   -> Maybe (Sensitive Text)
   -> Maybe Integer
   -> Text
   -> ActivityScheduledEventDetails)
-> Parser (Maybe HistoryEventExecutionDataDetails)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Integer -> Text -> ActivityScheduledEventDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HistoryEventExecutionDataDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"inputDetails")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Integer -> Text -> ActivityScheduledEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Integer -> Text -> ActivityScheduledEventDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"input")
            Parser (Maybe Integer -> Text -> ActivityScheduledEventDetails)
-> Parser (Maybe Integer)
-> Parser (Text -> ActivityScheduledEventDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeoutInSeconds")
            Parser (Text -> ActivityScheduledEventDetails)
-> Parser Text -> Parser ActivityScheduledEventDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resource")
      )

instance
  Prelude.Hashable
    ActivityScheduledEventDetails

instance Prelude.NFData ActivityScheduledEventDetails