module Stratosphere.FIS.ExperimentTemplate.DataSourcesProperty (
        module Exports, DataSourcesProperty(..), mkDataSourcesProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.FIS.ExperimentTemplate.CloudWatchDashboardProperty as Exports
import Stratosphere.ResourceProperties
data DataSourcesProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fis-experimenttemplate-datasources.html>
    DataSourcesProperty {DataSourcesProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fis-experimenttemplate-datasources.html#cfn-fis-experimenttemplate-datasources-cloudwatchdashboards>
                         DataSourcesProperty -> Maybe [CloudWatchDashboardProperty]
cloudWatchDashboards :: (Prelude.Maybe [CloudWatchDashboardProperty])}
  deriving stock (DataSourcesProperty -> DataSourcesProperty -> Bool
(DataSourcesProperty -> DataSourcesProperty -> Bool)
-> (DataSourcesProperty -> DataSourcesProperty -> Bool)
-> Eq DataSourcesProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DataSourcesProperty -> DataSourcesProperty -> Bool
== :: DataSourcesProperty -> DataSourcesProperty -> Bool
$c/= :: DataSourcesProperty -> DataSourcesProperty -> Bool
/= :: DataSourcesProperty -> DataSourcesProperty -> Bool
Prelude.Eq, Int -> DataSourcesProperty -> ShowS
[DataSourcesProperty] -> ShowS
DataSourcesProperty -> String
(Int -> DataSourcesProperty -> ShowS)
-> (DataSourcesProperty -> String)
-> ([DataSourcesProperty] -> ShowS)
-> Show DataSourcesProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DataSourcesProperty -> ShowS
showsPrec :: Int -> DataSourcesProperty -> ShowS
$cshow :: DataSourcesProperty -> String
show :: DataSourcesProperty -> String
$cshowList :: [DataSourcesProperty] -> ShowS
showList :: [DataSourcesProperty] -> ShowS
Prelude.Show)
mkDataSourcesProperty :: DataSourcesProperty
mkDataSourcesProperty :: DataSourcesProperty
mkDataSourcesProperty
  = DataSourcesProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cloudWatchDashboards :: Maybe [CloudWatchDashboardProperty]
cloudWatchDashboards = Maybe [CloudWatchDashboardProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DataSourcesProperty where
  toResourceProperties :: DataSourcesProperty -> ResourceProperties
toResourceProperties DataSourcesProperty {Maybe [CloudWatchDashboardProperty]
()
haddock_workaround_ :: DataSourcesProperty -> ()
cloudWatchDashboards :: DataSourcesProperty -> Maybe [CloudWatchDashboardProperty]
haddock_workaround_ :: ()
cloudWatchDashboards :: Maybe [CloudWatchDashboardProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::FIS::ExperimentTemplate.DataSources",
         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 -> [CloudWatchDashboardProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CloudWatchDashboards"
                              ([CloudWatchDashboardProperty] -> (Key, Value))
-> Maybe [CloudWatchDashboardProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CloudWatchDashboardProperty]
cloudWatchDashboards])}
instance JSON.ToJSON DataSourcesProperty where
  toJSON :: DataSourcesProperty -> Value
toJSON DataSourcesProperty {Maybe [CloudWatchDashboardProperty]
()
haddock_workaround_ :: DataSourcesProperty -> ()
cloudWatchDashboards :: DataSourcesProperty -> Maybe [CloudWatchDashboardProperty]
haddock_workaround_ :: ()
cloudWatchDashboards :: Maybe [CloudWatchDashboardProperty]
..}
    = [(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 -> [CloudWatchDashboardProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CloudWatchDashboards"
                 ([CloudWatchDashboardProperty] -> (Key, Value))
-> Maybe [CloudWatchDashboardProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CloudWatchDashboardProperty]
cloudWatchDashboards]))
instance Property "CloudWatchDashboards" DataSourcesProperty where
  type PropertyType "CloudWatchDashboards" DataSourcesProperty = [CloudWatchDashboardProperty]
  set :: PropertyType "CloudWatchDashboards" DataSourcesProperty
-> DataSourcesProperty -> DataSourcesProperty
set PropertyType "CloudWatchDashboards" DataSourcesProperty
newValue DataSourcesProperty {Maybe [CloudWatchDashboardProperty]
()
haddock_workaround_ :: DataSourcesProperty -> ()
cloudWatchDashboards :: DataSourcesProperty -> Maybe [CloudWatchDashboardProperty]
haddock_workaround_ :: ()
cloudWatchDashboards :: Maybe [CloudWatchDashboardProperty]
..}
    = DataSourcesProperty
        {cloudWatchDashboards :: Maybe [CloudWatchDashboardProperty]
cloudWatchDashboards = [CloudWatchDashboardProperty]
-> Maybe [CloudWatchDashboardProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [CloudWatchDashboardProperty]
PropertyType "CloudWatchDashboards" DataSourcesProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}