module Stratosphere.PinpointEmail.ConfigurationSetEventDestination.CloudWatchDestinationProperty (
        module Exports, CloudWatchDestinationProperty(..),
        mkCloudWatchDestinationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.PinpointEmail.ConfigurationSetEventDestination.DimensionConfigurationProperty as Exports
import Stratosphere.ResourceProperties
data CloudWatchDestinationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpointemail-configurationseteventdestination-cloudwatchdestination.html>
    CloudWatchDestinationProperty {CloudWatchDestinationProperty -> ()
haddock_workaround_ :: (),
                                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpointemail-configurationseteventdestination-cloudwatchdestination.html#cfn-pinpointemail-configurationseteventdestination-cloudwatchdestination-dimensionconfigurations>
                                   CloudWatchDestinationProperty
-> Maybe [DimensionConfigurationProperty]
dimensionConfigurations :: (Prelude.Maybe [DimensionConfigurationProperty])}
  deriving stock (CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> Bool
(CloudWatchDestinationProperty
 -> CloudWatchDestinationProperty -> Bool)
-> (CloudWatchDestinationProperty
    -> CloudWatchDestinationProperty -> Bool)
-> Eq CloudWatchDestinationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> Bool
== :: CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> Bool
$c/= :: CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> Bool
/= :: CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> Bool
Prelude.Eq, Int -> CloudWatchDestinationProperty -> ShowS
[CloudWatchDestinationProperty] -> ShowS
CloudWatchDestinationProperty -> String
(Int -> CloudWatchDestinationProperty -> ShowS)
-> (CloudWatchDestinationProperty -> String)
-> ([CloudWatchDestinationProperty] -> ShowS)
-> Show CloudWatchDestinationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CloudWatchDestinationProperty -> ShowS
showsPrec :: Int -> CloudWatchDestinationProperty -> ShowS
$cshow :: CloudWatchDestinationProperty -> String
show :: CloudWatchDestinationProperty -> String
$cshowList :: [CloudWatchDestinationProperty] -> ShowS
showList :: [CloudWatchDestinationProperty] -> ShowS
Prelude.Show)
mkCloudWatchDestinationProperty :: CloudWatchDestinationProperty
mkCloudWatchDestinationProperty :: CloudWatchDestinationProperty
mkCloudWatchDestinationProperty
  = CloudWatchDestinationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       dimensionConfigurations :: Maybe [DimensionConfigurationProperty]
dimensionConfigurations = Maybe [DimensionConfigurationProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CloudWatchDestinationProperty where
  toResourceProperties :: CloudWatchDestinationProperty -> ResourceProperties
toResourceProperties CloudWatchDestinationProperty {Maybe [DimensionConfigurationProperty]
()
haddock_workaround_ :: CloudWatchDestinationProperty -> ()
dimensionConfigurations :: CloudWatchDestinationProperty
-> Maybe [DimensionConfigurationProperty]
haddock_workaround_ :: ()
dimensionConfigurations :: Maybe [DimensionConfigurationProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::PinpointEmail::ConfigurationSetEventDestination.CloudWatchDestination",
         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 -> [DimensionConfigurationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DimensionConfigurations"
                              ([DimensionConfigurationProperty] -> (Key, Value))
-> Maybe [DimensionConfigurationProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DimensionConfigurationProperty]
dimensionConfigurations])}
instance JSON.ToJSON CloudWatchDestinationProperty where
  toJSON :: CloudWatchDestinationProperty -> Value
toJSON CloudWatchDestinationProperty {Maybe [DimensionConfigurationProperty]
()
haddock_workaround_ :: CloudWatchDestinationProperty -> ()
dimensionConfigurations :: CloudWatchDestinationProperty
-> Maybe [DimensionConfigurationProperty]
haddock_workaround_ :: ()
dimensionConfigurations :: Maybe [DimensionConfigurationProperty]
..}
    = [(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 -> [DimensionConfigurationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DimensionConfigurations"
                 ([DimensionConfigurationProperty] -> (Key, Value))
-> Maybe [DimensionConfigurationProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DimensionConfigurationProperty]
dimensionConfigurations]))
instance Property "DimensionConfigurations" CloudWatchDestinationProperty where
  type PropertyType "DimensionConfigurations" CloudWatchDestinationProperty = [DimensionConfigurationProperty]
  set :: PropertyType
  "DimensionConfigurations" CloudWatchDestinationProperty
-> CloudWatchDestinationProperty -> CloudWatchDestinationProperty
set PropertyType
  "DimensionConfigurations" CloudWatchDestinationProperty
newValue CloudWatchDestinationProperty {Maybe [DimensionConfigurationProperty]
()
haddock_workaround_ :: CloudWatchDestinationProperty -> ()
dimensionConfigurations :: CloudWatchDestinationProperty
-> Maybe [DimensionConfigurationProperty]
haddock_workaround_ :: ()
dimensionConfigurations :: Maybe [DimensionConfigurationProperty]
..}
    = CloudWatchDestinationProperty
        {dimensionConfigurations :: Maybe [DimensionConfigurationProperty]
dimensionConfigurations = [DimensionConfigurationProperty]
-> Maybe [DimensionConfigurationProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [DimensionConfigurationProperty]
PropertyType
  "DimensionConfigurations" CloudWatchDestinationProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}