{-# 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.RobOMaker.Types.WorldCount where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorldCount = WorldCount'
{
WorldCount -> Maybe Int
interiorCountPerFloorplan :: Prelude.Maybe Prelude.Int,
WorldCount -> Maybe Int
floorplanCount :: Prelude.Maybe Prelude.Int
}
deriving (WorldCount -> WorldCount -> Bool
(WorldCount -> WorldCount -> Bool)
-> (WorldCount -> WorldCount -> Bool) -> Eq WorldCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorldCount -> WorldCount -> Bool
$c/= :: WorldCount -> WorldCount -> Bool
== :: WorldCount -> WorldCount -> Bool
$c== :: WorldCount -> WorldCount -> Bool
Prelude.Eq, ReadPrec [WorldCount]
ReadPrec WorldCount
Int -> ReadS WorldCount
ReadS [WorldCount]
(Int -> ReadS WorldCount)
-> ReadS [WorldCount]
-> ReadPrec WorldCount
-> ReadPrec [WorldCount]
-> Read WorldCount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorldCount]
$creadListPrec :: ReadPrec [WorldCount]
readPrec :: ReadPrec WorldCount
$creadPrec :: ReadPrec WorldCount
readList :: ReadS [WorldCount]
$creadList :: ReadS [WorldCount]
readsPrec :: Int -> ReadS WorldCount
$creadsPrec :: Int -> ReadS WorldCount
Prelude.Read, Int -> WorldCount -> ShowS
[WorldCount] -> ShowS
WorldCount -> String
(Int -> WorldCount -> ShowS)
-> (WorldCount -> String)
-> ([WorldCount] -> ShowS)
-> Show WorldCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorldCount] -> ShowS
$cshowList :: [WorldCount] -> ShowS
show :: WorldCount -> String
$cshow :: WorldCount -> String
showsPrec :: Int -> WorldCount -> ShowS
$cshowsPrec :: Int -> WorldCount -> ShowS
Prelude.Show, (forall x. WorldCount -> Rep WorldCount x)
-> (forall x. Rep WorldCount x -> WorldCount) -> Generic WorldCount
forall x. Rep WorldCount x -> WorldCount
forall x. WorldCount -> Rep WorldCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorldCount x -> WorldCount
$cfrom :: forall x. WorldCount -> Rep WorldCount x
Prelude.Generic)
newWorldCount ::
WorldCount
newWorldCount :: WorldCount
newWorldCount =
WorldCount' :: Maybe Int -> Maybe Int -> WorldCount
WorldCount'
{ $sel:interiorCountPerFloorplan:WorldCount' :: Maybe Int
interiorCountPerFloorplan =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:floorplanCount:WorldCount' :: Maybe Int
floorplanCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
worldCount_interiorCountPerFloorplan :: Lens.Lens' WorldCount (Prelude.Maybe Prelude.Int)
worldCount_interiorCountPerFloorplan :: (Maybe Int -> f (Maybe Int)) -> WorldCount -> f WorldCount
worldCount_interiorCountPerFloorplan = (WorldCount -> Maybe Int)
-> (WorldCount -> Maybe Int -> WorldCount)
-> Lens WorldCount WorldCount (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldCount' {Maybe Int
interiorCountPerFloorplan :: Maybe Int
$sel:interiorCountPerFloorplan:WorldCount' :: WorldCount -> Maybe Int
interiorCountPerFloorplan} -> Maybe Int
interiorCountPerFloorplan) (\s :: WorldCount
s@WorldCount' {} Maybe Int
a -> WorldCount
s {$sel:interiorCountPerFloorplan:WorldCount' :: Maybe Int
interiorCountPerFloorplan = Maybe Int
a} :: WorldCount)
worldCount_floorplanCount :: Lens.Lens' WorldCount (Prelude.Maybe Prelude.Int)
worldCount_floorplanCount :: (Maybe Int -> f (Maybe Int)) -> WorldCount -> f WorldCount
worldCount_floorplanCount = (WorldCount -> Maybe Int)
-> (WorldCount -> Maybe Int -> WorldCount)
-> Lens WorldCount WorldCount (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldCount' {Maybe Int
floorplanCount :: Maybe Int
$sel:floorplanCount:WorldCount' :: WorldCount -> Maybe Int
floorplanCount} -> Maybe Int
floorplanCount) (\s :: WorldCount
s@WorldCount' {} Maybe Int
a -> WorldCount
s {$sel:floorplanCount:WorldCount' :: Maybe Int
floorplanCount = Maybe Int
a} :: WorldCount)
instance Core.FromJSON WorldCount where
parseJSON :: Value -> Parser WorldCount
parseJSON =
String
-> (Object -> Parser WorldCount) -> Value -> Parser WorldCount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorldCount"
( \Object
x ->
Maybe Int -> Maybe Int -> WorldCount
WorldCount'
(Maybe Int -> Maybe Int -> WorldCount)
-> Parser (Maybe Int) -> Parser (Maybe Int -> WorldCount)
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
"interiorCountPerFloorplan")
Parser (Maybe Int -> WorldCount)
-> Parser (Maybe Int) -> Parser WorldCount
forall (f :: * -> *) a b. Applicative f => 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
"floorplanCount")
)
instance Prelude.Hashable WorldCount
instance Prelude.NFData WorldCount
instance Core.ToJSON WorldCount where
toJSON :: WorldCount -> Value
toJSON WorldCount' {Maybe Int
floorplanCount :: Maybe Int
interiorCountPerFloorplan :: Maybe Int
$sel:floorplanCount:WorldCount' :: WorldCount -> Maybe Int
$sel:interiorCountPerFloorplan:WorldCount' :: WorldCount -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"interiorCountPerFloorplan" 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
interiorCountPerFloorplan,
(Text
"floorplanCount" 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
floorplanCount
]
)