{-# 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.CloudWatchEvents.Types.BatchArrayProperties 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
data BatchArrayProperties = BatchArrayProperties'
{
BatchArrayProperties -> Maybe Int
size :: Prelude.Maybe Prelude.Int
}
deriving (BatchArrayProperties -> BatchArrayProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchArrayProperties -> BatchArrayProperties -> Bool
$c/= :: BatchArrayProperties -> BatchArrayProperties -> Bool
== :: BatchArrayProperties -> BatchArrayProperties -> Bool
$c== :: BatchArrayProperties -> BatchArrayProperties -> Bool
Prelude.Eq, ReadPrec [BatchArrayProperties]
ReadPrec BatchArrayProperties
Int -> ReadS BatchArrayProperties
ReadS [BatchArrayProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchArrayProperties]
$creadListPrec :: ReadPrec [BatchArrayProperties]
readPrec :: ReadPrec BatchArrayProperties
$creadPrec :: ReadPrec BatchArrayProperties
readList :: ReadS [BatchArrayProperties]
$creadList :: ReadS [BatchArrayProperties]
readsPrec :: Int -> ReadS BatchArrayProperties
$creadsPrec :: Int -> ReadS BatchArrayProperties
Prelude.Read, Int -> BatchArrayProperties -> ShowS
[BatchArrayProperties] -> ShowS
BatchArrayProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchArrayProperties] -> ShowS
$cshowList :: [BatchArrayProperties] -> ShowS
show :: BatchArrayProperties -> String
$cshow :: BatchArrayProperties -> String
showsPrec :: Int -> BatchArrayProperties -> ShowS
$cshowsPrec :: Int -> BatchArrayProperties -> ShowS
Prelude.Show, forall x. Rep BatchArrayProperties x -> BatchArrayProperties
forall x. BatchArrayProperties -> Rep BatchArrayProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchArrayProperties x -> BatchArrayProperties
$cfrom :: forall x. BatchArrayProperties -> Rep BatchArrayProperties x
Prelude.Generic)
newBatchArrayProperties ::
BatchArrayProperties
newBatchArrayProperties :: BatchArrayProperties
newBatchArrayProperties =
BatchArrayProperties' {$sel:size:BatchArrayProperties' :: Maybe Int
size = forall a. Maybe a
Prelude.Nothing}
batchArrayProperties_size :: Lens.Lens' BatchArrayProperties (Prelude.Maybe Prelude.Int)
batchArrayProperties_size :: Lens' BatchArrayProperties (Maybe Int)
batchArrayProperties_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:BatchArrayProperties' :: BatchArrayProperties -> Maybe Int
size} -> Maybe Int
size) (\s :: BatchArrayProperties
s@BatchArrayProperties' {} Maybe Int
a -> BatchArrayProperties
s {$sel:size:BatchArrayProperties' :: Maybe Int
size = Maybe Int
a} :: BatchArrayProperties)
instance Data.FromJSON BatchArrayProperties where
parseJSON :: Value -> Parser BatchArrayProperties
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BatchArrayProperties"
( \Object
x ->
Maybe Int -> BatchArrayProperties
BatchArrayProperties'
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
"Size")
)
instance Prelude.Hashable BatchArrayProperties where
hashWithSalt :: Int -> BatchArrayProperties -> Int
hashWithSalt Int
_salt BatchArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:BatchArrayProperties' :: BatchArrayProperties -> Maybe Int
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
size
instance Prelude.NFData BatchArrayProperties where
rnf :: BatchArrayProperties -> ()
rnf BatchArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:BatchArrayProperties' :: BatchArrayProperties -> Maybe Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
size
instance Data.ToJSON BatchArrayProperties where
toJSON :: BatchArrayProperties -> Value
toJSON BatchArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:BatchArrayProperties' :: BatchArrayProperties -> 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]
)