« Twilio/Rest/Bulkexports/V1/Export/Job.pm
↑ Summary
Twilio/Rest/Api/V2010/Account/Usage/Record/Daily.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::AllTime; | ||||||||||||
| 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::Api::V2010::Account::Usage::Record::AllTimeList; | ||||||||||||
| 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 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 1 | my ($class, $version, $account_sid) = @_; | |||||||||||
| 17 | 1 | my $self = $class->SUPER::new($version); | |||||||||||
| 18 | 1 | $self->{solution} = { account_sid => $account_sid }; | |||||||||||
| 19 | 1 | $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), | |||||||||||
| 20 | '/Usage/Records/AllTime.json'; | ||||||||||||
| 21 | 1 | return $self; | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 0 | ▶ | sub read { | ||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||
| 25 | 0 | my ($self, @arguments) = @_; | |||||||||||
| 26 | 0 | 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 | 1 | ▶ | sub page { | ||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||
| 35 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||
| 36 | 1 | ▶ | $options //= {}; | ||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 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 | 1 | StartDate => Twilio::Serialize::iso8601_date($options->{start_date}), | |||||||||||
| 43 | PageToken => $page_token, | ||||||||||||
| 44 | Page => $page_number, | ||||||||||||
| 45 | PageSize => $page_size, | ||||||||||||
| 46 | }; | ||||||||||||
| 47 | |||||||||||||
| 48 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||
| 49 | 1 | 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 | 1 | ▶ | sub _build_page { | ||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||
| 59 | 1 | my ($self, $response) = @_; | |||||||||||
| 60 | return Twilio::Rest::Api::V2010::Account::Usage::Record::AllTimePage->new($self->{version}, | ||||||||||||
| 61 | 1 | $response, $self->{solution}); | |||||||||||
| 62 | } | ||||||||||||
| 63 | |||||||||||||
| 64 | package Twilio::Rest::Api::V2010::Account::Usage::Record::AllTimePage; | ||||||||||||
| 65 | |||||||||||||
| 66 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 67 | |||||||||||||
| 68 | 1 | ▶ | sub records_key { return 'usage_records' } | ||||||||||
|
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 | return Twilio::Rest::Api::V2010::Account::Usage::Record::AllTimeInstance->new($self->{version}, | ||||||||||||
| 73 | 1 | $payload, $self->{solution}{account_sid}); | |||||||||||
| 74 | } | ||||||||||||
| 75 | |||||||||||||
| 76 | package Twilio::Rest::Api::V2010::Account::Usage::Record::AllTimeInstance; | ||||||||||||
| 77 | |||||||||||||
| 78 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 79 | |||||||||||||
| 80 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 81 | |||||||||||||
| 82 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 83 | 1 | my ($class, $version, $payload, $account_sid) = @_; | |||||||||||
| 84 | 1 | my $self = $class->SUPER::new($version, $payload); | |||||||||||
| 85 | 1 | $self->{solution} = { account_sid => $account_sid }; | |||||||||||
| 86 | 1 | return $self; | |||||||||||
| 87 | } | ||||||||||||
| 88 | |||||||||||||
| 89 | 1 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 90 | 1 | ▶ | sub api_version { return $_[0]{properties}{api_version} } | ||||||||||
|
Subroutine
api_version: called CC=1 SCAR=0.0
| |||||||||||||
| 91 | 1 | ▶ | sub as_of { return $_[0]{properties}{as_of} } | ||||||||||
|
Subroutine
as_of: called CC=1 SCAR=0.0
| |||||||||||||
| 92 | 1 | ▶ | sub category { return $_[0]{properties}{category} } | ||||||||||
|
Subroutine
category: called CC=1 SCAR=0.0
| |||||||||||||
| 93 | 1 | ▶ | sub count { return $_[0]{properties}{count} } | ||||||||||
|
Subroutine
count: called CC=1 SCAR=0.0
| |||||||||||||
| 94 | 1 | ▶ | sub count_unit { return $_[0]{properties}{count_unit} } | ||||||||||
|
Subroutine
count_unit: called CC=1 SCAR=0.0
| |||||||||||||
| 95 | 1 | ▶ | sub description { return $_[0]{properties}{description} } | ||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
| |||||||||||||
| 96 | 1 | ▶ | sub end_date { return Twilio::Deserialize::date_time($_[0]{properties}{end_date}) } | ||||||||||
|
Subroutine
end_date: called CC=1 SCAR=0.0
| |||||||||||||
| 97 | 1 | ▶ | sub price { return $_[0]{properties}{price} } | ||||||||||
|
Subroutine
price: called CC=1 SCAR=0.0
| |||||||||||||
| 98 | 1 | ▶ | sub price_unit { return $_[0]{properties}{price_unit} } | ||||||||||
|
Subroutine
price_unit: called CC=1 SCAR=0.0
| |||||||||||||
| 99 | 1 | ▶ | sub start_date { return Twilio::Deserialize::date_time($_[0]{properties}{start_date}) } | ||||||||||
|
Subroutine
start_date: called CC=1 SCAR=0.0
| |||||||||||||
| 100 | 1 | ▶ | sub subresource_uris { return $_[0]{properties}{subresource_uris} } | ||||||||||
|
Subroutine
subresource_uris: called CC=1 SCAR=0.0
| |||||||||||||
| 101 | 1 | ▶ | sub uri { return $_[0]{properties}{uri} } | ||||||||||
|
Subroutine
uri: called CC=1 SCAR=0.0
| |||||||||||||
| 102 | 1 | ▶ | sub usage { return $_[0]{properties}{usage} } | ||||||||||
|
Subroutine
usage: called CC=1 SCAR=0.0
| |||||||||||||
| 103 | 1 | ▶ | sub usage_unit { return $_[0]{properties}{usage_unit} } | ||||||||||
|
Subroutine
usage_unit: called CC=1 SCAR=0.0
| |||||||||||||
| 104 | |||||||||||||
| 105 | 2 | 1; | |||||||||||
| 106 | |||||||||||||
| 107 | __END__ | ||||||||||||