| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||
| 2 | package Twilio::Rest::Oauth::V1::Token; | ||||||||||||
| 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::Oauth::V1::TokenList; | ||||||||||||
| 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 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 2 | my ($class, $version) = @_; | |||||||||||
| 17 | 2 | my $self = $class->SUPER::new($version); | |||||||||||
| 18 | 2 | $self->{solution} = {}; | |||||||||||
| 19 | 2 | $self->{uri} = '/token'; | |||||||||||
| 20 | 2 | 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 //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 26 | |||||||||||||
| 27 | my $data = { | ||||||||||||
| 28 | GrantType => $grant_type, | ||||||||||||
| 29 | ClientId => $client_id, | ||||||||||||
| 30 | Audience => $options->{audience}, | ||||||||||||
| 31 | ClientSecret => $options->{client_secret}, | ||||||||||||
| 32 | Code => $options->{code}, | ||||||||||||
| 33 | RedirectUri => $options->{redirect_uri}, | ||||||||||||
| 34 | RefreshToken => $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::Oauth::V1::TokenInstance->new($self->{version}, $response->get_content); | |||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | package Twilio::Rest::Oauth::V1::TokenInstance; | ||||||||||||
| 44 | |||||||||||||
| 45 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 46 | |||||||||||||
| 47 | 3 | ▶ | 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 | 3 | 1; | |||||||||||
| 63 | |||||||||||||
| 64 | __END__ | ||||||||||||