Twilio/Rest/PreviewIam/Versionless/Organization/Account.pm

filter: Statementstmt 85.3% 64 / 75 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 82.7% 24 / 29 Podpod n/a totaltotal 81.2% 91 / 112 CC 3 SCAR 2.6
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentType.pm ↑ Summary Twilio/Rest/Pricing/V1/PhoneNumber/Country.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::PreviewIam::Versionless::Organization::Account;
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::PreviewIam::Versionless::Organization::AccountList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version, $organization_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { organization_sid => $organization_sid };
19 2 $self->{uri} = join q{}, '/Organizations/', Twilio::Serialize::path_segment($organization_sid),
20 '/Accounts';
21 2 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 //= {}
l!l
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 1 my $params = {
39 PageToken => $page_token,
40 Page => $page_number,
41 PageSize => $page_size,
42 };
43  
44 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
45 1 return $self->_build_page($response);
46 }
47  
48 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
49 0 my ($self, $target_url) = @_;
50 0 my $client = $self->{version}->get_domain->get_client;
51 0 return $self->_build_page($client->request('GET', $target_url));
52 }
53  
54 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
55 1 my ($self, $response) = @_;
56 return Twilio::Rest::PreviewIam::Versionless::Organization::AccountPage->new($self->{version},
57 1 $response, $self->{solution});
58 }
59  
60 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
61 1 my ($self, $account_sid) = @_;
62 return Twilio::Rest::PreviewIam::Versionless::Organization::AccountContext->new($self->{version},
63 1 $self->{solution}{organization_sid}, $account_sid);
64 }
65  
66 package Twilio::Rest::PreviewIam::Versionless::Organization::AccountPage;
67  
68 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
69  
70 1 ▶sub records_key { return 'content' }
Subroutine records_key: called CC=1 SCAR=0.0
71  
72 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
73 1 my ($self, $payload) = @_;
74 return Twilio::Rest::PreviewIam::Versionless::Organization::AccountInstance->new($self->{version},
75 1 $payload, $self->{solution}{organization_sid});
76 }
77  
78 package Twilio::Rest::PreviewIam::Versionless::Organization::AccountContext;
79  
80 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
81  
82 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
83  
84 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
85 1 my ($class, $version, $organization_sid, $account_sid) = @_;
86 1 my $self = $class->SUPER::new($version);
87 1 $self->{solution} = { organization_sid => $organization_sid, account_sid => $account_sid };
88 1 $self->{uri} = join q{}, '/Organizations/', Twilio::Serialize::path_segment($organization_sid),
89 '/Accounts/', Twilio::Serialize::path_segment($account_sid);
90 1 return $self;
91 }
92  
93 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
94 1 my ($self) = @_;
95  
96 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
97 1 return $self->_build_instance($response);
98 }
99  
100 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
101 1 my ($self, $response) = @_;
102 return Twilio::Rest::PreviewIam::Versionless::Organization::AccountInstance->new(
103 $self->{version}, $response->get_content,
104 $self->{solution}{organization_sid},
105 $self->{solution}{account_sid}
106 1 );
107 }
108  
109 package Twilio::Rest::PreviewIam::Versionless::Organization::AccountInstance;
110  
111 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
112  
113 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
114  
115 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
116 2 my ($class, $version, $payload, $organization_sid, $account_sid) = @_;
117 2 my $self = $class->SUPER::new($version, $payload);
118 $self->{solution} = {
119 organization_sid => $organization_sid,
120 account_sid => $account_sid // $self->{properties}{account_sid}
121 2 ▶ };
Condition66%2/3
$account_sid // $self->{"properties"}{"account_sid"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$account_sid // $self->{"properties"}{"account_sid"}
$account_sid $self->{"properties"}{"account_sid"}
Truth table66%2/3
A // B
A= $account_sidB= $self->{"properties"}{"account_sid"}
ABresult
1X1
011
000
122 2 return $self;
123 }
124  
125 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
126 0 my ($self, @arguments) = @_;
127 0 return $self->_context->fetch(@arguments);
128 }
129  
130 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
131 0 my ($self) = @_;
132 return Twilio::Rest::PreviewIam::Versionless::Organization::AccountContext->new(
133 $self->{version},
134 $self->{solution}{organization_sid},
135 $self->{solution}{account_sid}
136 0 );
137 }
138  
139 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
140 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
141 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
142 2 ▶sub owner_sid { return $_[0]{properties}{owner_sid} }
Subroutine owner_sid: called CC=1 SCAR=0.0
143 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
144  
145 2 1;
146  
147 __END__
« Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentType.pm ↑ Summary Twilio/Rest/Pricing/V1/PhoneNumber/Country.pm »