{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.StartNotebookExecution
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts a notebook execution.
module Amazonka.EMR.StartNotebookExecution
  ( -- * Creating a Request
    StartNotebookExecution (..),
    newStartNotebookExecution,

    -- * Request Lenses
    startNotebookExecution_notebookExecutionName,
    startNotebookExecution_notebookInstanceSecurityGroupId,
    startNotebookExecution_notebookParams,
    startNotebookExecution_tags,
    startNotebookExecution_editorId,
    startNotebookExecution_relativePath,
    startNotebookExecution_executionEngine,
    startNotebookExecution_serviceRole,

    -- * Destructuring the Response
    StartNotebookExecutionResponse (..),
    newStartNotebookExecutionResponse,

    -- * Response Lenses
    startNotebookExecutionResponse_notebookExecutionId,
    startNotebookExecutionResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartNotebookExecution' smart constructor.
data StartNotebookExecution = StartNotebookExecution'
  { -- | An optional name for the notebook execution.
    StartNotebookExecution -> Maybe Text
notebookExecutionName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the Amazon EC2 security group to associate with
    -- the EMR Notebook for this notebook execution.
    StartNotebookExecution -> Maybe Text
notebookInstanceSecurityGroupId :: Prelude.Maybe Prelude.Text,
    -- | Input parameters in JSON format passed to the EMR Notebook at runtime
    -- for execution.
    StartNotebookExecution -> 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.
    StartNotebookExecution -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The unique identifier of the EMR Notebook to use for notebook execution.
    StartNotebookExecution -> Text
editorId :: Prelude.Text,
    -- | The path and file name of the notebook file for this execution, relative
    -- to the path specified for the EMR Notebook. For example, if you specify
    -- a path of @s3:\/\/MyBucket\/MyNotebooks@ when you create an EMR Notebook
    -- for a notebook with an ID of @e-ABCDEFGHIJK1234567890ABCD@ (the
    -- @EditorID@ of this request), and you specify a @RelativePath@ of
    -- @my_notebook_executions\/notebook_execution.ipynb@, the location of the
    -- file for the notebook execution is
    -- @s3:\/\/MyBucket\/MyNotebooks\/e-ABCDEFGHIJK1234567890ABCD\/my_notebook_executions\/notebook_execution.ipynb@.
    StartNotebookExecution -> Text
relativePath :: Prelude.Text,
    -- | Specifies the execution engine (cluster) that runs the notebook
    -- execution.
    StartNotebookExecution -> ExecutionEngineConfig
executionEngine :: ExecutionEngineConfig,
    -- | The name or ARN of the IAM role that is used as the service role for
    -- Amazon EMR (the EMR role) for the notebook execution.
    StartNotebookExecution -> Text
serviceRole :: Prelude.Text
  }
  deriving (StartNotebookExecution -> StartNotebookExecution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNotebookExecution -> StartNotebookExecution -> Bool
$c/= :: StartNotebookExecution -> StartNotebookExecution -> Bool
== :: StartNotebookExecution -> StartNotebookExecution -> Bool
$c== :: StartNotebookExecution -> StartNotebookExecution -> Bool
Prelude.Eq, ReadPrec [StartNotebookExecution]
ReadPrec StartNotebookExecution
Int -> ReadS StartNotebookExecution
ReadS [StartNotebookExecution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNotebookExecution]
$creadListPrec :: ReadPrec [StartNotebookExecution]
readPrec :: ReadPrec StartNotebookExecution
$creadPrec :: ReadPrec StartNotebookExecution
readList :: ReadS [StartNotebookExecution]
$creadList :: ReadS [StartNotebookExecution]
readsPrec :: Int -> ReadS StartNotebookExecution
$creadsPrec :: Int -> ReadS StartNotebookExecution
Prelude.Read, Int -> StartNotebookExecution -> ShowS
[StartNotebookExecution] -> ShowS
StartNotebookExecution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNotebookExecution] -> ShowS
$cshowList :: [StartNotebookExecution] -> ShowS
show :: StartNotebookExecution -> String
$cshow :: StartNotebookExecution -> String
showsPrec :: Int -> StartNotebookExecution -> ShowS
$cshowsPrec :: Int -> StartNotebookExecution -> ShowS
Prelude.Show, forall x. Rep StartNotebookExecution x -> StartNotebookExecution
forall x. StartNotebookExecution -> Rep StartNotebookExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartNotebookExecution x -> StartNotebookExecution
$cfrom :: forall x. StartNotebookExecution -> Rep StartNotebookExecution x
Prelude.Generic)

-- |
-- Create a value of 'StartNotebookExecution' 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:
--
-- 'notebookExecutionName', 'startNotebookExecution_notebookExecutionName' - An optional name for the notebook execution.
--
-- 'notebookInstanceSecurityGroupId', 'startNotebookExecution_notebookInstanceSecurityGroupId' - The unique identifier of the Amazon EC2 security group to associate with
-- the EMR Notebook for this notebook execution.
--
-- 'notebookParams', 'startNotebookExecution_notebookParams' - Input parameters in JSON format passed to the EMR Notebook at runtime
-- for execution.
--
-- 'tags', 'startNotebookExecution_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.
--
-- 'editorId', 'startNotebookExecution_editorId' - The unique identifier of the EMR Notebook to use for notebook execution.
--
-- 'relativePath', 'startNotebookExecution_relativePath' - The path and file name of the notebook file for this execution, relative
-- to the path specified for the EMR Notebook. For example, if you specify
-- a path of @s3:\/\/MyBucket\/MyNotebooks@ when you create an EMR Notebook
-- for a notebook with an ID of @e-ABCDEFGHIJK1234567890ABCD@ (the
-- @EditorID@ of this request), and you specify a @RelativePath@ of
-- @my_notebook_executions\/notebook_execution.ipynb@, the location of the
-- file for the notebook execution is
-- @s3:\/\/MyBucket\/MyNotebooks\/e-ABCDEFGHIJK1234567890ABCD\/my_notebook_executions\/notebook_execution.ipynb@.
--
-- 'executionEngine', 'startNotebookExecution_executionEngine' - Specifies the execution engine (cluster) that runs the notebook
-- execution.
--
-- 'serviceRole', 'startNotebookExecution_serviceRole' - The name or ARN of the IAM role that is used as the service role for
-- Amazon EMR (the EMR role) for the notebook execution.
newStartNotebookExecution ::
  -- | 'editorId'
  Prelude.Text ->
  -- | 'relativePath'
  Prelude.Text ->
  -- | 'executionEngine'
  ExecutionEngineConfig ->
  -- | 'serviceRole'
  Prelude.Text ->
  StartNotebookExecution
newStartNotebookExecution :: Text
-> Text -> ExecutionEngineConfig -> Text -> StartNotebookExecution
newStartNotebookExecution
  Text
pEditorId_
  Text
pRelativePath_
  ExecutionEngineConfig
pExecutionEngine_
  Text
pServiceRole_ =
    StartNotebookExecution'
      { $sel:notebookExecutionName:StartNotebookExecution' :: Maybe Text
notebookExecutionName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: Maybe Text
notebookInstanceSecurityGroupId = forall a. Maybe a
Prelude.Nothing,
        $sel:notebookParams:StartNotebookExecution' :: Maybe Text
notebookParams = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:StartNotebookExecution' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:editorId:StartNotebookExecution' :: Text
editorId = Text
pEditorId_,
        $sel:relativePath:StartNotebookExecution' :: Text
relativePath = Text
pRelativePath_,
        $sel:executionEngine:StartNotebookExecution' :: ExecutionEngineConfig
executionEngine = ExecutionEngineConfig
pExecutionEngine_,
        $sel:serviceRole:StartNotebookExecution' :: Text
serviceRole = Text
pServiceRole_
      }

-- | An optional name for the notebook execution.
startNotebookExecution_notebookExecutionName :: Lens.Lens' StartNotebookExecution (Prelude.Maybe Prelude.Text)
startNotebookExecution_notebookExecutionName :: Lens' StartNotebookExecution (Maybe Text)
startNotebookExecution_notebookExecutionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Maybe Text
notebookExecutionName :: Maybe Text
$sel:notebookExecutionName:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
notebookExecutionName} -> Maybe Text
notebookExecutionName) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Maybe Text
a -> StartNotebookExecution
s {$sel:notebookExecutionName:StartNotebookExecution' :: Maybe Text
notebookExecutionName = Maybe Text
a} :: StartNotebookExecution)

