module Stratosphere.CloudWatch.AnomalyDetector.ConfigurationProperty (
        module Exports, ConfigurationProperty(..), mkConfigurationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudWatch.AnomalyDetector.RangeProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ConfigurationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html>
    ConfigurationProperty {ConfigurationProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges>
                           ConfigurationProperty -> Maybe [RangeProperty]
excludedTimeRanges :: (Prelude.Maybe [RangeProperty]),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-metrictimezone>
                           ConfigurationProperty -> Maybe (Value Text)
metricTimeZone :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (ConfigurationProperty -> ConfigurationProperty -> Bool
(ConfigurationProperty -> ConfigurationProperty -> Bool)
-> (ConfigurationProperty -> ConfigurationProperty -> Bool)
-> Eq ConfigurationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConfigurationProperty -> ConfigurationProperty -> Bool
== :: ConfigurationProperty -> ConfigurationProperty -> Bool
$c/= :: ConfigurationProperty -> ConfigurationProperty -> Bool
/= :: ConfigurationProperty -> ConfigurationProperty -> Bool
Prelude.Eq, Int -> ConfigurationProperty -> ShowS
[ConfigurationProperty] -> ShowS
ConfigurationProperty -> String
(Int -> ConfigurationProperty -> ShowS)
-> (ConfigurationProperty -> String)
-> ([ConfigurationProperty] -> ShowS)
-> Show ConfigurationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConfigurationProperty -> ShowS
showsPrec :: Int -> ConfigurationProperty -> ShowS
$cshow :: ConfigurationProperty -> String
show :: ConfigurationProperty -> String
$cshowList :: [ConfigurationProperty] -> ShowS
showList :: [ConfigurationProperty] -> ShowS
Prelude.Show)
mkConfigurationProperty :: ConfigurationProperty
mkConfigurationProperty :: ConfigurationProperty
mkConfigurationProperty
  = ConfigurationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), excludedTimeRanges :: Maybe [RangeProperty]
excludedTimeRanges = Maybe [RangeProperty]
forall a. Maybe a
Prelude.Nothing,
       metricTimeZone :: Maybe (Value Text)
metricTimeZone = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ConfigurationProperty where
  toResourceProperties :: ConfigurationProperty -> ResourceProperties
toResourceProperties ConfigurationProperty {Maybe [RangeProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ConfigurationProperty -> ()
excludedTimeRanges :: ConfigurationProperty -> Maybe [RangeProperty]
metricTimeZone :: ConfigurationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
metricTimeZone :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudWatch::AnomalyDetector.Configuration",
         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 -> [RangeProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ExcludedTimeRanges" ([RangeProperty] -> (Key, Value))
-> Maybe [RangeProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RangeProperty]
excludedTimeRanges,
                            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
"MetricTimeZone" (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)
metricTimeZone])}
instance JSON.ToJSON ConfigurationProperty where
  toJSON :: ConfigurationProperty -> Value
toJSON ConfigurationProperty {Maybe [RangeProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ConfigurationProperty -> ()
excludedTimeRanges :: ConfigurationProperty -> Maybe [RangeProperty]
metricTimeZone :: ConfigurationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
metricTimeZone :: 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 -> [RangeProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ExcludedTimeRanges" ([RangeProperty] -> (Key, Value))
-> Maybe [RangeProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RangeProperty]
excludedTimeRanges,
               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
"MetricTimeZone" (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)
metricTimeZone]))
instance Property "ExcludedTimeRanges" ConfigurationProperty where
  type PropertyType "ExcludedTimeRanges" ConfigurationProperty = [RangeProperty]
  set :: PropertyType "ExcludedTimeRanges" ConfigurationProperty
-> ConfigurationProperty -> ConfigurationProperty
set PropertyType "ExcludedTimeRanges" ConfigurationProperty
newValue ConfigurationProperty {Maybe [RangeProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ConfigurationProperty -> ()
excludedTimeRanges :: ConfigurationProperty -> Maybe [RangeProperty]
metricTimeZone :: ConfigurationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
metricTimeZone :: Maybe (Value Text)
..}
    = ConfigurationProperty
        {excludedTimeRanges :: Maybe [RangeProperty]
excludedTimeRanges = [RangeProperty] -> Maybe [RangeProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RangeProperty]
PropertyType "ExcludedTimeRanges" ConfigurationProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
metricTimeZone :: Maybe (Value Text)
haddock_workaround_ :: ()
metricTimeZone :: Maybe (Value Text)
..}
instance Property "MetricTimeZone" ConfigurationProperty where
  type PropertyType "MetricTimeZone" ConfigurationProperty = Value Prelude.Text
  set :: PropertyType "MetricTimeZone" ConfigurationProperty
-> ConfigurationProperty -> ConfigurationProperty
set PropertyType "MetricTimeZone" ConfigurationProperty
newValue ConfigurationProperty {Maybe [RangeProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ConfigurationProperty -> ()
excludedTimeRanges :: ConfigurationProperty -> Maybe [RangeProperty]
metricTimeZone :: ConfigurationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
metricTimeZone :: Maybe (Value Text)
..}
    = ConfigurationProperty
        {metricTimeZone :: Maybe (Value Text)
metricTimeZone = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MetricTimeZone" ConfigurationProperty
Value Text
newValue, Maybe [RangeProperty]
()
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
haddock_workaround_ :: ()
excludedTimeRanges :: Maybe [RangeProperty]
..}