{-# 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 #-}
module Amazonka.Batch.Types.ArrayProperties where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ArrayProperties = ArrayProperties'
{
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)
newArrayProperties ::
ArrayProperties
newArrayProperties :: ArrayProperties
newArrayProperties =
ArrayProperties' :: Maybe Int -> ArrayProperties
ArrayProperties' {$sel:size:ArrayProperties' :: Maybe Int
size = Maybe Int
forall a. Maybe a
Prelude.Nothing}
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]
)