{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchArrayProperties = BatchArrayProperties'
{
BatchArrayProperties -> Maybe Int
size :: Prelude.Maybe Prelude.Int
}
deriving (BatchArrayProperties -> BatchArrayProperties -> Bool
(BatchArrayProperties -> BatchArrayProperties -> Bool)
-> (BatchArrayProperties -> BatchArrayProperties -> Bool)
-> Eq BatchArrayProperties
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]
(Int -> ReadS BatchArrayProperties)
-> ReadS [BatchArrayProperties]
-> ReadPrec BatchArrayProperties
-> ReadPrec [BatchArrayProperties]
-> Read 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
(Int -> BatchArrayProperties -> ShowS)
-> (BatchArrayProperties -> String)
-> ([BatchArrayProperties] -> ShowS)
-> Show BatchArrayProperties
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. BatchArrayProperties -> Rep BatchArrayProperties x)
-> (forall x. Rep BatchArrayProperties x -> BatchArrayProperties)
-> Generic BatchArrayProperties
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' :: Maybe Int -> BatchArrayProperties
BatchArrayProperties' {$sel:size:BatchArrayProperties' :: Maybe Int
size = Maybe Int
forall a. Maybe a
Prelude.Nothing}
batchArrayProperties_size :: Lens.Lens' BatchArrayProperties (Prelude.Maybe Prelude.Int)
batchArrayProperties_size :: (Maybe Int -> f (Maybe Int))
-> BatchArrayProperties -> f BatchArrayProperties
batchArrayProperties_size = (BatchArrayProperties -> Maybe Int)
-> (BatchArrayProperties -> Maybe Int -> BatchArrayProperties)
-> Lens
BatchArrayProperties BatchArrayProperties (Maybe Int) (Maybe Int)
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 Core.FromJSON BatchArrayProperties where
parseJSON :: Value -> Parser BatchArrayProperties
parseJSON =
String
-> (Object -> Parser BatchArrayProperties)
-> Value
-> Parser BatchArrayProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BatchArrayProperties"
( \Object
x ->
Maybe Int -> BatchArrayProperties
BatchArrayProperties'
(Maybe Int -> BatchArrayProperties)
-> Parser (Maybe Int) -> Parser BatchArrayProperties
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Size")
)
instance Prelude.Hashable BatchArrayProperties
instance Prelude.NFData BatchArrayProperties
instance Core.ToJSON BatchArrayProperties where
toJSON :: BatchArrayProperties -> Value
toJSON BatchArrayProperties' {Maybe Int
size :: Maybe Int
$sel:size:BatchArrayProperties' :: BatchArrayProperties -> 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]
)