Twilio/Rest/Routes/V3/IsoCountryCode.pm

filter: Statementstmt 90.7% 59 / 65 Branchbran n/a Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 88.4% 23 / 26 Podpod n/a totaltotal 84.8% 84 / 99 CC 3 SCAR 2.3
CC
3
Cov
87%
new
2.1
update
2.0
fetch
2.0
CRAP 1.3
« Twilio/Rest/Routes/V2/Trunk.pm ↑ Summary Twilio/Rest/Chat/V2/Service/Binding.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Routes::V3::IsoCountryCode;
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::Routes::V3::IsoCountryCodeList;
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 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version, $iso_country_code) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { iso_country_code => $iso_country_code };
19 3 $self->{uri} = join q{}, '/ShortCodes/', Twilio::Serialize::path_segment($iso_country_code);
20 3 return $self;
21 }
22  
23 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
24 3 my ($self, $short_code) = @_;
25 return Twilio::Rest::Routes::V3::IsoCountryCodeContext->new($self->{version},
26 3 $self->{solution}{iso_country_code}, $short_code);
27 }
28  
29 package Twilio::Rest::Routes::V3::IsoCountryCodeContext;
30  
31 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
36 3 my ($class, $version, $iso_country_code, $short_code) = @_;
37 3 my $self = $class->SUPER::new($version);
38 3 $self->{solution} = { iso_country_code => $iso_country_code, short_code => $short_code };
39 3 $self->{uri} = join q{}, '/ShortCodes/', Twilio::Serialize::path_segment($iso_country_code), '/',
40 Twilio::Serialize::path_segment($short_code);
41 3 return $self;
42 }
43  
44 2 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
45 2 my ($self) = @_;
46  
47 2 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
48 2 return $self->_build_instance($response);
49 }
50  
51 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
52 1 my ($self, $options) = @_;
53 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
54  
55 my $data = {
56 friendlyName => $options->{friendly_name},
57 messagingRegion => $options->{messaging_region},
58 1 };
59  
60 my $response =
61 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
62 1 return $self->_build_instance($response);
63 }
64  
65 3 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
66 3 my ($self, $response) = @_;
67 return Twilio::Rest::Routes::V3::IsoCountryCodeInstance->new(
68 $self->{version}, $response->get_content,
69 $self->{solution}{iso_country_code},
70 $self->{solution}{short_code}
71 3 );
72 }
73  
74 package Twilio::Rest::Routes::V3::IsoCountryCodeInstance;
75  
76 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
77  
78 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
79  
80 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
81 3 my ($class, $version, $payload, $iso_country_code, $short_code) = @_;
82 3 my $self = $class->SUPER::new($version, $payload);
83 $self->{solution} = {
84 iso_country_code => $iso_country_code,
85 short_code => $short_code // $self->{properties}{shortCode}
86 3 ▶ };
Condition33%1/3
$short_code // $self->{"properties"}{"shortCode"}
l!l&&r!l&&!r
300
MC/DC0%0/2
$short_code // $self->{"properties"}{"shortCode"}
$short_code $self->{"properties"}{"shortCode"}
Truth table33%1/3
A // B
A= $short_codeB= $self->{"properties"}{"shortCode"}
ABresult
1X1
011
000
87 3 return $self;
88 }
89  
90 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
91 0 my ($self, @arguments) = @_;
92 0 return $self->_context->fetch(@arguments);
93 }
94  
95 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
96 0 my ($self, @arguments) = @_;
97 0 return $self->_context->update(@arguments);
98 }
99  
100 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
101 0 my ($self) = @_;
102 return Twilio::Rest::Routes::V3::IsoCountryCodeContext->new(
103 $self->{version},
104 $self->{solution}{iso_country_code},
105 $self->{solution}{short_code}
106 0 );
107 }
108  
109 2 ▶sub account_sid { return $_[0]{properties}{accountSid} }
Subroutine account_sid: called CC=1 SCAR=0.0
110 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{dateCreated}) }
Subroutine date_created: called CC=1 SCAR=0.0
111 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{dateUpdated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
112 2 ▶sub friendly_name { return $_[0]{properties}{friendlyName} }
Subroutine friendly_name: called CC=1 SCAR=0.0
113 2 ▶sub iso_country_code { return $_[0]{properties}{isoCountryCode} }
Subroutine iso_country_code: called CC=1 SCAR=0.0
114 2 ▶sub messaging_region { return $_[0]{properties}{messagingRegion} }
Subroutine messaging_region: called CC=1 SCAR=0.0
115 3 ▶sub short_code { return $_[0]{properties}{shortCode} }
Subroutine short_code: called CC=1 SCAR=0.0
116 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
117  
118 3 1;
119  
120 __END__
« Twilio/Rest/Routes/V2/Trunk.pm ↑ Summary Twilio/Rest/Chat/V2/Service/Binding.pm »