Twilio/Rest/FlexApi/V1/Assessments.pm

filter: Statementstmt 87.9% 80 / 91 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 87.1% 34 / 39 Podpod n/a totaltotal 82.6% 119 / 144 CC 5 SCAR 2.7
CC
5
Cov
85%
create
2.0
page
2.0
update
2.0
CRAP 1.3
« Twilio/Rest/Iam/V1/ApiKey.pm ↑ Summary Twilio/Rest/PreviewIam/Versionless/Organization/User.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::FlexApi::V1::Assessments;
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::FlexApi::V1::AssessmentsList;
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) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = {};
19 3 $self->{uri} = '/Insights/QualityManagement/Assessments';
20 3 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 my (
25 1 $self, $category_sid, $category_name, $segment_id,
26 $agent_id, $offset, $metric_id, $metric_name,
27 $answer_text, $answer_id, $questionnaire_sid, $options
28 ) = @_;
29 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
30  
31 1 my $data = {
32 CategorySid => $category_sid,
33 CategoryName => $category_name,
34 SegmentId => $segment_id,
35 AgentId => $agent_id,
36 Offset => $offset,
37 MetricId => $metric_id,
38 MetricName => $metric_name,
39 AnswerText => $answer_text,
40 AnswerId => $answer_id,
41 QuestionnaireSid => $questionnaire_sid,
42 };
43  
44 my $response = $self->{version}->handle_request(
45 'POST',
46 $self->{uri},
47 'create',
48 {
49 data => $data,
50 headers => { Authorization => $options->{authorization}, }
51 }
52 1 );
53 return Twilio::Rest::FlexApi::V1::AssessmentsInstance->new($self->{version},
54 1 $response->get_content);
55 }
56  
57 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
58 0 my ($self, @arguments) = @_;
59 0 return $self->read_records(@arguments);
60 }
61  
62 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
63 0 my ($self, @arguments) = @_;
64 0 return $self->stream_records(@arguments);
65 }
66  
67 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
68 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
69 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
70  
71 my $params = {
72 SegmentId => $options->{segment_id},
73 1 PageToken => $page_token,
74 Page => $page_number,
75 PageSize => $page_size,
76 };
77  
78 my $response = $self->{version}->page(
79 'GET',
80 $self->{uri},
81 {
82 params => $params,
83 headers => { Authorization => $options->{authorization}, }
84 }
85 1 );
86 1 return $self->_build_page($response);
87 }
88  
89 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
90 0 my ($self, $target_url) = @_;
91 0 my $client = $self->{version}->get_domain->get_client;
92 0 return $self->_build_page($client->request('GET', $target_url));
93 }
94  
95 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
96 1 my ($self, $response) = @_;
97 return Twilio::Rest::FlexApi::V1::AssessmentsPage->new($self->{version}, $response,
98 1 $self->{solution});
99 }
100  
101 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
102 1 my ($self, $assessment_sid) = @_;
103 1 return Twilio::Rest::FlexApi::V1::AssessmentsContext->new($self->{version}, $assessment_sid);
104 }
105  
106 package Twilio::Rest::FlexApi::V1::AssessmentsPage;
107  
108 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
109  
110 1 ▶sub records_key { return 'assessments' }
Subroutine records_key: called CC=1 SCAR=0.0
111  
112 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
113 1 my ($self, $payload) = @_;
114 1 return Twilio::Rest::FlexApi::V1::AssessmentsInstance->new($self->{version}, $payload);
115 }
116  
117 package Twilio::Rest::FlexApi::V1::AssessmentsContext;
118  
119 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
120  
121 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
122  
123 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
124 1 my ($class, $version, $assessment_sid) = @_;
125 1 my $self = $class->SUPER::new($version);
126 1 $self->{solution} = { assessment_sid => $assessment_sid };
127 1 $self->{uri} = join q{}, '/Insights/QualityManagement/Assessments/',
128 Twilio::Serialize::path_segment($assessment_sid);
129 1 return $self;
130 }
131  
132 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
133 1 my ($self, $offset, $answer_text, $answer_id, $options) = @_;
134 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
135  
136 1 my $data = {
137 Offset => $offset,
138 AnswerText => $answer_text,
139 AnswerId => $answer_id,
140 };
141  
142 my $response = $self->{version}->handle_request(
143 'POST',
144 $self->{uri},
145 'update',
146 {
147 data => $data,
148 headers => { Authorization => $options->{authorization}, }
149 }
150 1 );
151 1 return $self->_build_instance($response);
152 }
153  
154 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
155 1 my ($self, $response) = @_;
156 return Twilio::Rest::FlexApi::V1::AssessmentsInstance->new($self->{version},
157 1 $response->get_content, $self->{solution}{assessment_sid});
158 }
159  
160 package Twilio::Rest::FlexApi::V1::AssessmentsInstance;
161  
162 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
163  
164 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
165  
166 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
167 3 my ($class, $version, $payload, $assessment_sid) = @_;
168 3 my $self = $class->SUPER::new($version, $payload);
169 3 ▶ $self->{solution} = { assessment_sid => $assessment_sid // $self->{properties}{assessment_sid} };
Condition66%2/3
$assessment_sid // $self->{"properties"}{"assessment_sid"}
l!l&&r!l&&!r
120
MC/DC0%0/2
$assessment_sid // $self->{"properties"}{"assessment_sid"}
$assessment_sid $self->{"properties"}{"assessment_sid"}
Truth table66%2/3
A // B
A= $assessment_sidB= $self->{"properties"}{"assessment_sid"}
ABresult
1X1
011
000
170 3 return $self;
171 }
172  
173 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
174 0 my ($self, @arguments) = @_;
175 0 return $self->_context->update(@arguments);
176 }
177  
178 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
179 0 my ($self) = @_;
180 return Twilio::Rest::FlexApi::V1::AssessmentsContext->new($self->{version},
181 0 $self->{solution}{assessment_sid});
182 }
183  
184 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
185 3 ▶sub agent_id { return $_[0]{properties}{agent_id} }
Subroutine agent_id: called CC=1 SCAR=0.0
186 3 ▶sub answer_id { return $_[0]{properties}{answer_id} }
Subroutine answer_id: called CC=1 SCAR=0.0
187 3 ▶sub answer_text { return $_[0]{properties}{answer_text} }
Subroutine answer_text: called CC=1 SCAR=0.0
188 3 ▶sub assessment { return $_[0]{properties}{assessment} }
Subroutine assessment: called CC=1 SCAR=0.0
189 3 ▶sub assessment_sid { return $_[0]{properties}{assessment_sid} }
Subroutine assessment_sid: called CC=1 SCAR=0.0
190 3 ▶sub offset { return $_[0]{properties}{offset} }
Subroutine offset: called CC=1 SCAR=0.0
191 3 ▶sub report { return $_[0]{properties}{report} }
Subroutine report: called CC=1 SCAR=0.0
192 3 ▶sub segment_id { return $_[0]{properties}{segment_id} }
Subroutine segment_id: called CC=1 SCAR=0.0
193 3 ▶sub timestamp { return $_[0]{properties}{timestamp} }
Subroutine timestamp: called CC=1 SCAR=0.0
194 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
195 3 ▶sub user_email { return $_[0]{properties}{user_email} }
Subroutine user_email: called CC=1 SCAR=0.0
196 3 ▶sub user_name { return $_[0]{properties}{user_name} }
Subroutine user_name: called CC=1 SCAR=0.0
197 3 ▶sub weight { return $_[0]{properties}{weight} }
Subroutine weight: called CC=1 SCAR=0.0
198  
199 2 1;
200  
201 __END__
« Twilio/Rest/Iam/V1/ApiKey.pm ↑ Summary Twilio/Rest/PreviewIam/Versionless/Organization/User.pm »