{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data WorldCount = WorldCount'
{
WorldCount -> Maybe Int
floorplanCount :: Prelude.Maybe Prelude.Int,
WorldCount -> Maybe Int
interiorCountPerFloorplan :: Prelude.Maybe Prelude.Int
}
deriving (WorldCount -> WorldCount -> Bool
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]
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
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. 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'
{ $sel:floorplanCount:WorldCount' :: Maybe Int
floorplanCount = forall a. Maybe a
Prelude.Nothing,
$sel:interiorCountPerFloorplan:WorldCount' :: Maybe Int
interiorCountPerFloorplan = forall a. Maybe a
Prelude.Nothing
}
worldCount_floorplanCount :: Lens.Lens' WorldCount (Prelude.Maybe Prelude.Int)
worldCount_floorplanCount :: Lens' WorldCount (Maybe Int)
worldCount_floorplanCount = 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)
worldCount_interiorCountPerFloorplan :: Lens.Lens' WorldCount (Prelude.Maybe Prelude.Int)
worldCount_interiorCountPerFloorplan :: Lens' WorldCount (Maybe Int)
worldCount_interiorCountPerFloorplan = 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)
instance Data.FromJSON WorldCount where
parseJSON :: Value -> Parser WorldCount
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WorldCount"
( \Object
x ->
Maybe Int -> Maybe Int -> WorldCount
WorldCount'
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
"floorplanCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"interiorCountPerFloorplan")
)
instance Prelude.Hashable WorldCount where
hashWithSalt :: Int -> WorldCount -> Int
hashWithSalt Int
_salt WorldCount' {Maybe Int
interiorCountPerFloorplan :: Maybe Int
floorplanCount :: Maybe Int
$sel:interiorCountPerFloorplan:WorldCount' :: WorldCount -> Maybe Int
$sel:floorplanCount:WorldCount' :: WorldCount -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
floorplanCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
interiorCountPerFloorplan
instance Prelude.NFData WorldCount where
rnf :: WorldCount -> ()
rnf WorldCount' {Maybe Int
interiorCountPerFloorplan :: Maybe Int
floorplanCount :: Maybe Int
$sel:interiorCountPerFloorplan:WorldCount' :: WorldCount -> Maybe Int
$sel:floorplanCount:WorldCount' :: WorldCount -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
floorplanCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
interiorCountPerFloorplan
instance Data.ToJSON WorldCount where
toJSON :: WorldCount -> Value
toJSON WorldCount' {Maybe Int
interiorCountPerFloorplan :: Maybe Int
floorplanCount :: Maybe Int
$sel:interiorCountPerFloorplan:WorldCount' :: WorldCount -> Maybe Int
$sel:floorplanCount:WorldCount' :: WorldCount -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"floorplanCount" 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
floorplanCount,
(Key
"interiorCountPerFloorplan" 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
interiorCountPerFloorplan
]
)