module Stratosphere.EC2.CapacityReservation.CapacityAllocationProperty (
CapacityAllocationProperty(..), mkCapacityAllocationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CapacityAllocationProperty
=
CapacityAllocationProperty {CapacityAllocationProperty -> ()
haddock_workaround_ :: (),
CapacityAllocationProperty -> Maybe (Value Text)
allocationType :: (Prelude.Maybe (Value Prelude.Text)),
CapacityAllocationProperty -> Maybe (Value Integer)
count :: (Prelude.Maybe (Value Prelude.Integer))}
deriving stock (CapacityAllocationProperty -> CapacityAllocationProperty -> Bool
(CapacityAllocationProperty -> CapacityAllocationProperty -> Bool)
-> (CapacityAllocationProperty
-> CapacityAllocationProperty -> Bool)
-> Eq CapacityAllocationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CapacityAllocationProperty -> CapacityAllocationProperty -> Bool
== :: CapacityAllocationProperty -> CapacityAllocationProperty -> Bool
$c/= :: CapacityAllocationProperty -> CapacityAllocationProperty -> Bool
/= :: CapacityAllocationProperty -> CapacityAllocationProperty -> Bool
Prelude.Eq, Int -> CapacityAllocationProperty -> ShowS
[CapacityAllocationProperty] -> ShowS
CapacityAllocationProperty -> String
(Int -> CapacityAllocationProperty -> ShowS)
-> (CapacityAllocationProperty -> String)
-> ([CapacityAllocationProperty] -> ShowS)
-> Show CapacityAllocationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CapacityAllocationProperty -> ShowS
showsPrec :: Int -> CapacityAllocationProperty -> ShowS
$cshow :: CapacityAllocationProperty -> String
show :: CapacityAllocationProperty -> String
$cshowList :: [CapacityAllocationProperty] -> ShowS
showList :: [CapacityAllocationProperty] -> ShowS
Prelude.Show)
mkCapacityAllocationProperty :: CapacityAllocationProperty
mkCapacityAllocationProperty :: CapacityAllocationProperty
mkCapacityAllocationProperty
= CapacityAllocationProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), allocationType :: Maybe (Value Text)
allocationType = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
count :: Maybe (Value Integer)
count = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CapacityAllocationProperty where
toResourceProperties :: CapacityAllocationProperty -> ResourceProperties
toResourceProperties CapacityAllocationProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: CapacityAllocationProperty -> ()
allocationType :: CapacityAllocationProperty -> Maybe (Value Text)
count :: CapacityAllocationProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
count :: Maybe (Value Integer)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EC2::CapacityReservation.CapacityAllocation",
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 Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AllocationType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
allocationType,
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
"Count" (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)
count])}
instance JSON.ToJSON CapacityAllocationProperty where
toJSON :: CapacityAllocationProperty -> Value
toJSON CapacityAllocationProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: CapacityAllocationProperty -> ()
allocationType :: CapacityAllocationProperty -> Maybe (Value Text)
count :: CapacityAllocationProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
count :: 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 Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AllocationType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
allocationType,
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
"Count" (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)
count]))
instance Property "AllocationType" CapacityAllocationProperty where
type PropertyType "AllocationType" CapacityAllocationProperty = Value Prelude.Text
set :: PropertyType "AllocationType" CapacityAllocationProperty
-> CapacityAllocationProperty -> CapacityAllocationProperty
set PropertyType "AllocationType" CapacityAllocationProperty
newValue CapacityAllocationProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: CapacityAllocationProperty -> ()
allocationType :: CapacityAllocationProperty -> Maybe (Value Text)
count :: CapacityAllocationProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
count :: Maybe (Value Integer)
..}
= CapacityAllocationProperty
{allocationType :: Maybe (Value Text)
allocationType = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllocationType" CapacityAllocationProperty
Value Text
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
count :: Maybe (Value Integer)
haddock_workaround_ :: ()
count :: Maybe (Value Integer)
..}
instance Property "Count" CapacityAllocationProperty where
type PropertyType "Count" CapacityAllocationProperty = Value Prelude.Integer
set :: PropertyType "Count" CapacityAllocationProperty
-> CapacityAllocationProperty -> CapacityAllocationProperty
set PropertyType "Count" CapacityAllocationProperty
newValue CapacityAllocationProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: CapacityAllocationProperty -> ()
allocationType :: CapacityAllocationProperty -> Maybe (Value Text)
count :: CapacityAllocationProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
count :: Maybe (Value Integer)
..}
= CapacityAllocationProperty {count :: Maybe (Value Integer)
count = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Count" CapacityAllocationProperty
Value Integer
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
haddock_workaround_ :: ()
allocationType :: Maybe (Value Text)
..}