# Copyright (c) 2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.

from . import AWSObject, AWSProperty
from .validators import integer, positive_integer, boolean

class MetricDimension(AWSProperty):
    props = {
        'Name': (basestring, True),
        'Value': (basestring, True),
    }


class Alarm(AWSObject):
    type = "AWS::CloudWatch::Alarm"

    props = {
        'ActionsEnabled': (boolean, False),
        'AlarmActions': ([basestring], False),
        'AlarmDescription': (basestring, False),
        'AlarmName': (basestring, False),
        'ComparisonOperator': (basestring, True),
        'Dimensions': ([MetricDimension], False),
        'EvaluationPeriods': (positive_integer, True),
        'InsufficientDataActions': ([basestring], False),
        'MetricName': (basestring, True),
        'Namespace': (basestring, True),
        'OKActions': ([basestring], False),
        'Period': (positive_integer, True),
        'Statistic': (basestring, True),
        'Threshold': (integer, True),
        'Unit': (basestring, False),
    }

@@ -140,17 +140,22 @@
 Property
+, Ref
 %0A
-
 from .va
@@ -484,32 +484,37 @@
 s': (%5Bbasestring
+, Ref
 %5D, False),%0A     
@@ -793,32 +793,37 @@
 s': (%5Bbasestring
+, Ref
 %5D, False),%0A     
@@ -892,32 +892,32 @@
 estring, True),%0A
-
         'OKActio
@@ -933,16 +933,21 @@
 sestring
+, Ref
 %5D, False

Allow Ref's in addition to basestrings