Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceipt.pm

filter: Statementstmt 86.5% 71 / 82 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 86.1% 31 / 36 Podpod n/a totaltotal 83.3% 105 / 126 CC 3 SCAR 2.1
CC
3
Cov
85%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Wireless/V1/Sim.pm ↑ Summary Twilio/Rest/Intelligence/V2/Operator.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceipt;
3  
4 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptList;
10  
11 2 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version, $chat_service_sid, $conversation_sid, $message_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 $self->{solution} = {
19 2 chat_service_sid => $chat_service_sid,
20 conversation_sid => $conversation_sid,
21 message_sid => $message_sid
22 };
23 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($chat_service_sid),
24 '/Conversations/', Twilio::Serialize::path_segment($conversation_sid), '/Messages/',
25 Twilio::Serialize::path_segment($message_sid), '/Receipts';
26 2 return $self;
27 }
28  
29 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->read_records(@arguments);
32 }
33  
34 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
35 0 my ($self, @arguments) = @_;
36 0 return $self->stream_records(@arguments);
37 }
38  
39 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
40 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
41 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
42  
43 1 my $params = {
44 PageToken => $page_token,
45 Page => $page_number,
46 PageSize => $page_size,
47 };
48  
49 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
50 1 return $self->_build_page($response);
51 }
52  
53 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
54 0 my ($self, $target_url) = @_;
55 0 my $client = $self->{version}->get_domain->get_client;
56 0 return $self->_build_page($client->request('GET', $target_url));
57 }
58  
59 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
60 1 my ($self, $response) = @_;
61 return Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptPage->new(
62 1 $self->{version}, $response, $self->{solution});
63 }
64  
65 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
66 1 my ($self, $sid) = @_;
67 return
68 Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptContext->new(
69 $self->{version},
70 $self->{solution}{chat_service_sid},
71 $self->{solution}{conversation_sid},
72 1 $self->{solution}{message_sid}, $sid
73 );
74 }
75  
76 package Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptPage;
77  
78 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
79  
80 1 ▶sub records_key { return 'delivery_receipts' }
Subroutine records_key: called CC=1 SCAR=0.0
81  
82 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
83 1 my ($self, $payload) = @_;
84 return
85 Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptInstance->new(
86 $self->{version}, $payload,
87 $self->{solution}{chat_service_sid},
88 $self->{solution}{conversation_sid},
89 $self->{solution}{message_sid}
90 1 );
91 }
92  
93 package Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptContext;
94  
95 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
100 1 my ($class, $version, $chat_service_sid, $conversation_sid, $message_sid, $sid) = @_;
101 1 my $self = $class->SUPER::new($version);
102 $self->{solution} = {
103 1 chat_service_sid => $chat_service_sid,
104 conversation_sid => $conversation_sid,
105 message_sid => $message_sid,
106 sid => $sid
107 };
108 1 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($chat_service_sid),
109 '/Conversations/', Twilio::Serialize::path_segment($conversation_sid), '/Messages/',
110 Twilio::Serialize::path_segment($message_sid), '/Receipts/',
111 Twilio::Serialize::path_segment($sid);
112 1 return $self;
113 }
114  
115 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
116 1 my ($self) = @_;
117  
118 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
119 1 return $self->_build_instance($response);
120 }
121  
122 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
123 1 my ($self, $response) = @_;
124 return
125 Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptInstance->new(
126 $self->{version}, $response->get_content,
127 $self->{solution}{chat_service_sid},
128 $self->{solution}{conversation_sid},
129 $self->{solution}{message_sid},
130 $self->{solution}{sid}
131 1 );
132 }
133  
134 package Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptInstance;
135  
136 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
137  
138 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
139  
140 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
141 2 my ($class, $version, $payload, $chat_service_sid, $conversation_sid, $message_sid, $sid) = @_;
142 2 my $self = $class->SUPER::new($version, $payload);
143 $self->{solution} = {
144 chat_service_sid => $chat_service_sid,
145 conversation_sid => $conversation_sid,
146 message_sid => $message_sid,
147 sid => $sid // $self->{properties}{sid}
148 2 ▶ };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
110
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
149 2 return $self;
150 }
151  
152 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
153 0 my ($self, @arguments) = @_;
154 0 return $self->_context->fetch(@arguments);
155 }
156  
157 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
158 0 my ($self) = @_;
159 return
160 Twilio::Rest::Conversations::V1::Service::Conversation::Message::DeliveryReceiptContext->new(
161 $self->{version},
162 $self->{solution}{chat_service_sid},
163 $self->{solution}{conversation_sid},
164 $self->{solution}{message_sid},
165 $self->{solution}{sid}
166 0 );
167 }
168  
169 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
170 2 ▶sub channel_message_sid { return $_[0]{properties}{channel_message_sid} }
Subroutine channel_message_sid: called CC=1 SCAR=0.0
171 2 ▶sub chat_service_sid { return $_[0]{properties}{chat_service_sid} }
Subroutine chat_service_sid: called CC=1 SCAR=0.0
172 2 ▶sub conversation_sid { return $_[0]{properties}{conversation_sid} }
Subroutine conversation_sid: called CC=1 SCAR=0.0
173 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
174 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
175 2 ▶sub error_code { return $_[0]{properties}{error_code} }
Subroutine error_code: called CC=1 SCAR=0.0
176 2 ▶sub message_sid { return $_[0]{properties}{message_sid} }
Subroutine message_sid: called CC=1 SCAR=0.0
177 2 ▶sub participant_sid { return $_[0]{properties}{participant_sid} }
Subroutine participant_sid: called CC=1 SCAR=0.0
178 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
179 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
180 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
181  
182 2 1;
183  
184 __END__
« Twilio/Rest/Wireless/V1/Sim.pm ↑ Summary Twilio/Rest/Intelligence/V2/Operator.pm »