File Coverage

blib/lib/Cfn/Resource/AWS/SNS/Topic.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             # AWS::SNS::Topic generated from spec 7.4.0
2 5     5   2912 use Moose::Util::TypeConstraints;
  5         16  
  5         49  
3              
4             coerce 'Cfn::Resource::Properties::AWS::SNS::Topic',
5             from 'HashRef',
6             via { Cfn::Resource::Properties::AWS::SNS::Topic->new( %$_ ) };
7              
8             package Cfn::Resource::AWS::SNS::Topic {
9 5     5   9651 use Moose;
  5         14  
  5         39  
10             extends 'Cfn::Resource';
11             has Properties => (isa => 'Cfn::Resource::Properties::AWS::SNS::Topic', is => 'rw', coerce => 1);
12            
13             sub AttributeList {
14 1     1 0 5 [ 'TopicName' ]
15             }
16             sub supported_regions {
17 1     1 0 979 [ '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::SNS::Topic::Subscription',
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::SNS::Topic::Subscription',
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::SNS::Topic::Subscription')->coerce($_)
41             } @$_
42             ]);
43             };
44              
45             subtype 'Cfn::Resource::Properties::AWS::SNS::Topic::Subscription',
46             as 'Cfn::Value';
47              
48             coerce 'Cfn::Resource::Properties::AWS::SNS::Topic::Subscription',
49             from 'HashRef',
50             via {
51             if (my $f = Cfn::TypeLibrary::try_function($_)) {
52             return $f
53             } else {
54             return Cfn::Resource::Properties::AWS::SNS::Topic::SubscriptionValue->new( %$_ );
55             }
56             };
57              
58             package Cfn::Resource::Properties::AWS::SNS::Topic::SubscriptionValue {
59 5     5   32870 use Moose;
  5         18  
  5         24  
60 5     5   29196 use MooseX::StrictConstructor;
  5         17  
  5         38  
61             extends 'Cfn::Value::TypedValue';
62            
63             has Endpoint => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
64             has Protocol => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
65             }
66              
67             package Cfn::Resource::Properties::AWS::SNS::Topic {
68 5     5   15137 use Moose;
  5         14  
  5         25  
69 5     5   28891 use MooseX::StrictConstructor;
  5         12  
  5         25  
70             extends 'Cfn::Resource::Properties';
71            
72             has DisplayName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
73             has KmsMasterKeyId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
74             has Subscription => (isa => 'ArrayOfCfn::Resource::Properties::AWS::SNS::Topic::Subscription', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
75             has Tags => (isa => 'ArrayOfCfn::Resource::Properties::TagType', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
76             has TopicName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
77             }
78              
79             1;