{-# 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.EMR.Types.NotebookExecution
-- 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.EMR.Types.NotebookExecution where

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ExecutionEngineConfig
import Amazonka.EMR.Types.NotebookExecutionStatus
import Amazonka.EMR.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A notebook execution. An execution is a specific instance that an EMR
-- Notebook is run using the @StartNotebookExecution@ action.
--
-- /See:/ 'newNotebookExecution' smart constructor.
data NotebookExecution = NotebookExecution'
  { -- | The status of the notebook execution.
    --
    -- -   @START_PENDING@ indicates that the cluster has received the
    --     execution request but execution has not begun.
    --
    -- -   @STARTING@ indicates that the execution is starting on the cluster.
    --
    -- -   @RUNNING@ indicates that the execution is being processed by the
    --     cluster.
    --
    -- -   @FINISHING@ indicates that execution processing is in the final
    --     stages.
    --
    -- -   @FINISHED@ indicates that the execution has completed without error.
    --
    -- -   @FAILING@ indicates that the execution is failing and will not
    --     finish successfully.
    --
    -- -   @FAILED@ indicates that the execution failed.
    --
    -- -   @STOP_PENDING@ indicates that the cluster has received a
    --     @StopNotebookExecution@ request and the stop is pending.
    --
    -- -   @STOPPING@ indicates that the cluster is in the process of stopping
    --     the execution as a result of a @StopNotebookExecution@ request.
    --
    -- -   @STOPPED@ indicates that the execution stopped because of a
    --     @StopNotebookExecution@ request.
    NotebookExecution -> Maybe NotebookExecutionStatus
status :: Prelude.Maybe NotebookExecutionStatus,
    -- | The execution engine, such as an EMR cluster, used to run the EMR
    -- notebook and perform the notebook execution.
    NotebookExecution -> Maybe ExecutionEngineConfig
executionEngine :: Prelude.Maybe ExecutionEngineConfig,
    -- | The unique identifier of the EC2 security group associated with the EMR
    -- Notebook instance. For more information see
    -- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-security-groups.html Specifying EC2 Security Groups for EMR Notebooks>
    -- in the /EMR Management Guide/.
    NotebookExecution -> Maybe Text
notebookInstanceSecurityGroupId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the EMR Notebook that is used for the notebook
    -- execution.
    NotebookExecution -> Maybe Text
editorId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when notebook execution started.
    NotebookExecution -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the notebook execution.
    NotebookExecution -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The location of the notebook execution\'s output file in Amazon S3.
    NotebookExecution -> Maybe Text
outputNotebookURI :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of a notebook execution.
    NotebookExecution -> Maybe Text
notebookExecutionId :: Prelude.Maybe Prelude.Text,
    -- | A name for the notebook execution.
    NotebookExecution -> Maybe Text
notebookExecutionName :: Prelude.Maybe Prelude.Text,
    -- | The reason for the latest status change of the notebook execution.
    NotebookExecution -> Maybe Text
lastStateChangeReason :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when notebook execution ended.
    NotebookExecution -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | Input parameters in JSON format passed to the EMR Notebook at runtime
    -- for execution.
    NotebookExecution -> Maybe Text
notebookParams :: Prelude.Maybe Prelude.Text,
    -- | A list of tags associated with a notebook execution. Tags are
    -- user-defined key-value pairs that consist of a required key string with
    -- a maximum of 128 characters and an optional value string with a maximum
    -- of 256 characters.
    NotebookExecution -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (NotebookExecution -> NotebookExecution -> Bool
(NotebookExecution -> NotebookExecution -> Bool)
-> (NotebookExecution -> NotebookExecution -> Bool)
-> Eq NotebookExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotebookExecution -> NotebookExecution -> Bool
$c/= :: NotebookExecution -> NotebookExecution -> Bool
== :: NotebookExecution -> NotebookExecution -> Bool
$c== :: NotebookExecution -> NotebookExecution -> Bool
Prelude.Eq, ReadPrec [NotebookExecution]
ReadPrec NotebookExecution
Int -> ReadS NotebookExecution
ReadS [NotebookExecution]
(Int -> ReadS NotebookExecution)
-> ReadS [NotebookExecution]
-> ReadPrec NotebookExecution
-> ReadPrec [NotebookExecution]
-> Read NotebookExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotebookExecution]
$creadListPrec :: ReadPrec [NotebookExecution]
readPrec :: ReadPrec NotebookExecution
$creadPrec :: ReadPrec NotebookExecution
readList :: ReadS [NotebookExecution]
$creadList :: ReadS [NotebookExecution]
readsPrec :: Int -> ReadS NotebookExecution
$creadsPrec :: Int -> ReadS NotebookExecution
Prelude.Read, Int -> NotebookExecution -> ShowS
[NotebookExecution] -> ShowS
NotebookExecution -> String
(Int -> NotebookExecution -> ShowS)
-> (NotebookExecution -> String)
-> ([NotebookExecution] -> ShowS)
-> Show NotebookExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotebookExecution] -> ShowS
$cshowList :: [NotebookExecution] -> ShowS
show :: NotebookExecution -> String
$cshow :: NotebookExecution -> String
showsPrec :: Int -> NotebookExecution -> ShowS
$cshowsPrec :: Int -> NotebookExecution -> ShowS
Prelude.Show, (forall x. NotebookExecution -> Rep NotebookExecution x)
-> (forall x. Rep NotebookExecution x -> NotebookExecution)
-> Generic NotebookExecution
forall x. Rep NotebookExecution x -> NotebookExecution
forall x. NotebookExecution -> Rep NotebookExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotebookExecution x -> NotebookExecution
$cfrom :: forall x. NotebookExecution -> Rep NotebookExecution x
Prelude.Generic)

