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

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

-- | An object representing 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
(ArrayProperties -> ArrayProperties -> Bool)
-> (ArrayProperties -> ArrayProperties -> Bool)
-> Eq ArrayProperties
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]
(Int -> ReadS ArrayProperties)
-> ReadS [ArrayProperties]
-> ReadPrec ArrayProperties
-> ReadPrec [ArrayProperties]
-> Read 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
(Int -> ArrayProperties -> ShowS)
-> (ArrayProperties -> String)
-> ([ArrayProperties] -> ShowS)
-> Show ArrayProperties
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. ArrayProperties -> Rep ArrayProperties x)
-> (forall x. Rep ArrayProperties x -> ArrayProperties)
-> Generic ArrayProperties
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' :: Maybe Int -> ArrayProperties
ArrayProperties' {$sel:size:ArrayProperties' :: Maybe Int
size = Maybe Int
forall a. Maybe a
Prelude.Nothing}

-- | The size of the array job.
arrayProperties_size :: Lens.Lens' ArrayProperties (Prelude.Maybe Prelude.Int)
arrayProperties_size :: (Maybe Int -> f (Maybe Int))
-> ArrayProperties -> f ArrayProperties
arrayProperties_size = (ArrayProperties -> Maybe Int)
-> (ArrayProperties -> Maybe Int -> ArrayProperties)
-> Lens ArrayProperties ArrayProperties (Maybe Int) (Maybe Int)
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

instance Prelude.NFData ArrayProperties

instance Core.ToJSON ArrayProperties where
  toJSON :: ArrayProperties -> Value
toJSON ArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:ArrayProperties' :: ArrayProperties -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"size" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
size]
      )