{-# 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.Glue.Types.BatchStopJobRunSuccessfulSubmission
-- 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.Glue.Types.BatchStopJobRunSuccessfulSubmission where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Records a successful request to stop a specified @JobRun@.
--
-- /See:/ 'newBatchStopJobRunSuccessfulSubmission' smart constructor.
data BatchStopJobRunSuccessfulSubmission = BatchStopJobRunSuccessfulSubmission'
  { -- | The name of the job definition used in the job run that was stopped.
    BatchStopJobRunSuccessfulSubmission -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The @JobRunId@ of the job run that was stopped.
    BatchStopJobRunSuccessfulSubmission -> Maybe Text
jobRunId :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchStopJobRunSuccessfulSubmission
-> BatchStopJobRunSuccessfulSubmission -> Bool
(BatchStopJobRunSuccessfulSubmission
 -> BatchStopJobRunSuccessfulSubmission -> Bool)
-> (BatchStopJobRunSuccessfulSubmission
    -> BatchStopJobRunSuccessfulSubmission -> Bool)
-> Eq BatchStopJobRunSuccessfulSubmission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchStopJobRunSuccessfulSubmission
-> BatchStopJobRunSuccessfulSubmission -> Bool
$c/= :: BatchStopJobRunSuccessfulSubmission
-> BatchStopJobRunSuccessfulSubmission -> Bool
== :: BatchStopJobRunSuccessfulSubmission
-> BatchStopJobRunSuccessfulSubmission -> Bool
$c== :: BatchStopJobRunSuccessfulSubmission
-> BatchStopJobRunSuccessfulSubmission -> Bool
Prelude.Eq, ReadPrec [BatchStopJobRunSuccessfulSubmission]
ReadPrec BatchStopJobRunSuccessfulSubmission
Int -> ReadS BatchStopJobRunSuccessfulSubmission
ReadS [BatchStopJobRunSuccessfulSubmission]
(Int -> ReadS BatchStopJobRunSuccessfulSubmission)
-> ReadS [BatchStopJobRunSuccessfulSubmission]
-> ReadPrec BatchStopJobRunSuccessfulSubmission
-> ReadPrec [BatchStopJobRunSuccessfulSubmission]
-> Read BatchStopJobRunSuccessfulSubmission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchStopJobRunSuccessfulSubmission]
$creadListPrec :: ReadPrec [BatchStopJobRunSuccessfulSubmission]
readPrec :: ReadPrec BatchStopJobRunSuccessfulSubmission
$creadPrec :: ReadPrec BatchStopJobRunSuccessfulSubmission
readList :: ReadS [BatchStopJobRunSuccessfulSubmission]
$creadList :: ReadS [BatchStopJobRunSuccessfulSubmission]
readsPrec :: Int -> ReadS BatchStopJobRunSuccessfulSubmission
$creadsPrec :: Int -> ReadS BatchStopJobRunSuccessfulSubmission
Prelude.Read, Int -> BatchStopJobRunSuccessfulSubmission -> ShowS
[BatchStopJobRunSuccessfulSubmission] -> ShowS
BatchStopJobRunSuccessfulSubmission -> String
(Int -> BatchStopJobRunSuccessfulSubmission -> ShowS)
-> (BatchStopJobRunSuccessfulSubmission -> String)
-> ([BatchStopJobRunSuccessfulSubmission] -> ShowS)
-> Show BatchStopJobRunSuccessfulSubmission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchStopJobRunSuccessfulSubmission] -> ShowS
$cshowList :: [BatchStopJobRunSuccessfulSubmission] -> ShowS
show :: BatchStopJobRunSuccessfulSubmission -> String
$cshow :: BatchStopJobRunSuccessfulSubmission -> String
showsPrec :: Int -> BatchStopJobRunSuccessfulSubmission -> ShowS
$cshowsPrec :: Int -> BatchStopJobRunSuccessfulSubmission -> ShowS
Prelude.Show, (forall x.
 BatchStopJobRunSuccessfulSubmission
 -> Rep BatchStopJobRunSuccessfulSubmission x)
-> (forall x.
    Rep BatchStopJobRunSuccessfulSubmission x
    -> BatchStopJobRunSuccessfulSubmission)
-> Generic BatchStopJobRunSuccessfulSubmission
forall x.
Rep BatchStopJobRunSuccessfulSubmission x
-> BatchStopJobRunSuccessfulSubmission
forall x.
BatchStopJobRunSuccessfulSubmission
-> Rep BatchStopJobRunSuccessfulSubmission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchStopJobRunSuccessfulSubmission x
-> BatchStopJobRunSuccessfulSubmission
$cfrom :: forall x.
BatchStopJobRunSuccessfulSubmission
-> Rep BatchStopJobRunSuccessfulSubmission x
Prelude.Generic)