-- |
-- Create a value of 'NotebookExecution' 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:
--
-- 'status', 'notebookExecution_status' - The status of the notebook execution.
--
-- -   @START_PENDING@ indicates that the cluster has received the
--     execution request but execution has not begun.
--
-- -   @STARTING@ indicates that the execution is starting on the cluster.
--
-- -   @RUNNING@ indicates that the execution is being processed by the
--     cluster.
--
-- -   @FINISHING@ indicates that execution processing is in the final
--     stages.
--
-- -   @FINISHED@ indicates that the execution has completed without error.
--
-- -   @FAILING@ indicates that the execution is failing and will not
--     finish successfully.
--
-- -   @FAILED@ indicates that the execution failed.
--
-- -   @STOP_PENDING@ indicates that the cluster has received a
--     @StopNotebookExecution@ request and the stop is pending.
--
-- -   @STOPPING@ indicates that the cluster is in the process of stopping
--     the execution as a result of a @StopNotebookExecution@ request.
--
-- -   @STOPPED@ indicates that the execution stopped because of a
--     @StopNotebookExecution@ request.
--
-- 'executionEngine', 'notebookExecution_executionEngine' - The execution engine, such as an EMR cluster, used to run the EMR
-- notebook and perform the notebook execution.
--
-- 'notebookInstanceSecurityGroupId', 'notebookExecution_notebookInstanceSecurityGroupId' - The unique identifier of the EC2 security group associated with the EMR
-- Notebook instance. For more information see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-security-groups.html Specifying EC2 Security Groups for EMR Notebooks>
-- in the /EMR Management Guide/.
--
-- 'editorId', 'notebookExecution_editorId' - The unique identifier of the EMR Notebook that is used for the notebook
-- execution.
--
-- 'startTime', 'notebookExecution_startTime' - The timestamp when notebook execution started.
--
-- 'arn', 'notebookExecution_arn' - The Amazon Resource Name (ARN) of the notebook execution.
--
-- 'outputNotebookURI', 'notebookExecution_outputNotebookURI' - The location of the notebook execution\'s output file in Amazon S3.
--
-- 'notebookExecutionId', 'notebookExecution_notebookExecutionId' - The unique identifier of a notebook execution.
--
-- 'notebookExecutionName', 'notebookExecution_notebookExecutionName' - A name for the notebook execution.
--
-- 'lastStateChangeReason', 'notebookExecution_lastStateChangeReason' - The reason for the latest status change of the notebook execution.
--
-- 'endTime', 'notebookExecution_endTime' - The timestamp when notebook execution ended.
--
-- 'notebookParams', 'notebookExecution_notebookParams' - Input parameters in JSON format passed to the EMR Notebook at runtime
-- for execution.
--
-- 'tags', 'notebookExecution_tags' - A list of tags associated with a notebook execution. Tags are
-- user-defined key-value pairs that consist of a required key string with
-- a maximum of 128 characters and an optional value string with a maximum
-- of 256 characters.
newNotebookExecution ::
  NotebookExecution
