Twilio/Rest/Oauth/V2/Token.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/Oauth/V1/Token.pm ↑ Summary Twilio/Rest/PreviewIam/V1/Token.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Oauth::V2::Token;
3  
4 4 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Oauth::V2::TokenList;
10  
11 4 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 20 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 20 my ($class, $version) = @_;
17 20 my $self = $class->SUPER::new($version);
18 20 $self->{solution} = {};
19 20 $self->{uri} = '/token';
20 20 return $self;
21 }
22  
23 20 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 20 my ($self, $grant_type, $options) = @_;
25 20 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
200
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
26  
27 my $data = {
28 grant_type => $grant_type,
29 audience => $options->{audience},
30 client_id => $options->{client_id},
31 client_secret => $options->{client_secret},
32 code => $options->{code},
33 code_verifier => $options->{code_verifier},
34 redirect_uri => $options->{redirect_uri},
35 refresh_token => $options->{refresh_token},
36 scope => $options->{scope},
37 20 };
38  
39 my $response = $self->{version}->handle_request(
40 'POST',
41 $self->{uri},
42 'create',
43 {
44 data => $data,
45 params => { account_sid => $options->{account_sid}, }
46 }
47 20 );
48 19 return Twilio::Rest::Oauth::V2::TokenInstance->new($self->{version}, $response->get_content);
49 }
50  
51 package Twilio::Rest::Oauth::V2::TokenInstance;
52  
53 4 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 4 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 19 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
58 19 my ($class, $version, $payload) = @_;
59 19 my $self = $class->SUPER::new($version, $payload);
60 19 $self->{solution} = {};
61 19 return $self;
62 }
63  
64 19 ▶sub access_token { return $_[0]{properties}{access_token} }
Subroutine access_token: called CC=1 SCAR=0.0
65 1 ▶sub expires_in { return $_[0]{properties}{expires_in} }
Subroutine expires_in: called CC=1 SCAR=0.0
66 1 ▶sub id_token { return $_[0]{properties}{id_token} }
Subroutine id_token: called CC=1 SCAR=0.0
67 1 ▶sub refresh_token { return $_[0]{properties}{refresh_token} }
Subroutine refresh_token: called CC=1 SCAR=0.0
68 1 ▶sub token_type { return $_[0]{properties}{token_type} }
Subroutine token_type: called CC=1 SCAR=0.0
69  
70 4 1;
71  
72 __END__
« Twilio/Rest/Oauth/V1/Token.pm ↑ Summary Twilio/Rest/PreviewIam/V1/Token.pm »