Twilio/Rest/Pricing/V1/Messaging/Country.pm

filter: Statementstmt 85.5% 65 / 76 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 83.3% 25 / 30 Podpod n/a totaltotal 81.5% 93 / 114 CC 3 SCAR 2.5
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtension.pm ↑ Summary Twilio/Rest/Pricing/V1/Voice/Country.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Pricing::V1::Messaging::Country;
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::Pricing::V1::Messaging::CountryList;
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) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = {};
19 3 $self->{uri} = '/Messaging/Countries';
20 3 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 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
36  
37 1 my $params = {
38 PageToken => $page_token,
39 Page => $page_number,
40 PageSize => $page_size,
41 };
42  
43 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
44 1 return $self->_build_page($response);
45 }
46  
47 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
48 0 my ($self, $target_url) = @_;
49 0 my $client = $self->{version}->get_domain->get_client;
50 0 return $self->_build_page($client->request('GET', $target_url));
51 }
52  
53 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
54 1 my ($self, $response) = @_;
55 return Twilio::Rest::Pricing::V1::Messaging::CountryPage->new($self->{version}, $response,
56 1 $self->{solution});
57 }
58  
59 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
60 2 my ($self, $iso_country) = @_;
61 2 return Twilio::Rest::Pricing::V1::Messaging::CountryContext->new($self->{version}, $iso_country);
62 }
63  
64 package Twilio::Rest::Pricing::V1::Messaging::CountryPage;
65  
66 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
67  
68 1 ▶sub records_key { return 'countries' }
Subroutine records_key: called CC=1 SCAR=0.0
69  
70 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
71 1 my ($self, $payload) = @_;
72 1 return Twilio::Rest::Pricing::V1::Messaging::CountryInstance->new($self->{version}, $payload);
73 }
74  
75 package Twilio::Rest::Pricing::V1::Messaging::CountryContext;
76  
77 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
78  
79 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
82 2 my ($class, $version, $iso_country) = @_;
83 2 my $self = $class->SUPER::new($version);
84 2 $self->{solution} = { iso_country => $iso_country };
85 2 $self->{uri} = join q{}, '/Messaging/Countries/', Twilio::Serialize::path_segment($iso_country);
86 2 return $self;
87 }
88  
89 2 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
90 2 my ($self) = @_;
91  
92 2 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
93 2 return $self->_build_instance($response);
94 }
95  
96 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
97 2 my ($self, $response) = @_;
98 return Twilio::Rest::Pricing::V1::Messaging::CountryInstance->new($self->{version},
99 2 $response->get_content, $self->{solution}{iso_country});
100 }
101  
102 package Twilio::Rest::Pricing::V1::Messaging::CountryInstance;
103  
104 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
105  
106 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
107  
108 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
109 3 my ($class, $version, $payload, $iso_country) = @_;
110 3 my $self = $class->SUPER::new($version, $payload);
111 3 ▶ $self->{solution} = { iso_country => $iso_country // $self->{properties}{iso_country} };
Condition66%2/3
$iso_country // $self->{"properties"}{"iso_country"}
l!l&&r!l&&!r
210
MC/DC0%0/2
$iso_country // $self->{"properties"}{"iso_country"}
$iso_country $self->{"properties"}{"iso_country"}
Truth table66%2/3
A // B
A= $iso_countryB= $self->{"properties"}{"iso_country"}
ABresult
1X1
011
000
112 3 return $self;
113 }
114  
115 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
116 0 my ($self, @arguments) = @_;
117 0 return $self->_context->fetch(@arguments);
118 }
119  
120 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
121 0 my ($self) = @_;
122 return Twilio::Rest::Pricing::V1::Messaging::CountryContext->new($self->{version},
123 0 $self->{solution}{iso_country});
124 }
125  
126 2 ▶sub country { return $_[0]{properties}{country} }
Subroutine country: called CC=1 SCAR=0.0
127 1 ▶sub inbound_sms_prices { return $_[0]{properties}{inbound_sms_prices} }
Subroutine inbound_sms_prices: called CC=1 SCAR=0.0
128 2 ▶sub iso_country { return $_[0]{properties}{iso_country} }
Subroutine iso_country: called CC=1 SCAR=0.0
129 1 ▶sub outbound_sms_prices { return $_[0]{properties}{outbound_sms_prices} }
Subroutine outbound_sms_prices: called CC=1 SCAR=0.0
130 1 ▶sub price_unit { return $_[0]{properties}{price_unit} }
Subroutine price_unit: called CC=1 SCAR=0.0
131 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
132  
133 3 1;
134  
135 __END__
« Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtension.pm ↑ Summary Twilio/Rest/Pricing/V1/Voice/Country.pm »