Twilio/Rest/Conversations/V2/Configuration.pm

filter: Statementstmt 85.7% 102 / 119 Branchbran n/a Conditioncond 53.8% 7 / 13 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 84.3% 43 / 51 Podpod n/a totaltotal 80.0% 152 / 190 CC 7 SCAR 3.0
CC
7
Cov
83%
delete
2.0
create
2.0
page
2.0
CRAP 1.4
« Twilio/Rest/Api/V2010/Account/Sip/Domain.pm ↑ Summary Twilio/Rest/Chat/V1/Service.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Conversations::V2::Configuration;
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::V2::ConfigurationList;
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 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 6 my ($class, $version) = @_;
17 6 my $self = $class->SUPER::new($version);
18 6 $self->{solution} = {};
19 6 $self->{uri} = '/ControlPlane/Configurations';
20 6 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $body, $options) = @_;
25 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
26  
27 1 my $data = Twilio::Serialize::json_body($body, { 'memoryExtractionEnabled' => 'boolean' });
28  
29 my $response = $self->{version}->handle_request(
30 'POST',
31 $self->{uri},
32 'create',
33 {
34 data => $data,
35 headers => {
36 'Content-Type' => 'application/json',
37 'Idempotency-Key' => $options->{idempotency_key},
38 }
39 }
40 1 );
41 return Twilio::Rest::Conversations::V2::CreateConfiguration202ResponseInstance->new(
42 1 $self->{version}, $response->get_content);
43 }
44  
45 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
46 0 my ($self, @arguments) = @_;
47 0 return $self->read_records(@arguments);
48 }
49  
50 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
51 0 my ($self, @arguments) = @_;
52 0 return $self->stream_records(@arguments);
53 }
54  
55 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
56 1 my ($self, $options, $page_size, $page_token) = @_;
57 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
58  
59 my $params = {
60 memoryStoreId => $options->{memory_store_id},
61 1 pageSize => $page_size,
62 pageToken => $page_token,
63 };
64  
65 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
66 1 return $self->_build_page($response);
67 }
68  
69 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
70 0 my ($self, $target_url) = @_;
71 0 my $client = $self->{version}->get_domain->get_client;
72 0 return $self->_build_page($client->request('GET', $target_url));
73 }
74  
75 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
76 1 my ($self, $response) = @_;
77 return Twilio::Rest::Conversations::V2::ConfigurationPage->new($self->{version}, $response,
78 1 $self->{solution});
79 }
80  
81 4 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
82 4 my ($self, $id) = @_;
83 4 return Twilio::Rest::Conversations::V2::ConfigurationContext->new($self->{version}, $id);
84 }
85  
86 package Twilio::Rest::Conversations::V2::ConfigurationPage;
87  
88 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
89  
90 1 ▶sub records_key { return 'configurations' }
Subroutine records_key: called CC=1 SCAR=0.0
91  
92 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
93 1 my ($self, $payload) = @_;
94 1 return Twilio::Rest::Conversations::V2::ConfigurationInstance->new($self->{version}, $payload);
95 }
96  
97 package Twilio::Rest::Conversations::V2::ConfigurationContext;
98  
99 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
100  
101 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
102  
103 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
104 4 my ($class, $version, $id) = @_;
105 4 my $self = $class->SUPER::new($version);
106 4 $self->{solution} = { id => $id };
107 4 $self->{uri} = join q{}, '/ControlPlane/Configurations/', Twilio::Serialize::path_segment($id);
108 4 return $self;
109 }
110  
111 1 ▶sub delete {
Subroutine delete: called CC=2 SCAR=7.0
112 1 my ($self, $options) = @_;
113 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
114 my $response = $self->{version}->handle_request('DELETE', $self->{uri}, 'delete',
115 1 { headers => { 'Idempotency-Key' => $options->{idempotency_key}, } });
116 return Twilio::Rest::Conversations::V2::CreateConfiguration202ResponseInstance->new(
117 1 $self->{version}, $response->get_content);
118 }
119  
120 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
121 1 my ($self) = @_;
122  
123 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
124 1 return $self->_build_instance($response);
125 }
126  
127 1 ▶sub patch {
Subroutine patch: called CC=2 SCAR=7.0
128 1 my ($self, $body, $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 1 my $data = Twilio::Serialize::json_body($body, { 'memoryExtractionEnabled' => 'boolean' });
132  
133 my $response = $self->{version}->handle_request(
134 'PATCH',
135 $self->{uri},
136 'patch',
137 {
138 data => $data,
139 headers => {
140 'Content-Type' => 'application/json',
141 'Idempotency-Key' => $options->{idempotency_key},
142 }
143 }
144 1 );
145 return Twilio::Rest::Conversations::V2::CreateConfiguration202ResponseInstance->new(
146 1 $self->{version}, $response->get_content);
147 }
148  
149 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
150 1 my ($self, $body, $options) = @_;
151 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
152  
153 1 my $data = Twilio::Serialize::json_body($body, { 'memoryExtractionEnabled' => 'boolean' });
154  
155 my $response = $self->{version}->handle_request(
156 'PUT',
157 $self->{uri},
158 'update',
159 {
160 data => $data,
161 headers => {
162 'Content-Type' => 'application/json',
163 'Idempotency-Key' => $options->{idempotency_key},
164 }
165 }
166 1 );
167 return Twilio::Rest::Conversations::V2::CreateConfiguration202ResponseInstance->new(
168 1 $self->{version}, $response->get_content);
169 }
170  
171 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
172 1 my ($self, $response) = @_;
173 return Twilio::Rest::Conversations::V2::ConfigurationInstance->new($self->{version},
174 1 $response->get_content, $self->{solution}{id});
175 }
176  
177 package Twilio::Rest::Conversations::V2::ConfigurationInstance;
178  
179 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
180  
181 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
182  
183 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
184 2 my ($class, $version, $payload, $id) = @_;
185 2 my $self = $class->SUPER::new($version, $payload);
186 2 ▶ $self->{solution} = { id => $id // $self->{properties}{id} };
Condition66%2/3
$id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$id // $self->{"properties"}{"id"}
$id $self->{"properties"}{"id"}
Truth table66%2/3
A // B
A= $idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
187 2 return $self;
188 }
189  
190 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
191 0 my ($self, @arguments) = @_;
192 0 return $self->_context->delete(@arguments);
193 }
194  
195 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
196 0 my ($self, @arguments) = @_;
197 0 return $self->_context->fetch(@arguments);
198 }
199  
200 0 ▶sub patch {
Subroutine patch: not called CC=1 SCAR=6.9
201 0 my ($self, @arguments) = @_;
202 0 return $self->_context->patch(@arguments);
203 }
204  
205 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
206 0 my ($self, @arguments) = @_;
207 0 return $self->_context->update(@arguments);
208 }
209  
210 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
211 0 my ($self) = @_;
212 return Twilio::Rest::Conversations::V2::ConfigurationContext->new($self->{version},
213 0 $self->{solution}{id});
214 }
215  
216 2 ▶sub channel_settings { return $_[0]{properties}{channelSettings} }
Subroutine channel_settings: called CC=1 SCAR=0.0
217 2 ▶sub conversation_grouping_type { return $_[0]{properties}{conversationGroupingType} }
Subroutine conversation_grouping_type: called CC=1 SCAR=0.0
218 2 ▶sub conversations_v1_bridge { return $_[0]{properties}{conversationsV1Bridge} }
Subroutine conversations_v1_bridge: called CC=1 SCAR=0.0
219 2 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
220 2 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
221 2 ▶sub display_name { return $_[0]{properties}{displayName} }
Subroutine display_name: called CC=1 SCAR=0.0
222 2 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
223 2 ▶sub intelligence_configuration_ids { return $_[0]{properties}{intelligenceConfigurationIds} }
Subroutine intelligence_configuration_ids: called CC=1 SCAR=0.0
224 2 ▶sub memory_extraction_enabled { return $_[0]{properties}{memoryExtractionEnabled} }
Subroutine memory_extraction_enabled: called CC=1 SCAR=0.0
225 2 ▶sub memory_store_id { return $_[0]{properties}{memoryStoreId} }
Subroutine memory_store_id: called CC=1 SCAR=0.0
226  
227 2 ▶sub observation_extraction_strategy_ids {
Subroutine observation_extraction_strategy_ids: called CC=1 SCAR=0.0
228 2 return $_[0]{properties}{observationExtractionStrategyIds};
229 }
230 2 ▶sub redaction_configuration_id { return $_[0]{properties}{redactionConfigurationId} }
Subroutine redaction_configuration_id: called CC=1 SCAR=0.0
231 2 ▶sub status_callbacks { return $_[0]{properties}{statusCallbacks} }
Subroutine status_callbacks: called CC=1 SCAR=0.0
232 2 ▶sub trait_extraction_strategy_ids { return $_[0]{properties}{traitExtractionStrategyIds} }
Subroutine trait_extraction_strategy_ids: called CC=1 SCAR=0.0
233 2 ▶sub updated_at { return Twilio::Deserialize::date_time($_[0]{properties}{updatedAt}) }
Subroutine updated_at: called CC=1 SCAR=0.0
234 2 ▶sub version { return $_[0]{properties}{version} }
Subroutine version: called CC=1 SCAR=0.0
235  
236 package Twilio::Rest::Conversations::V2::CreateConfiguration202ResponseInstance;
237  
238 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
239  
240 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
241  
242 4 ▶sub related { return $_[0]{properties}{related} }
Subroutine related: called CC=1 SCAR=0.0
243 4 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
244  
245 2 1;
246  
247 __END__
« Twilio/Rest/Api/V2010/Account/Sip/Domain.pm ↑ Summary Twilio/Rest/Chat/V1/Service.pm »