Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument.pm

filter: Statementstmt 83.1% 84 / 101 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.0% 32 / 40 Podpod n/a totaltotal 78.0% 121 / 155 CC 5 SCAR 3.1
CC
5
Cov
81%
create
2.0
page
2.0
update
2.0
CRAP 1.4
« Twilio/Rest/Messaging/V1.pm ↑ Summary Twilio/Rest/Sync/V1/Service/SyncStream.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Preview::HostedNumbers::AuthorizationDocument;
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::Preview::HostedNumbers::AuthorizationDocumentList;
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 7 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 7 my ($class, $version) = @_;
17 7 my $self = $class->SUPER::new($version);
18 7 $self->{solution} = {};
19 7 $self->{uri} = '/AuthorizationDocuments';
20 7 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $hosted_number_order_sids, $address_sid, $email, $contact_title,
25 $contact_phone_number, $options)
26 = @_;
27 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
28  
29 my $data = {
30 HostedNumberOrderSids => $hosted_number_order_sids,
31 AddressSid => $address_sid,
32 Email => $email,
33 ContactTitle => $contact_title,
34 ContactPhoneNumber => $contact_phone_number,
35 CcEmails => $options->{cc_emails},
36 1 };
37  
38 my $response =
39 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
40 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentInstance->new($self->{version},
41 1 $response->get_content);
42 }
43  
44 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
45 0 my ($self, @arguments) = @_;
46 0 return $self->read_records(@arguments);
47 }
48  
49 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
50 0 my ($self, @arguments) = @_;
51 0 return $self->stream_records(@arguments);
52 }
53  
54 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
55 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
56 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
57  
58 my $params = {
59 Email => $options->{email},
60 Status => $options->{status},
61 1 PageToken => $page_token,
62 Page => $page_number,
63 PageSize => $page_size,
64 };
65  
66 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
67 1 return $self->_build_page($response);
68 }
69  
70 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
71 0 my ($self, $target_url) = @_;
72 0 my $client = $self->{version}->get_domain->get_client;
73 0 return $self->_build_page($client->request('GET', $target_url));
74 }
75  
76 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
77 1 my ($self, $response) = @_;
78 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentPage->new($self->{version},
79 1 $response, $self->{solution});
80 }
81  
82 5 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
83 5 my ($self, $sid) = @_;
84 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentContext->new($self->{version},
85 5 $sid);
86 }
87  
88 package Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentPage;
89  
90 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
91  
92 1 ▶sub records_key { return 'items' }
Subroutine records_key: called CC=1 SCAR=0.0
93  
94 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
95 1 my ($self, $payload) = @_;
96 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentInstance->new($self->{version},
97 1 $payload);
98 }
99  
100 package Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentContext;
101  
102 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
105  
106 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
107 5 my ($class, $version, $sid) = @_;
108 5 my $self = $class->SUPER::new($version);
109 5 $self->{solution} = { sid => $sid };
110 5 $self->{uri} = join q{}, '/AuthorizationDocuments/', Twilio::Serialize::path_segment($sid);
111 5 return $self;
112 }
113  
114 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
115 1 my ($self) = @_;
116 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
117 1 return 1;
118 }
119  
120 2 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
121 2 my ($self) = @_;
122  
123 2 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
124 2 return $self->_build_instance($response);
125 }
126  
127 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
128 1 my ($self, $options) = @_;
129 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
130  
131 my $data = {
132 AddressSid => $options->{address_sid},
133 CcEmails => $options->{cc_emails},
134 ContactPhoneNumber => $options->{contact_phone_number},
135 ContactTitle => $options->{contact_title},
136 Email => $options->{email},
137 HostedNumberOrderSids => $options->{hosted_number_order_sids},
138 Status => $options->{status},
139 1 };
140  
141 my $response =
142 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
143 1 return $self->_build_instance($response);
144 }
145  
146 3 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
147 3 my ($self, $response) = @_;
148 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentInstance->new($self->{version},
149 3 $response->get_content, $self->{solution}{sid});
150 }
151  
152 1 ▶sub dependent_hosted_number_orders {
Subroutine dependent_hosted_number_orders: called CC=1 SCAR=0.0
153 1 my ($self) = @_;
154 1 require Twilio::Rest::Preview::HostedNumbers::AuthorizationDocument::DependentHostedNumberOrder;
155 return
156 Twilio::Rest::Preview::HostedNumbers::AuthorizationDocument::DependentHostedNumberOrderList
157 1 ->new($self->{version}, $self->{solution}{sid});
158 }
159  
160 package Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentInstance;
161  
162 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
163  
164 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
165  
166 5 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
167 5 my ($class, $version, $payload, $sid) = @_;
168 5 my $self = $class->SUPER::new($version, $payload);
169 5 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
320
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
170 5 return $self;
171 }
172  
173 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
174 0 my ($self, @arguments) = @_;
175 0 return $self->_context->delete(@arguments);
176 }
177  
178 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
179 0 my ($self, @arguments) = @_;
180 0 return $self->_context->fetch(@arguments);
181 }
182  
183 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
184 0 my ($self, @arguments) = @_;
185 0 return $self->_context->update(@arguments);
186 }
187  
188 0 ▶sub dependent_hosted_number_orders {
Subroutine dependent_hosted_number_orders: not called CC=1 SCAR=6.9
189 0 my ($self, @arguments) = @_;
190 0 return $self->_context->dependent_hosted_number_orders(@arguments);
191 }
192  
193 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
194 0 my ($self) = @_;
195 return Twilio::Rest::Preview::HostedNumbers::AuthorizationDocumentContext->new($self->{version},
196 0 $self->{solution}{sid});
197 }
198  
199 4 ▶sub address_sid { return $_[0]{properties}{address_sid} }
Subroutine address_sid: called CC=1 SCAR=0.0
200 4 ▶sub cc_emails { return $_[0]{properties}{cc_emails} }
Subroutine cc_emails: called CC=1 SCAR=0.0
201 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
202 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
203 4 ▶sub email { return $_[0]{properties}{email} }
Subroutine email: called CC=1 SCAR=0.0
204 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
205 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
206 4 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
207 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
208  
209 3 1;
210  
211 __END__
« Twilio/Rest/Messaging/V1.pm ↑ Summary Twilio/Rest/Sync/V1/Service/SyncStream.pm »