module Stratosphere.ApplicationSignals.ServiceLevelObjective.GoalProperty (
module Exports, GoalProperty(..), mkGoalProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ApplicationSignals.ServiceLevelObjective.IntervalProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data GoalProperty
=
GoalProperty {GoalProperty -> ()
haddock_workaround_ :: (),
GoalProperty -> Maybe (Value Double)
attainmentGoal :: (Prelude.Maybe (Value Prelude.Double)),
GoalProperty -> Maybe IntervalProperty
interval :: (Prelude.Maybe IntervalProperty),
GoalProperty -> Maybe (Value Double)
warningThreshold :: (Prelude.Maybe (Value Prelude.Double))}
deriving stock (GoalProperty -> GoalProperty -> Bool
(GoalProperty -> GoalProperty -> Bool)
-> (GoalProperty -> GoalProperty -> Bool) -> Eq GoalProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GoalProperty -> GoalProperty -> Bool
== :: GoalProperty -> GoalProperty -> Bool
$c/= :: GoalProperty -> GoalProperty -> Bool
/= :: GoalProperty -> GoalProperty -> Bool
Prelude.Eq, Int -> GoalProperty -> ShowS
[GoalProperty] -> ShowS
GoalProperty -> String
(Int -> GoalProperty -> ShowS)
-> (GoalProperty -> String)
-> ([GoalProperty] -> ShowS)
-> Show GoalProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GoalProperty -> ShowS
showsPrec :: Int -> GoalProperty -> ShowS
$cshow :: GoalProperty -> String
show :: GoalProperty -> String
$cshowList :: [GoalProperty] -> ShowS
showList :: [GoalProperty] -> ShowS
Prelude.Show)
mkGoalProperty :: GoalProperty
mkGoalProperty :: GoalProperty
mkGoalProperty
= GoalProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), attainmentGoal :: Maybe (Value Double)
attainmentGoal = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing,
interval :: Maybe IntervalProperty
interval = Maybe IntervalProperty
forall a. Maybe a
Prelude.Nothing, warningThreshold :: Maybe (Value Double)
warningThreshold = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties GoalProperty where
toResourceProperties :: GoalProperty -> ResourceProperties
toResourceProperties GoalProperty {Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: GoalProperty -> ()
attainmentGoal :: GoalProperty -> Maybe (Value Double)
interval :: GoalProperty -> Maybe IntervalProperty
warningThreshold :: GoalProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::ApplicationSignals::ServiceLevelObjective.Goal",
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 Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AttainmentGoal" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
attainmentGoal,
Key -> IntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Interval" (IntervalProperty -> (Key, Value))
-> Maybe IntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntervalProperty
interval,
Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"WarningThreshold" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
warningThreshold])}
instance JSON.ToJSON GoalProperty where
toJSON :: GoalProperty -> Value
toJSON GoalProperty {Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: GoalProperty -> ()
attainmentGoal :: GoalProperty -> Maybe (Value Double)
interval :: GoalProperty -> Maybe IntervalProperty
warningThreshold :: GoalProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
= [(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 Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AttainmentGoal" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
attainmentGoal,
Key -> IntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Interval" (IntervalProperty -> (Key, Value))
-> Maybe IntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntervalProperty
interval,
Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"WarningThreshold" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
warningThreshold]))
instance Property "AttainmentGoal" GoalProperty where
type PropertyType "AttainmentGoal" GoalProperty = Value Prelude.Double
set :: PropertyType "AttainmentGoal" GoalProperty
-> GoalProperty -> GoalProperty
set PropertyType "AttainmentGoal" GoalProperty
newValue GoalProperty {Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: GoalProperty -> ()
attainmentGoal :: GoalProperty -> Maybe (Value Double)
interval :: GoalProperty -> Maybe IntervalProperty
warningThreshold :: GoalProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
= GoalProperty {attainmentGoal :: Maybe (Value Double)
attainmentGoal = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AttainmentGoal" GoalProperty
Value Double
newValue, Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: ()
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
haddock_workaround_ :: ()
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
instance Property "Interval" GoalProperty where
type PropertyType "Interval" GoalProperty = IntervalProperty
set :: PropertyType "Interval" GoalProperty
-> GoalProperty -> GoalProperty
set PropertyType "Interval" GoalProperty
newValue GoalProperty {Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: GoalProperty -> ()
attainmentGoal :: GoalProperty -> Maybe (Value Double)
interval :: GoalProperty -> Maybe IntervalProperty
warningThreshold :: GoalProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
= GoalProperty {interval :: Maybe IntervalProperty
interval = IntervalProperty -> Maybe IntervalProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Interval" GoalProperty
IntervalProperty
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
warningThreshold :: Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
warningThreshold :: Maybe (Value Double)
..}
instance Property "WarningThreshold" GoalProperty where
type PropertyType "WarningThreshold" GoalProperty = Value Prelude.Double
set :: PropertyType "WarningThreshold" GoalProperty
-> GoalProperty -> GoalProperty
set PropertyType "WarningThreshold" GoalProperty
newValue GoalProperty {Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: GoalProperty -> ()
attainmentGoal :: GoalProperty -> Maybe (Value Double)
interval :: GoalProperty -> Maybe IntervalProperty
warningThreshold :: GoalProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
warningThreshold :: Maybe (Value Double)
..}
= GoalProperty {warningThreshold :: Maybe (Value Double)
warningThreshold = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "WarningThreshold" GoalProperty
Value Double
newValue, Maybe (Value Double)
Maybe IntervalProperty
()
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
haddock_workaround_ :: ()
attainmentGoal :: Maybe (Value Double)
interval :: Maybe IntervalProperty
..}