-- | The unique identifier of the Amazon EC2 security group to associate with
-- the EMR Notebook for this notebook execution.
startNotebookExecution_notebookInstanceSecurityGroupId :: Lens.Lens' StartNotebookExecution (Prelude.Maybe Prelude.Text)
startNotebookExecution_notebookInstanceSecurityGroupId :: Lens' StartNotebookExecution (Maybe Text)
startNotebookExecution_notebookInstanceSecurityGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
$sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
notebookInstanceSecurityGroupId} -> Maybe Text
notebookInstanceSecurityGroupId) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Maybe Text
a -> StartNotebookExecution
s {$sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: Maybe Text
notebookInstanceSecurityGroupId = Maybe Text
a} :: StartNotebookExecution)

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

-- | 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.
startNotebookExecution_tags :: Lens.Lens' StartNotebookExecution (Prelude.Maybe [Tag])
startNotebookExecution_tags :: Lens' StartNotebookExecution (Maybe [Tag])
startNotebookExecution_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartNotebookExecution' :: StartNotebookExecution -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Maybe [Tag]
a -> StartNotebookExecution
s {$sel:tags:StartNotebookExecution' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartNotebookExecution) 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

-- | The unique identifier of the EMR Notebook to use for notebook execution.
startNotebookExecution_editorId :: Lens.Lens' StartNotebookExecution Prelude.Text
startNotebookExecution_editorId :: Lens' StartNotebookExecution Text
startNotebookExecution_editorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Text
editorId :: Text
$sel:editorId:StartNotebookExecution' :: StartNotebookExecution -> Text
editorId} -> Text
editorId) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Text
a -> StartNotebookExecution
s {$sel:editorId:StartNotebookExecution' :: Text
editorId = Text
a} :: StartNotebookExecution)

