Twilio/Rest/Numbers/V2/BulkHostedNumberOrder.pm

filter: Statementstmt 93.7% 60 / 64 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 92.3% 24 / 26 Podpod n/a totaltotal 88.7% 87 / 98 CC 3 SCAR 2.0
CC
3
Cov
91%
fetch
2.0
new
2.0
fetch
2.0
CRAP 1.2
« Twilio/Rest/FlexApi/V1/InsightsSession.pm ↑ Summary Twilio/Base/PhoneNumberCapabilities.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Numbers::V2::BulkHostedNumberOrder;
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::Numbers::V2::BulkHostedNumberOrderList;
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) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = {};
19 2 $self->{uri} = '/HostedNumber/Orders/Bulk';
20 2 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
24 1 my ($self, $body) = @_;
25  
26 1 my $data = Twilio::Serialize::json_body($body, {});
27  
28 my $response = $self->{version}->handle_request(
29 'POST',
30 $self->{uri},
31 1 'create',
32 {
33 data => $data,
34 headers => { 'Content-Type' => 'application/json', }
35 }
36 );
37 return Twilio::Rest::Numbers::V2::BulkHostedNumberOrderInstance->new($self->{version},
38 1 $response->get_content);
39 }
40  
41 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
42 1 my ($self, $bulk_hosting_sid) = @_;
43 return Twilio::Rest::Numbers::V2::BulkHostedNumberOrderContext->new($self->{version},
44 1 $bulk_hosting_sid);
45 }
46  
47 package Twilio::Rest::Numbers::V2::BulkHostedNumberOrderContext;
48  
49 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
54 1 my ($class, $version, $bulk_hosting_sid) = @_;
55 1 my $self = $class->SUPER::new($version);
56 1 $self->{solution} = { bulk_hosting_sid => $bulk_hosting_sid };
57 1 $self->{uri} = join q{}, '/HostedNumber/Orders/Bulk/',
58 Twilio::Serialize::path_segment($bulk_hosting_sid);
59 1 return $self;
60 }
61  
62 1 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=7.0
63 1 my ($self, $options) = @_;
64 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
65  
66 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch',
67 1 { params => { OrderStatus => $options->{order_status}, } });
68 1 return $self->_build_instance($response);
69 }
70  
71 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
72 1 my ($self, $response) = @_;
73 return Twilio::Rest::Numbers::V2::BulkHostedNumberOrderInstance->new($self->{version},
74 1 $response->get_content, $self->{solution}{bulk_hosting_sid});
75 }
76  
77 package Twilio::Rest::Numbers::V2::BulkHostedNumberOrderInstance;
78  
79 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
82  
83 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
84 2 my ($class, $version, $payload, $bulk_hosting_sid) = @_;
85 2 my $self = $class->SUPER::new($version, $payload);
86 $self->{solution} =
87 2 ▶ { bulk_hosting_sid => $bulk_hosting_sid // $self->{properties}{bulk_hosting_sid} };
Condition66%2/3
$bulk_hosting_sid // $self->{"properties"}{"bulk_hosting_sid"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$bulk_hosting_sid // $self->{"properties"}{"bulk_hosting_sid"}
$bulk_hosting_sid $self->{"properties"}{"bulk_hosting_sid"}
Truth table66%2/3
A // B
A= $bulk_hosting_sidB= $self->{"properties"}{"bulk_hosting_sid"}
ABresult
1X1
011
000
88 2 return $self;
89 }
90  
91 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
92 0 my ($self, @arguments) = @_;
93 0 return $self->_context->fetch(@arguments);
94 }
95  
96 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
97 0 my ($self) = @_;
98 return Twilio::Rest::Numbers::V2::BulkHostedNumberOrderContext->new($self->{version},
99 0 $self->{solution}{bulk_hosting_sid});
100 }
101  
102 2 ▶sub bulk_hosting_sid { return $_[0]{properties}{bulk_hosting_sid} }
Subroutine bulk_hosting_sid: called CC=1 SCAR=0.0
103 2 ▶sub date_completed { return Twilio::Deserialize::date_time($_[0]{properties}{date_completed}) }
Subroutine date_completed: called CC=1 SCAR=0.0
104 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
105 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
106 2 ▶sub notification_email { return $_[0]{properties}{notification_email} }
Subroutine notification_email: called CC=1 SCAR=0.0
107 2 ▶sub request_status { return $_[0]{properties}{request_status} }
Subroutine request_status: called CC=1 SCAR=0.0
108 2 ▶sub results { return $_[0]{properties}{results} }
Subroutine results: called CC=1 SCAR=0.0
109 2 ▶sub total_count { return $_[0]{properties}{total_count} }
Subroutine total_count: called CC=1 SCAR=0.0
110 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
111  
112 2 1;
113  
114 __END__
« Twilio/Rest/FlexApi/V1/InsightsSession.pm ↑ Summary Twilio/Base/PhoneNumberCapabilities.pm »