Twilio/Rest/Api/V2010/Account/Sip/Domain.pm

filter: Statementstmt 83.2% 104 / 125 Branchbran 100% 4 / 4 Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 82.1% 46 / 56 Podpod n/a totaltotal 79.9% 159 / 199 CC 7 SCAR 3.0
CC
7
Cov
82%
create
2.0
page
2.0
update
2.0
CRAP 1.4
« Twilio/Rest/Studio/V1/Flow/Engagement.pm ↑ Summary Twilio/Rest/Conversations/V2/Configuration.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::Sip::Domain;
3  
4 3 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Api::V2010::Account::Sip::DomainList;
10  
11 3 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 26 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 26 my ($class, $version, $account_sid) = @_;
17 26 my $self = $class->SUPER::new($version);
18 26 $self->{solution} = { account_sid => $account_sid };
19 26 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/SIP/Domains.json';
21 26 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 1 my ($self, $domain_name, $options) = @_;
26 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
27  
28 my $data = {
29 DomainName => $domain_name,
30 ByocTrunkSid => $options->{byoc_trunk_sid},
31 EmergencyCallerSid => $options->{emergency_caller_sid},
32 EmergencyCallingEnabled =>
33 Twilio::Serialize::boolean_to_string($options->{emergency_calling_enabled}),
34 FriendlyName => $options->{friendly_name},
35 Secure => Twilio::Serialize::boolean_to_string($options->{secure}),
36 SipRegistration => Twilio::Serialize::boolean_to_string($options->{sip_registration}),
37 VoiceFallbackMethod => $options->{voice_fallback_method},
38 VoiceFallbackUrl => $options->{voice_fallback_url},
39 VoiceMethod => $options->{voice_method},
40 VoiceStatusCallbackMethod => $options->{voice_status_callback_method},
41 VoiceStatusCallbackUrl => $options->{voice_status_callback_url},
42 VoiceUrl => $options->{voice_url},
43 1 };
44  
45 my $response =
46 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
47 return Twilio::Rest::Api::V2010::Account::Sip::DomainInstance->new($self->{version},
48 1 $response->get_content, $self->{solution}{account_sid});
49 }
50  
51 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
52 0 my ($self, @arguments) = @_;
53 0 return $self->read_records(@arguments);
54 }
55  
56 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
57 0 my ($self, @arguments) = @_;
58 0 return $self->stream_records(@arguments);
59 }
60  
61 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
62 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
63 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
64  
65 1 my $params = {
66 PageToken => $page_token,
67 Page => $page_number,
68 PageSize => $page_size,
69 };
70  
71 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
72 1 return $self->_build_page($response);
73 }
74  
75 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
76 0 my ($self, $target_url) = @_;
77 0 my $client = $self->{version}->get_domain->get_client;
78 0 return $self->_build_page($client->request('GET', $target_url));
79 }
80  
81 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
82 1 my ($self, $response) = @_;
83 return Twilio::Rest::Api::V2010::Account::Sip::DomainPage->new($self->{version}, $response,
84 1 $self->{solution});
85 }
86  
87 24 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
88 24 my ($self, $sid) = @_;
89 return Twilio::Rest::Api::V2010::Account::Sip::DomainContext->new($self->{version},
90 24 $self->{solution}{account_sid}, $sid);
91 }
92  
93 package Twilio::Rest::Api::V2010::Account::Sip::DomainPage;
94  
95 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 1 ▶sub records_key { return 'domains' }
Subroutine records_key: called CC=1 SCAR=0.0
98  
99 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
100 1 my ($self, $payload) = @_;
101 return Twilio::Rest::Api::V2010::Account::Sip::DomainInstance->new($self->{version}, $payload,
102 1 $self->{solution}{account_sid});
103 }
104  
105 package Twilio::Rest::Api::V2010::Account::Sip::DomainContext;
106  
107 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
108  
109 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
110  
111 24 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
112 24 my ($class, $version, $account_sid, $sid) = @_;
113 24 my $self = $class->SUPER::new($version);
114 24 $self->{solution} = { account_sid => $account_sid, sid => $sid };
115 24 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
116 '/SIP/Domains/', Twilio::Serialize::path_segment($sid), '.json';
117 24 return $self;
118 }
119  
120 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
121 1 my ($self) = @_;
122 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
123 1 return 1;
124 }
125  
126 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
127 1 my ($self) = @_;
128  
129 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
130 1 return $self->_build_instance($response);
131 }
132  
133 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
134 1 my ($self, $options) = @_;
135 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
136  
137 my $data = {
138 ByocTrunkSid => $options->{byoc_trunk_sid},
139 DomainName => $options->{domain_name},
140 EmergencyCallerSid => $options->{emergency_caller_sid},
141 EmergencyCallingEnabled =>
142 Twilio::Serialize::boolean_to_string($options->{emergency_calling_enabled}),
143 FriendlyName => $options->{friendly_name},
144 Secure => Twilio::Serialize::boolean_to_string($options->{secure}),
145 SipRegistration => Twilio::Serialize::boolean_to_string($options->{sip_registration}),
146 VoiceFallbackMethod => $options->{voice_fallback_method},
147 VoiceFallbackUrl => $options->{voice_fallback_url},
148 VoiceMethod => $options->{voice_method},
149 VoiceStatusCallbackMethod => $options->{voice_status_callback_method},
150 VoiceStatusCallbackUrl => $options->{voice_status_callback_url},
151 VoiceUrl => $options->{voice_url},
152 1 };
153  
154 my $response =
155 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
156 1 return $self->_build_instance($response);
157 }
158  
159 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
160 2 my ($self, $response) = @_;
161 return Twilio::Rest::Api::V2010::Account::Sip::DomainInstance->new(
162 $self->{version}, $response->get_content,
163 $self->{solution}{account_sid}, $self->{solution}{sid}
164 2 );
165 }
166  
167 13 ▶sub auth {
Subroutine auth: called CC=1 SCAR=0.0
168 13 my ($self) = @_;
169 13 require Twilio::Rest::Api::V2010::Account::Sip::Domain::AuthTypes;
170 return Twilio::Rest::Api::V2010::Account::Sip::Domain::AuthTypesList->new(
171 $self->{version},
172 $self->{solution}{account_sid},
173 $self->{solution}{sid}
174 13 );
175 }
176  
177 4 ▶sub credential_list_mappings {
Subroutine credential_list_mappings: called CC=2 SCAR=6.9
178 4 my ($self, $sid) = @_;
179 4 require Twilio::Rest::Api::V2010::Account::Sip::Domain::CredentialListMapping;
180 my $list = Twilio::Rest::Api::V2010::Account::Sip::Domain::CredentialListMappingList->new(
181 $self->{version},
182 $self->{solution}{account_sid},
183 $self->{solution}{sid}
184 4 );
185 4 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 2 2 4
186 }
187  
188 4 ▶sub ip_access_control_list_mappings {
Subroutine ip_access_control_list_mappings: called CC=2 SCAR=6.9
189 4 my ($self, $sid) = @_;
190 4 require Twilio::Rest::Api::V2010::Account::Sip::Domain::IpAccessControlListMapping;
191 my $list = Twilio::Rest::Api::V2010::Account::Sip::Domain::IpAccessControlListMappingList->new(
192 $self->{version},
193 $self->{solution}{account_sid},
194 $self->{solution}{sid}
195 4 );
196 4 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 2 2 4
197 }
198  
199 package Twilio::Rest::Api::V2010::Account::Sip::DomainInstance;
200  
201 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
202  
203 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
204  
205 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
206 4 my ($class, $version, $payload, $account_sid, $sid) = @_;
207 4 my $self = $class->SUPER::new($version, $payload);
208 4 ▶ $self->{solution} = { account_sid => $account_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
209 4 return $self;
210 }
211  
212 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
213 0 my ($self, @arguments) = @_;
214 0 return $self->_context->delete(@arguments);
215 }
216  
217 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
218 0 my ($self, @arguments) = @_;
219 0 return $self->_context->fetch(@arguments);
220 }
221  
222 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
223 0 my ($self, @arguments) = @_;
224 0 return $self->_context->update(@arguments);
225 }
226  
227 0 ▶sub auth {
Subroutine auth: not called CC=1 SCAR=6.9
228 0 my ($self, @arguments) = @_;
229 0 return $self->_context->auth(@arguments);
230 }
231  
232 0 ▶sub credential_list_mappings {
Subroutine credential_list_mappings: not called CC=1 SCAR=6.9
233 0 my ($self, @arguments) = @_;
234 0 return $self->_context->credential_list_mappings(@arguments);
235 }
236  
237 0 ▶sub ip_access_control_list_mappings {
Subroutine ip_access_control_list_mappings: not called CC=1 SCAR=6.9
238 0 my ($self, @arguments) = @_;
239 0 return $self->_context->ip_access_control_list_mappings(@arguments);
240 }
241  
242 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
243 0 my ($self) = @_;
244 return Twilio::Rest::Api::V2010::Account::Sip::DomainContext->new(
245 $self->{version},
246 $self->{solution}{account_sid},
247 $self->{solution}{sid}
248 0 );
249 }
250  
251 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
252 4 ▶sub api_version { return $_[0]{properties}{api_version} }
Subroutine api_version: called CC=1 SCAR=0.0
253 4 ▶sub auth_type { return $_[0]{properties}{auth_type} }
Subroutine auth_type: called CC=1 SCAR=0.0
254 4 ▶sub byoc_trunk_sid { return $_[0]{properties}{byoc_trunk_sid} }
Subroutine byoc_trunk_sid: called CC=1 SCAR=0.0
255 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
256 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
257 4 ▶sub domain_name { return $_[0]{properties}{domain_name} }
Subroutine domain_name: called CC=1 SCAR=0.0
258 4 ▶sub emergency_caller_sid { return $_[0]{properties}{emergency_caller_sid} }
Subroutine emergency_caller_sid: called CC=1 SCAR=0.0
259 4 ▶sub emergency_calling_enabled { return $_[0]{properties}{emergency_calling_enabled} }
Subroutine emergency_calling_enabled: called CC=1 SCAR=0.0
260 4 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
261 4 ▶sub secure { return $_[0]{properties}{secure} }
Subroutine secure: called CC=1 SCAR=0.0
262 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
263 4 ▶sub sip_registration { return $_[0]{properties}{sip_registration} }
Subroutine sip_registration: called CC=1 SCAR=0.0
264 4 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
265 4 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
266 4 ▶sub voice_fallback_method { return $_[0]{properties}{voice_fallback_method} }
Subroutine voice_fallback_method: called CC=1 SCAR=0.0
267 4 ▶sub voice_fallback_url { return $_[0]{properties}{voice_fallback_url} }
Subroutine voice_fallback_url: called CC=1 SCAR=0.0
268 4 ▶sub voice_method { return $_[0]{properties}{voice_method} }
Subroutine voice_method: called CC=1 SCAR=0.0
269 4 ▶sub voice_status_callback_method { return $_[0]{properties}{voice_status_callback_method} }
Subroutine voice_status_callback_method: called CC=1 SCAR=0.0
270 4 ▶sub voice_status_callback_url { return $_[0]{properties}{voice_status_callback_url} }
Subroutine voice_status_callback_url: called CC=1 SCAR=0.0
271 4 ▶sub voice_url { return $_[0]{properties}{voice_url} }
Subroutine voice_url: called CC=1 SCAR=0.0
272  
273 3 1;
274  
275 __END__
« Twilio/Rest/Studio/V1/Flow/Engagement.pm ↑ Summary Twilio/Rest/Conversations/V2/Configuration.pm »