-- | The path and file name of the notebook file for this execution, relative
-- to the path specified for the EMR Notebook. For example, if you specify
-- a path of @s3:\/\/MyBucket\/MyNotebooks@ when you create an EMR Notebook
-- for a notebook with an ID of @e-ABCDEFGHIJK1234567890ABCD@ (the
-- @EditorID@ of this request), and you specify a @RelativePath@ of
-- @my_notebook_executions\/notebook_execution.ipynb@, the location of the
-- file for the notebook execution is
-- @s3:\/\/MyBucket\/MyNotebooks\/e-ABCDEFGHIJK1234567890ABCD\/my_notebook_executions\/notebook_execution.ipynb@.
startNotebookExecution_relativePath :: Lens.Lens' StartNotebookExecution Prelude.Text
startNotebookExecution_relativePath :: Lens' StartNotebookExecution Text
startNotebookExecution_relativePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Text
relativePath :: Text
$sel:relativePath:StartNotebookExecution' :: StartNotebookExecution -> Text
relativePath} -> Text
relativePath) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Text
a -> StartNotebookExecution
s {$sel:relativePath:StartNotebookExecution' :: Text
relativePath = Text
a} :: StartNotebookExecution)

-- | Specifies the execution engine (cluster) that runs the notebook
-- execution.
startNotebookExecution_executionEngine :: Lens.Lens' StartNotebookExecution ExecutionEngineConfig
startNotebookExecution_executionEngine :: Lens' StartNotebookExecution ExecutionEngineConfig
startNotebookExecution_executionEngine = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {ExecutionEngineConfig
executionEngine :: ExecutionEngineConfig
$sel:executionEngine:StartNotebookExecution' :: StartNotebookExecution -> ExecutionEngineConfig
executionEngine} -> ExecutionEngineConfig
executionEngine) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} ExecutionEngineConfig
a -> StartNotebookExecution
s {$sel:executionEngine:StartNotebookExecution' :: ExecutionEngineConfig
executionEngine = ExecutionEngineConfig
a} :: StartNotebookExecution)

-- | The name or ARN of the IAM role that is used as the service role for
-- Amazon EMR (the EMR role) for the notebook execution.
startNotebookExecution_serviceRole :: Lens.Lens' StartNotebookExecution Prelude.Text
startNotebookExecution_serviceRole :: Lens' StartNotebookExecution Text
startNotebookExecution_serviceRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecution' {Text
serviceRole :: Text
$sel:serviceRole:StartNotebookExecution' :: StartNotebookExecution -> Text
serviceRole} -> Text
serviceRole) (\s :: StartNotebookExecution
s@StartNotebookExecution' {} Text
a -> StartNotebookExecution
s {$sel:serviceRole:StartNotebookExecution' :: Text
serviceRole = Text
a} :: StartNotebookExecution)

