Twilio/Rest/Webhooks/V1/AuthProfile.pm

filter: Statementstmt 84.8% 84 / 99 Branchbran n/a Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 83.3% 35 / 42 Podpod n/a totaltotal 80.9% 123 / 152 CC 4 SCAR 2.5
CC
4
Cov
83%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignments.pm ↑ Summary Twilio/Rest/PreviewIam/Versionless/Organization/RoleAssignment.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Webhooks::V1::AuthProfile;
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::Webhooks::V1::AuthProfileList;
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 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} = '/Webhooks/AuthProfiles';
20 5 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, {});
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::Webhooks::V1::AuthProfileInstance->new($self->{version},
42 1 $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
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
58  
59 1 my $params = {
60 pageSize => $page_size,
61 pageToken => $page_token,
62 };
63  
64 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
65 1 return $self->_build_page($response);
66 }
67  
68 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
69 0 my ($self, $target_url) = @_;
70 0 my $client = $self->{version}->get_domain->get_client;
71 0 return $self->_build_page($client->request('GET', $target_url));
72 }
73  
74 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
75 1 my ($self, $response) = @_;
76 return Twilio::Rest::Webhooks::V1::AuthProfilePage->new($self->{version}, $response,
77 1 $self->{solution});
78 }
79  
80 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
81 3 my ($self, $auth_profile_id) = @_;
82 3 return Twilio::Rest::Webhooks::V1::AuthProfileContext->new($self->{version}, $auth_profile_id);
83 }
84  
85 package Twilio::Rest::Webhooks::V1::AuthProfilePage;
86  
87 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 1 ▶sub records_key { return 'authProfiles' }
Subroutine records_key: called CC=1 SCAR=0.0
90  
91 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
92 1 my ($self, $payload) = @_;
93 1 return Twilio::Rest::Webhooks::V1::AuthProfileInstance->new($self->{version}, $payload);
94 }
95  
96 package Twilio::Rest::Webhooks::V1::AuthProfileContext;
97  
98 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
99  
100 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
103 3 my ($class, $version, $auth_profile_id) = @_;
104 3 my $self = $class->SUPER::new($version);
105 3 $self->{solution} = { auth_profile_id => $auth_profile_id };
106 3 $self->{uri} = join q{}, '/Webhooks/AuthProfiles/',
107 Twilio::Serialize::path_segment($auth_profile_id);
108 3 return $self;
109 }
110  
111 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
112 1 my ($self) = @_;
113 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
114 1 return 1;
115 }
116  
117 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
118 1 my ($self) = @_;
119  
120 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
121 1 return $self->_build_instance($response);
122 }
123  
124 1 ▶sub patch {
Subroutine patch: called CC=1 SCAR=0.0
125 1 my ($self, $body) = @_;
126  
127 1 my $data = Twilio::Serialize::json_body($body, {});
128  
129 my $response = $self->{version}->handle_request(
130 'PATCH',
131 $self->{uri},
132 1 'patch',
133 {
134 data => $data,
135 headers => { 'Content-Type' => 'application/json', }
136 }
137 );
138 1 return $self->_build_instance($response);
139 }
140  
141 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
142 2 my ($self, $response) = @_;
143 return Twilio::Rest::Webhooks::V1::AuthProfileInstance->new($self->{version},
144 2 $response->get_content, $self->{solution}{auth_profile_id});
145 }
146  
147 package Twilio::Rest::Webhooks::V1::AuthProfileInstance;
148  
149 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
150  
151 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
152  
153 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
154 4 my ($class, $version, $payload, $auth_profile_id) = @_;
155 4 my $self = $class->SUPER::new($version, $payload);
156 4 ▶ $self->{solution} = { auth_profile_id => $auth_profile_id // $self->{properties}{id} };
Condition66%2/3
$auth_profile_id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$auth_profile_id // $self->{"properties"}{"id"}
$auth_profile_id $self->{"properties"}{"id"}
Truth table66%2/3
A // B
A= $auth_profile_idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
157 4 return $self;
158 }
159  
160 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
161 0 my ($self, @arguments) = @_;
162 0 return $self->_context->delete(@arguments);
163 }
164  
165 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
166 0 my ($self, @arguments) = @_;
167 0 return $self->_context->fetch(@arguments);
168 }
169  
170 0 ▶sub patch {
Subroutine patch: not called CC=1 SCAR=6.9
171 0 my ($self, @arguments) = @_;
172 0 return $self->_context->patch(@arguments);
173 }
174  
175 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
176 0 my ($self) = @_;
177 return Twilio::Rest::Webhooks::V1::AuthProfileContext->new($self->{version},
178 0 $self->{solution}{auth_profile_id});
179 }
180  
181 3 ▶sub audience { return $_[0]{properties}{audience} }
Subroutine audience: called CC=1 SCAR=0.0
182 3 ▶sub client_credentials_auth_method { return $_[0]{properties}{clientCredentialsAuthMethod} }
Subroutine client_credentials_auth_method: called CC=1 SCAR=0.0
183 3 ▶sub client_id { return $_[0]{properties}{clientId} }
Subroutine client_id: called CC=1 SCAR=0.0
184 3 ▶sub client_secret { return $_[0]{properties}{clientSecret} }
Subroutine client_secret: called CC=1 SCAR=0.0
185 4 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
186 4 ▶sub friendly_name { return $_[0]{properties}{friendlyName} }
Subroutine friendly_name: called CC=1 SCAR=0.0
187 4 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
188 3 ▶sub password { return $_[0]{properties}{password} }
Subroutine password: called CC=1 SCAR=0.0
189 3 ▶sub scope { return $_[0]{properties}{scope} }
Subroutine scope: called CC=1 SCAR=0.0
190 3 ▶sub token_url { return $_[0]{properties}{tokenUrl} }
Subroutine token_url: called CC=1 SCAR=0.0
191 4 ▶sub type { return $_[0]{properties}{type} }
Subroutine type: called CC=1 SCAR=0.0
192 4 ▶sub updated_at { return Twilio::Deserialize::date_time($_[0]{properties}{updatedAt}) }
Subroutine updated_at: called CC=1 SCAR=0.0
193 3 ▶sub username { return $_[0]{properties}{username} }
Subroutine username: called CC=1 SCAR=0.0
194  
195 2 1;
196  
197 __END__
« Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignments.pm ↑ Summary Twilio/Rest/PreviewIam/Versionless/Organization/RoleAssignment.pm »