Twilio/Rest/Insights/V3/CustomFieldMapping.pm

filter: Statementstmt 87.5% 77 / 88 Branchbran n/a Conditioncond 71.4% 5 / 7 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 85.2% 29 / 34 Podpod n/a totaltotal 84.2% 112 / 133 CC 4 SCAR 2.6
CC
4
Cov
86%
patch
2.0
new
2.0
stream
2.0
CRAP 1.3
« Twilio/Rest/Voice/V1/DialingPermissions/Settings.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Recording.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Insights::V3::CustomFieldMapping;
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::Insights::V3::CustomFieldMappingList;
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 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 5 my ($class, $version) = @_;
17 5 my $self = $class->SUPER::new($version);
18 5 $self->{solution} = {};
19 5 $self->{uri} = '/ControlPlane/ConversationInsights/CustomFieldMappings';
20 5 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
24 1 my ($self, $body) = @_;
25  
26 1 my $data = Twilio::Serialize::json_body($body, {});
27  
28 my $response = $self->{version}->handle_request(
29 'POST',
30 $self->{uri},
31 1 'create',
32 {
33 data => $data,
34 headers => { 'Content-Type' => 'application/json', }
35 }
36 );
37 return Twilio::Rest::Insights::V3::CustomFieldMappingInstance->new($self->{version},
38 1 $response->get_content);
39 }
40  
41 1 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
42 1 my ($self, @arguments) = @_;
43 1 return $self->read_records(@arguments);
44 }
45  
46 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
47 0 my ($self, @arguments) = @_;
48 0 return $self->stream_records(@arguments);
49 }
50  
51 2 ▶sub page {
Subroutine page: called CC=2 SCAR=6.9
52 2 my ($self, $options, $page_size, $page_token) = @_;
53 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
54  
55 2 my $params = {
56 pageSize => $page_size,
57 pageToken => $page_token,
58 };
59  
60 2 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
61 2 return $self->_build_page($response);
62 }
63  
64 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
65 0 my ($self, $target_url) = @_;
66 0 my $client = $self->{version}->get_domain->get_client;
67 0 return $self->_build_page($client->request('GET', $target_url));
68 }
69  
70 2 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
71 2 my ($self, $response) = @_;
72 return Twilio::Rest::Insights::V3::CustomFieldMappingPage->new($self->{version}, $response,
73 2 $self->{solution});
74 }
75  
76 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
77 2 my ($self, $mapping_id) = @_;
78 2 return Twilio::Rest::Insights::V3::CustomFieldMappingContext->new($self->{version}, $mapping_id);
79 }
80  
81 package Twilio::Rest::Insights::V3::CustomFieldMappingPage;
82  
83 3 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 3 ▶sub records_key { return 'items' }
Subroutine records_key: called CC=1 SCAR=0.0
86  
87 3 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
88 3 my ($self, $payload) = @_;
89 3 return Twilio::Rest::Insights::V3::CustomFieldMappingInstance->new($self->{version}, $payload);
90 }
91  
92 package Twilio::Rest::Insights::V3::CustomFieldMappingContext;
93  
94 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
95  
96 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
97  
98 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
99 2 my ($class, $version, $mapping_id) = @_;
100 2 my $self = $class->SUPER::new($version);
101 2 $self->{solution} = { mapping_id => $mapping_id };
102 2 $self->{uri} = join q{}, '/ControlPlane/ConversationInsights/CustomFieldMappings/',
103 Twilio::Serialize::path_segment($mapping_id);
104 2 return $self;
105 }
106  
107 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
108 1 my ($self) = @_;
109  
110 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
111 1 return $self->_build_instance($response);
112 }
113  
114 1 ▶sub patch {
Subroutine patch: called CC=2 SCAR=7.0
115 1 my ($self, $body, $options) = @_;
116 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
117  
118 1 my $data = Twilio::Serialize::json_body($body, {});
119  
120 my $response = $self->{version}->handle_request(
121 'PATCH',
122 $self->{uri},
123 'patch',
124 {
125 data => $data,
126 headers => {
127 'Content-Type' => 'application/json',
128 'If-Match' => $options->{if_match},
129 }
130 }
131 1 );
132 1 return $self->_build_instance($response);
133 }
134  
135 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
136 2 my ($self, $response) = @_;
137 return Twilio::Rest::Insights::V3::CustomFieldMappingInstance->new($self->{version},
138 2 $response->get_content, $self->{solution}{mapping_id});
139 }
140  
141 package Twilio::Rest::Insights::V3::CustomFieldMappingInstance;
142  
143 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
144  
145 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
146  
147 6 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
148 6 my ($class, $version, $payload, $mapping_id) = @_;
149 6 my $self = $class->SUPER::new($version, $payload);
150 6 ▶ $self->{solution} = { mapping_id => $mapping_id // $self->{properties}{id} };
Condition66%2/3
$mapping_id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
240
MC/DC0%0/2
$mapping_id // $self->{"properties"}{"id"}
$mapping_id $self->{"properties"}{"id"}
Truth table66%2/3
A // B
A= $mapping_idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
151 6 return $self;
152 }
153  
154 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
155 0 my ($self, @arguments) = @_;
156 0 return $self->_context->fetch(@arguments);
157 }
158  
159 0 ▶sub patch {
Subroutine patch: not called CC=1 SCAR=6.9
160 0 my ($self, @arguments) = @_;
161 0 return $self->_context->patch(@arguments);
162 }
163  
164 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
165 0 my ($self) = @_;
166 return Twilio::Rest::Insights::V3::CustomFieldMappingContext->new($self->{version},
167 0 $self->{solution}{mapping_id});
168 }
169  
170 4 ▶sub category { return $_[0]{properties}{category} }
Subroutine category: called CC=1 SCAR=0.0
171 4 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
172 4 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
173 4 ▶sub entity_metadata { return $_[0]{properties}{entityMetadata} }
Subroutine entity_metadata: called CC=1 SCAR=0.0
174 6 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
175 4 ▶sub name { return $_[0]{properties}{name} }
Subroutine name: called CC=1 SCAR=0.0
176 4 ▶sub updated_at { return Twilio::Deserialize::date_time($_[0]{properties}{updatedAt}) }
Subroutine updated_at: called CC=1 SCAR=0.0
177  
178 3 1;
179  
180 __END__
« Twilio/Rest/Voice/V1/DialingPermissions/Settings.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Recording.pm »