Twilio/Rest/Intelligence/V2/OperatorAttachment.pm

filter: Statementstmt 89.8% 53 / 59 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 18 / 21 Podpod n/a totaltotal 84.7% 72 / 85 CC 2 SCAR 2.1
CC
2
Cov
87%
new
2.1
create
2.0
delete
2.0
CRAP 1.2
« Twilio/Rest/Wireless/V1/Sim/UsageRecord.pm ↑ Summary Twilio/Rest/Messaging/V1/LinkshorteningMessagingService.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Intelligence::V2::OperatorAttachment;
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::Intelligence::V2::OperatorAttachmentList;
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, $service_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { service_sid => $service_sid };
19 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
20 '/Operators';
21 2 return $self;
22 }
23  
24 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
25 2 my ($self, $operator_sid) = @_;
26 return Twilio::Rest::Intelligence::V2::OperatorAttachmentContext->new($self->{version},
27 $self->{solution}{service_sid},
28 2 $operator_sid);
29 }
30  
31 package Twilio::Rest::Intelligence::V2::OperatorAttachmentContext;
32  
33 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
38 2 my ($class, $version, $service_sid, $operator_sid) = @_;
39 2 my $self = $class->SUPER::new($version);
40 2 $self->{solution} = { service_sid => $service_sid, operator_sid => $operator_sid };
41 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid),
42 '/Operators/', Twilio::Serialize::path_segment($operator_sid);
43 2 return $self;
44 }
45  
46 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
47 1 my ($self) = @_;
48  
49 1 my $data = {};
50  
51 my $response =
52 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
53 1 return $self->_build_instance($response);
54 }
55  
56 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
57 1 my ($self) = @_;
58 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
59 1 return 1;
60 }
61  
62 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
63 1 my ($self, $response) = @_;
64 return Twilio::Rest::Intelligence::V2::OperatorAttachmentInstance->new(
65 $self->{version}, $response->get_content,
66 $self->{solution}{service_sid},
67 $self->{solution}{operator_sid}
68 1 );
69 }
70  
71 package Twilio::Rest::Intelligence::V2::OperatorAttachmentInstance;
72  
73 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
74  
75 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
76  
77 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
78 1 my ($class, $version, $payload, $service_sid, $operator_sid) = @_;
79 1 my $self = $class->SUPER::new($version, $payload);
80 $self->{solution} = {
81 service_sid => $service_sid,
82 operator_sid => $operator_sid // $self->{properties}{operator_sid}
83 1 ▶ };
Condition33%1/3
$operator_sid // $self->{"properties"}{"operator_sid"}
l!l&&r!l&&!r
100
MC/DC0%0/2
$operator_sid // $self->{"properties"}{"operator_sid"}
$operator_sid $self->{"properties"}{"operator_sid"}
Truth table33%1/3
A // B
A= $operator_sidB= $self->{"properties"}{"operator_sid"}
ABresult
1X1
011
000
84 1 return $self;
85 }
86  
87 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
88 0 my ($self, @arguments) = @_;
89 0 return $self->_context->create(@arguments);
90 }
91  
92 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
93 0 my ($self, @arguments) = @_;
94 0 return $self->_context->delete(@arguments);
95 }
96  
97 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
98 0 my ($self) = @_;
99 return Twilio::Rest::Intelligence::V2::OperatorAttachmentContext->new(
100 $self->{version},
101 $self->{solution}{service_sid},
102 $self->{solution}{operator_sid}
103 0 );
104 }
105  
106 1 ▶sub operator_sid { return $_[0]{properties}{operator_sid} }
Subroutine operator_sid: called CC=1 SCAR=0.0
107 1 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
108 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
109  
110 2 1;
111  
112 __END__
« Twilio/Rest/Wireless/V1/Sim/UsageRecord.pm ↑ Summary Twilio/Rest/Messaging/V1/LinkshorteningMessagingService.pm »