instance Core.AWSRequest StartNotebookExecution where
  type
    AWSResponse StartNotebookExecution =
      StartNotebookExecutionResponse
  request :: (Service -> Service)
-> StartNotebookExecution -> Request StartNotebookExecution
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartNotebookExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartNotebookExecution)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> StartNotebookExecutionResponse
StartNotebookExecutionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NotebookExecutionId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable StartNotebookExecution where
  hashWithSalt :: Int -> StartNotebookExecution -> Int
hashWithSalt Int
_salt StartNotebookExecution' {Maybe [Tag]
Maybe Text
Text
ExecutionEngineConfig
serviceRole :: Text
executionEngine :: ExecutionEngineConfig
relativePath :: Text
editorId :: Text
tags :: Maybe [Tag]
notebookParams :: Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
notebookExecutionName :: Maybe Text
$sel:serviceRole:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:executionEngine:StartNotebookExecution' :: StartNotebookExecution -> ExecutionEngineConfig
$sel:relativePath:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:editorId:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:tags:StartNotebookExecution' :: StartNotebookExecution -> Maybe [Tag]
$sel:notebookParams:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookExecutionName:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
..} =
    Int
_salt
      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 [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
editorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
relativePath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ExecutionEngineConfig
executionEngine
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceRole

instance Prelude.NFData StartNotebookExecution where
  rnf :: StartNotebookExecution -> ()
rnf StartNotebookExecution' {Maybe [Tag]
Maybe Text
Text
ExecutionEngineConfig
serviceRole :: Text
executionEngine :: ExecutionEngineConfig
relativePath :: Text
editorId :: Text
tags :: Maybe [Tag]
notebookParams :: Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
notebookExecutionName :: Maybe Text
$sel:serviceRole:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:executionEngine:StartNotebookExecution' :: StartNotebookExecution -> ExecutionEngineConfig
$sel:relativePath:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:editorId:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:tags:StartNotebookExecution' :: StartNotebookExecution -> Maybe [Tag]
$sel:notebookParams:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookExecutionName:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
..} =
    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 [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
editorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
relativePath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ExecutionEngineConfig
executionEngine
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceRole

instance Data.ToHeaders StartNotebookExecution where
  toHeaders :: StartNotebookExecution -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ElasticMapReduce.StartNotebookExecution" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StartNotebookExecution where
  toJSON :: StartNotebookExecution -> Value
toJSON StartNotebookExecution' {Maybe [Tag]
Maybe Text
Text
ExecutionEngineConfig
serviceRole :: Text
executionEngine :: ExecutionEngineConfig
relativePath :: Text
editorId :: Text
tags :: Maybe [Tag]
notebookParams :: Maybe Text
notebookInstanceSecurityGroupId :: Maybe Text
notebookExecutionName :: Maybe Text
$sel:serviceRole:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:executionEngine:StartNotebookExecution' :: StartNotebookExecution -> ExecutionEngineConfig
$sel:relativePath:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:editorId:StartNotebookExecution' :: StartNotebookExecution -> Text
$sel:tags:StartNotebookExecution' :: StartNotebookExecution -> Maybe [Tag]
$sel:notebookParams:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookInstanceSecurityGroupId:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
$sel:notebookExecutionName:StartNotebookExecution' :: StartNotebookExecution -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"NotebookExecutionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notebookExecutionName,
            (Key
"NotebookInstanceSecurityGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notebookInstanceSecurityGroupId,
            (Key
"NotebookParams" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notebookParams,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"EditorId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
editorId),
            forall a. a -> Maybe a
Prelude.Just (Key
"RelativePath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
relativePath),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ExecutionEngine" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ExecutionEngineConfig
executionEngine),
            forall a. a -> Maybe a
Prelude.Just (Key
"ServiceRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceRole)
          ]
      )

