module Stratosphere.PCS.ComputeNodeGroup.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-pcs-computenodegroup-spotoptions.html>
    SpotOptionsProperty {SpotOptionsProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pcs-computenodegroup-spotoptions.html#cfn-pcs-computenodegroup-spotoptions-allocationstrategy>
                         SpotOptionsProperty -> Maybe (Value Text)
allocationStrategy :: (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_ = (), allocationStrategy :: Maybe (Value Text)
allocationStrategy = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SpotOptionsProperty where
  toResourceProperties :: SpotOptionsProperty -> ResourceProperties
toResourceProperties SpotOptionsProperty {Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
allocationStrategy :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
allocationStrategy :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::PCS::ComputeNodeGroup.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 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
"AllocationStrategy" (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)
allocationStrategy])}
instance JSON.ToJSON SpotOptionsProperty where
  toJSON :: SpotOptionsProperty -> Value
toJSON SpotOptionsProperty {Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
allocationStrategy :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
allocationStrategy :: 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 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
"AllocationStrategy" (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)
allocationStrategy]))
instance Property "AllocationStrategy" SpotOptionsProperty where
  type PropertyType "AllocationStrategy" SpotOptionsProperty = Value Prelude.Text
  set :: PropertyType "AllocationStrategy" SpotOptionsProperty
-> SpotOptionsProperty -> SpotOptionsProperty
set PropertyType "AllocationStrategy" SpotOptionsProperty
newValue SpotOptionsProperty {Maybe (Value Text)
()
haddock_workaround_ :: SpotOptionsProperty -> ()
allocationStrategy :: SpotOptionsProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
allocationStrategy :: Maybe (Value Text)
..}
    = SpotOptionsProperty
        {allocationStrategy :: Maybe (Value Text)
allocationStrategy = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllocationStrategy" SpotOptionsProperty
Value Text
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}