{-# 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.FileBatchJobDefinition
-- 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.FileBatchJobDefinition 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 file containing a batch job definition.
--
-- /See:/ 'newFileBatchJobDefinition' smart constructor.
data FileBatchJobDefinition = FileBatchJobDefinition'
  { -- | The path to the file containing the batch job definition.
    FileBatchJobDefinition -> Maybe Text
folderPath :: Prelude.Maybe Prelude.Text,
    -- | The name of the file containing the batch job definition.
    FileBatchJobDefinition -> Text
fileName :: Prelude.Text
  }
  deriving (FileBatchJobDefinition -> FileBatchJobDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileBatchJobDefinition -> FileBatchJobDefinition -> Bool
$c/= :: FileBatchJobDefinition -> FileBatchJobDefinition -> Bool
== :: FileBatchJobDefinition -> FileBatchJobDefinition -> Bool
$c== :: FileBatchJobDefinition -> FileBatchJobDefinition -> Bool
Prelude.Eq, ReadPrec [FileBatchJobDefinition]
ReadPrec FileBatchJobDefinition
Int -> ReadS FileBatchJobDefinition
ReadS [FileBatchJobDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileBatchJobDefinition]
$creadListPrec :: ReadPrec [FileBatchJobDefinition]
readPrec :: ReadPrec FileBatchJobDefinition
$creadPrec :: ReadPrec FileBatchJobDefinition
readList :: ReadS [FileBatchJobDefinition]
$creadList :: ReadS [FileBatchJobDefinition]
readsPrec :: Int -> ReadS FileBatchJobDefinition
$creadsPrec :: Int -> ReadS FileBatchJobDefinition
Prelude.Read, Int -> FileBatchJobDefinition -> ShowS
[FileBatchJobDefinition] -> ShowS
FileBatchJobDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileBatchJobDefinition] -> ShowS
$cshowList :: [FileBatchJobDefinition] -> ShowS
show :: FileBatchJobDefinition -> String
$cshow :: FileBatchJobDefinition -> String
showsPrec :: Int -> FileBatchJobDefinition -> ShowS
$cshowsPrec :: Int -> FileBatchJobDefinition -> ShowS
Prelude.Show, forall x. Rep FileBatchJobDefinition x -> FileBatchJobDefinition
forall x. FileBatchJobDefinition -> Rep FileBatchJobDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileBatchJobDefinition x -> FileBatchJobDefinition
$cfrom :: forall x. FileBatchJobDefinition -> Rep FileBatchJobDefinition x
Prelude.Generic)

-- |
-- Create a value of 'FileBatchJobDefinition' 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:
--
-- 'folderPath', 'fileBatchJobDefinition_folderPath' - The path to the file containing the batch job definition.
--
-- 'fileName', 'fileBatchJobDefinition_fileName' - The name of the file containing the batch job definition.
newFileBatchJobDefinition ::
  -- | 'fileName'
  Prelude.Text ->
  FileBatchJobDefinition
newFileBatchJobDefinition :: Text -> FileBatchJobDefinition
newFileBatchJobDefinition Text
pFileName_ =
  FileBatchJobDefinition'
    { $sel:folderPath:FileBatchJobDefinition' :: Maybe Text
folderPath =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fileName:FileBatchJobDefinition' :: Text
fileName = Text
pFileName_
    }

-- | The path to the file containing the batch job definition.
fileBatchJobDefinition_folderPath :: Lens.Lens' FileBatchJobDefinition (Prelude.Maybe Prelude.Text)
fileBatchJobDefinition_folderPath :: Lens' FileBatchJobDefinition (Maybe Text)
fileBatchJobDefinition_folderPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileBatchJobDefinition' {Maybe Text
folderPath :: Maybe Text
$sel:folderPath:FileBatchJobDefinition' :: FileBatchJobDefinition -> Maybe Text
folderPath} -> Maybe Text
folderPath) (\s :: FileBatchJobDefinition
s@FileBatchJobDefinition' {} Maybe Text
a -> FileBatchJobDefinition
s {$sel:folderPath:FileBatchJobDefinition' :: Maybe Text
folderPath = Maybe Text
a} :: FileBatchJobDefinition)

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

instance Data.FromJSON FileBatchJobDefinition where
  parseJSON :: Value -> Parser FileBatchJobDefinition
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FileBatchJobDefinition"
      ( \Object
x ->
          Maybe Text -> Text -> FileBatchJobDefinition
FileBatchJobDefinition'
            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
"folderPath")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"fileName")
      )

instance Prelude.Hashable FileBatchJobDefinition where
  hashWithSalt :: Int -> FileBatchJobDefinition -> Int
hashWithSalt Int
_salt FileBatchJobDefinition' {Maybe Text
Text
fileName :: Text
folderPath :: Maybe Text
$sel:fileName:FileBatchJobDefinition' :: FileBatchJobDefinition -> Text
$sel:folderPath:FileBatchJobDefinition' :: FileBatchJobDefinition -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
folderPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fileName

instance Prelude.NFData FileBatchJobDefinition where
  rnf :: FileBatchJobDefinition -> ()
rnf FileBatchJobDefinition' {Maybe Text
Text
fileName :: Text
folderPath :: Maybe Text
$sel:fileName:FileBatchJobDefinition' :: FileBatchJobDefinition -> Text
$sel:folderPath:FileBatchJobDefinition' :: FileBatchJobDefinition -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
folderPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fileName