Twilio/Rest/Api/V2010/Account/NewKey.pm

filter: Statementstmt 100% 38 / 38 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 14 / 14 Podpod n/a totaltotal 96.3% 53 / 55 CC 2 SCAR 1.3
CC
2
Cov
98%
create
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiries.pm ↑ Summary Twilio/Rest/Api/V2010/Account/NewSigningKey.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::NewKey;
3  
4 3 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Api::V2010::Account::NewKeyList;
10  
11 3 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version, $account_sid) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { account_sid => $account_sid };
19 3 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/Keys.json';
21 3 return $self;
22 }
23  
24 2 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 2 my ($self, $options) = @_;
26 2 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
20
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
27  
28 2 my $data = { FriendlyName => $options->{friendly_name}, };
29  
30 my $response =
31 2 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
32 return Twilio::Rest::Api::V2010::Account::NewKeyInstance->new($self->{version},
33 2 $response->get_content, $self->{solution}{account_sid});
34 }
35  
36 package Twilio::Rest::Api::V2010::Account::NewKeyInstance;
37  
38 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
43 2 my ($class, $version, $payload, $account_sid) = @_;
44 2 my $self = $class->SUPER::new($version, $payload);
45 2 $self->{solution} = { account_sid => $account_sid };
46 2 return $self;
47 }
48  
49 1 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
50 1 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
51 1 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
52 2 ▶sub secret { return $_[0]{properties}{secret} }
Subroutine secret: called CC=1 SCAR=0.0
53 1 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
54  
55 3 1;
56  
57 __END__
« Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiries.pm ↑ Summary Twilio/Rest/Api/V2010/Account/NewSigningKey.pm »