| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategory; | ||||||||||||||||||||
| 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::FlexApi::V1::InsightsQuestionnairesCategoryList; | ||||||||||||||||||||
| 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 | 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} = '/Insights/QualityManagement/Categories'; | |||||||||||||||||||
| 20 | 4 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $name, $options) = @_; | |||||||||||||||||||
| 25 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 1 | my $data = { Name => $name, }; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 30 | 'POST', | ||||||||||||||||||||
| 31 | $self->{uri}, | ||||||||||||||||||||
| 32 | 'create', | ||||||||||||||||||||
| 33 | { | ||||||||||||||||||||
| 34 | data => $data, | ||||||||||||||||||||
| 35 | headers => { Authorization => $options->{authorization}, } | ||||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | 1 | ); | |||||||||||||||||||
| 38 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryInstance->new($self->{version}, | ||||||||||||||||||||
| 39 | 1 | $response->get_content); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 43 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 44 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 48 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 49 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 53 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 54 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 1 | my $params = { | |||||||||||||||||||
| 57 | PageToken => $page_token, | ||||||||||||||||||||
| 58 | Page => $page_number, | ||||||||||||||||||||
| 59 | PageSize => $page_size, | ||||||||||||||||||||
| 60 | }; | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | my $response = $self->{version}->page( | ||||||||||||||||||||
| 63 | 'GET', | ||||||||||||||||||||
| 64 | $self->{uri}, | ||||||||||||||||||||
| 65 | { | ||||||||||||||||||||
| 66 | params => $params, | ||||||||||||||||||||
| 67 | headers => { Authorization => $options->{authorization}, } | ||||||||||||||||||||
| 68 | } | ||||||||||||||||||||
| 69 | 1 | ); | |||||||||||||||||||
| 70 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 71 | } | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 74 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 75 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 76 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 80 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 81 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryPage->new($self->{version}, | ||||||||||||||||||||
| 82 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 83 | } | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | 2 | my ($self, $category_sid) = @_; | |||||||||||||||||||
| 87 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryContext->new($self->{version}, | ||||||||||||||||||||
| 88 | 2 | $category_sid); | |||||||||||||||||||
| 89 | } | ||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | package Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryPage; | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 1 | ▶ | sub records_key { return 'categories' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 98 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 99 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryInstance->new($self->{version}, | ||||||||||||||||||||
| 100 | 1 | $payload); | |||||||||||||||||||
| 101 | } | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | package Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryContext; | ||||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 110 | 2 | my ($class, $version, $category_sid) = @_; | |||||||||||||||||||
| 111 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 112 | 2 | $self->{solution} = { category_sid => $category_sid }; | |||||||||||||||||||
| 113 | 2 | $self->{uri} = join q{}, '/Insights/QualityManagement/Categories/', | |||||||||||||||||||
| 114 | Twilio::Serialize::path_segment($category_sid); | ||||||||||||||||||||
| 115 | 2 | return $self; | |||||||||||||||||||
| 116 | } | ||||||||||||||||||||
| 117 | |||||||||||||||||||||
| 118 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 119 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 120 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 121 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete', | ||||||||||||||||||||
| 122 | 1 | { headers => { Authorization => $options->{authorization}, } }); | |||||||||||||||||||
| 123 | 1 | return 1; | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 127 | 1 | my ($self, $name, $options) = @_; | |||||||||||||||||||
| 128 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | 1 | my $data = { Name => $name, }; | |||||||||||||||||||
| 131 | |||||||||||||||||||||
| 132 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 133 | 'POST', | ||||||||||||||||||||
| 134 | $self->{uri}, | ||||||||||||||||||||
| 135 | 'update', | ||||||||||||||||||||
| 136 | { | ||||||||||||||||||||
| 137 | data => $data, | ||||||||||||||||||||
| 138 | headers => { Authorization => $options->{authorization}, } | ||||||||||||||||||||
| 139 | } | ||||||||||||||||||||
| 140 | 1 | ); | |||||||||||||||||||
| 141 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 142 | } | ||||||||||||||||||||
| 143 | |||||||||||||||||||||
| 144 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 145 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 146 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryInstance->new($self->{version}, | ||||||||||||||||||||
| 147 | 1 | $response->get_content, $self->{solution}{category_sid}); | |||||||||||||||||||
| 148 | } | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | package Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryInstance; | ||||||||||||||||||||
| 151 | |||||||||||||||||||||
| 152 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 157 | 3 | my ($class, $version, $payload, $category_sid) = @_; | |||||||||||||||||||
| 158 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 159 | 3 | ▶ | $self->{solution} = { category_sid => $category_sid // $self->{properties}{category_sid} }; | ||||||||||||||||||
|
Condition66%2/3
$category_sid // $self->{"properties"}{"category_sid"}
MC/DC0%0/2
$category_sid // $self->{"properties"}{"category_sid"}
$category_sid
$self->{"properties"}{"category_sid"}
Truth table66%2/3
A // B
A= $category_sidB= $self->{"properties"}{"category_sid"}
| |||||||||||||||||||||
| 160 | 3 | return $self; | |||||||||||||||||||
| 161 | } | ||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 164 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 165 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | |||||||||||||||||||||
| 168 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 169 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 170 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 171 | } | ||||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 174 | 0 | my ($self) = @_; | |||||||||||||||||||
| 175 | return Twilio::Rest::FlexApi::V1::InsightsQuestionnairesCategoryContext->new($self->{version}, | ||||||||||||||||||||
| 176 | 0 | $self->{solution}{category_sid}); | |||||||||||||||||||
| 177 | } | ||||||||||||||||||||
| 178 | |||||||||||||||||||||
| 179 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 180 | 3 | ▶ | sub category_sid { return $_[0]{properties}{category_sid} } | ||||||||||||||||||
|
Subroutine
category_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 181 | 3 | ▶ | sub name { return $_[0]{properties}{name} } | ||||||||||||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 182 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 183 | |||||||||||||||||||||
| 184 | 2 | 1; | |||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | __END__ | ||||||||||||||||||||