{-# 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.Batch.Types.ArrayProperties
-- 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.Batch.Types.ArrayProperties 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

-- | An object that represents an Batch array job.
--
-- /See:/ 'newArrayProperties' smart constructor.
data ArrayProperties = ArrayProperties'
  { -- | The size of the array job.
    ArrayProperties -> Maybe Int
size :: Prelude.Maybe Prelude.Int
  }
  deriving (ArrayProperties -> ArrayProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArrayProperties -> ArrayProperties -> Bool
$c/= :: ArrayProperties -> ArrayProperties -> Bool
== :: ArrayProperties -> ArrayProperties -> Bool
$c== :: ArrayProperties -> ArrayProperties -> Bool
Prelude.Eq, ReadPrec [ArrayProperties]
ReadPrec ArrayProperties
Int -> ReadS ArrayProperties
ReadS [ArrayProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArrayProperties]
$creadListPrec :: ReadPrec [ArrayProperties]
readPrec :: ReadPrec ArrayProperties
$creadPrec :: ReadPrec ArrayProperties
readList :: ReadS [ArrayProperties]
$creadList :: ReadS [ArrayProperties]
readsPrec :: Int -> ReadS ArrayProperties
$creadsPrec :: Int -> ReadS ArrayProperties
Prelude.Read, Int -> ArrayProperties -> ShowS
[ArrayProperties] -> ShowS
ArrayProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArrayProperties] -> ShowS
$cshowList :: [ArrayProperties] -> ShowS
show :: ArrayProperties -> String
$cshow :: ArrayProperties -> String
showsPrec :: Int -> ArrayProperties -> ShowS
$cshowsPrec :: Int -> ArrayProperties -> ShowS
Prelude.Show, forall x. Rep ArrayProperties x -> ArrayProperties
forall x. ArrayProperties -> Rep ArrayProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArrayProperties x -> ArrayProperties
$cfrom :: forall x. ArrayProperties -> Rep ArrayProperties x
Prelude.Generic)

-- |
-- Create a value of 'ArrayProperties' 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:
--
-- 'size', 'arrayProperties_size' - The size of the array job.
newArrayProperties ::
  ArrayProperties
newArrayProperties :: ArrayProperties
newArrayProperties =
  ArrayProperties' {$sel:size:ArrayProperties' :: Maybe Int
size = forall a. Maybe a
Prelude.Nothing}

-- | The size of the array job.
arrayProperties_size :: Lens.Lens' ArrayProperties (Prelude.Maybe Prelude.Int)
arrayProperties_size :: Lens' ArrayProperties (Maybe Int)
arrayProperties_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:ArrayProperties' :: ArrayProperties -> Maybe Int
size} -> Maybe Int
size) (\s :: ArrayProperties
s@ArrayProperties' {} Maybe Int
a -> ArrayProperties
s {$sel:size:ArrayProperties' :: Maybe Int
size = Maybe Int
a} :: ArrayProperties)

instance Prelude.Hashable ArrayProperties where
  hashWithSalt :: Int -> ArrayProperties -> Int
hashWithSalt Int
_salt ArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:ArrayProperties' :: ArrayProperties -> Maybe Int
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
size

instance Prelude.NFData ArrayProperties where
  rnf :: ArrayProperties -> ()
rnf ArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:ArrayProperties' :: ArrayProperties -> Maybe Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
size

instance Data.ToJSON ArrayProperties where
  toJSON :: ArrayProperties -> Value
toJSON ArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:ArrayProperties' :: ArrayProperties -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"size" 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 Int
size]
      )