newNotebookExecution :: NotebookExecution
newNotebookExecution =
  NotebookExecution' :: Maybe NotebookExecutionStatus
-> Maybe ExecutionEngineConfig
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [Tag]
-> NotebookExecution
NotebookExecution'
    { $sel:status:NotebookExecution' :: Maybe NotebookExecutionStatus
status = Maybe NotebookExecutionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:executionEngine:NotebookExecution' :: Maybe ExecutionEngineConfig
executionEngine = Maybe ExecutionEngineConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:notebookInstanceSecurityGroupId:NotebookExecution' :: Maybe Text
notebookInstanceSecurityGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:editorId:NotebookExecution' :: Maybe Text
editorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:NotebookExecution' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:NotebookExecution' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputNotebookURI:NotebookExecution' :: Maybe Text
outputNotebookURI = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notebookExecutionId:NotebookExecution' :: Maybe Text
notebookExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notebookExecutionName:NotebookExecution' :: Maybe Text
notebookExecutionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastStateChangeReason:NotebookExecution' :: Maybe Text
lastStateChangeReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:NotebookExecution' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:notebookParams:NotebookExecution' :: Maybe Text
notebookParams = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:NotebookExecution' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the notebook execution.
--
-- -   @START_PENDING@ indicates that the cluster has received the
--     execution request but execution has not begun.
--
-- -   @STARTING@ indicates that the execution is starting on the cluster.
--
-- -   @RUNNING@ indicates that the execution is being processed by the
--     cluster.
--
-- -   @FINISHING@ indicates that execution processing is in the final
--     stages.
--
-- -   @FINISHED@ indicates that the execution has completed without error.
--
-- -   @FAILING@ indicates that the execution is failing and will not
--     finish successfully.
--
-- -   @FAILED@ indicates that the execution failed.
--
-- -   @STOP_PENDING@ indicates that the cluster has received a
--     @StopNotebookExecution@ request and the stop is pending.
--
-- -   @STOPPING@ indicates that the cluster is in the process of stopping
--     the execution as a result of a @StopNotebookExecution@ request.
--
-- -   @STOPPED@ indicates that the execution stopped because of a
--     @StopNotebookExecution@ request.
notebookExecution_status :: Lens.Lens' NotebookExecution (Prelude.Maybe NotebookExecutionStatus)
notebookExecution_status :: (Maybe NotebookExecutionStatus
 -> f (Maybe NotebookExecutionStatus))
-> NotebookExecution -> f NotebookExecution
notebookExecution_status = (NotebookExecution -> Maybe NotebookExecutionStatus)
-> (NotebookExecution
    -> Maybe NotebookExecutionStatus -> NotebookExecution)
-> Lens
     NotebookExecution
     NotebookExecution
     (Maybe NotebookExecutionStatus)
     (Maybe NotebookExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe NotebookExecutionStatus
status :: Maybe NotebookExecutionStatus
$sel:status:NotebookExecution' :: NotebookExecution -> Maybe NotebookExecutionStatus
status} -> Maybe NotebookExecutionStatus
status) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe NotebookExecutionStatus
a -> NotebookExecution
s {$sel:status:NotebookExecution' :: Maybe NotebookExecutionStatus
status = Maybe NotebookExecutionStatus
a} :: NotebookExecution)

-- | The execution engine, such as an EMR cluster, used to run the EMR
-- notebook and perform the notebook execution.
notebookExecution_executionEngine :: Lens.Lens' NotebookExecution (Prelude.Maybe ExecutionEngineConfig)
notebookExecution_executionEngine :: (Maybe ExecutionEngineConfig -> f (Maybe ExecutionEngineConfig))
-> NotebookExecution -> f NotebookExecution
notebookExecution_executionEngine = (NotebookExecution -> Maybe ExecutionEngineConfig)
-> (NotebookExecution
    -> Maybe ExecutionEngineConfig -> NotebookExecution)
