File Coverage

blib/lib/Cfn/Resource/AWS/CloudWatch/Alarm.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 14 14 100.0
pod 0 2 0.0
total 52 54 96.3


line stmt bran cond sub pod time code
1             # AWS::CloudWatch::Alarm generated from spec 6.0.0
2 5     5   3186 use Moose::Util::TypeConstraints;
  5         11  
  5         45  
3              
4             coerce 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm',
5             from 'HashRef',
6             via { Cfn::Resource::Properties::AWS::CloudWatch::Alarm->new( %$_ ) };
7              
8             package Cfn::Resource::AWS::CloudWatch::Alarm {
9 5     5   9726 use Moose;
  5         13  
  5         35  
10             extends 'Cfn::Resource';
11             has Properties => (isa => 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm', is => 'rw', coerce => 1);
12            
13             sub AttributeList {
14 1     1 0 4 [ 'Arn' ]
15             }
16             sub supported_regions {
17 1     1 0 1088 [ 'ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-southeast-1','ap-southeast-2','ca-central-1','cn-north-1','cn-northwest-1','eu-central-1','eu-north-1','eu-west-1','eu-west-2','eu-west-3','me-south-1','sa-east-1','us-east-1','us-east-2','us-gov-east-1','us-gov-west-1','us-west-1','us-west-2' ]
18             }
19             }
20              
21              
22             subtype 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension',
23             as 'Cfn::Value',
24             where { $_->isa('Cfn::Value::Array') or $_->isa('Cfn::Value::Function') },
25             message { "$_ is not a Cfn::Value or a Cfn::Value::Function" };
26              
27             coerce 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension',
28             from 'HashRef',
29             via {
30             if (my $f = Cfn::TypeLibrary::try_function($_)) {
31             return $f
32             } else {
33             die 'Only accepts functions';
34             }
35             },
36             from 'ArrayRef',
37             via {
38             Cfn::Value::Array->new(Value => [
39             map {
40             Moose::Util::TypeConstraints::find_type_constraint('Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension')->coerce($_)
41             } @$_
42             ]);
43             };
44              
45             subtype 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension',
46             as 'Cfn::Value';
47              
48             coerce 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension',
49             from 'HashRef',
50             via {
51             if (my $f = Cfn::TypeLibrary::try_function($_)) {
52             return $f
53             } else {
54             return Cfn::Resource::Properties::AWS::CloudWatch::Alarm::DimensionValue->new( %$_ );
55             }
56             };
57              
58             package Cfn::Resource::Properties::AWS::CloudWatch::Alarm::DimensionValue {
59 5     5   32545 use Moose;
  5         20  
  5         31  
60 5     5   29472 use MooseX::StrictConstructor;
  5         13  
  5         44  
61             extends 'Cfn::Value::TypedValue';
62            
63             has Name => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
64             has Value => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
65             }
66              
67             subtype 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Metric',
68             as 'Cfn::Value';
69              
70             coerce 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Metric',
71             from 'HashRef',
72             via {
73             if (my $f = Cfn::TypeLibrary::try_function($_)) {
74             return $f
75             } else {
76             return Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricValue->new( %$_ );
77             }
78             };
79              
80             package Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricValue {
81 5     5   16386 use Moose;
  5         22  
  5         30  
82 5     5   29248 use MooseX::StrictConstructor;
  5         18  
  5         26  
83             extends 'Cfn::Value::TypedValue';
84            
85             has Dimensions => (isa => 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
86             has MetricName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
87             has Namespace => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
88             }
89              
90             subtype 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricStat',
91             as 'Cfn::Value';
92              
93             coerce 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricStat',
94             from 'HashRef',
95             via {
96             if (my $f = Cfn::TypeLibrary::try_function($_)) {
97             return $f
98             } else {
99             return Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricStatValue->new( %$_ );
100             }
101             };
102              
103             package Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricStatValue {
104 5     5   14939 use Moose;
  5         14  
  5         33  
105 5     5   28896 use MooseX::StrictConstructor;
  5         16  
  5         21  
106             extends 'Cfn::Value::TypedValue';
107            
108             has Metric => (isa => 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::Metric', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
109             has Period => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
110             has Stat => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
111             has Unit => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
112             }
113             subtype 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery',
114             as 'Cfn::Value',
115             where { $_->isa('Cfn::Value::Array') or $_->isa('Cfn::Value::Function') },
116             message { "$_ is not a Cfn::Value or a Cfn::Value::Function" };
117              
118             coerce 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery',
119             from 'HashRef',
120             via {
121             if (my $f = Cfn::TypeLibrary::try_function($_)) {
122             return $f
123             } else {
124             die 'Only accepts functions';
125             }
126             },
127             from 'ArrayRef',
128             via {
129             Cfn::Value::Array->new(Value => [
130             map {
131             Moose::Util::TypeConstraints::find_type_constraint('Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery')->coerce($_)
132             } @$_
133             ]);
134             };
135              
136             subtype 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery',
137             as 'Cfn::Value';
138              
139             coerce 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery',
140             from 'HashRef',
141             via {
142             if (my $f = Cfn::TypeLibrary::try_function($_)) {
143             return $f
144             } else {
145             return Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQueryValue->new( %$_ );
146             }
147             };
148              
149             package Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQueryValue {
150 5     5   15691 use Moose;
  5         22  
  5         40  
151 5     5   29171 use MooseX::StrictConstructor;
  5         15  
  5         28  
152             extends 'Cfn::Value::TypedValue';
153            
154             has Expression => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
155             has Id => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
156             has Label => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
157             has MetricStat => (isa => 'Cfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricStat', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
158             has ReturnData => (isa => 'Cfn::Value::Boolean', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
159             }
160              
161             package Cfn::Resource::Properties::AWS::CloudWatch::Alarm {
162 5     5   14853 use Moose;
  5         11  
  5         27  
163 5     5   29672 use MooseX::StrictConstructor;
  5         13  
  5         32  
164             extends 'Cfn::Resource::Properties';
165            
166             has ActionsEnabled => (isa => 'Cfn::Value::Boolean', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
167             has AlarmActions => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
168             has AlarmDescription => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
169             has AlarmName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
170             has ComparisonOperator => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
171             has DatapointsToAlarm => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
172             has Dimensions => (isa => 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::Dimension', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
173             has EvaluateLowSampleCountPercentile => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
174             has EvaluationPeriods => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
175             has ExtendedStatistic => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
176             has InsufficientDataActions => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
177             has MetricName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
178             has Metrics => (isa => 'ArrayOfCfn::Resource::Properties::AWS::CloudWatch::Alarm::MetricDataQuery', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
179             has Namespace => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
180             has OKActions => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
181             has Period => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
182             has Statistic => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
183             has Threshold => (isa => 'Cfn::Value::Double', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
184             has ThresholdMetricId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
185             has TreatMissingData => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
186             has Unit => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
187             }
188              
189             1;