module Stratosphere.Lightsail.Instance.HardwareProperty (
        module Exports, HardwareProperty(..), mkHardwareProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Lightsail.Instance.DiskProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data HardwareProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-hardware.html>
    HardwareProperty {HardwareProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-cpucount>
                      HardwareProperty -> Maybe (Value Integer)
cpuCount :: (Prelude.Maybe (Value Prelude.Integer)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-disks>
                      HardwareProperty -> Maybe [DiskProperty]
disks :: (Prelude.Maybe [DiskProperty]),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-ramsizeingb>
                      HardwareProperty -> Maybe (Value Integer)
ramSizeInGb :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (HardwareProperty -> HardwareProperty -> Bool
(HardwareProperty -> HardwareProperty -> Bool)
-> (HardwareProperty -> HardwareProperty -> Bool)
-> Eq HardwareProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HardwareProperty -> HardwareProperty -> Bool
== :: HardwareProperty -> HardwareProperty -> Bool
$c/= :: HardwareProperty -> HardwareProperty -> Bool
/= :: HardwareProperty -> HardwareProperty -> Bool
Prelude.Eq, Int -> HardwareProperty -> ShowS
[HardwareProperty] -> ShowS
HardwareProperty -> String
(Int -> HardwareProperty -> ShowS)
-> (HardwareProperty -> String)
-> ([HardwareProperty] -> ShowS)
-> Show HardwareProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HardwareProperty -> ShowS
showsPrec :: Int -> HardwareProperty -> ShowS
$cshow :: HardwareProperty -> String
show :: HardwareProperty -> String
$cshowList :: [HardwareProperty] -> ShowS
showList :: [HardwareProperty] -> ShowS
Prelude.Show)
mkHardwareProperty :: HardwareProperty
mkHardwareProperty :: HardwareProperty
mkHardwareProperty
  = HardwareProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cpuCount :: Maybe (Value Integer)
cpuCount = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       disks :: Maybe [DiskProperty]
disks = Maybe [DiskProperty]
forall a. Maybe a
Prelude.Nothing, ramSizeInGb :: Maybe (Value Integer)
ramSizeInGb = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties HardwareProperty where
  toResourceProperties :: HardwareProperty -> ResourceProperties
toResourceProperties HardwareProperty {Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: HardwareProperty -> ()
cpuCount :: HardwareProperty -> Maybe (Value Integer)
disks :: HardwareProperty -> Maybe [DiskProperty]
ramSizeInGb :: HardwareProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Lightsail::Instance.Hardware",
         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 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
"CpuCount" (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)
cpuCount,
                            Key -> [DiskProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Disks" ([DiskProperty] -> (Key, Value))
-> Maybe [DiskProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DiskProperty]
disks,
                            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
"RamSizeInGb" (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)
ramSizeInGb])}
instance JSON.ToJSON HardwareProperty where
  toJSON :: HardwareProperty -> Value
toJSON HardwareProperty {Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: HardwareProperty -> ()
cpuCount :: HardwareProperty -> Maybe (Value Integer)
disks :: HardwareProperty -> Maybe [DiskProperty]
ramSizeInGb :: HardwareProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
ramSizeInGb :: 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 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
"CpuCount" (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)
cpuCount,
               Key -> [DiskProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Disks" ([DiskProperty] -> (Key, Value))
-> Maybe [DiskProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DiskProperty]
disks,
               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
"RamSizeInGb" (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)
ramSizeInGb]))
instance Property "CpuCount" HardwareProperty where
  type PropertyType "CpuCount" HardwareProperty = Value Prelude.Integer
  set :: PropertyType "CpuCount" HardwareProperty
-> HardwareProperty -> HardwareProperty
set PropertyType "CpuCount" HardwareProperty
newValue HardwareProperty {Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: HardwareProperty -> ()
cpuCount :: HardwareProperty -> Maybe (Value Integer)
disks :: HardwareProperty -> Maybe [DiskProperty]
ramSizeInGb :: HardwareProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
..}
    = HardwareProperty {cpuCount :: Maybe (Value Integer)
cpuCount = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CpuCount" HardwareProperty
Value Integer
newValue, Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: ()
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
haddock_workaround_ :: ()
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
..}
instance Property "Disks" HardwareProperty where
  type PropertyType "Disks" HardwareProperty = [DiskProperty]
  set :: PropertyType "Disks" HardwareProperty
-> HardwareProperty -> HardwareProperty
set PropertyType "Disks" HardwareProperty
newValue HardwareProperty {Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: HardwareProperty -> ()
cpuCount :: HardwareProperty -> Maybe (Value Integer)
disks :: HardwareProperty -> Maybe [DiskProperty]
ramSizeInGb :: HardwareProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
..}
    = HardwareProperty {disks :: Maybe [DiskProperty]
disks = [DiskProperty] -> Maybe [DiskProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [DiskProperty]
PropertyType "Disks" HardwareProperty
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
ramSizeInGb :: Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
ramSizeInGb :: Maybe (Value Integer)
..}
instance Property "RamSizeInGb" HardwareProperty where
  type PropertyType "RamSizeInGb" HardwareProperty = Value Prelude.Integer
  set :: PropertyType "RamSizeInGb" HardwareProperty
-> HardwareProperty -> HardwareProperty
set PropertyType "RamSizeInGb" HardwareProperty
newValue HardwareProperty {Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: HardwareProperty -> ()
cpuCount :: HardwareProperty -> Maybe (Value Integer)
disks :: HardwareProperty -> Maybe [DiskProperty]
ramSizeInGb :: HardwareProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
ramSizeInGb :: Maybe (Value Integer)
..}
    = HardwareProperty {ramSizeInGb :: Maybe (Value Integer)
ramSizeInGb = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RamSizeInGb" HardwareProperty
Value Integer
newValue, Maybe [DiskProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
haddock_workaround_ :: ()
cpuCount :: Maybe (Value Integer)
disks :: Maybe [DiskProperty]
..}