Twilio/Rest/Messaging/V1/DomainCerts.pm

filter: Statementstmt 85.7% 48 / 56 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 20 / 24 Podpod n/a totaltotal 85.0% 68 / 80 CC 1 SCAR 1.5
CC
1
Cov
86%
delete
2.0
fetch
2.0
update
2.0
CRAP 1.2
« Twilio/Rest/Api/V2010/Account/Message.pm ↑ Summary Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachine.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Messaging::V1::DomainCerts;
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::DomainCertsContext;
10  
11 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 4 my ($class, $version, $domain_sid) = @_;
17 4 my $self = $class->SUPER::new($version);
18 4 $self->{solution} = { domain_sid => $domain_sid };
19 4 $self->{uri} = join q{}, '/LinkShortening/Domains/',
20 Twilio::Serialize::path_segment($domain_sid), '/Certificate';
21 4 return $self;
22 }
23  
24 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
25 1 my ($self) = @_;
26 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
27 1 return 1;
28 }
29  
30 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
31 1 my ($self) = @_;
32  
33 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
34 1 return $self->_build_instance($response);
35 }
36  
37 2 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
38 2 my ($self, $tls_cert) = @_;
39  
40 2 my $data = { TlsCert => $tls_cert, };
41  
42 my $response =
43 2 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
44 2 return $self->_build_instance($response);
45 }
46  
47 3 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
48 3 my ($self, $response) = @_;
49 return Twilio::Rest::Messaging::V1::DomainCertsInstance->new($self->{version},
50 3 $response->get_content, $self->{solution}{domain_sid});
51 }
52  
53 package Twilio::Rest::Messaging::V1::DomainCertsInstance;
54  
55 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
60 3 my ($class, $version, $payload, $domain_sid) = @_;
61 3 my $self = $class->SUPER::new($version, $payload);
62 3 $self->{solution} = { domain_sid => $domain_sid };
63 3 return $self;
64 }
65  
66 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
67 0 my ($self, @arguments) = @_;
68 0 return $self->_context->delete(@arguments);
69 }
70  
71 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
72 0 my ($self, @arguments) = @_;
73 0 return $self->_context->fetch(@arguments);
74 }
75  
76 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
77 0 my ($self, @arguments) = @_;
78 0 return $self->_context->update(@arguments);
79 }
80  
81 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
82 0 my ($self) = @_;
83 return Twilio::Rest::Messaging::V1::DomainCertsContext->new($self->{version},
84 0 $self->{solution}{domain_sid});
85 }
86  
87 3 ▶sub cert_in_validation { return $_[0]{properties}{cert_in_validation} }
Subroutine cert_in_validation: called CC=1 SCAR=0.0
88 3 ▶sub certificate_sid { return $_[0]{properties}{certificate_sid} }
Subroutine certificate_sid: called CC=1 SCAR=0.0
89 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
90 3 ▶sub date_expires { return Twilio::Deserialize::date_time($_[0]{properties}{date_expires}) }
Subroutine date_expires: called CC=1 SCAR=0.0
91 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
92 3 ▶sub domain_name { return $_[0]{properties}{domain_name} }
Subroutine domain_name: called CC=1 SCAR=0.0
93 3 ▶sub domain_sid { return $_[0]{properties}{domain_sid} }
Subroutine domain_sid: called CC=1 SCAR=0.0
94 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
95  
96 2 1;
97  
98 __END__
« Twilio/Rest/Api/V2010/Account/Message.pm ↑ Summary Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachine.pm »