File Coverage

lib/WebService/Intercom/Types.pm
Criterion Covered Total %
statement 77 87 88.5
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 81 91 89.0


line stmt bran cond sub pod time code
1 2     2   9 use Moops -strict;
  2         3  
  2         16  
2              
3 2     2   14990 library WebService::Intercom::Types
  2     2   48  
  2     2   15  
  2         3  
  2         122  
  2         26  
  2         3  
  2         17  
  2         611  
  2         3  
  2         11  
  2         110  
  2         2  
  2         134  
  2         10  
  2         2  
  2         153  
  2         52  
  2         9  
  2         2  
  2         19  
  2         7458  
  2         4  
  2         15  
  2         1871  
  2         10  
  2         76  
  2         8  
  2         2  
  2         66  
  2         7  
  2         2  
  2         79  
  2         8  
  2         3  
  2         228  
  2         9  
  2         4  
  2         16  
  2         3252  
  2         4  
  2         17  
  2         4627  
  2         34599  
  2         3493  
4             extends Types::Standard
5             declares CustomAttributeNameType,
6             CustomAttributeValueType,
7             IPAddressType,
8             CustomAttributesType,
9             EventNameType,
10             EventMetadataURLValueType,
11             EventMetadataPriceValueType,
12             EventMetadataType,
13             SocialProfileListType,
14             SocialProfileType,
15             AvatarType,
16             LocationDataType,
17             CompaniesListType,
18             SegmentsListType,
19             SegmentType,
20             TagsListType,
21             TagUserIdentifierType,
22             TagCompanyIdentifierType,
23             MessagePersonType
24             {
25            
26 2         31 declare "MessagePersonType", as Dict[
27             type => StrMatch[qr/^(admin|user)$/],
28             user_id => Optional[Str],
29             email => Optional[Str],
30             id => Optional[Str]
31             ];
32             coerce MessagePersonType, from HashRef, via {
33 0         0 MessagePersonType->new($_);
34 2         17798 };
35            
36 2         1065 declare "CustomAttributeNameType", as StrMatch[qr/^[^[.\$]+$/];
37 2         2308 declare "IPAddressType", as StrMatch[qr/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/];
38             coerce IPAddressType, from Str, via {
39 0         0 IPAddressType->new($_);
40 2         2296 };
41            
42            
43 2         286 declare "CustomAttributeValueType", as Value|Bool;
44            
45 2         7858 declare "CustomAttributesType", as Map[CustomAttributeNameType, CustomAttributeValueType];
46             coerce CustomAttributesType, from HashRef, via {
47 0         0 CustomAttributesType->new($_);
48 2         7212 };
49            
50 2         327 declare "SocialProfileType", as Dict[type => Str,
51             name => Str,
52             username => Str,
53             url => Str,
54             id => Maybe[Str]
55             ];
56             coerce SocialProfileType, from HashRef, via {
57 0         0 SocialProfileType->new($_);
58 2         11765 };
59            
60 2         351 declare "SocialProfileListType", as Dict[type => Str,
61             social_profiles => ArrayRef[SocialProfileType]
62             ];
63             coerce SocialProfileListType, from HashRef, via {
64 0         0 SocialProfileListType->new($_);
65 2         19320 };
66            
67 2         340 declare "EventNameType", as StrMatch[qr/^[^[.\$]+$/];
68            
69 2         2157 declare "EventMetadataURLValueType", as Dict[url => Str,
70             value => Optional[Str]];
71             coerce EventMetadataURLValueType, from HashRef, via {
72 0         0 EventMetadataURLValueType->new($_);
73 2         5654 };
74            
75 2         299 declare "EventMetadataPriceValueType", as Dict[amount => Int,
76             currency => Str];
77            
78             coerce EventMetadataPriceValueType, from HashRef, via {
79 0         0 EventMetadataPriceValueType->new($_);
80 2         7278 };
81              
82              
83 2         308 declare "EventMetadataType", as Map[Str, Value|EventMetadataURLValueType|EventMetadataPriceValueType];
84             coerce EventMetadataType from HashRef, via {
85 0         0 EventMetadataType->new($_);
86 2         12093 };
87              
88              
89 2         296 declare "TagUserIdentifierType", as Dict[id => Optional[Str],
90             email => Optional[Str],
91             user_id => Optional[Str],
92             untag => Optional[Bool],
93             ];
94             coerce TagUserIdentifierType, from HashRef, via {
95 0         0 TagUserIdentifierType->new($_)
96 2         8252 };
97              
98              
99 2         306 declare "TagCompanyIdentifierType", as Dict[id => Optional[Str],
100             company_id => Optional[Str],
101             untag => Optional[Bool],
102             ];
103             coerce TagCompanyIdentifierType, from HashRef, via {
104 0         0 TagCompanyIdentifierType->new($_)
105 2         6339 };
106              
107            
108              
109 2         293 declare "AvatarType", as Dict[type => Str,
110             image_url => Maybe[Str]];
111              
112 2         6290 declare "LocationDataType", as Dict[type => Str,
113             city_name => Maybe[Str],
114             continent_code => Maybe[Str],
115             country_code => Maybe[Str],
116             country_name => Maybe[Str],
117             latitude => Maybe[Num],
118             longitude => Maybe[Num],
119             postal_code => Maybe[Str],
120             region_name => Maybe[Str],
121             timezone => Maybe[Str]
122             ];
123              
124 2         21433 declare "CompaniesListType", as Dict[type => Str,
125             companies => ArrayRef[Dict[id => Str]]];
126            
127              
128 2         13344 declare "SegmentType", as Dict[type => Str,
129             id => Str,
130             name => Str,
131             created_at => Int,
132             updated_at => Int];
133            
134 2         13016 declare "SegmentsListType", as Dict[type => Str,
135             segments => ArrayRef[Dict[type => Str, id => Str]]];
136              
137              
138 2         14970 declare "TagsListType", as Dict[type => Str,
139             tags => ArrayRef[Dict[id => Str,
140             type => Str,
141             name => Optional[Str]
142             ]]];
143              
144             };
145            
146             1;