| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Iam::V1::OAuthApp; | ||||||||||||||||||||
| 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::Iam::V1::OAuthAppList; | ||||||||||||||||||||
| 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 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 4 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = '/Account/OAuthApps'; | |||||||||||||||||||
| 20 | 4 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 2 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 2 | my ($self, $body) = @_; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 2 | my $data = Twilio::Serialize::json_body($body, {}); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 29 | 'POST', | ||||||||||||||||||||
| 30 | $self->{uri}, | ||||||||||||||||||||
| 31 | 2 | 'create', | |||||||||||||||||||
| 32 | { | ||||||||||||||||||||
| 33 | data => $data, | ||||||||||||||||||||
| 34 | headers => { 'Content-Type' => 'application/json', } | ||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | 2 | return Twilio::Rest::Iam::V1::OAuthAppInstance->new($self->{version}, $response->get_content); | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 41 | 2 | my ($self, $sid) = @_; | |||||||||||||||||||
| 42 | 2 | return Twilio::Rest::Iam::V1::OAuthAppContext->new($self->{version}, $sid); | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | package Twilio::Rest::Iam::V1::OAuthAppContext; | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 3 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 3 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 52 | 2 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 53 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 54 | 2 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 55 | 2 | $self->{uri} = join q{}, '/Account/OAuthApps/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 56 | 2 | return $self; | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 60 | 1 | my ($self) = @_; | |||||||||||||||||||
| 61 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 62 | 1 | return 1; | |||||||||||||||||||
| 63 | } | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 66 | 1 | my ($self, $body) = @_; | |||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 71 | 'PUT', | ||||||||||||||||||||
| 72 | $self->{uri}, | ||||||||||||||||||||
| 73 | 1 | 'update', | |||||||||||||||||||
| 74 | { | ||||||||||||||||||||
| 75 | data => $data, | ||||||||||||||||||||
| 76 | headers => { 'Content-Type' => 'application/json', } | ||||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | ); | ||||||||||||||||||||
| 79 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 80 | } | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 83 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 84 | return Twilio::Rest::Iam::V1::OAuthAppInstance->new($self->{version}, $response->get_content, | ||||||||||||||||||||
| 85 | 1 | $self->{solution}{sid}); | |||||||||||||||||||
| 86 | } | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | package Twilio::Rest::Iam::V1::OAuthAppInstance; | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 3 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 95 | 3 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 96 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 97 | 3 | ▶ | $self->{solution} = { sid => $sid // $self->{properties}{sid} }; | ||||||||||||||||||
|
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid
$self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
| |||||||||||||||||||||
| 98 | 3 | return $self; | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 102 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 103 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 104 | } | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 107 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 108 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 109 | } | ||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 112 | 0 | my ($self) = @_; | |||||||||||||||||||
| 113 | 0 | return Twilio::Rest::Iam::V1::OAuthAppContext->new($self->{version}, $self->{solution}{sid}); | |||||||||||||||||||
| 114 | } | ||||||||||||||||||||
| 115 | |||||||||||||||||||||
| 116 | 2 | ▶ | sub access_token_ttl { return $_[0]{properties}{access_token_ttl} } | ||||||||||||||||||
|
Subroutine
access_token_ttl: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 117 | 2 | ▶ | sub created_by { return $_[0]{properties}{created_by} } | ||||||||||||||||||
|
Subroutine
created_by: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 118 | 2 | ▶ | sub creator_sid { return $_[0]{properties}{creator_sid} } | ||||||||||||||||||
|
Subroutine
creator_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 119 | 2 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 120 | 2 | ▶ | sub description { return $_[0]{properties}{description} } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 121 | 2 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 122 | 2 | ▶ | sub policy { return $_[0]{properties}{policy} } | ||||||||||||||||||
|
Subroutine
policy: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 123 | 2 | ▶ | sub secret { return $_[0]{properties}{secret} } | ||||||||||||||||||
|
Subroutine
secret: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 124 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 125 | 2 | ▶ | sub status { return $_[0]{properties}{status} } | ||||||||||||||||||
|
Subroutine
status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 126 | 2 | ▶ | sub type { return $_[0]{properties}{type} } | ||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | 3 | 1; | |||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | __END__ | ||||||||||||||||||||