-> Lens
     NotebookExecution
     NotebookExecution
     (Maybe ExecutionEngineConfig)
     (Maybe ExecutionEngineConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe ExecutionEngineConfig
executionEngine :: Maybe ExecutionEngineConfig
$sel:executionEngine:NotebookExecution' :: NotebookExecution -> Maybe ExecutionEngineConfig
executionEngine} -> Maybe ExecutionEngineConfig
executionEngine) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe ExecutionEngineConfig
a -> NotebookExecution
s {$sel:executionEngine:NotebookExecution' :: Maybe ExecutionEngineConfig
executionEngine = Maybe ExecutionEngineConfig
a} :: NotebookExecution)

-- | The unique identifier of the EC2 security group associated with the EMR
-- Notebook instance. For more information see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-security-groups.html Specifying EC2 Security Groups for EMR Notebooks>
-- in the /EMR Management Guide/.
notebookExecution_notebookInstanceSecurityGroupId :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_notebookInstanceSecurityGroupId :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_notebookInstanceSecurityGroupId = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
$sel:notebookInstanceSecurityGroupId:NotebookExecution' :: NotebookExecution -> Maybe Text
notebookInstanceSecurityGroupId} -> Maybe Text
notebookInstanceSecurityGroupId) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:notebookInstanceSecurityGroupId:NotebookExecution' :: Maybe Text
notebookInstanceSecurityGroupId = Maybe Text
a} :: NotebookExecution)

-- | The unique identifier of the EMR Notebook that is used for the notebook
-- execution.
notebookExecution_editorId :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_editorId :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_editorId = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
editorId :: Maybe Text
$sel:editorId:NotebookExecution' :: NotebookExecution -> Maybe Text
editorId} -> Maybe Text
editorId) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:editorId:NotebookExecution' :: Maybe Text
editorId = Maybe Text
a} :: NotebookExecution)

-- | The timestamp when notebook execution started.
notebookExecution_startTime :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.UTCTime)
notebookExecution_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookExecution -> f NotebookExecution
notebookExecution_startTime = (NotebookExecution -> Maybe POSIX)
-> (NotebookExecution -> Maybe POSIX -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe POSIX
a -> NotebookExecution
s {$sel:startTime:NotebookExecution' :: Maybe POSIX
startTime = Maybe POSIX
a} :: NotebookExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> NotebookExecution -> f NotebookExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookExecution
-> f NotebookExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the notebook execution.
notebookExecution_arn :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_arn :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_arn = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
arn :: Maybe Text
$sel:arn:NotebookExecution' :: NotebookExecution -> Maybe Text
arn} -> Maybe Text
arn) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:arn:NotebookExecution' :: Maybe Text
arn = Maybe Text
a} :: NotebookExecution)

-- | The location of the notebook execution\'s output file in Amazon S3.
notebookExecution_outputNotebookURI :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_outputNotebookURI :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_outputNotebookURI = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
outputNotebookURI :: Maybe Text
$sel:outputNotebookURI:NotebookExecution' :: NotebookExecution -> Maybe Text
outputNotebookURI} -> Maybe Text
outputNotebookURI) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:outputNotebookURI:NotebookExecution' :: Maybe Text
outputNotebookURI = Maybe Text
a} :: NotebookExecution)

-- | The unique identifier of a notebook execution.
notebookExecution_notebookExecutionId :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_notebookExecutionId :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_notebookExecutionId = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
notebookExecutionId :: Maybe Text
$sel:notebookExecutionId:NotebookExecution' :: NotebookExecution -> Maybe Text
notebookExecutionId} -> Maybe Text
notebookExecutionId) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:notebookExecutionId:NotebookExecution' :: Maybe Text
notebookExecutionId = Maybe Text
a} :: NotebookExecution)

-- | A name for the notebook execution.
notebookExecution_notebookExecutionName :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_notebookExecutionName :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_notebookExecutionName = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
notebookExecutionName :: Maybe Text
$sel:notebookExecutionName:NotebookExecution' :: NotebookExecution -> Maybe Text
notebookExecutionName} -> Maybe Text
notebookExecutionName) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:notebookExecutionName:NotebookExecution' :: Maybe Text
notebookExecutionName = Maybe Text
a} :: NotebookExecution)

