module Stratosphere.EC2.LaunchTemplate.CapacityReservationSpecificationProperty (
module Exports, CapacityReservationSpecificationProperty(..),
mkCapacityReservationSpecificationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.EC2.LaunchTemplate.CapacityReservationTargetProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CapacityReservationSpecificationProperty
=
CapacityReservationSpecificationProperty {CapacityReservationSpecificationProperty -> ()
haddock_workaround_ :: (),
CapacityReservationSpecificationProperty -> Maybe (Value Text)
capacityReservationPreference :: (Prelude.Maybe (Value Prelude.Text)),
CapacityReservationSpecificationProperty
-> Maybe CapacityReservationTargetProperty
capacityReservationTarget :: (Prelude.Maybe CapacityReservationTargetProperty)}
deriving stock (CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool
(CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool)
-> (CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool)
-> Eq CapacityReservationSpecificationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool
== :: CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool
$c/= :: CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool
/= :: CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty -> Bool
Prelude.Eq, Int -> CapacityReservationSpecificationProperty -> ShowS
[CapacityReservationSpecificationProperty] -> ShowS
CapacityReservationSpecificationProperty -> String
(Int -> CapacityReservationSpecificationProperty -> ShowS)
-> (CapacityReservationSpecificationProperty -> String)
-> ([CapacityReservationSpecificationProperty] -> ShowS)
-> Show CapacityReservationSpecificationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CapacityReservationSpecificationProperty -> ShowS
showsPrec :: Int -> CapacityReservationSpecificationProperty -> ShowS
$cshow :: CapacityReservationSpecificationProperty -> String
show :: CapacityReservationSpecificationProperty -> String
$cshowList :: [CapacityReservationSpecificationProperty] -> ShowS
showList :: [CapacityReservationSpecificationProperty] -> ShowS
Prelude.Show)
mkCapacityReservationSpecificationProperty ::
CapacityReservationSpecificationProperty
mkCapacityReservationSpecificationProperty :: CapacityReservationSpecificationProperty
mkCapacityReservationSpecificationProperty
= CapacityReservationSpecificationProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (),
capacityReservationPreference :: Maybe (Value Text)
capacityReservationPreference = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
capacityReservationTarget = Maybe CapacityReservationTargetProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CapacityReservationSpecificationProperty where
toResourceProperties :: CapacityReservationSpecificationProperty -> ResourceProperties
toResourceProperties CapacityReservationSpecificationProperty {Maybe (Value Text)
Maybe CapacityReservationTargetProperty
()
haddock_workaround_ :: CapacityReservationSpecificationProperty -> ()
capacityReservationPreference :: CapacityReservationSpecificationProperty -> Maybe (Value Text)
capacityReservationTarget :: CapacityReservationSpecificationProperty
-> Maybe CapacityReservationTargetProperty
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EC2::LaunchTemplate.CapacityReservationSpecification",
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
"CapacityReservationPreference"
(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)
capacityReservationPreference,
Key -> CapacityReservationTargetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CapacityReservationTarget"
(CapacityReservationTargetProperty -> (Key, Value))
-> Maybe CapacityReservationTargetProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CapacityReservationTargetProperty
capacityReservationTarget])}
instance JSON.ToJSON CapacityReservationSpecificationProperty where
toJSON :: CapacityReservationSpecificationProperty -> Value
toJSON CapacityReservationSpecificationProperty {Maybe (Value Text)
Maybe CapacityReservationTargetProperty
()
haddock_workaround_ :: CapacityReservationSpecificationProperty -> ()
capacityReservationPreference :: CapacityReservationSpecificationProperty -> Maybe (Value Text)
capacityReservationTarget :: CapacityReservationSpecificationProperty
-> Maybe CapacityReservationTargetProperty
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
..}
= [(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
"CapacityReservationPreference"
(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)
capacityReservationPreference,
Key -> CapacityReservationTargetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CapacityReservationTarget"
(CapacityReservationTargetProperty -> (Key, Value))
-> Maybe CapacityReservationTargetProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CapacityReservationTargetProperty
capacityReservationTarget]))
instance Property "CapacityReservationPreference" CapacityReservationSpecificationProperty where
type PropertyType "CapacityReservationPreference" CapacityReservationSpecificationProperty = Value Prelude.Text
set :: PropertyType
"CapacityReservationPreference"
CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty
set PropertyType
"CapacityReservationPreference"
CapacityReservationSpecificationProperty
newValue CapacityReservationSpecificationProperty {Maybe (Value Text)
Maybe CapacityReservationTargetProperty
()
haddock_workaround_ :: CapacityReservationSpecificationProperty -> ()
capacityReservationPreference :: CapacityReservationSpecificationProperty -> Maybe (Value Text)
capacityReservationTarget :: CapacityReservationSpecificationProperty
-> Maybe CapacityReservationTargetProperty
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
..}
= CapacityReservationSpecificationProperty
{capacityReservationPreference :: Maybe (Value Text)
capacityReservationPreference = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType
"CapacityReservationPreference"
CapacityReservationSpecificationProperty
Value Text
newValue, Maybe CapacityReservationTargetProperty
()
haddock_workaround_ :: ()
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
haddock_workaround_ :: ()
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
..}
instance Property "CapacityReservationTarget" CapacityReservationSpecificationProperty where
type PropertyType "CapacityReservationTarget" CapacityReservationSpecificationProperty = CapacityReservationTargetProperty
set :: PropertyType
"CapacityReservationTarget"
CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty
-> CapacityReservationSpecificationProperty
set PropertyType
"CapacityReservationTarget"
CapacityReservationSpecificationProperty
newValue CapacityReservationSpecificationProperty {Maybe (Value Text)
Maybe CapacityReservationTargetProperty
()
haddock_workaround_ :: CapacityReservationSpecificationProperty -> ()
capacityReservationPreference :: CapacityReservationSpecificationProperty -> Maybe (Value Text)
capacityReservationTarget :: CapacityReservationSpecificationProperty
-> Maybe CapacityReservationTargetProperty
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
capacityReservationTarget :: Maybe CapacityReservationTargetProperty
..}
= CapacityReservationSpecificationProperty
{capacityReservationTarget :: Maybe CapacityReservationTargetProperty
capacityReservationTarget = CapacityReservationTargetProperty
-> Maybe CapacityReservationTargetProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType
"CapacityReservationTarget"
CapacityReservationSpecificationProperty
CapacityReservationTargetProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
haddock_workaround_ :: ()
capacityReservationPreference :: Maybe (Value Text)
..}