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