Twilio/Rest/Verify/V2/Service/Verification.pm

filter: Statementstmt 92.1% 70 / 76 Branchbran n/a Conditioncond 80.0% 4 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 91.1% 31 / 34 Podpod n/a totaltotal 89.8% 106 / 118 CC 3 SCAR 1.8
CC
3
Cov
91%
new
2.0
create
2.0
fetch
2.0
CRAP 1.2
« Twilio/Rest/Chat/V3/Channel.pm ↑ Summary Twilio/Rest/Memory/V1/Store.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Verify::V2::Service::Verification;
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::Verify::V2::Service::VerificationList;
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 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 4 my ($class, $version, $service_sid) = @_;
17 4 my $self = $class->SUPER::new($version);
18 4 $self->{solution} = { service_sid => $service_sid };
19 4 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
20 '/Verifications';
21 4 return $self;
22 }
23  
24 2 ▶sub create {
Subroutine create: called CC=2 SCAR=6.9
25 2 my ($self, $to, $channel, $options) = @_;
26 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
27  
28 my $data = {
29 To => $to,
30 Channel => $channel,
31 Amount => $options->{amount},
32 AppHash => $options->{app_hash},
33 ChannelConfiguration => Twilio::Serialize::json_object($options->{channel_configuration}),
34 CustomCode => $options->{custom_code},
35 CustomFriendlyName => $options->{custom_friendly_name},
36 CustomMessage => $options->{custom_message},
37 DeviceIp => $options->{device_ip},
38 EnableSnaClientToken =>
39 Twilio::Serialize::boolean_to_string($options->{enable_sna_client_token}),
40 Locale => $options->{locale},
41 Payee => $options->{payee},
42 RateLimits => Twilio::Serialize::json_object($options->{rate_limits}),
43 RiskCheck => $options->{risk_check},
44 SendDigits => $options->{send_digits},
45 Tags => $options->{tags},
46 TemplateCustomSubstitutions => $options->{template_custom_substitutions},
47 TemplateSid => $options->{template_sid},
48 Templates => $options->{templates},
49 2 };
50  
51 my $response =
52 2 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
53 return Twilio::Rest::Verify::V2::Service::VerificationInstance->new($self->{version},
54 2 $response->get_content, $self->{solution}{service_sid});
55 }
56  
57 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
58 2 my ($self, $sid) = @_;
59 return Twilio::Rest::Verify::V2::Service::VerificationContext->new($self->{version},
60 2 $self->{solution}{service_sid}, $sid);
61 }
62  
63 package Twilio::Rest::Verify::V2::Service::VerificationContext;
64  
65 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
66  
67 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
70 2 my ($class, $version, $service_sid, $sid) = @_;
71 2 my $self = $class->SUPER::new($version);
72 2 $self->{solution} = { service_sid => $service_sid, sid => $sid };
73 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
74 '/Verifications/', Twilio::Serialize::path_segment($sid);
75 2 return $self;
76 }
77  
78 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
79 1 my ($self) = @_;
80  
81 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
82 1 return $self->_build_instance($response);
83 }
84  
85 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
86 1 my ($self, $status) = @_;
87  
88 1 my $data = { Status => $status, };
89  
90 my $response =
91 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
92 1 return $self->_build_instance($response);
93 }
94  
95 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
96 2 my ($self, $response) = @_;
97 return Twilio::Rest::Verify::V2::Service::VerificationInstance->new(
98 $self->{version}, $response->get_content,
99 $self->{solution}{service_sid}, $self->{solution}{sid}
100 2 );
101 }
102  
103 package Twilio::Rest::Verify::V2::Service::VerificationInstance;
104  
105 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
106  
107 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
108  
109 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
110 4 my ($class, $version, $payload, $service_sid, $sid) = @_;
111 4 my $self = $class->SUPER::new($version, $payload);
112 4 ▶ $self->{solution} = { service_sid => $service_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
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
113 4 return $self;
114 }
115  
116 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
117 0 my ($self, @arguments) = @_;
118 0 return $self->_context->fetch(@arguments);
119 }
120  
121 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
122 0 my ($self, @arguments) = @_;
123 0 return $self->_context->update(@arguments);
124 }
125  
126 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
127 0 my ($self) = @_;
128 return Twilio::Rest::Verify::V2::Service::VerificationContext->new(
129 $self->{version},
130 $self->{solution}{service_sid},
131 $self->{solution}{sid}
132 0 );
133 }
134  
135 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
136 3 ▶sub amount { return $_[0]{properties}{amount} }
Subroutine amount: called CC=1 SCAR=0.0
137 3 ▶sub channel { return $_[0]{properties}{channel} }
Subroutine channel: called CC=1 SCAR=0.0
138 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
139 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
140 3 ▶sub lookup { return $_[0]{properties}{lookup} }
Subroutine lookup: called CC=1 SCAR=0.0
141 3 ▶sub payee { return $_[0]{properties}{payee} }
Subroutine payee: called CC=1 SCAR=0.0
142 3 ▶sub send_code_attempts { return $_[0]{properties}{send_code_attempts} }
Subroutine send_code_attempts: called CC=1 SCAR=0.0
143 3 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
144 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
145 3 ▶sub sna { return $_[0]{properties}{sna} }
Subroutine sna: called CC=1 SCAR=0.0
146 3 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
147 3 ▶sub to { return $_[0]{properties}{to} }
Subroutine to: called CC=1 SCAR=0.0
148 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
149 3 ▶sub valid { return $_[0]{properties}{valid} }
Subroutine valid: called CC=1 SCAR=0.0
150  
151 3 1;
152  
153 __END__
« Twilio/Rest/Chat/V3/Channel.pm ↑ Summary Twilio/Rest/Memory/V1/Store.pm »