-- |
-- Create a value of 'BatchStopJobRunSuccessfulSubmission' 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:
--
-- 'jobName', 'batchStopJobRunSuccessfulSubmission_jobName' - The name of the job definition used in the job run that was stopped.
--
-- 'jobRunId', 'batchStopJobRunSuccessfulSubmission_jobRunId' - The @JobRunId@ of the job run that was stopped.
newBatchStopJobRunSuccessfulSubmission ::
  BatchStopJobRunSuccessfulSubmission
newBatchStopJobRunSuccessfulSubmission :: BatchStopJobRunSuccessfulSubmission
newBatchStopJobRunSuccessfulSubmission =
  BatchStopJobRunSuccessfulSubmission' :: Maybe Text -> Maybe Text -> BatchStopJobRunSuccessfulSubmission
BatchStopJobRunSuccessfulSubmission'
    { $sel:jobName:BatchStopJobRunSuccessfulSubmission' :: Maybe Text
jobName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobRunId:BatchStopJobRunSuccessfulSubmission' :: Maybe Text
jobRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the job definition used in the job run that was stopped.
batchStopJobRunSuccessfulSubmission_jobName :: Lens.Lens' BatchStopJobRunSuccessfulSubmission (Prelude.Maybe Prelude.Text)
batchStopJobRunSuccessfulSubmission_jobName :: (Maybe Text -> f (Maybe Text))
-> BatchStopJobRunSuccessfulSubmission
-> f BatchStopJobRunSuccessfulSubmission
batchStopJobRunSuccessfulSubmission_jobName = (BatchStopJobRunSuccessfulSubmission -> Maybe Text)
-> (BatchStopJobRunSuccessfulSubmission
    -> Maybe Text -> BatchStopJobRunSuccessfulSubmission)
-> Lens
     BatchStopJobRunSuccessfulSubmission
     BatchStopJobRunSuccessfulSubmission
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRunSuccessfulSubmission' {Maybe Text
jobName :: Maybe Text
$sel:jobName:BatchStopJobRunSuccessfulSubmission' :: BatchStopJobRunSuccessfulSubmission -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: BatchStopJobRunSuccessfulSubmission
s@BatchStopJobRunSuccessfulSubmission' {} Maybe Text
a -> BatchStopJobRunSuccessfulSubmission
s {$sel:jobName:BatchStopJobRunSuccessfulSubmission' :: Maybe Text
jobName = Maybe Text
a} :: BatchStopJobRunSuccessfulSubmission)

-- | The @JobRunId@ of the job run that was stopped.
batchStopJobRunSuccessfulSubmission_jobRunId :: Lens.Lens' BatchStopJobRunSuccessfulSubmission (Prelude.Maybe Prelude.Text)
batchStopJobRunSuccessfulSubmission_jobRunId :: (Maybe Text -> f (Maybe Text))
-> BatchStopJobRunSuccessfulSubmission
-> f BatchStopJobRunSuccessfulSubmission
batchStopJobRunSuccessfulSubmission_jobRunId = (BatchStopJobRunSuccessfulSubmission -> Maybe Text)
-> (BatchStopJobRunSuccessfulSubmission
    -> Maybe Text -> BatchStopJobRunSuccessfulSubmission)
-> Lens
     BatchStopJobRunSuccessfulSubmission
     BatchStopJobRunSuccessfulSubmission
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRunSuccessfulSubmission' {Maybe Text
jobRunId :: Maybe Text
$sel:jobRunId:BatchStopJobRunSuccessfulSubmission' :: BatchStopJobRunSuccessfulSubmission -> Maybe Text
jobRunId} -> Maybe Text
jobRunId) (\s :: BatchStopJobRunSuccessfulSubmission
s@BatchStopJobRunSuccessfulSubmission' {} Maybe Text
a -> BatchStopJobRunSuccessfulSubmission
s {$sel:jobRunId:BatchStopJobRunSuccessfulSubmission' :: Maybe Text
jobRunId = Maybe Text
a} :: BatchStopJobRunSuccessfulSubmission)

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

instance
  Prelude.Hashable
    BatchStopJobRunSuccessfulSubmission

instance
  Prelude.NFData
    BatchStopJobRunSuccessfulSubmission