instance Data.ToPath StartNotebookExecution where
  toPath :: StartNotebookExecution -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery StartNotebookExecution where
  toQuery :: StartNotebookExecution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newStartNotebookExecutionResponse' smart constructor.
data StartNotebookExecutionResponse = StartNotebookExecutionResponse'
  { -- | The unique identifier of the notebook execution.
    StartNotebookExecutionResponse -> Maybe Text
notebookExecutionId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartNotebookExecutionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartNotebookExecutionResponse
-> StartNotebookExecutionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNotebookExecutionResponse
-> StartNotebookExecutionResponse -> Bool
$c/= :: StartNotebookExecutionResponse
-> StartNotebookExecutionResponse -> Bool
== :: StartNotebookExecutionResponse
-> StartNotebookExecutionResponse -> Bool
$c== :: StartNotebookExecutionResponse
-> StartNotebookExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StartNotebookExecutionResponse]
ReadPrec StartNotebookExecutionResponse
Int -> ReadS StartNotebookExecutionResponse
ReadS [StartNotebookExecutionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNotebookExecutionResponse]
$creadListPrec :: ReadPrec [StartNotebookExecutionResponse]
readPrec :: ReadPrec StartNotebookExecutionResponse
$creadPrec :: ReadPrec StartNotebookExecutionResponse
readList :: ReadS [StartNotebookExecutionResponse]
$creadList :: ReadS [StartNotebookExecutionResponse]
readsPrec :: Int -> ReadS StartNotebookExecutionResponse
$creadsPrec :: Int -> ReadS StartNotebookExecutionResponse
Prelude.Read, Int -> StartNotebookExecutionResponse -> ShowS
[StartNotebookExecutionResponse] -> ShowS
StartNotebookExecutionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNotebookExecutionResponse] -> ShowS
$cshowList :: [StartNotebookExecutionResponse] -> ShowS
show :: StartNotebookExecutionResponse -> String
$cshow :: StartNotebookExecutionResponse -> String
showsPrec :: Int -> StartNotebookExecutionResponse -> ShowS
$cshowsPrec :: Int -> StartNotebookExecutionResponse -> ShowS
Prelude.Show, forall x.
Rep StartNotebookExecutionResponse x
-> StartNotebookExecutionResponse
forall x.
StartNotebookExecutionResponse
-> Rep StartNotebookExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartNotebookExecutionResponse x
-> StartNotebookExecutionResponse
$cfrom :: forall x.
StartNotebookExecutionResponse
-> Rep StartNotebookExecutionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartNotebookExecutionResponse' 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:
--
-- 'notebookExecutionId', 'startNotebookExecutionResponse_notebookExecutionId' - The unique identifier of the notebook execution.
--
-- 'httpStatus', 'startNotebookExecutionResponse_httpStatus' - The response's http status code.
newStartNotebookExecutionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartNotebookExecutionResponse
newStartNotebookExecutionResponse :: Int -> StartNotebookExecutionResponse
newStartNotebookExecutionResponse Int
pHttpStatus_ =
  StartNotebookExecutionResponse'
    { $sel:notebookExecutionId:StartNotebookExecutionResponse' :: Maybe Text
notebookExecutionId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartNotebookExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The response's http status code.
startNotebookExecutionResponse_httpStatus :: Lens.Lens' StartNotebookExecutionResponse Prelude.Int
startNotebookExecutionResponse_httpStatus :: Lens' StartNotebookExecutionResponse Int
startNotebookExecutionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartNotebookExecutionResponse' :: StartNotebookExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartNotebookExecutionResponse
s@StartNotebookExecutionResponse' {} Int
a -> StartNotebookExecutionResponse
s {$sel:httpStatus:StartNotebookExecutionResponse' :: Int
httpStatus = Int
a} :: StartNotebookExecutionResponse)

instance
  Prelude.NFData
    StartNotebookExecutionResponse
  where
  rnf :: StartNotebookExecutionResponse -> ()
rnf StartNotebookExecutionResponse' {Int
Maybe Text
httpStatus :: Int
notebookExecutionId :: Maybe Text
$sel:httpStatus:StartNotebookExecutionResponse' :: StartNotebookExecutionResponse -> Int
$sel:notebookExecutionId:StartNotebookExecutionResponse' :: StartNotebookExecutionResponse -> Maybe Text
..} =
    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 Int
httpStatus