| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||
| 2 | package Twilio::Rest::Content::V1::Content::ApprovalCreate; | ||
| 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::Content::V1::Content::ApprovalCreateList; | ||
| 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 | 2 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
| |||
| 16 | 2 | my ($class, $version, $content_sid) = @_; | |
| 17 | 2 | my $self = $class->SUPER::new($version); | |
| 18 | 2 | $self->{solution} = { content_sid => $content_sid }; | |
| 19 | 2 | $self->{uri} = join q{}, '/Content/', Twilio::Serialize::path_segment($content_sid), | |
| 20 | '/ApprovalRequests/whatsapp'; | ||
| 21 | 2 | return $self; | |
| 22 | } | ||
| 23 | |||
| 24 | 1 | ▶ | sub create { |
|
Subroutine
create: called CC=1 SCAR=0.0
| |||
| 25 | 1 | my ($self, $body) = @_; | |
| 26 | |||
| 27 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |
| 28 | |||
| 29 | my $response = $self->{version}->handle_request( | ||
| 30 | 'POST', | ||
| 31 | $self->{uri}, | ||
| 32 | 1 | 'create', | |
| 33 | { | ||
| 34 | data => $data, | ||
| 35 | headers => { 'Content-Type' => 'application/json', } | ||
| 36 | } | ||
| 37 | ); | ||
| 38 | return Twilio::Rest::Content::V1::Content::ApprovalCreateInstance->new($self->{version}, | ||
| 39 | 1 | $response->get_content, $self->{solution}{content_sid}); | |
| 40 | } | ||
| 41 | |||
| 42 | 1 | ▶ | sub update { |
|
Subroutine
update: called CC=1 SCAR=0.0
| |||
| 43 | 1 | my ($self, $body) = @_; | |
| 44 | |||
| 45 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |
| 46 | |||
| 47 | my $response = $self->{version}->handle_request( | ||
| 48 | 'PATCH', | ||
| 49 | $self->{uri}, | ||
| 50 | 1 | 'update', | |
| 51 | { | ||
| 52 | data => $data, | ||
| 53 | headers => { 'Content-Type' => 'application/json', } | ||
| 54 | } | ||
| 55 | ); | ||
| 56 | return Twilio::Rest::Content::V1::Content::ApprovalCreateInstance->new($self->{version}, | ||
| 57 | 1 | $response->get_content, $self->{solution}{content_sid}); | |
| 58 | } | ||
| 59 | |||
| 60 | package Twilio::Rest::Content::V1::Content::ApprovalCreateInstance; | ||
| 61 | |||
| 62 | 2 | ▶ | use parent 'Twilio::InstanceResource'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 63 | |||
| 64 | 2 | ▶ | use Twilio::Deserialize; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 65 | |||
| 66 | 2 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
| |||
| 67 | 2 | my ($class, $version, $payload, $content_sid) = @_; | |
| 68 | 2 | my $self = $class->SUPER::new($version, $payload); | |
| 69 | 2 | $self->{solution} = { content_sid => $content_sid }; | |
| 70 | 2 | return $self; | |
| 71 | } | ||
| 72 | |||
| 73 | 2 | ▶ | sub allow_category_change { return $_[0]{properties}{allow_category_change} } |
|
Subroutine
allow_category_change: called CC=1 SCAR=0.0
| |||
| 74 | 2 | ▶ | sub bid_amount { return $_[0]{properties}{bid_amount} } |
|
Subroutine
bid_amount: called CC=1 SCAR=0.0
| |||
| 75 | 2 | ▶ | sub category { return $_[0]{properties}{category} } |
|
Subroutine
category: called CC=1 SCAR=0.0
| |||
| 76 | 2 | ▶ | sub content_type { return $_[0]{properties}{content_type} } |
|
Subroutine
content_type: called CC=1 SCAR=0.0
| |||
| 77 | 2 | ▶ | sub name { return $_[0]{properties}{name} } |
|
Subroutine
name: called CC=1 SCAR=0.0
| |||
| 78 | 2 | ▶ | sub rejection_reason { return $_[0]{properties}{rejection_reason} } |
|
Subroutine
rejection_reason: called CC=1 SCAR=0.0
| |||
| 79 | 2 | ▶ | sub send_ttl_seconds { return $_[0]{properties}{send_ttl_seconds} } |
|
Subroutine
send_ttl_seconds: called CC=1 SCAR=0.0
| |||
| 80 | 2 | ▶ | sub status { return $_[0]{properties}{status} } |
|
Subroutine
status: called CC=1 SCAR=0.0
| |||
| 81 | |||
| 82 | 2 | 1; | |
| 83 | |||
| 84 | __END__ | ||