Twilio/Rest/Memory/V1/TraitGroup.pm

filter: Statementstmt 92.5% 112 / 121 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 20.0% 1 / 5 Subroutinesub 91.6% 44 / 48 Podpod n/a totaltotal 88.5% 162 / 183 CC 5 SCAR 2.1
CC
5
Cov
90%
new
2.1
fetch
2.0
patch
2.0
CRAP 1.2
« Twilio/Rest/Api/V2010/Account/Call/Transcription.pm ↑ Summary Twilio/Rest/Video/V1/Room/RoomRecording.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Memory::V1::TraitGroup;
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::Memory::V1::TraitGroupList;
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 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 6 my ($class, $version, $store_id) = @_;
17 6 my $self = $class->SUPER::new($version);
18 6 $self->{solution} = { store_id => $store_id };
19 6 $self->{uri} = join q{}, '/ControlPlane/Stores/', Twilio::Serialize::path_segment($store_id),
20 '/TraitGroups';
21 6 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
25 1 my ($self, $body) = @_;
26  
27 1 my $data = Twilio::Serialize::json_body($body, {});
28  
29 my $response = $self->{version}->handle_request(
30 'POST',
31 $self->{uri},
32 1 'create',
33 {
34 data => $data,
35 headers => { 'Content-Type' => 'application/json', }
36 }
37 );
38 return Twilio::Rest::Memory::V1::CreateTraitGroup202ResponseInstance->new($self->{version},
39 1 $response->get_content);
40 }
41  
42 1 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
43 1 my ($self, @arguments) = @_;
44 1 return $self->read_records(@arguments);
45 }
46  
47 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
48 0 my ($self, @arguments) = @_;
49 0 return $self->stream_records(@arguments);
50 }
51  
52 2 ▶sub page {
Subroutine page: called CC=2 SCAR=6.9
53 2 my ($self, $options, $page_size, $page_token) = @_;
54 2 ▶ $options //= {};
Condition100%2/2
$options //= {}
l!l
11
MC/DC100%1/1
$options //= {}
$options
Truth table100%2/2
A
A= $options
Aresult
11
00
55  
56 my $params = {
57 includeTraits => Twilio::Serialize::boolean_to_string($options->{include_traits}),
58 orderBy => $options->{order_by},
59 2 pageSize => $page_size,
60 pageToken => $page_token,
61 };
62  
63 2 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
64 2 return $self->_build_page($response);
65 }
66  
67 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
68 0 my ($self, $target_url) = @_;
69 0 my $client = $self->{version}->get_domain->get_client;
70 0 return $self->_build_page($client->request('GET', $target_url));
71 }
72  
73 2 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
74 2 my ($self, $response) = @_;
75 return Twilio::Rest::Memory::V1::TraitGroupPage->new($self->{version}, $response,
76 2 $self->{solution});
77 }
78  
79 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
80 3 my ($self, $trait_group_name) = @_;
81 return Twilio::Rest::Memory::V1::TraitGroupContext->new($self->{version},
82 $self->{solution}{store_id},
83 3 $trait_group_name);
84 }
85  
86 package Twilio::Rest::Memory::V1::TraitGroupPage;
87  
88 3 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
89  
90 2 ▶sub records_key { return 'traitGroups' }
Subroutine records_key: called CC=1 SCAR=0.0
91  
92 2 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
93 2 my ($self, $payload) = @_;
94 return Twilio::Rest::Memory::V1::TraitGroupInstance->new($self->{version}, $payload,
95 2 $self->{solution}{store_id});
96 }
97  
98 package Twilio::Rest::Memory::V1::TraitGroupContext;
99  
100 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
105 4 my ($class, $version, $store_id, $trait_group_name) = @_;
106 4 my $self = $class->SUPER::new($version);
107 4 $self->{solution} = { store_id => $store_id, trait_group_name => $trait_group_name };
108 4 $self->{uri} = join q{}, '/ControlPlane/Stores/', Twilio::Serialize::path_segment($store_id),
109 '/TraitGroups/', Twilio::Serialize::path_segment($trait_group_name);
110 4 return $self;
111 }
112  
113 2 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
114 2 my ($self) = @_;
115 2 my $response = $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
116 return Twilio::Rest::Memory::V1::DeleteTraitGroup202ResponseInstance->new($self->{version},
117 2 $response->get_content);
118 }
119  
120 1 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=7.0
121 1 my ($self, $options) = @_;
122 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
123  
124 my $response = $self->{version}->handle_request(
125 'GET',
126 $self->{uri},
127 'fetch',
128 {
129 params => {
130 includeTraits => Twilio::Serialize::boolean_to_string($options->{include_traits}),
131 orderBy => $options->{order_by},
132 pageSize => $options->{page_size},
133 pageToken => $options->{page_token},
134 }
135 }
136 1 );
137 return Twilio::Rest::Memory::V1::FetchTraitGroup200ResponseInstance->new($self->{version},
138 1 $response->get_content);
139 }
140  
141 1 ▶sub patch {
Subroutine patch: called CC=2 SCAR=7.0
142 1 my ($self, $body, $options) = @_;
143 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
144  
145 1 my $data = Twilio::Serialize::json_body($body, {});
146  
147 my $response = $self->{version}->handle_request(
148 'PATCH',
149 $self->{uri},
150 'patch',
151 {
152 data => $data,
153 headers => {
154 'Content-Type' => 'application/json',
155 'If-Match' => $options->{if_match},
156 }
157 }
158 1 );
159 return Twilio::Rest::Memory::V1::PatchTraitGroup202ResponseInstance->new($self->{version},
160 1 $response->get_content);
161 }
162  
163 package Twilio::Rest::Memory::V1::TraitGroupInstance;
164  
165 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
166  
167 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
168  
169 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
170 2 my ($class, $version, $payload, $store_id, $trait_group_name) = @_;
171 2 my $self = $class->SUPER::new($version, $payload);
172 $self->{solution} = {
173 store_id => $store_id,
174 trait_group_name => $trait_group_name // $self->{properties}{displayName}
175 2 ▶ };
Condition33%1/3
$trait_group_name // $self->{"properties"}{"displayName"}
l!l&&r!l&&!r
020
MC/DC0%0/2
$trait_group_name // $self->{"properties"}{"displayName"}
$trait_group_name $self->{"properties"}{"displayName"}
Truth table33%1/3
A // B
A= $trait_group_nameB= $self->{"properties"}{"displayName"}
ABresult
1X1
011
000
176 2 return $self;
177 }
178  
179 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
180 1 my ($self, @arguments) = @_;
181 1 return $self->_context->delete(@arguments);
182 }
183  
184 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
185 0 my ($self, @arguments) = @_;
186 0 return $self->_context->fetch(@arguments);
187 }
188  
189 0 ▶sub patch {
Subroutine patch: not called CC=1 SCAR=6.9
190 0 my ($self, @arguments) = @_;
191 0 return $self->_context->patch(@arguments);
192 }
193  
194 1 ▶sub _context {
Subroutine _context: called CC=1 SCAR=0.0
195 1 my ($self) = @_;
196 return Twilio::Rest::Memory::V1::TraitGroupContext->new(
197 $self->{version},
198 $self->{solution}{store_id},
199 $self->{solution}{trait_group_name}
200 1 );
201 }
202  
203 1 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
204 1 ▶sub display_name { return $_[0]{properties}{displayName} }
Subroutine display_name: called CC=1 SCAR=0.0
205 1 ▶sub traits { return $_[0]{properties}{traits} }
Subroutine traits: called CC=1 SCAR=0.0
206 1 ▶sub version { return $_[0]{properties}{version} }
Subroutine version: called CC=1 SCAR=0.0
207  
208 package Twilio::Rest::Memory::V1::CreateTraitGroup202ResponseInstance;
209  
210 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
211  
212 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
213  
214 1 ▶sub message { return $_[0]{properties}{message} }
Subroutine message: called CC=1 SCAR=0.0
215 1 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
216  
217 package Twilio::Rest::Memory::V1::FetchTraitGroup200ResponseInstance;
218  
219 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
220  
221 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
222  
223 1 ▶sub meta { return $_[0]{properties}{meta} }
Subroutine meta: called CC=1 SCAR=0.0
224 1 ▶sub trait_group { return $_[0]{properties}{traitGroup} }
Subroutine trait_group: called CC=1 SCAR=0.0
225  
226 package Twilio::Rest::Memory::V1::PatchTraitGroup202ResponseInstance;
227  
228 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
229  
230 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
231  
232 1 ▶sub message { return $_[0]{properties}{message} }
Subroutine message: called CC=1 SCAR=0.0
233 1 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
234  
235 package Twilio::Rest::Memory::V1::DeleteTraitGroup202ResponseInstance;
236  
237 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
238  
239 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
240  
241 1 ▶sub message { return $_[0]{properties}{message} }
Subroutine message: called CC=1 SCAR=0.0
242 1 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
243  
244 3 1;
245  
246 __END__
« Twilio/Rest/Api/V2010/Account/Call/Transcription.pm ↑ Summary Twilio/Rest/Video/V1/Room/RoomRecording.pm »