module Stratosphere.GreengrassV2.Deployment.SystemResourceLimitsProperty (
        SystemResourceLimitsProperty(..), mkSystemResourceLimitsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SystemResourceLimitsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrassv2-deployment-systemresourcelimits.html>
    SystemResourceLimitsProperty {SystemResourceLimitsProperty -> ()
haddock_workaround_ :: (),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrassv2-deployment-systemresourcelimits.html#cfn-greengrassv2-deployment-systemresourcelimits-cpus>
                                  SystemResourceLimitsProperty -> Maybe (Value Double)
cpus :: (Prelude.Maybe (Value Prelude.Double)),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrassv2-deployment-systemresourcelimits.html#cfn-greengrassv2-deployment-systemresourcelimits-memory>
                                  SystemResourceLimitsProperty -> Maybe (Value Integer)
memory :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> Bool
(SystemResourceLimitsProperty
 -> SystemResourceLimitsProperty -> Bool)
-> (SystemResourceLimitsProperty
    -> SystemResourceLimitsProperty -> Bool)
-> Eq SystemResourceLimitsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> Bool
== :: SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> Bool
$c/= :: SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> Bool
/= :: SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> Bool
Prelude.Eq, Int -> SystemResourceLimitsProperty -> ShowS
[SystemResourceLimitsProperty] -> ShowS
SystemResourceLimitsProperty -> String
(Int -> SystemResourceLimitsProperty -> ShowS)
-> (SystemResourceLimitsProperty -> String)
-> ([SystemResourceLimitsProperty] -> ShowS)
-> Show SystemResourceLimitsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SystemResourceLimitsProperty -> ShowS
showsPrec :: Int -> SystemResourceLimitsProperty -> ShowS
$cshow :: SystemResourceLimitsProperty -> String
show :: SystemResourceLimitsProperty -> String
$cshowList :: [SystemResourceLimitsProperty] -> ShowS
showList :: [SystemResourceLimitsProperty] -> ShowS
Prelude.Show)
mkSystemResourceLimitsProperty :: SystemResourceLimitsProperty
mkSystemResourceLimitsProperty :: SystemResourceLimitsProperty
mkSystemResourceLimitsProperty
  = SystemResourceLimitsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cpus :: Maybe (Value Double)
cpus = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing,
       memory :: Maybe (Value Integer)
memory = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SystemResourceLimitsProperty where
  toResourceProperties :: SystemResourceLimitsProperty -> ResourceProperties
toResourceProperties SystemResourceLimitsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: SystemResourceLimitsProperty -> ()
cpus :: SystemResourceLimitsProperty -> Maybe (Value Double)
memory :: SystemResourceLimitsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
memory :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GreengrassV2::Deployment.SystemResourceLimits",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Cpus" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
cpus,
                            Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Memory" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
memory])}
instance JSON.ToJSON SystemResourceLimitsProperty where
  toJSON :: SystemResourceLimitsProperty -> Value
toJSON SystemResourceLimitsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: SystemResourceLimitsProperty -> ()
cpus :: SystemResourceLimitsProperty -> Maybe (Value Double)
memory :: SystemResourceLimitsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
memory :: Maybe (Value Integer)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Cpus" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
cpus,
               Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Memory" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
memory]))
instance Property "Cpus" SystemResourceLimitsProperty where
  type PropertyType "Cpus" SystemResourceLimitsProperty = Value Prelude.Double
  set :: PropertyType "Cpus" SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> SystemResourceLimitsProperty
set PropertyType "Cpus" SystemResourceLimitsProperty
newValue SystemResourceLimitsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: SystemResourceLimitsProperty -> ()
cpus :: SystemResourceLimitsProperty -> Maybe (Value Double)
memory :: SystemResourceLimitsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
memory :: Maybe (Value Integer)
..}
    = SystemResourceLimitsProperty {cpus :: Maybe (Value Double)
cpus = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Cpus" SystemResourceLimitsProperty
Value Double
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
memory :: Maybe (Value Integer)
haddock_workaround_ :: ()
memory :: Maybe (Value Integer)
..}
instance Property "Memory" SystemResourceLimitsProperty where
  type PropertyType "Memory" SystemResourceLimitsProperty = Value Prelude.Integer
  set :: PropertyType "Memory" SystemResourceLimitsProperty
-> SystemResourceLimitsProperty -> SystemResourceLimitsProperty
set PropertyType "Memory" SystemResourceLimitsProperty
newValue SystemResourceLimitsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: SystemResourceLimitsProperty -> ()
cpus :: SystemResourceLimitsProperty -> Maybe (Value Double)
memory :: SystemResourceLimitsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
memory :: Maybe (Value Integer)
..}
    = SystemResourceLimitsProperty {memory :: Maybe (Value Integer)
memory = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Memory" SystemResourceLimitsProperty
Value Integer
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
haddock_workaround_ :: ()
cpus :: Maybe (Value Double)
..}