Twilio/Rest/Api/V2010/Account/Usage/Record.pm

filter: Statementstmt 94.2% 82 / 87 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 94.8% 37 / 39 Podpod n/a totaltotal 93.0% 120 / 129 CC 2 SCAR 1.0
CC
2
Cov
93%
page
2.0
stream
2.0
get_page
2.0
CRAP 1.1
« Twilio/Rest/Insights/V1/Call/CallSummary.pm ↑ Summary Twilio/Rest/Verify/V2/Service/Entity/Challenge/Notification.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::Usage::Record;
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::Api::V2010::Account::Usage::RecordList;
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 11 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 11 my ($class, $version, $account_sid) = @_;
17 11 my $self = $class->SUPER::new($version);
18 11 $self->{solution} = { account_sid => $account_sid };
19 11 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/Usage/Records.json';
21 11 return $self;
22 }
23  
24 1 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
25 1 my ($self, @arguments) = @_;
26 1 return $self->read_records(@arguments);
27 }
28  
29 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->stream_records(@arguments);
32 }
33  
34 2 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
35 2 my ($self, $options, $page_size, $page_token, $page_number) = @_;
36 2 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
20
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 my $params = {
39 Category => $options->{category},
40 EndDate => Twilio::Serialize::iso8601_date($options->{end_date}),
41 IncludeSubaccounts => Twilio::Serialize::boolean_to_string($options->{include_subaccounts}),
42 2 StartDate => Twilio::Serialize::iso8601_date($options->{start_date}),
43 PageToken => $page_token,
44 Page => $page_number,
45 PageSize => $page_size,
46 };
47  
48 2 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
49 2 return $self->_build_page($response);
50 }
51  
52 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
53 0 my ($self, $target_url) = @_;
54 0 my $client = $self->{version}->get_domain->get_client;
55 0 return $self->_build_page($client->request('GET', $target_url));
56 }
57  
58 2 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
59 2 my ($self, $response) = @_;
60 return Twilio::Rest::Api::V2010::Account::Usage::RecordPage->new($self->{version}, $response,
61 2 $self->{solution});
62 }
63  
64 1 ▶sub all_time {
Subroutine all_time: called CC=1 SCAR=0.0
65 1 my ($self) = @_;
66 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::AllTime;
67 return Twilio::Rest::Api::V2010::Account::Usage::Record::AllTimeList->new($self->{version},
68 1 $self->{solution}{account_sid});
69 }
70  
71 1 ▶sub daily {
Subroutine daily: called CC=1 SCAR=0.0
72 1 my ($self) = @_;
73 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::Daily;
74 return Twilio::Rest::Api::V2010::Account::Usage::Record::DailyList->new($self->{version},
75 1 $self->{solution}{account_sid});
76 }
77  
78 1 ▶sub last_month {
Subroutine last_month: called CC=1 SCAR=0.0
79 1 my ($self) = @_;
80 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::LastMonth;
81 return Twilio::Rest::Api::V2010::Account::Usage::Record::LastMonthList->new($self->{version},
82 1 $self->{solution}{account_sid});
83 }
84  
85 1 ▶sub monthly {
Subroutine monthly: called CC=1 SCAR=0.0
86 1 my ($self) = @_;
87 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::Monthly;
88 return Twilio::Rest::Api::V2010::Account::Usage::Record::MonthlyList->new($self->{version},
89 1 $self->{solution}{account_sid});
90 }
91  
92 2 ▶sub this_month {
Subroutine this_month: called CC=1 SCAR=0.0
93 2 my ($self) = @_;
94 2 require Twilio::Rest::Api::V2010::Account::Usage::Record::ThisMonth;
95 return Twilio::Rest::Api::V2010::Account::Usage::Record::ThisMonthList->new($self->{version},
96 2 $self->{solution}{account_sid});
97 }
98  
99 1 ▶sub today {
Subroutine today: called CC=1 SCAR=0.0
100 1 my ($self) = @_;
101 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::Today;
102 return Twilio::Rest::Api::V2010::Account::Usage::Record::TodayList->new($self->{version},
103 1 $self->{solution}{account_sid});
104 }
105  
106 1 ▶sub yearly {
Subroutine yearly: called CC=1 SCAR=0.0
107 1 my ($self) = @_;
108 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::Yearly;
109 return Twilio::Rest::Api::V2010::Account::Usage::Record::YearlyList->new($self->{version},
110 1 $self->{solution}{account_sid});
111 }
112  
113 1 ▶sub yesterday {
Subroutine yesterday: called CC=1 SCAR=0.0
114 1 my ($self) = @_;
115 1 require Twilio::Rest::Api::V2010::Account::Usage::Record::Yesterday;
116 return Twilio::Rest::Api::V2010::Account::Usage::Record::YesterdayList->new($self->{version},
117 1 $self->{solution}{account_sid});
118 }
119  
120 package Twilio::Rest::Api::V2010::Account::Usage::RecordPage;
121  
122 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
123  
124 2 ▶sub records_key { return 'usage_records' }
Subroutine records_key: called CC=1 SCAR=0.0
125  
126 2 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
127 2 my ($self, $payload) = @_;
128 return Twilio::Rest::Api::V2010::Account::Usage::RecordInstance->new($self->{version}, $payload,
129 2 $self->{solution}{account_sid});
130 }
131  
132 package Twilio::Rest::Api::V2010::Account::Usage::RecordInstance;
133  
134 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
135  
136 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
137  
138 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
139 2 my ($class, $version, $payload, $account_sid) = @_;
140 2 my $self = $class->SUPER::new($version, $payload);
141 2 $self->{solution} = { account_sid => $account_sid };
142 2 return $self;
143 }
144  
145 1 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
146 1 ▶sub api_version { return $_[0]{properties}{api_version} }
Subroutine api_version: called CC=1 SCAR=0.0
147 1 ▶sub as_of { return $_[0]{properties}{as_of} }
Subroutine as_of: called CC=1 SCAR=0.0
148 2 ▶sub category { return $_[0]{properties}{category} }
Subroutine category: called CC=1 SCAR=0.0
149 1 ▶sub count { return $_[0]{properties}{count} }
Subroutine count: called CC=1 SCAR=0.0
150 1 ▶sub count_unit { return $_[0]{properties}{count_unit} }
Subroutine count_unit: called CC=1 SCAR=0.0
151 1 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
152 1 ▶sub end_date { return Twilio::Deserialize::date_time($_[0]{properties}{end_date}) }
Subroutine end_date: called CC=1 SCAR=0.0
153 1 ▶sub price { return $_[0]{properties}{price} }
Subroutine price: called CC=1 SCAR=0.0
154 1 ▶sub price_unit { return $_[0]{properties}{price_unit} }
Subroutine price_unit: called CC=1 SCAR=0.0
155 1 ▶sub start_date { return Twilio::Deserialize::date_time($_[0]{properties}{start_date}) }
Subroutine start_date: called CC=1 SCAR=0.0
156 1 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
157 1 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
158 1 ▶sub usage { return $_[0]{properties}{usage} }
Subroutine usage: called CC=1 SCAR=0.0
159 1 ▶sub usage_unit { return $_[0]{properties}{usage_unit} }
Subroutine usage_unit: called CC=1 SCAR=0.0
160  
161 3 1;
162  
163 __END__
« Twilio/Rest/Insights/V1/Call/CallSummary.pm ↑ Summary Twilio/Rest/Verify/V2/Service/Entity/Challenge/Notification.pm »