{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EMR.Types.NotebookExecution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types.ExecutionEngineConfig
import Amazonka.EMR.Types.NotebookExecutionStatus
import Amazonka.EMR.Types.Tag
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 Amazon Resource Name (ARN) of the notebook execution.
    NotebookExecution -> Maybe Text
arn :: 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 ended.
    NotebookExecution -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | 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 reason for the latest status change of the notebook execution.
    NotebookExecution -> Maybe Text
lastStateChangeReason :: 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 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,
    -- | Input parameters in JSON format passed to the EMR Notebook at runtime
    -- for execution.
    NotebookExecution -> Maybe Text
notebookParams :: 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 timestamp when notebook execution started.
    NotebookExecution -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | 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,
    -- | 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
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]
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
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. 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:
--
-- 'arn', 'notebookExecution_arn' - The Amazon Resource Name (ARN) of the notebook execution.
--
-- 'editorId', 'notebookExecution_editorId' - The unique identifier of the EMR Notebook that is used for the notebook
-- execution.
--
-- 'endTime', 'notebookExecution_endTime' - The timestamp when notebook execution ended.
--
-- 'executionEngine', 'notebookExecution_executionEngine' - The execution engine, such as an EMR cluster, used to run the EMR
-- notebook and perform the notebook execution.
--
-- 'lastStateChangeReason', 'notebookExecution_lastStateChangeReason' - The reason for the latest status change of the notebook execution.
--
-- 'notebookExecutionId', 'notebookExecution_notebookExecutionId' - The unique identifier of a notebook execution.
--
-- 'notebookExecutionName', 'notebookExecution_notebookExecutionName' - A name for 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/.
--
-- 'notebookParams', 'notebookExecution_notebookParams' - Input parameters in JSON format passed to the EMR Notebook at runtime
-- for execution.
--
-- 'outputNotebookURI', 'notebookExecution_outputNotebookURI' - The location of the notebook execution\'s output file in Amazon S3.
--
-- 'startTime', 'notebookExecution_startTime' - The timestamp when notebook execution started.
--
-- '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.
--
-- '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'
    { $sel:arn:NotebookExecution' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:editorId:NotebookExecution' :: Maybe Text
editorId = forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:NotebookExecution' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:executionEngine:NotebookExecution' :: Maybe ExecutionEngineConfig
executionEngine = forall a. Maybe a
Prelude.Nothing,
      $sel:lastStateChangeReason:NotebookExecution' :: Maybe Text
lastStateChangeReason = forall a. Maybe a
Prelude.Nothing,
      $sel:notebookExecutionId:NotebookExecution' :: Maybe Text
notebookExecutionId = forall a. Maybe a
Prelude.Nothing,
      $sel:notebookExecutionName:NotebookExecution' :: Maybe Text
notebookExecutionName = forall a. Maybe a
Prelude.Nothing,
      $sel:notebookInstanceSecurityGroupId:NotebookExecution' :: Maybe Text
notebookInstanceSecurityGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:notebookParams:NotebookExecution' :: Maybe Text
notebookParams = forall a. Maybe a
Prelude.Nothing,
      $sel:outputNotebookURI:NotebookExecution' :: Maybe Text
outputNotebookURI = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:NotebookExecution' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:NotebookExecution' :: Maybe NotebookExecutionStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:NotebookExecution' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the notebook execution.
notebookExecution_arn :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_arn :: Lens' NotebookExecution (Maybe Text)
notebookExecution_arn = 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 unique identifier of the EMR Notebook that is used for the notebook
-- execution.
notebookExecution_editorId :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_editorId :: Lens' NotebookExecution (Maybe Text)
notebookExecution_editorId = 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 ended.
notebookExecution_endTime :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.UTCTime)
notebookExecution_endTime :: Lens' NotebookExecution (Maybe UTCTime)
notebookExecution_endTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | 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 :: Lens' NotebookExecution (Maybe ExecutionEngineConfig)
notebookExecution_executionEngine = 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 reason for the latest status change of the notebook execution.
notebookExecution_lastStateChangeReason :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_lastStateChangeReason :: Lens' NotebookExecution (Maybe Text)
notebookExecution_lastStateChangeReason = 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 unique identifier of a notebook execution.
notebookExecution_notebookExecutionId :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_notebookExecutionId :: Lens' NotebookExecution (Maybe Text)
notebookExecution_notebookExecutionId = 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 :: Lens' NotebookExecution (Maybe Text)
notebookExecution_notebookExecutionName = 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 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 :: Lens' NotebookExecution (Maybe Text)
notebookExecution_notebookInstanceSecurityGroupId = 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)

