{-# 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.Compute 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
import Amazonka.RobOMaker.Types.ComputeType
data Compute = Compute'
{
Compute -> Maybe ComputeType
computeType :: Prelude.Maybe ComputeType,
Compute -> Maybe Natural
gpuUnitLimit :: Prelude.Maybe Prelude.Natural,
Compute -> Maybe Natural
simulationUnitLimit :: Prelude.Maybe Prelude.Natural
}
deriving (Compute -> Compute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Compute -> Compute -> Bool
$c/= :: Compute -> Compute -> Bool
== :: Compute -> Compute -> Bool
$c== :: Compute -> Compute -> Bool
Prelude.Eq, ReadPrec [Compute]
ReadPrec Compute
Int -> ReadS Compute
ReadS [Compute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Compute]
$creadListPrec :: ReadPrec [Compute]
readPrec :: ReadPrec Compute
$creadPrec :: ReadPrec Compute
readList :: ReadS [Compute]
$creadList :: ReadS [Compute]
readsPrec :: Int -> ReadS Compute
$creadsPrec :: Int -> ReadS Compute
Prelude.Read, Int -> Compute -> ShowS
[Compute] -> ShowS
Compute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Compute] -> ShowS
$cshowList :: [Compute] -> ShowS
show :: Compute -> String
$cshow :: Compute -> String
showsPrec :: Int -> Compute -> ShowS
$cshowsPrec :: Int -> Compute -> ShowS
Prelude.Show, forall x. Rep Compute x -> Compute
forall x. Compute -> Rep Compute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Compute x -> Compute
$cfrom :: forall x. Compute -> Rep Compute x
Prelude.Generic)
newCompute ::
Compute
newCompute :: Compute
newCompute =
Compute'
{ $sel:computeType:Compute' :: Maybe ComputeType
computeType = forall a. Maybe a
Prelude.Nothing,
$sel:gpuUnitLimit:Compute' :: Maybe Natural
gpuUnitLimit = forall a. Maybe a
Prelude.Nothing,
$sel:simulationUnitLimit:Compute' :: Maybe Natural
simulationUnitLimit = forall a. Maybe a
Prelude.Nothing
}
compute_computeType :: Lens.Lens' Compute (Prelude.Maybe ComputeType)
compute_computeType :: Lens' Compute (Maybe ComputeType)
compute_computeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Compute' {Maybe ComputeType
computeType :: Maybe ComputeType
$sel:computeType:Compute' :: Compute -> Maybe ComputeType
computeType} -> Maybe ComputeType
computeType) (\s :: Compute
s@Compute' {} Maybe ComputeType
a -> Compute
s {$sel:computeType:Compute' :: Maybe ComputeType
computeType = Maybe ComputeType
a} :: Compute)
compute_gpuUnitLimit :: Lens.Lens' Compute (Prelude.Maybe Prelude.Natural)
compute_gpuUnitLimit :: Lens' Compute (Maybe Natural)
compute_gpuUnitLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Compute' {Maybe Natural
gpuUnitLimit :: Maybe Natural
$sel:gpuUnitLimit:Compute' :: Compute -> Maybe Natural
gpuUnitLimit} -> Maybe Natural
gpuUnitLimit) (\s :: Compute
s@Compute' {} Maybe Natural
a -> Compute
s {$sel:gpuUnitLimit:Compute' :: Maybe Natural
gpuUnitLimit = Maybe Natural
a} :: Compute)
compute_simulationUnitLimit :: Lens.Lens' Compute (Prelude.Maybe Prelude.Natural)
compute_simulationUnitLimit :: Lens' Compute (Maybe Natural)
compute_simulationUnitLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Compute' {Maybe Natural
simulationUnitLimit :: Maybe Natural
$sel:simulationUnitLimit:Compute' :: Compute -> Maybe Natural
simulationUnitLimit} -> Maybe Natural
simulationUnitLimit) (\s :: Compute
s@Compute' {} Maybe Natural
a -> Compute
s {$sel:simulationUnitLimit:Compute' :: Maybe Natural
simulationUnitLimit = Maybe Natural
a} :: Compute)
instance Data.FromJSON Compute where
parseJSON :: Value -> Parser Compute
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Compute"
( \Object
x ->
Maybe ComputeType -> Maybe Natural -> Maybe Natural -> Compute
Compute'
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
"computeType")
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
"gpuUnitLimit")
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
"simulationUnitLimit")
)
instance Prelude.Hashable Compute where
hashWithSalt :: Int -> Compute -> Int
hashWithSalt Int
_salt Compute' {Maybe Natural
Maybe ComputeType
simulationUnitLimit :: Maybe Natural
gpuUnitLimit :: Maybe Natural
computeType :: Maybe ComputeType
$sel:simulationUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:gpuUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:computeType:Compute' :: Compute -> Maybe ComputeType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComputeType
computeType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
gpuUnitLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
simulationUnitLimit
instance Prelude.NFData Compute where
rnf :: Compute -> ()
rnf Compute' {Maybe Natural
Maybe ComputeType
simulationUnitLimit :: Maybe Natural
gpuUnitLimit :: Maybe Natural
computeType :: Maybe ComputeType
$sel:simulationUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:gpuUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:computeType:Compute' :: Compute -> Maybe ComputeType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ComputeType
computeType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
gpuUnitLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
simulationUnitLimit
instance Data.ToJSON Compute where
toJSON :: Compute -> Value
toJSON Compute' {Maybe Natural
Maybe ComputeType
simulationUnitLimit :: Maybe Natural
gpuUnitLimit :: Maybe Natural
computeType :: Maybe ComputeType
$sel:simulationUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:gpuUnitLimit:Compute' :: Compute -> Maybe Natural
$sel:computeType:Compute' :: Compute -> Maybe ComputeType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"computeType" 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 ComputeType
computeType,
(Key
"gpuUnitLimit" 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 Natural
gpuUnitLimit,
(Key
"simulationUnitLimit" 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 Natural
simulationUnitLimit
]
)