-- | The reason for the latest status change of the notebook execution.
notebookExecution_lastStateChangeReason :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_lastStateChangeReason :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_lastStateChangeReason = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
lastStateChangeReason :: Maybe Text
$sel:lastStateChangeReason:NotebookExecution' :: NotebookExecution -> Maybe Text
lastStateChangeReason} -> Maybe Text
lastStateChangeReason) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:lastStateChangeReason:NotebookExecution' :: Maybe Text
lastStateChangeReason = Maybe Text
a} :: NotebookExecution)

-- | The timestamp when notebook execution ended.
notebookExecution_endTime :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.UTCTime)
notebookExecution_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookExecution -> f NotebookExecution
notebookExecution_endTime = (NotebookExecution -> Maybe POSIX)
-> (NotebookExecution -> Maybe POSIX -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe POSIX
a -> NotebookExecution
s {$sel:endTime:NotebookExecution' :: Maybe POSIX
endTime = Maybe POSIX
a} :: NotebookExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> NotebookExecution -> f NotebookExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookExecution
-> f NotebookExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Input parameters in JSON format passed to the EMR Notebook at runtime
-- for execution.
notebookExecution_notebookParams :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_notebookParams :: (Maybe Text -> f (Maybe Text))
-> NotebookExecution -> f NotebookExecution
notebookExecution_notebookParams = (NotebookExecution -> Maybe Text)
-> (NotebookExecution -> Maybe Text -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe Text
notebookParams :: Maybe Text
$sel:notebookParams:NotebookExecution' :: NotebookExecution -> Maybe Text
notebookParams} -> Maybe Text
notebookParams) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe Text
a -> NotebookExecution
s {$sel:notebookParams:NotebookExecution' :: Maybe Text
notebookParams = Maybe Text
a} :: NotebookExecution)

-- | A list of tags associated with a notebook execution. Tags are
-- user-defined key-value pairs that consist of a required key string with
-- a maximum of 128 characters and an optional value string with a maximum
-- of 256 characters.
notebookExecution_tags :: Lens.Lens' NotebookExecution (Prelude.Maybe [Tag])
notebookExecution_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> NotebookExecution -> f NotebookExecution
notebookExecution_tags = (NotebookExecution -> Maybe [Tag])
-> (NotebookExecution -> Maybe [Tag] -> NotebookExecution)
-> Lens
     NotebookExecution NotebookExecution (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookExecution' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:NotebookExecution' :: NotebookExecution -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: NotebookExecution
s@NotebookExecution' {} Maybe [Tag]
a -> NotebookExecution
s {$sel:tags:NotebookExecution' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: NotebookExecution) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> NotebookExecution -> f NotebookExecution)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> NotebookExecution
-> f NotebookExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON NotebookExecution where
  parseJSON :: Value -> Parser NotebookExecution
parseJSON =
    String
-> (Object -> Parser NotebookExecution)
-> Value
-> Parser NotebookExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NotebookExecution"
      ( \Object
x ->
          Maybe NotebookExecutionStatus
-> Maybe ExecutionEngineConfig
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [Tag]
-> NotebookExecution
NotebookExecution'
            (Maybe NotebookExecutionStatus
 -> Maybe ExecutionEngineConfig
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [Tag]
 -> NotebookExecution)
-> Parser (Maybe NotebookExecutionStatus)
-> Parser
     (Maybe ExecutionEngineConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NotebookExecutionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe ExecutionEngineConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe ExecutionEngineConfig)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExecutionEngineConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecutionEngine")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
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
"NotebookInstanceSecurityGroupId")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
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
"EditorId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
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
"OutputNotebookURI")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> NotebookExecution)
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
"NotebookExecutionId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe [Tag] -> NotebookExecution)
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
"NotebookExecutionName")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe [Tag] -> NotebookExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe [Tag] -> NotebookExecution)
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
"LastStateChangeReason")
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe [Tag] -> NotebookExecution)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe [Tag] -> NotebookExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
            Parser (Maybe Text -> Maybe [Tag] -> NotebookExecution)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> NotebookExecution)
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
"NotebookParams")
            Parser (Maybe [Tag] -> NotebookExecution)
-> Parser (Maybe [Tag]) -> Parser NotebookExecution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable NotebookExecution

instance Prelude.NFData NotebookExecution