-- | 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 :: Lens' NotebookExecution (Maybe Text)
notebookExecution_notebookParams = 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)

-- | The location of the notebook execution\'s output file in Amazon S3.
notebookExecution_outputNotebookURI :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.Text)
notebookExecution_outputNotebookURI :: Lens' NotebookExecution (Maybe Text)
notebookExecution_outputNotebookURI = 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 timestamp when notebook execution started.
notebookExecution_startTime :: Lens.Lens' NotebookExecution (Prelude.Maybe Prelude.UTCTime)
notebookExecution_startTime :: Lens' NotebookExecution (Maybe UTCTime)
notebookExecution_startTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | 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 :: Lens' NotebookExecution (Maybe NotebookExecutionStatus)
notebookExecution_status = 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)

-- | 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 :: Lens' NotebookExecution (Maybe [Tag])
notebookExecution_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable NotebookExecution where
  hashWithSalt :: Int -> NotebookExecution -> Int
hashWithSalt Int
_salt NotebookExecution' {Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe ExecutionEngineConfig
Maybe NotebookExecutionStatus
tags :: Maybe [Tag]
status :: Maybe NotebookExecutionStatus
startTime :: Maybe POSIX
outputNotebookURI :: Maybe Text
notebookParams :: Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
notebookExecutionName :: Maybe Text
notebookExecutionId :: Maybe Text
lastStateChangeReason :: Maybe Text
executionEngine :: Maybe ExecutionEngineConfig
endTime :: Maybe POSIX
editorId :: Maybe Text
arn :: Maybe Text
$sel:tags:NotebookExecution' :: NotebookExecution -> Maybe [Tag]
$sel:status:NotebookExecution' :: NotebookExecution -> Maybe NotebookExecutionStatus
$sel:startTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
$sel:outputNotebookURI:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookParams:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookInstanceSecurityGroupId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookExecutionName:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookExecutionId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:lastStateChangeReason:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:executionEngine:NotebookExecution' :: NotebookExecution -> Maybe ExecutionEngineConfig
$sel:endTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
$sel:editorId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:arn:NotebookExecution' :: NotebookExecution -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
editorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecutionEngineConfig
executionEngine
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastStateChangeReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notebookExecutionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notebookExecutionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notebookInstanceSecurityGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notebookParams
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputNotebookURI
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotebookExecutionStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData NotebookExecution where
  rnf :: NotebookExecution -> ()
rnf NotebookExecution' {Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe ExecutionEngineConfig
Maybe NotebookExecutionStatus
tags :: Maybe [Tag]
status :: Maybe NotebookExecutionStatus
startTime :: Maybe POSIX
outputNotebookURI :: Maybe Text
notebookParams :: Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
notebookExecutionName :: Maybe Text
notebookExecutionId :: Maybe Text
lastStateChangeReason :: Maybe Text
executionEngine :: Maybe ExecutionEngineConfig
endTime :: Maybe POSIX
editorId :: Maybe Text
arn :: Maybe Text
$sel:tags:NotebookExecution' :: NotebookExecution -> Maybe [Tag]
$sel:status:NotebookExecution' :: NotebookExecution -> Maybe NotebookExecutionStatus
$sel:startTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
$sel:outputNotebookURI:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookParams:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookInstanceSecurityGroupId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookExecutionName:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:notebookExecutionId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:lastStateChangeReason:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:executionEngine:NotebookExecution' :: NotebookExecution -> Maybe ExecutionEngineConfig
$sel:endTime:NotebookExecution' :: NotebookExecution -> Maybe POSIX
$sel:editorId:NotebookExecution' :: NotebookExecution -> Maybe Text
$sel:arn:NotebookExecution' :: NotebookExecution -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
editorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecutionEngineConfig
executionEngine
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastStateChangeReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookExecutionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookExecutionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookInstanceSecurityGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookParams
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputNotebookURI
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotebookExecutionStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags