Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteraction.pm

filter: Statementstmt 88.4% 84 / 95 Branchbran n/a Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 88.8% 40 / 45 Podpod n/a totaltotal 84.7% 128 / 151 CC 4 SCAR 2.1
CC
4
Cov
86%
create
2.0
page
2.0
new
2.0
CRAP 1.2
« Twilio/Rest/Messaging/V1/LinkshorteningMessagingService.pm ↑ Summary Twilio/Rest/Insights/V1/Conference.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteraction;
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::Proxy::V1::Service::Session::Participant::MessageInteractionList;
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 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version, $service_sid, $session_sid, $participant_sid) = @_;
17 3 my $self = $class->SUPER::new($version);
18 $self->{solution} = {
19 3 service_sid => $service_sid,
20 session_sid => $session_sid,
21 participant_sid => $participant_sid
22 };
23 3 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
24 '/Sessions/', Twilio::Serialize::path_segment($session_sid), '/Participants/',
25 Twilio::Serialize::path_segment($participant_sid), '/MessageInteractions';
26 3 return $self;
27 }
28  
29 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
30 1 my ($self, $options) = @_;
31 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
32  
33 my $data = {
34 Body => $options->{body},
35 MediaUrl => $options->{media_url},
36 1 };
37  
38 my $response =
39 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
40 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionInstance->new(
41 $self->{version}, $response->get_content,
42 $self->{solution}{service_sid},
43 $self->{solution}{session_sid},
44 $self->{solution}{participant_sid}
45 1 );
46 }
47  
48 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
49 0 my ($self, @arguments) = @_;
50 0 return $self->read_records(@arguments);
51 }
52  
53 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
54 0 my ($self, @arguments) = @_;
55 0 return $self->stream_records(@arguments);
56 }
57  
58 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
59 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
60 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
61  
62 1 my $params = {
63 PageToken => $page_token,
64 Page => $page_number,
65 PageSize => $page_size,
66 };
67  
68 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
69 1 return $self->_build_page($response);
70 }
71  
72 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
73 0 my ($self, $target_url) = @_;
74 0 my $client = $self->{version}->get_domain->get_client;
75 0 return $self->_build_page($client->request('GET', $target_url));
76 }
77  
78 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
79 1 my ($self, $response) = @_;
80 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionPage->new(
81 1 $self->{version}, $response, $self->{solution});
82 }
83  
84 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
85 1 my ($self, $sid) = @_;
86 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionContext->new(
87 $self->{version},
88 $self->{solution}{service_sid},
89 $self->{solution}{session_sid},
90 1 $self->{solution}{participant_sid}, $sid
91 );
92 }
93  
94 package Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionPage;
95  
96 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
97  
98 1 ▶sub records_key { return 'interactions' }
Subroutine records_key: called CC=1 SCAR=0.0
99  
100 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
101 1 my ($self, $payload) = @_;
102 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionInstance->new(
103 $self->{version}, $payload,
104 $self->{solution}{service_sid},
105 $self->{solution}{session_sid},
106 $self->{solution}{participant_sid}
107 1 );
108 }
109  
110 package Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionContext;
111  
112 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
115  
116 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
117 1 my ($class, $version, $service_sid, $session_sid, $participant_sid, $sid) = @_;
118 1 my $self = $class->SUPER::new($version);
119 $self->{solution} = {
120 1 service_sid => $service_sid,
121 session_sid => $session_sid,
122 participant_sid => $participant_sid,
123 sid => $sid
124 };
125 1 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
126 '/Sessions/', Twilio::Serialize::path_segment($session_sid), '/Participants/',
127 Twilio::Serialize::path_segment($participant_sid), '/MessageInteractions/',
128 Twilio::Serialize::path_segment($sid);
129 1 return $self;
130 }
131  
132 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
133 1 my ($self) = @_;
134  
135 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
136 1 return $self->_build_instance($response);
137 }
138  
139 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
140 1 my ($self, $response) = @_;
141 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionInstance->new(
142 $self->{version}, $response->get_content,
143 $self->{solution}{service_sid},
144 $self->{solution}{session_sid},
145 $self->{solution}{participant_sid},
146 $self->{solution}{sid}
147 1 );
148 }
149  
150 package Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionInstance;
151  
152 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
153  
154 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
155  
156 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
157 3 my ($class, $version, $payload, $service_sid, $session_sid, $participant_sid, $sid) = @_;
158 3 my $self = $class->SUPER::new($version, $payload);
159 $self->{solution} = {
160 service_sid => $service_sid,
161 session_sid => $session_sid,
162 participant_sid => $participant_sid,
163 sid => $sid // $self->{properties}{sid}
164 3 ▶ };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
120
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
165 3 return $self;
166 }
167  
168 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
169 0 my ($self, @arguments) = @_;
170 0 return $self->_context->fetch(@arguments);
171 }
172  
173 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
174 0 my ($self) = @_;
175 return Twilio::Rest::Proxy::V1::Service::Session::Participant::MessageInteractionContext->new(
176 $self->{version},
177 $self->{solution}{service_sid},
178 $self->{solution}{session_sid},
179 $self->{solution}{participant_sid},
180 $self->{solution}{sid}
181 0 );
182 }
183  
184 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
185 3 ▶sub data { return $_[0]{properties}{data} }
Subroutine data: called CC=1 SCAR=0.0
186 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
187 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
188 3 ▶sub inbound_participant_sid { return $_[0]{properties}{inbound_participant_sid} }
Subroutine inbound_participant_sid: called CC=1 SCAR=0.0
189 3 ▶sub inbound_resource_sid { return $_[0]{properties}{inbound_resource_sid} }
Subroutine inbound_resource_sid: called CC=1 SCAR=0.0
190 3 ▶sub inbound_resource_status { return $_[0]{properties}{inbound_resource_status} }
Subroutine inbound_resource_status: called CC=1 SCAR=0.0
191 3 ▶sub inbound_resource_type { return $_[0]{properties}{inbound_resource_type} }
Subroutine inbound_resource_type: called CC=1 SCAR=0.0
192 3 ▶sub inbound_resource_url { return $_[0]{properties}{inbound_resource_url} }
Subroutine inbound_resource_url: called CC=1 SCAR=0.0
193 3 ▶sub outbound_participant_sid { return $_[0]{properties}{outbound_participant_sid} }
Subroutine outbound_participant_sid: called CC=1 SCAR=0.0
194 3 ▶sub outbound_resource_sid { return $_[0]{properties}{outbound_resource_sid} }
Subroutine outbound_resource_sid: called CC=1 SCAR=0.0
195 3 ▶sub outbound_resource_status { return $_[0]{properties}{outbound_resource_status} }
Subroutine outbound_resource_status: called CC=1 SCAR=0.0
196 3 ▶sub outbound_resource_type { return $_[0]{properties}{outbound_resource_type} }
Subroutine outbound_resource_type: called CC=1 SCAR=0.0
197 3 ▶sub outbound_resource_url { return $_[0]{properties}{outbound_resource_url} }
Subroutine outbound_resource_url: called CC=1 SCAR=0.0
198 3 ▶sub participant_sid { return $_[0]{properties}{participant_sid} }
Subroutine participant_sid: called CC=1 SCAR=0.0
199 3 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
200 3 ▶sub session_sid { return $_[0]{properties}{session_sid} }
Subroutine session_sid: called CC=1 SCAR=0.0
201 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
202 3 ▶sub type { return $_[0]{properties}{type} }
Subroutine type: called CC=1 SCAR=0.0
203 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
204  
205 2 1;
206  
207 __END__
« Twilio/Rest/Messaging/V1/LinkshorteningMessagingService.pm ↑ Summary Twilio/Rest/Insights/V1/Conference.pm »