{-# 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.M2.Types.ScriptBatchJobIdentifier
-- 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.M2.Types.ScriptBatchJobIdentifier where

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

-- | A batch job identifier in which the batch job to run is identified by
-- the script name.
--
-- /See:/ 'newScriptBatchJobIdentifier' smart constructor.
data ScriptBatchJobIdentifier = ScriptBatchJobIdentifier'
  { -- | The name of the script containing the batch job definition.
    ScriptBatchJobIdentifier -> Text
scriptName :: Prelude.Text
  }
  deriving (ScriptBatchJobIdentifier -> ScriptBatchJobIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScriptBatchJobIdentifier -> ScriptBatchJobIdentifier -> Bool
$c/= :: ScriptBatchJobIdentifier -> ScriptBatchJobIdentifier -> Bool
== :: ScriptBatchJobIdentifier -> ScriptBatchJobIdentifier -> Bool
$c== :: ScriptBatchJobIdentifier -> ScriptBatchJobIdentifier -> Bool
Prelude.Eq, ReadPrec [ScriptBatchJobIdentifier]
ReadPrec ScriptBatchJobIdentifier
Int -> ReadS ScriptBatchJobIdentifier
ReadS [ScriptBatchJobIdentifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScriptBatchJobIdentifier]
$creadListPrec :: ReadPrec [ScriptBatchJobIdentifier]
readPrec :: ReadPrec ScriptBatchJobIdentifier
$creadPrec :: ReadPrec ScriptBatchJobIdentifier
readList :: ReadS [ScriptBatchJobIdentifier]
$creadList :: ReadS [ScriptBatchJobIdentifier]
readsPrec :: Int -> ReadS ScriptBatchJobIdentifier
$creadsPrec :: Int -> ReadS ScriptBatchJobIdentifier
Prelude.Read, Int -> ScriptBatchJobIdentifier -> ShowS
[ScriptBatchJobIdentifier] -> ShowS
ScriptBatchJobIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScriptBatchJobIdentifier] -> ShowS
$cshowList :: [ScriptBatchJobIdentifier] -> ShowS
show :: ScriptBatchJobIdentifier -> String
$cshow :: ScriptBatchJobIdentifier -> String
showsPrec :: Int -> ScriptBatchJobIdentifier -> ShowS
$cshowsPrec :: Int -> ScriptBatchJobIdentifier -> ShowS
Prelude.Show, forall x.
Rep ScriptBatchJobIdentifier x -> ScriptBatchJobIdentifier
forall x.
ScriptBatchJobIdentifier -> Rep ScriptBatchJobIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ScriptBatchJobIdentifier x -> ScriptBatchJobIdentifier
$cfrom :: forall x.
ScriptBatchJobIdentifier -> Rep ScriptBatchJobIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'ScriptBatchJobIdentifier' 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:
--
-- 'scriptName', 'scriptBatchJobIdentifier_scriptName' - The name of the script containing the batch job definition.
newScriptBatchJobIdentifier ::
  -- | 'scriptName'
  Prelude.Text ->
  ScriptBatchJobIdentifier
newScriptBatchJobIdentifier :: Text -> ScriptBatchJobIdentifier
newScriptBatchJobIdentifier Text
pScriptName_ =
  ScriptBatchJobIdentifier'
    { $sel:scriptName:ScriptBatchJobIdentifier' :: Text
scriptName =
        Text
pScriptName_
    }

-- | The name of the script containing the batch job definition.
scriptBatchJobIdentifier_scriptName :: Lens.Lens' ScriptBatchJobIdentifier Prelude.Text
scriptBatchJobIdentifier_scriptName :: Lens' ScriptBatchJobIdentifier Text
scriptBatchJobIdentifier_scriptName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScriptBatchJobIdentifier' {Text
scriptName :: Text
$sel:scriptName:ScriptBatchJobIdentifier' :: ScriptBatchJobIdentifier -> Text
scriptName} -> Text
scriptName) (\s :: ScriptBatchJobIdentifier
s@ScriptBatchJobIdentifier' {} Text
a -> ScriptBatchJobIdentifier
s {$sel:scriptName:ScriptBatchJobIdentifier' :: Text
scriptName = Text
a} :: ScriptBatchJobIdentifier)

instance Prelude.Hashable ScriptBatchJobIdentifier where
  hashWithSalt :: Int -> ScriptBatchJobIdentifier -> Int
hashWithSalt Int
_salt ScriptBatchJobIdentifier' {Text
scriptName :: Text
$sel:scriptName:ScriptBatchJobIdentifier' :: ScriptBatchJobIdentifier -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scriptName

instance Prelude.NFData ScriptBatchJobIdentifier where
  rnf :: ScriptBatchJobIdentifier -> ()
rnf ScriptBatchJobIdentifier' {Text
scriptName :: Text
$sel:scriptName:ScriptBatchJobIdentifier' :: ScriptBatchJobIdentifier -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
scriptName

instance Data.ToJSON ScriptBatchJobIdentifier where
  toJSON :: ScriptBatchJobIdentifier -> Value
toJSON ScriptBatchJobIdentifier' {Text
scriptName :: Text
$sel:scriptName:ScriptBatchJobIdentifier' :: ScriptBatchJobIdentifier -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"scriptName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
scriptName)]
      )