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   15409 library WebService::Intercom::Types
  2     2   46  
  2     2   15  
  2         2  
  2         119  
  2         26  
  2         2  
  2         16  
  2         552  
  2         3  
  2         12  
  2         102  
  2         2  
  2         91  
  2         8  
  2         2  
  2         213  
  2         48  
  2         9  
  2         2  
  2         18  
  2         7614  
  2         4  
  2         15  
  2         1884  
  2         11  
  2         70  
  2         8  
  2         4  
  2         62  
  2         7  
  2         2  
  2         75  
  2         6  
  2         4  
  2         223  
  2         8  
  2         2  
  2         18  
  2         3101  
  2         5  
  2         21  
  2         4392  
  2         36223  
  2         3441  
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         19630 };
35            
36 2         1129 declare "CustomAttributeNameType", as StrMatch[qr/^[^[.\$]+$/];
37 2         2383 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         2279 };
41            
42            
43 2         289 declare "CustomAttributeValueType", as Value|Bool;
44            
45 2         8010 declare "CustomAttributesType", as Map[CustomAttributeNameType, CustomAttributeValueType];
46             coerce CustomAttributesType, from HashRef, via {
47 0         0 CustomAttributesType->new($_);
48 2         7717 };
49            
50 2         377 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         12253 };
59            
60 2         327 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         19965 };
66            
67 2         378 declare "EventNameType", as StrMatch[qr/^[^[.\$]+$/];
68            
69 2         2280 declare "EventMetadataURLValueType", as Dict[url => Str,
70             value => Optional[Str]];
71             coerce EventMetadataURLValueType, from HashRef, via {
72 0         0 EventMetadataURLValueType->new($_);
73 2         5950 };
74            
75 2         310 declare "EventMetadataPriceValueType", as Dict[amount => Int,
76             currency => Str];
77            
78             coerce EventMetadataPriceValueType, from HashRef, via {
79 0         0 EventMetadataPriceValueType->new($_);
80 2         7385 };
81              
82              
83 2         369 declare "EventMetadataType", as Map[Str, Value|EventMetadataURLValueType|EventMetadataPriceValueType];
84             coerce EventMetadataType from HashRef, via {
85 0         0 EventMetadataType->new($_);
86 2         12420 };
87              
88              
89 2         274 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         8477 };
97              
98              
99 2         329 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         7057 };
106              
107            
108              
109 2         353 declare "AvatarType", as Dict[type => Str,
110             image_url => Maybe[Str]];
111              
112 2         7035 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         21488 declare "CompaniesListType", as Dict[type => Str,
125             companies => ArrayRef[Dict[id => Str]]];
126            
127              
128 2         14085 declare "SegmentType", as Dict[type => Str,
129             id => Str,
130             name => Str,
131             created_at => Int,
132             updated_at => Int];
133            
134 2         13546 declare "SegmentsListType", as Dict[type => Str,
135             segments => ArrayRef[Dict[type => Str, id => Str]]];
136              
137              
138 2         15306 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;