module Stratosphere.EMR.Cluster.ScalingRuleProperty (
module Exports, ScalingRuleProperty(..), mkScalingRuleProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.EMR.Cluster.ScalingActionProperty as Exports
import {-# SOURCE #-} Stratosphere.EMR.Cluster.ScalingTriggerProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ScalingRuleProperty
=
ScalingRuleProperty {ScalingRuleProperty -> ()
haddock_workaround_ :: (),
ScalingRuleProperty -> ScalingActionProperty
action :: ScalingActionProperty,
ScalingRuleProperty -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
ScalingRuleProperty -> Value Text
name :: (Value Prelude.Text),
ScalingRuleProperty -> ScalingTriggerProperty
trigger :: ScalingTriggerProperty}
deriving stock (ScalingRuleProperty -> ScalingRuleProperty -> Bool
(ScalingRuleProperty -> ScalingRuleProperty -> Bool)
-> (ScalingRuleProperty -> ScalingRuleProperty -> Bool)
-> Eq ScalingRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ScalingRuleProperty -> ScalingRuleProperty -> Bool
== :: ScalingRuleProperty -> ScalingRuleProperty -> Bool
$c/= :: ScalingRuleProperty -> ScalingRuleProperty -> Bool
/= :: ScalingRuleProperty -> ScalingRuleProperty -> Bool
Prelude.Eq, Int -> ScalingRuleProperty -> ShowS
[ScalingRuleProperty] -> ShowS
ScalingRuleProperty -> String
(Int -> ScalingRuleProperty -> ShowS)
-> (ScalingRuleProperty -> String)
-> ([ScalingRuleProperty] -> ShowS)
-> Show ScalingRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ScalingRuleProperty -> ShowS
showsPrec :: Int -> ScalingRuleProperty -> ShowS
$cshow :: ScalingRuleProperty -> String
show :: ScalingRuleProperty -> String
$cshowList :: [ScalingRuleProperty] -> ShowS
showList :: [ScalingRuleProperty] -> ShowS
Prelude.Show)
mkScalingRuleProperty ::
ScalingActionProperty
-> Value Prelude.Text
-> ScalingTriggerProperty -> ScalingRuleProperty
mkScalingRuleProperty :: ScalingActionProperty
-> Value Text -> ScalingTriggerProperty -> ScalingRuleProperty
mkScalingRuleProperty ScalingActionProperty
action Value Text
name ScalingTriggerProperty
trigger
= ScalingRuleProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), action :: ScalingActionProperty
action = ScalingActionProperty
action, name :: Value Text
name = Value Text
name,
trigger :: ScalingTriggerProperty
trigger = ScalingTriggerProperty
trigger, description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ScalingRuleProperty where
toResourceProperties :: ScalingRuleProperty -> ResourceProperties
toResourceProperties ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EMR::Cluster.ScalingRule",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Action" Key -> ScalingActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ScalingActionProperty
action, Key
"Name" 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..= Value Text
name,
Key
"Trigger" Key -> ScalingTriggerProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ScalingTriggerProperty
trigger]
([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
"Description" (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)
description]))}
instance JSON.ToJSON ScalingRuleProperty where
toJSON :: ScalingRuleProperty -> Value
toJSON ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Action" Key -> ScalingActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ScalingActionProperty
action, Key
"Name" 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..= Value Text
name,
Key
"Trigger" Key -> ScalingTriggerProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ScalingTriggerProperty
trigger]
([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
"Description" (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)
description])))
instance Property "Action" ScalingRuleProperty where
type PropertyType "Action" ScalingRuleProperty = ScalingActionProperty
set :: PropertyType "Action" ScalingRuleProperty
-> ScalingRuleProperty -> ScalingRuleProperty
set PropertyType "Action" ScalingRuleProperty
newValue ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= ScalingRuleProperty {action :: ScalingActionProperty
action = PropertyType "Action" ScalingRuleProperty
ScalingActionProperty
newValue, Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
instance Property "Description" ScalingRuleProperty where
type PropertyType "Description" ScalingRuleProperty = Value Prelude.Text
set :: PropertyType "Description" ScalingRuleProperty
-> ScalingRuleProperty -> ScalingRuleProperty
set PropertyType "Description" ScalingRuleProperty
newValue ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= ScalingRuleProperty {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" ScalingRuleProperty
Value Text
newValue, ()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
name :: Value Text
trigger :: ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
name :: Value Text
trigger :: ScalingTriggerProperty
..}
instance Property "Name" ScalingRuleProperty where
type PropertyType "Name" ScalingRuleProperty = Value Prelude.Text
set :: PropertyType "Name" ScalingRuleProperty
-> ScalingRuleProperty -> ScalingRuleProperty
set PropertyType "Name" ScalingRuleProperty
newValue ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= ScalingRuleProperty {name :: Value Text
name = PropertyType "Name" ScalingRuleProperty
Value Text
newValue, Maybe (Value Text)
()
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
trigger :: ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
trigger :: ScalingTriggerProperty
..}
instance Property "Trigger" ScalingRuleProperty where
type PropertyType "Trigger" ScalingRuleProperty = ScalingTriggerProperty
set :: PropertyType "Trigger" ScalingRuleProperty
-> ScalingRuleProperty -> ScalingRuleProperty
set PropertyType "Trigger" ScalingRuleProperty
newValue ScalingRuleProperty {Maybe (Value Text)
()
Value Text
ScalingTriggerProperty
ScalingActionProperty
haddock_workaround_ :: ScalingRuleProperty -> ()
action :: ScalingRuleProperty -> ScalingActionProperty
description :: ScalingRuleProperty -> Maybe (Value Text)
name :: ScalingRuleProperty -> Value Text
trigger :: ScalingRuleProperty -> ScalingTriggerProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
trigger :: ScalingTriggerProperty
..}
= ScalingRuleProperty {trigger :: ScalingTriggerProperty
trigger = PropertyType "Trigger" ScalingRuleProperty
ScalingTriggerProperty
newValue, Maybe (Value Text)
()
Value Text
ScalingActionProperty
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
haddock_workaround_ :: ()
action :: ScalingActionProperty
description :: Maybe (Value Text)
name :: Value Text
..}