module Stratosphere.EC2.Instance.CpuOptionsProperty (
CpuOptionsProperty(..), mkCpuOptionsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CpuOptionsProperty
=
CpuOptionsProperty {CpuOptionsProperty -> ()
haddock_workaround_ :: (),
CpuOptionsProperty -> Maybe (Value Integer)
coreCount :: (Prelude.Maybe (Value Prelude.Integer)),
CpuOptionsProperty -> Maybe (Value Integer)
threadsPerCore :: (Prelude.Maybe (Value Prelude.Integer))}
deriving stock (CpuOptionsProperty -> CpuOptionsProperty -> Bool
(CpuOptionsProperty -> CpuOptionsProperty -> Bool)
-> (CpuOptionsProperty -> CpuOptionsProperty -> Bool)
-> Eq CpuOptionsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CpuOptionsProperty -> CpuOptionsProperty -> Bool
== :: CpuOptionsProperty -> CpuOptionsProperty -> Bool
$c/= :: CpuOptionsProperty -> CpuOptionsProperty -> Bool
/= :: CpuOptionsProperty -> CpuOptionsProperty -> Bool
Prelude.Eq, Int -> CpuOptionsProperty -> ShowS
[CpuOptionsProperty] -> ShowS
CpuOptionsProperty -> String
(Int -> CpuOptionsProperty -> ShowS)
-> (CpuOptionsProperty -> String)
-> ([CpuOptionsProperty] -> ShowS)
-> Show CpuOptionsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CpuOptionsProperty -> ShowS
showsPrec :: Int -> CpuOptionsProperty -> ShowS
$cshow :: CpuOptionsProperty -> String
show :: CpuOptionsProperty -> String
$cshowList :: [CpuOptionsProperty] -> ShowS
showList :: [CpuOptionsProperty] -> ShowS
Prelude.Show)
mkCpuOptionsProperty :: CpuOptionsProperty
mkCpuOptionsProperty :: CpuOptionsProperty
mkCpuOptionsProperty
= CpuOptionsProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), coreCount :: Maybe (Value Integer)
coreCount = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
threadsPerCore :: Maybe (Value Integer)
threadsPerCore = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CpuOptionsProperty where
toResourceProperties :: CpuOptionsProperty -> ResourceProperties
toResourceProperties CpuOptionsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: CpuOptionsProperty -> ()
coreCount :: CpuOptionsProperty -> Maybe (Value Integer)
threadsPerCore :: CpuOptionsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
threadsPerCore :: Maybe (Value Integer)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EC2::Instance.CpuOptions",
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
"CoreCount" (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)
coreCount,
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
"ThreadsPerCore" (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)
threadsPerCore])}
instance JSON.ToJSON CpuOptionsProperty where
toJSON :: CpuOptionsProperty -> Value
toJSON CpuOptionsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: CpuOptionsProperty -> ()
coreCount :: CpuOptionsProperty -> Maybe (Value Integer)
threadsPerCore :: CpuOptionsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
threadsPerCore :: 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
"CoreCount" (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)
coreCount,
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
"ThreadsPerCore" (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)
threadsPerCore]))
instance Property "CoreCount" CpuOptionsProperty where
type PropertyType "CoreCount" CpuOptionsProperty = Value Prelude.Integer
set :: PropertyType "CoreCount" CpuOptionsProperty
-> CpuOptionsProperty -> CpuOptionsProperty
set PropertyType "CoreCount" CpuOptionsProperty
newValue CpuOptionsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: CpuOptionsProperty -> ()
coreCount :: CpuOptionsProperty -> Maybe (Value Integer)
threadsPerCore :: CpuOptionsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
threadsPerCore :: Maybe (Value Integer)
..}
= CpuOptionsProperty {coreCount :: Maybe (Value Integer)
coreCount = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CoreCount" CpuOptionsProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
threadsPerCore :: Maybe (Value Integer)
haddock_workaround_ :: ()
threadsPerCore :: Maybe (Value Integer)
..}
instance Property "ThreadsPerCore" CpuOptionsProperty where
type PropertyType "ThreadsPerCore" CpuOptionsProperty = Value Prelude.Integer
set :: PropertyType "ThreadsPerCore" CpuOptionsProperty
-> CpuOptionsProperty -> CpuOptionsProperty
set PropertyType "ThreadsPerCore" CpuOptionsProperty
newValue CpuOptionsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: CpuOptionsProperty -> ()
coreCount :: CpuOptionsProperty -> Maybe (Value Integer)
threadsPerCore :: CpuOptionsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
threadsPerCore :: Maybe (Value Integer)
..}
= CpuOptionsProperty {threadsPerCore :: Maybe (Value Integer)
threadsPerCore = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ThreadsPerCore" CpuOptionsProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
haddock_workaround_ :: ()
coreCount :: Maybe (Value Integer)
..}