Twilio/Rest/Iam/V1/NewApiKey.pm

filter: Statementstmt 100% 39 / 39 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 15 / 15 Podpod n/a totaltotal 96.4% 55 / 57 CC 2 SCAR 1.2
CC
2
Cov
98%
create
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Twilio/Rest/Api/V2010/Account/Message/Feedback.pm ↑ Summary Twilio/Rest/Video/V1/Room/Participant/SubscribeRules.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Iam::V1::NewApiKey;
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::Iam::V1::NewApiKeyList;
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = {};
19 1 $self->{uri} = '/Keys';
20 1 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $account_sid, $options) = @_;
25 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
26  
27 my $data = {
28 AccountSid => $account_sid,
29 FriendlyName => $options->{friendly_name},
30 KeyType => $options->{key_type},
31 1 Policy => Twilio::Serialize::json_object($options->{policy}),
32 };
33  
34 my $response =
35 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
36 1 return Twilio::Rest::Iam::V1::NewApiKeyInstance->new($self->{version}, $response->get_content);
37 }
38  
39 package Twilio::Rest::Iam::V1::NewApiKeyInstance;
40  
41 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
42  
43 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
46 1 my ($class, $version, $payload) = @_;
47 1 my $self = $class->SUPER::new($version, $payload);
48 1 $self->{solution} = {};
49 1 return $self;
50 }
51  
52 1 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
53 1 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
54 1 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
55 1 ▶sub policy { return $_[0]{properties}{policy} }
Subroutine policy: called CC=1 SCAR=0.0
56 1 ▶sub secret { return $_[0]{properties}{secret} }
Subroutine secret: called CC=1 SCAR=0.0
57 1 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
58  
59 2 1;
60  
61 __END__
« Twilio/Rest/Api/V2010/Account/Message/Feedback.pm ↑ Summary Twilio/Rest/Video/V1/Room/Participant/SubscribeRules.pm »