« Twilio/Rest/Intelligence/V2/CustomOperator.pm
↑ Summary
Twilio/Rest/Taskrouter/V1/Workspace/Worker/Reservation.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Taskrouter::V1::Workspace::Task::Reservation; | ||||||||||||||||||||
| 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::Taskrouter::V1::Workspace::Task::ReservationList; | ||||||||||||||||||||
| 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 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 3 | my ($class, $version, $workspace_sid, $task_sid) = @_; | |||||||||||||||||||
| 17 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 3 | $self->{solution} = { workspace_sid => $workspace_sid, task_sid => $task_sid }; | |||||||||||||||||||
| 19 | 3 | $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid), | |||||||||||||||||||
| 20 | '/Tasks/', Twilio::Serialize::path_segment($task_sid), '/Reservations'; | ||||||||||||||||||||
| 21 | 3 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 25 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 26 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 30 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 31 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 35 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 36 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | my $params = { | ||||||||||||||||||||
| 39 | ReservationStatus => $options->{reservation_status}, | ||||||||||||||||||||
| 40 | WorkerSid => $options->{worker_sid}, | ||||||||||||||||||||
| 41 | 1 | PageToken => $page_token, | |||||||||||||||||||
| 42 | Page => $page_number, | ||||||||||||||||||||
| 43 | PageSize => $page_size, | ||||||||||||||||||||
| 44 | }; | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 47 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 51 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 52 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 53 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 57 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 58 | return Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationPage->new($self->{version}, | ||||||||||||||||||||
| 59 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 60 | } | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 63 | 2 | my ($self, $sid) = @_; | |||||||||||||||||||
| 64 | return Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationContext->new( | ||||||||||||||||||||
| 65 | $self->{version}, | ||||||||||||||||||||
| 66 | $self->{solution}{workspace_sid}, | ||||||||||||||||||||
| 67 | 2 | $self->{solution}{task_sid}, $sid | |||||||||||||||||||
| 68 | ); | ||||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | package Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationPage; | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 1 | ▶ | sub records_key { return 'reservations' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 78 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 79 | return Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationInstance->new( | ||||||||||||||||||||
| 80 | $self->{version}, $payload, | ||||||||||||||||||||
| 81 | $self->{solution}{workspace_sid}, | ||||||||||||||||||||
| 82 | $self->{solution}{task_sid} | ||||||||||||||||||||
| 83 | 1 | ); | |||||||||||||||||||
| 84 | } | ||||||||||||||||||||
| 85 | |||||||||||||||||||||
| 86 | package Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationContext; | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 93 | 2 | my ($class, $version, $workspace_sid, $task_sid, $sid) = @_; | |||||||||||||||||||
| 94 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 95 | 2 | $self->{solution} = { workspace_sid => $workspace_sid, task_sid => $task_sid, sid => $sid }; | |||||||||||||||||||
| 96 | 2 | $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid), | |||||||||||||||||||
| 97 | '/Tasks/', Twilio::Serialize::path_segment($task_sid), '/Reservations/', | ||||||||||||||||||||
| 98 | Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 99 | 2 | return $self; | |||||||||||||||||||
| 100 | } | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | 1 | my ($self) = @_; | |||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 106 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 107 | } | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 110 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 111 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | my $data = { | ||||||||||||||||||||
| 114 | Beep => $options->{beep}, | ||||||||||||||||||||
| 115 | BeepOnCustomerEntrance => | ||||||||||||||||||||
| 116 | Twilio::Serialize::boolean_to_string($options->{beep_on_customer_entrance}), | ||||||||||||||||||||
| 117 | CallAccept => Twilio::Serialize::boolean_to_string($options->{call_accept}), | ||||||||||||||||||||
| 118 | CallFrom => $options->{call_from}, | ||||||||||||||||||||
| 119 | CallRecord => $options->{call_record}, | ||||||||||||||||||||
| 120 | CallStatusCallbackUrl => $options->{call_status_callback_url}, | ||||||||||||||||||||
| 121 | CallTimeout => $options->{call_timeout}, | ||||||||||||||||||||
| 122 | CallTo => $options->{call_to}, | ||||||||||||||||||||
| 123 | CallUrl => $options->{call_url}, | ||||||||||||||||||||
| 124 | ConferenceRecord => $options->{conference_record}, | ||||||||||||||||||||
| 125 | ConferenceRecordingStatusCallback => $options->{conference_recording_status_callback}, | ||||||||||||||||||||
| 126 | ConferenceRecordingStatusCallbackMethod => | ||||||||||||||||||||
| 127 | $options->{conference_recording_status_callback_method}, | ||||||||||||||||||||
| 128 | ConferenceStatusCallback => $options->{conference_status_callback}, | ||||||||||||||||||||
| 129 | ConferenceStatusCallbackEvent => $options->{conference_status_callback_event}, | ||||||||||||||||||||
| 130 | ConferenceStatusCallbackMethod => $options->{conference_status_callback_method}, | ||||||||||||||||||||
| 131 | ConferenceTrim => $options->{conference_trim}, | ||||||||||||||||||||
| 132 | DequeueFrom => $options->{dequeue_from}, | ||||||||||||||||||||
| 133 | DequeuePostWorkActivitySid => $options->{dequeue_post_work_activity_sid}, | ||||||||||||||||||||
| 134 | DequeueRecord => $options->{dequeue_record}, | ||||||||||||||||||||
| 135 | DequeueStatusCallbackEvent => $options->{dequeue_status_callback_event}, | ||||||||||||||||||||
| 136 | DequeueStatusCallbackUrl => $options->{dequeue_status_callback_url}, | ||||||||||||||||||||
| 137 | DequeueTimeout => $options->{dequeue_timeout}, | ||||||||||||||||||||
| 138 | DequeueTo => $options->{dequeue_to}, | ||||||||||||||||||||
| 139 | EarlyMedia => Twilio::Serialize::boolean_to_string($options->{early_media}), | ||||||||||||||||||||
| 140 | EndConferenceOnCustomerExit => | ||||||||||||||||||||
| 141 | Twilio::Serialize::boolean_to_string($options->{end_conference_on_customer_exit}), | ||||||||||||||||||||
| 142 | EndConferenceOnExit => Twilio::Serialize::boolean_to_string($options->{end_conference_on_exit}), | ||||||||||||||||||||
| 143 | From => $options->{from}, | ||||||||||||||||||||
| 144 | Instruction => $options->{instruction}, | ||||||||||||||||||||
| 145 | JitterBufferSize => $options->{jitter_buffer_size}, | ||||||||||||||||||||
| 146 | MaxParticipants => $options->{max_participants}, | ||||||||||||||||||||
| 147 | Muted => Twilio::Serialize::boolean_to_string($options->{muted}), | ||||||||||||||||||||
| 148 | PostWorkActivitySid => $options->{post_work_activity_sid}, | ||||||||||||||||||||
| 149 | Record => Twilio::Serialize::boolean_to_string($options->{record}), | ||||||||||||||||||||
| 150 | RecordingChannels => $options->{recording_channels}, | ||||||||||||||||||||
| 151 | RecordingStatusCallback => $options->{recording_status_callback}, | ||||||||||||||||||||
| 152 | RecordingStatusCallbackMethod => $options->{recording_status_callback_method}, | ||||||||||||||||||||
| 153 | RedirectAccept => Twilio::Serialize::boolean_to_string($options->{redirect_accept}), | ||||||||||||||||||||
| 154 | RedirectCallSid => $options->{redirect_call_sid}, | ||||||||||||||||||||
| 155 | RedirectUrl => $options->{redirect_url}, | ||||||||||||||||||||
| 156 | Region => $options->{region}, | ||||||||||||||||||||
| 157 | ReservationStatus => $options->{reservation_status}, | ||||||||||||||||||||
| 158 | SipAuthPassword => $options->{sip_auth_password}, | ||||||||||||||||||||
| 159 | SipAuthUsername => $options->{sip_auth_username}, | ||||||||||||||||||||
| 160 | StartConferenceOnEnter => | ||||||||||||||||||||
| 161 | Twilio::Serialize::boolean_to_string($options->{start_conference_on_enter}), | ||||||||||||||||||||
| 162 | StatusCallback => $options->{status_callback}, | ||||||||||||||||||||
| 163 | StatusCallbackEvent => $options->{status_callback_event}, | ||||||||||||||||||||
| 164 | StatusCallbackMethod => $options->{status_callback_method}, | ||||||||||||||||||||
| 165 | Supervisor => $options->{supervisor}, | ||||||||||||||||||||
| 166 | SupervisorMode => $options->{supervisor_mode}, | ||||||||||||||||||||
| 167 | Timeout => $options->{timeout}, | ||||||||||||||||||||
| 168 | To => $options->{to}, | ||||||||||||||||||||
| 169 | WaitMethod => $options->{wait_method}, | ||||||||||||||||||||
| 170 | WaitUrl => $options->{wait_url}, | ||||||||||||||||||||
| 171 | WorkerActivitySid => $options->{worker_activity_sid}, | ||||||||||||||||||||
| 172 | 1 | }; | |||||||||||||||||||
| 173 | |||||||||||||||||||||
| 174 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 175 | 'POST', | ||||||||||||||||||||
| 176 | $self->{uri}, | ||||||||||||||||||||
| 177 | 'update', | ||||||||||||||||||||
| 178 | { | ||||||||||||||||||||
| 179 | data => $data, | ||||||||||||||||||||
| 180 | headers => { 'If-Match' => $options->{if_match}, } | ||||||||||||||||||||
| 181 | } | ||||||||||||||||||||
| 182 | 1 | ); | |||||||||||||||||||
| 183 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 184 | } | ||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 187 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 188 | return Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationInstance->new( | ||||||||||||||||||||
| 189 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 190 | $self->{solution}{workspace_sid}, | ||||||||||||||||||||
| 191 | $self->{solution}{task_sid}, | ||||||||||||||||||||
| 192 | $self->{solution}{sid} | ||||||||||||||||||||
| 193 | 2 | ); | |||||||||||||||||||
| 194 | } | ||||||||||||||||||||
| 195 | |||||||||||||||||||||
| 196 | package Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationInstance; | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 199 | |||||||||||||||||||||
| 200 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 201 | |||||||||||||||||||||
| 202 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 203 | 3 | my ($class, $version, $payload, $workspace_sid, $task_sid, $sid) = @_; | |||||||||||||||||||
| 204 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 205 | $self->{solution} = { | ||||||||||||||||||||
| 206 | workspace_sid => $workspace_sid, | ||||||||||||||||||||
| 207 | task_sid => $task_sid, | ||||||||||||||||||||
| 208 | sid => $sid // $self->{properties}{sid} | ||||||||||||||||||||
| 209 | 3 | ▶ | }; | ||||||||||||||||||
|
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"}
| |||||||||||||||||||||
| 210 | 3 | return $self; | |||||||||||||||||||
| 211 | } | ||||||||||||||||||||
| 212 | |||||||||||||||||||||
| 213 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 214 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 215 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 216 | } | ||||||||||||||||||||
| 217 | |||||||||||||||||||||
| 218 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 219 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 220 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 221 | } | ||||||||||||||||||||
| 222 | |||||||||||||||||||||
| 223 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 224 | 0 | my ($self) = @_; | |||||||||||||||||||
| 225 | return Twilio::Rest::Taskrouter::V1::Workspace::Task::ReservationContext->new( | ||||||||||||||||||||
| 226 | $self->{version}, | ||||||||||||||||||||
| 227 | $self->{solution}{workspace_sid}, | ||||||||||||||||||||
| 228 | $self->{solution}{task_sid}, | ||||||||||||||||||||
| 229 | $self->{solution}{sid} | ||||||||||||||||||||
| 230 | 0 | ); | |||||||||||||||||||
| 231 | } | ||||||||||||||||||||
| 232 | |||||||||||||||||||||
| 233 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 234 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 235 | 3 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 236 | 3 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 237 | 3 | ▶ | sub reservation_status { return $_[0]{properties}{reservation_status} } | ||||||||||||||||||
|
Subroutine
reservation_status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 238 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 239 | 3 | ▶ | sub task_sid { return $_[0]{properties}{task_sid} } | ||||||||||||||||||
|
Subroutine
task_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 240 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 241 | 3 | ▶ | sub worker_name { return $_[0]{properties}{worker_name} } | ||||||||||||||||||
|
Subroutine
worker_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 242 | 3 | ▶ | sub worker_sid { return $_[0]{properties}{worker_sid} } | ||||||||||||||||||
|
Subroutine
worker_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 243 | 3 | ▶ | sub workspace_sid { return $_[0]{properties}{workspace_sid} } | ||||||||||||||||||
|
Subroutine
workspace_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 244 | |||||||||||||||||||||
| 245 | 2 | 1; | |||||||||||||||||||
| 246 | |||||||||||||||||||||
| 247 | __END__ | ||||||||||||||||||||