Twilio/Rest/Messaging/V1/LinkshorteningMessagingService.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/Intelligence/V2/OperatorAttachment.pm ↑ Summary Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteraction.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Messaging::V1::LinkshorteningMessagingService;
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::Messaging::V1::LinkshorteningMessagingServiceList;
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, $domain_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { domain_sid => $domain_sid };
19 2 $self->{uri} = join q{}, '/LinkShortening/Domains/',
20 Twilio::Serialize::path_segment($domain_sid), '/MessagingServices';
21 2 return $self;
22 }
23  
24 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
25 2 my ($self, $messaging_service_sid) = @_;
26 return Twilio::Rest::Messaging::V1::LinkshorteningMessagingServiceContext->new($self->{version},
27 $self->{solution}{domain_sid},
28 2 $messaging_service_sid);
29 }
30  
31 package Twilio::Rest::Messaging::V1::LinkshorteningMessagingServiceContext;
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, $domain_sid, $messaging_service_sid) = @_;
39 2 my $self = $class->SUPER::new($version);
40 $self->{solution} =
41 2 { domain_sid => $domain_sid, messaging_service_sid => $messaging_service_sid };
42 2 $self->{uri} = join q{}, '/LinkShortening/Domains/',
43 Twilio::Serialize::path_segment($domain_sid), '/MessagingServices/',
44 Twilio::Serialize::path_segment($messaging_service_sid);
45 2 return $self;
46 }
47  
48 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
49 1 my ($self) = @_;
50  
51 1 my $data = {};
52  
53 my $response =
54 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
55 1 return $self->_build_instance($response);
56 }
57  
58 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
59 1 my ($self) = @_;
60 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
61 1 return 1;
62 }
63  
64 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
65 1 my ($self, $response) = @_;
66 return Twilio::Rest::Messaging::V1::LinkshorteningMessagingServiceInstance->new(
67 $self->{version}, $response->get_content,
68 $self->{solution}{domain_sid},
69 $self->{solution}{messaging_service_sid}
70 1 );
71 }
72  
73 package Twilio::Rest::Messaging::V1::LinkshorteningMessagingServiceInstance;
74  
75 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
76  
77 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
78  
79 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
80 1 my ($class, $version, $payload, $domain_sid, $messaging_service_sid) = @_;
81 1 my $self = $class->SUPER::new($version, $payload);
82 $self->{solution} = {
83 domain_sid => $domain_sid,
84 messaging_service_sid => $messaging_service_sid // $self->{properties}{messaging_service_sid}
85 1 ▶ };
Condition33%1/3
$messaging_service_sid // $self->{"properties"}{"messaging_service_sid"}
l!l&&r!l&&!r
100
MC/DC0%0/2
$messaging_service_sid // $self->{"properties"}{"messaging_service_sid"}
$messaging_service_sid $self->{"properties"}{"messaging_service_sid"}
Truth table33%1/3
A // B
A= $messaging_service_sidB= $self->{"properties"}{"messaging_service_sid"}
ABresult
1X1
011
000
86 1 return $self;
87 }
88  
89 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
90 0 my ($self, @arguments) = @_;
91 0 return $self->_context->create(@arguments);
92 }
93  
94 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
95 0 my ($self, @arguments) = @_;
96 0 return $self->_context->delete(@arguments);
97 }
98  
99 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
100 0 my ($self) = @_;
101 return Twilio::Rest::Messaging::V1::LinkshorteningMessagingServiceContext->new(
102 $self->{version},
103 $self->{solution}{domain_sid},
104 $self->{solution}{messaging_service_sid}
105 0 );
106 }
107  
108 1 ▶sub domain_sid { return $_[0]{properties}{domain_sid} }
Subroutine domain_sid: called CC=1 SCAR=0.0
109 1 ▶sub messaging_service_sid { return $_[0]{properties}{messaging_service_sid} }
Subroutine messaging_service_sid: called CC=1 SCAR=0.0
110 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
111  
112 2 1;
113  
114 __END__
« Twilio/Rest/Intelligence/V2/OperatorAttachment.pm ↑ Summary Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteraction.pm »