Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluations.pm

filter: Statementstmt 86.5% 71 / 82 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 84.8% 28 / 33 Podpod n/a totaltotal 82.9% 102 / 123 CC 3 SCAR 2.3
CC
3
Cov
85%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/Evaluation.pm ↑ Summary Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluations.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluations;
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::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsList;
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, $customer_profile_sid) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { customer_profile_sid => $customer_profile_sid };
19 3 $self->{uri} = join q{}, '/CustomerProfiles/',
20 Twilio::Serialize::path_segment($customer_profile_sid), '/Evaluations';
21 3 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
25 1 my ($self, $policy_sid) = @_;
26  
27 1 my $data = { PolicySid => $policy_sid, };
28  
29 my $response =
30 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
31 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsInstance->new(
32 1 $self->{version}, $response->get_content, $self->{solution}{customer_profile_sid});
33 }
34  
35 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
36 0 my ($self, @arguments) = @_;
37 0 return $self->read_records(@arguments);
38 }
39  
40 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
41 0 my ($self, @arguments) = @_;
42 0 return $self->stream_records(@arguments);
43 }
44  
45 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
46 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
47 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
48  
49 1 my $params = {
50 PageToken => $page_token,
51 Page => $page_number,
52 PageSize => $page_size,
53 };
54  
55 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
56 1 return $self->_build_page($response);
57 }
58  
59 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
60 0 my ($self, $target_url) = @_;
61 0 my $client = $self->{version}->get_domain->get_client;
62 0 return $self->_build_page($client->request('GET', $target_url));
63 }
64  
65 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
66 1 my ($self, $response) = @_;
67 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsPage->new(
68 1 $self->{version}, $response, $self->{solution});
69 }
70  
71 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
72 1 my ($self, $sid) = @_;
73 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsContext->new(
74 1 $self->{version}, $self->{solution}{customer_profile_sid}, $sid);
75 }
76  
77 package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsPage;
78  
79 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 1 ▶sub records_key { return 'results' }
Subroutine records_key: called CC=1 SCAR=0.0
82  
83 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
84 1 my ($self, $payload) = @_;
85 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsInstance->new(
86 1 $self->{version}, $payload, $self->{solution}{customer_profile_sid});
87 }
88  
89 package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsContext;
90  
91 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
92  
93 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
94  
95 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
96 1 my ($class, $version, $customer_profile_sid, $sid) = @_;
97 1 my $self = $class->SUPER::new($version);
98 1 $self->{solution} = { customer_profile_sid => $customer_profile_sid, sid => $sid };
99 1 $self->{uri} = join q{}, '/CustomerProfiles/',
100 Twilio::Serialize::path_segment($customer_profile_sid), '/Evaluations/',
101 Twilio::Serialize::path_segment($sid);
102 1 return $self;
103 }
104  
105 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
106 1 my ($self) = @_;
107  
108 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
109 1 return $self->_build_instance($response);
110 }
111  
112 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
113 1 my ($self, $response) = @_;
114 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsInstance->new(
115 $self->{version}, $response->get_content,
116 $self->{solution}{customer_profile_sid},
117 $self->{solution}{sid}
118 1 );
119 }
120  
121 package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsInstance;
122  
123 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
124  
125 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
126  
127 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
128 3 my ($class, $version, $payload, $customer_profile_sid, $sid) = @_;
129 3 my $self = $class->SUPER::new($version, $payload);
130 $self->{solution} =
131 3 ▶ { customer_profile_sid => $customer_profile_sid, sid => $sid // $self->{properties}{sid} };
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
132 3 return $self;
133 }
134  
135 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
136 0 my ($self, @arguments) = @_;
137 0 return $self->_context->fetch(@arguments);
138 }
139  
140 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
141 0 my ($self) = @_;
142 return Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesEvaluationsContext->new(
143 $self->{version},
144 $self->{solution}{customer_profile_sid},
145 $self->{solution}{sid}
146 0 );
147 }
148  
149 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
150 3 ▶sub customer_profile_sid { return $_[0]{properties}{customer_profile_sid} }
Subroutine customer_profile_sid: called CC=1 SCAR=0.0
151 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
152 3 ▶sub policy_sid { return $_[0]{properties}{policy_sid} }
Subroutine policy_sid: called CC=1 SCAR=0.0
153 3 ▶sub results { return $_[0]{properties}{results} }
Subroutine results: called CC=1 SCAR=0.0
154 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
155 3 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
156 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
157  
158 2 1;
159  
160 __END__
« Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/Evaluation.pm ↑ Summary Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluations.pm »