{-# 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.ExecutionStartedEventDetails
-- 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.ExecutionStartedEventDetails 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 the start of the execution.
--
-- /See:/ 'newExecutionStartedEventDetails' smart constructor.
data ExecutionStartedEventDetails = ExecutionStartedEventDetails'
  { -- | Contains details about the input for an execution history event.
    ExecutionStartedEventDetails
-> Maybe HistoryEventExecutionDataDetails
inputDetails :: Prelude.Maybe HistoryEventExecutionDataDetails,
    -- | The JSON data input to the execution. Length constraints apply to the
    -- payload size, and are expressed as bytes in UTF-8 encoding.
    ExecutionStartedEventDetails -> Maybe (Sensitive Text)
input :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the IAM role used for executing AWS
    -- Lambda tasks.
    ExecutionStartedEventDetails -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ExecutionStartedEventDetails
-> ExecutionStartedEventDetails -> Bool
(ExecutionStartedEventDetails
 -> ExecutionStartedEventDetails -> Bool)
-> (ExecutionStartedEventDetails
    -> ExecutionStartedEventDetails -> Bool)
-> Eq ExecutionStartedEventDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecutionStartedEventDetails
-> ExecutionStartedEventDetails -> Bool
$c/= :: ExecutionStartedEventDetails
-> ExecutionStartedEventDetails -> Bool
== :: ExecutionStartedEventDetails
-> ExecutionStartedEventDetails -> Bool
$c== :: ExecutionStartedEventDetails
-> ExecutionStartedEventDetails -> Bool
Prelude.Eq, Int -> ExecutionStartedEventDetails -> ShowS
[ExecutionStartedEventDetails] -> ShowS
ExecutionStartedEventDetails -> String
(Int -> ExecutionStartedEventDetails -> ShowS)
-> (ExecutionStartedEventDetails -> String)
-> ([ExecutionStartedEventDetails] -> ShowS)
-> Show ExecutionStartedEventDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecutionStartedEventDetails] -> ShowS
$cshowList :: [ExecutionStartedEventDetails] -> ShowS
show :: ExecutionStartedEventDetails -> String
$cshow :: ExecutionStartedEventDetails -> String
showsPrec :: Int -> ExecutionStartedEventDetails -> ShowS
$cshowsPrec :: Int -> ExecutionStartedEventDetails -> ShowS
Prelude.Show, (forall x.
 ExecutionStartedEventDetails -> Rep ExecutionStartedEventDetails x)
-> (forall x.
    Rep ExecutionStartedEventDetails x -> ExecutionStartedEventDetails)
-> Generic ExecutionStartedEventDetails
forall x.
Rep ExecutionStartedEventDetails x -> ExecutionStartedEventDetails
forall x.
ExecutionStartedEventDetails -> Rep ExecutionStartedEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExecutionStartedEventDetails x -> ExecutionStartedEventDetails
$cfrom :: forall x.
ExecutionStartedEventDetails -> Rep ExecutionStartedEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExecutionStartedEventDetails' 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:
--
-- 'inputDetails', 'executionStartedEventDetails_inputDetails' - Contains details about the input for an execution history event.
--
-- 'input', 'executionStartedEventDetails_input' - The JSON data input to the execution. Length constraints apply to the
-- payload size, and are expressed as bytes in UTF-8 encoding.
--
-- 'roleArn', 'executionStartedEventDetails_roleArn' - The Amazon Resource Name (ARN) of the IAM role used for executing AWS
-- Lambda tasks.
newExecutionStartedEventDetails ::
  ExecutionStartedEventDetails
newExecutionStartedEventDetails :: ExecutionStartedEventDetails
newExecutionStartedEventDetails =
  ExecutionStartedEventDetails' :: Maybe HistoryEventExecutionDataDetails
-> Maybe (Sensitive Text)
-> Maybe Text
-> ExecutionStartedEventDetails
ExecutionStartedEventDetails'
    { $sel:inputDetails:ExecutionStartedEventDetails' :: Maybe HistoryEventExecutionDataDetails
inputDetails =
        Maybe HistoryEventExecutionDataDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:input:ExecutionStartedEventDetails' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ExecutionStartedEventDetails' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The JSON data input to the execution. Length constraints apply to the
-- payload size, and are expressed as bytes in UTF-8 encoding.
executionStartedEventDetails_input :: Lens.Lens' ExecutionStartedEventDetails (Prelude.Maybe Prelude.Text)
executionStartedEventDetails_input :: (Maybe Text -> f (Maybe Text))
-> ExecutionStartedEventDetails -> f ExecutionStartedEventDetails
executionStartedEventDetails_input = (ExecutionStartedEventDetails -> Maybe (Sensitive Text))
-> (ExecutionStartedEventDetails
    -> Maybe (Sensitive Text) -> ExecutionStartedEventDetails)
-> Lens
     ExecutionStartedEventDetails
     ExecutionStartedEventDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionStartedEventDetails' {Maybe (Sensitive Text)
input :: Maybe (Sensitive Text)
$sel:input:ExecutionStartedEventDetails' :: ExecutionStartedEventDetails -> Maybe (Sensitive Text)
input} -> Maybe (Sensitive Text)
input) (\s :: ExecutionStartedEventDetails
s@ExecutionStartedEventDetails' {} Maybe (Sensitive Text)
a -> ExecutionStartedEventDetails
s {$sel:input:ExecutionStartedEventDetails' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
a} :: ExecutionStartedEventDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ExecutionStartedEventDetails -> f ExecutionStartedEventDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ExecutionStartedEventDetails
-> f ExecutionStartedEventDetails
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 Amazon Resource Name (ARN) of the IAM role used for executing AWS
-- Lambda tasks.
executionStartedEventDetails_roleArn :: Lens.Lens' ExecutionStartedEventDetails (Prelude.Maybe Prelude.Text)
executionStartedEventDetails_roleArn :: (Maybe Text -> f (Maybe Text))
-> ExecutionStartedEventDetails -> f ExecutionStartedEventDetails
executionStartedEventDetails_roleArn = (ExecutionStartedEventDetails -> Maybe Text)
-> (ExecutionStartedEventDetails
    -> Maybe Text -> ExecutionStartedEventDetails)
-> Lens
     ExecutionStartedEventDetails
     ExecutionStartedEventDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionStartedEventDetails' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:ExecutionStartedEventDetails' :: ExecutionStartedEventDetails -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: ExecutionStartedEventDetails
s@ExecutionStartedEventDetails' {} Maybe Text
a -> ExecutionStartedEventDetails
s {$sel:roleArn:ExecutionStartedEventDetails' :: Maybe Text
roleArn = Maybe Text
a} :: ExecutionStartedEventDetails)

instance Core.FromJSON ExecutionStartedEventDetails where
  parseJSON :: Value -> Parser ExecutionStartedEventDetails
parseJSON =
    String
-> (Object -> Parser ExecutionStartedEventDetails)
-> Value
-> Parser ExecutionStartedEventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExecutionStartedEventDetails"
      ( \Object
x ->
          Maybe HistoryEventExecutionDataDetails
-> Maybe (Sensitive Text)
-> Maybe Text
-> ExecutionStartedEventDetails
ExecutionStartedEventDetails'
            (Maybe HistoryEventExecutionDataDetails
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> ExecutionStartedEventDetails)
-> Parser (Maybe HistoryEventExecutionDataDetails)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Text -> ExecutionStartedEventDetails)
forall (f :: * -> *) a b. Functor 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 Text -> ExecutionStartedEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> ExecutionStartedEventDetails)
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 Text -> ExecutionStartedEventDetails)
-> Parser (Maybe Text) -> Parser ExecutionStartedEventDetails
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
"roleArn")
      )

instance
  Prelude.Hashable
    ExecutionStartedEventDetails

instance Prelude.NFData ExecutionStartedEventDetails