Twilio/Rest/PreviewIam/V1/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/V2/Token.pm ↑ Summary Twilio/Rest/Video/V1/Room/RecordingRules.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::PreviewIam::V1::Token;
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::PreviewIam::V1::TokenList;
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} = '/token';
20 1 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $grant_type, $client_id, $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 grant_type => $grant_type,
29 client_id => $client_id,
30 audience => $options->{audience},
31 client_secret => $options->{client_secret},
32 code => $options->{code},
33 redirect_uri => $options->{redirect_uri},
34 refresh_token => $options->{refresh_token},
35 scope => $options->{scope},
36 1 };
37  
38 my $response =
39 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
40 1 return Twilio::Rest::PreviewIam::V1::TokenInstance->new($self->{version}, $response->get_content);
41 }
42  
43 package Twilio::Rest::PreviewIam::V1::TokenInstance;
44  
45 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
46  
47 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
48  
49 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
50 1 my ($class, $version, $payload) = @_;
51 1 my $self = $class->SUPER::new($version, $payload);
52 1 $self->{solution} = {};
53 1 return $self;
54 }
55  
56 1 ▶sub access_token { return $_[0]{properties}{access_token} }
Subroutine access_token: called CC=1 SCAR=0.0
57 1 ▶sub expires_in { return $_[0]{properties}{expires_in} }
Subroutine expires_in: called CC=1 SCAR=0.0
58 1 ▶sub id_token { return $_[0]{properties}{id_token} }
Subroutine id_token: called CC=1 SCAR=0.0
59 1 ▶sub refresh_token { return $_[0]{properties}{refresh_token} }
Subroutine refresh_token: called CC=1 SCAR=0.0
60 1 ▶sub token_type { return $_[0]{properties}{token_type} }
Subroutine token_type: called CC=1 SCAR=0.0
61  
62 2 1;
63  
64 __END__
« Twilio/Rest/Oauth/V2/Token.pm ↑ Summary Twilio/Rest/Video/V1/Room/RecordingRules.pm »