module Stratosphere.EC2.LaunchTemplate.SpotOptionsProperty (
        SpotOptionsProperty(..), mkSpotOptionsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SpotOptionsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html>
    SpotOptionsProperty {SpotOptionsProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html#cfn-ec2-launchtemplate-spotoptions-blockdurationminutes>
                         SpotOptionsProperty -> Maybe (Value Integer)
blockDurationMinutes :: (Prelude.Maybe (Value Prelude.Integer)),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html#cfn-ec2-launchtemplate-spotoptions-instanceinterruptionbehavior>
                         SpotOptionsProperty -> Maybe (Value Text)
instanceInterruptionBehavior :: (Prelude.Maybe (Value Prelude.Text)),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html#cfn-ec2-launchtemplate-spotoptions-maxprice>
                         SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: (Prelude.Maybe (Value Prelude.Text)),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html#cfn-ec2-launchtemplate-spotoptions-spotinstancetype>
                         SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: (Prelude.Maybe (Value Prelude.Text)),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-spotoptions.html#cfn-ec2-launchtemplate-spotoptions-validuntil>
                         SpotOptionsProperty -> Maybe (Value Text)
validUntil :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (SpotOptionsProperty -> SpotOptionsProperty -> Bool
(SpotOptionsProperty -> SpotOptionsProperty -> Bool)
-> (SpotOptionsProperty -> SpotOptionsProperty -> Bool)
-> Eq SpotOptionsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpotOptionsProperty -> SpotOptionsProperty -> Bool
== :: SpotOptionsProperty -> SpotOptionsProperty -> Bool
$c/= :: SpotOptionsProperty -> SpotOptionsProperty -> Bool
/= :: SpotOptionsProperty -> SpotOptionsProperty -> Bool
Prelude.Eq, Int -> SpotOptionsProperty -> ShowS
[SpotOptionsProperty] -> ShowS
SpotOptionsProperty -> String
(Int -> SpotOptionsProperty -> ShowS)
-> (SpotOptionsProperty -> String)
-> ([SpotOptionsProperty] -> ShowS)
-> Show SpotOptionsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SpotOptionsProperty -> ShowS
showsPrec :: Int -> SpotOptionsProperty -> ShowS
$cshow :: SpotOptionsProperty -> String
show :: SpotOptionsProperty -> String
$cshowList :: [SpotOptionsProperty] -> ShowS
showList :: [SpotOptionsProperty] -> ShowS
Prelude.Show)
mkSpotOptionsProperty :: SpotOptionsProperty
mkSpotOptionsProperty :: SpotOptionsProperty
mkSpotOptionsProperty
  = SpotOptionsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), blockDurationMinutes :: Maybe (Value Integer)
blockDurationMinutes = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       instanceInterruptionBehavior :: Maybe (Value Text)
instanceInterruptionBehavior = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       maxPrice :: Maybe (Value Text)
maxPrice = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, spotInstanceType :: Maybe (Value Text)
spotInstanceType = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       validUntil :: Maybe (Value Text)
validUntil = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SpotOptionsProperty where
  toResourceProperties :: SpotOptionsProperty -> ResourceProperties
toResourceProperties SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::EC2::LaunchTemplate.SpotOptions",
         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
"BlockDurationMinutes" (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)
blockDurationMinutes,
                            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
"InstanceInterruptionBehavior"
                              (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)
instanceInterruptionBehavior,
                            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
"MaxPrice" (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)
maxPrice,
                            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
"SpotInstanceType" (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)
spotInstanceType,
                            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
"ValidUntil" (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)
validUntil])}
instance JSON.ToJSON SpotOptionsProperty where
  toJSON :: SpotOptionsProperty -> Value
toJSON SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = [(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
"BlockDurationMinutes" (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)
blockDurationMinutes,
               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
"InstanceInterruptionBehavior"
                 (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)
instanceInterruptionBehavior,
               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
"MaxPrice" (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)
maxPrice,
               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
"SpotInstanceType" (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)
spotInstanceType,
               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
"ValidUntil" (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)
validUntil]))
instance Property "BlockDurationMinutes" SpotOptionsProperty where
  type PropertyType "BlockDurationMinutes" SpotOptionsProperty = Value Prelude.Integer
  set :: PropertyType "BlockDurationMinutes" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "BlockDurationMinutes" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = SpotOptionsProperty
        {blockDurationMinutes :: Maybe (Value Integer)
blockDurationMinutes = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "BlockDurationMinutes" SpotOptionsProperty
Value Integer
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
haddock_workaround_ :: ()
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
instance Property "InstanceInterruptionBehavior" SpotOptionsProperty where
  type PropertyType "InstanceInterruptionBehavior" SpotOptionsProperty = Value Prelude.Text
  set :: PropertyType "InstanceInterruptionBehavior" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "InstanceInterruptionBehavior" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = SpotOptionsProperty
        {instanceInterruptionBehavior :: Maybe (Value Text)
instanceInterruptionBehavior = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "InstanceInterruptionBehavior" SpotOptionsProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
instance Property "MaxPrice" SpotOptionsProperty where
  type PropertyType "MaxPrice" SpotOptionsProperty = Value Prelude.Text
  set :: PropertyType "MaxPrice" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "MaxPrice" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = SpotOptionsProperty {maxPrice :: Maybe (Value Text)
maxPrice = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MaxPrice" SpotOptionsProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
instance Property "SpotInstanceType" SpotOptionsProperty where
  type PropertyType "SpotInstanceType" SpotOptionsProperty = Value Prelude.Text
  set :: PropertyType "SpotInstanceType" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "SpotInstanceType" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = SpotOptionsProperty
        {spotInstanceType :: Maybe (Value Text)
spotInstanceType = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SpotInstanceType" SpotOptionsProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
instance Property "ValidUntil" SpotOptionsProperty where
  type PropertyType "ValidUntil" SpotOptionsProperty = Value Prelude.Text
  set :: PropertyType "ValidUntil" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "ValidUntil" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
blockDurationMinutes :: SpotOptionsProperty -> Maybe (Value Integer)
instanceInterruptionBehavior :: SpotOptionsProperty -> Maybe (Value Text)
maxPrice :: SpotOptionsProperty -> Maybe (Value Text)
spotInstanceType :: SpotOptionsProperty -> Maybe (Value Text)
validUntil :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
validUntil :: Maybe (Value Text)
..}
    = SpotOptionsProperty {validUntil :: Maybe (Value Text)
validUntil = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ValidUntil" SpotOptionsProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
haddock_workaround_ :: ()
blockDurationMinutes :: Maybe (Value Integer)
instanceInterruptionBehavior :: Maybe (Value Text)
maxPrice :: Maybe (Value Text)
spotInstanceType :: Maybe (Value Text)
..}