Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::ReservationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::ReservationContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb
Instance Method Summary collapse
-
#fetch ⇒ ReservationInstance
Fetch the ReservationInstance.
-
#initialize(version, workspace_sid, worker_sid, sid) ⇒ ReservationContext
constructor
Initialize the ReservationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(reservation_status: :unset, worker_activity_sid: :unset, instruction: :unset, dequeue_post_work_activity_sid: :unset, dequeue_from: :unset, dequeue_record: :unset, dequeue_timeout: :unset, dequeue_to: :unset, dequeue_status_callback_url: :unset, call_from: :unset, call_record: :unset, call_timeout: :unset, call_to: :unset, call_url: :unset, call_status_callback_url: :unset, call_accept: :unset, redirect_call_sid: :unset, redirect_accept: :unset, redirect_url: :unset, to: :unset, from: :unset, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, conference_record: :unset, conference_trim: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, region: :unset, sip_auth_username: :unset, sip_auth_password: :unset, dequeue_status_callback_event: :unset, post_work_activity_sid: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, jitter_buffer_size: :unset, if_match: :unset) ⇒ ReservationInstance
Update the ReservationInstance.
Constructor Details
#initialize(version, workspace_sid, worker_sid, sid) ⇒ ReservationContext
Initialize the ReservationContext
147 148 149 150 151 152 153 154 155 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 147 def initialize(version, workspace_sid, worker_sid, sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, worker_sid: worker_sid, sid: sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/#{@solution[:worker_sid]}/Reservations/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ ReservationInstance
Fetch the ReservationInstance
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 159 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ReservationInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], worker_sid: @solution[:worker_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
370 371 372 373 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 370 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.ReservationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
363 364 365 366 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 363 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.ReservationContext #{context}>" end |
#update(reservation_status: :unset, worker_activity_sid: :unset, instruction: :unset, dequeue_post_work_activity_sid: :unset, dequeue_from: :unset, dequeue_record: :unset, dequeue_timeout: :unset, dequeue_to: :unset, dequeue_status_callback_url: :unset, call_from: :unset, call_record: :unset, call_timeout: :unset, call_to: :unset, call_url: :unset, call_status_callback_url: :unset, call_accept: :unset, redirect_call_sid: :unset, redirect_accept: :unset, redirect_url: :unset, to: :unset, from: :unset, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, conference_record: :unset, conference_trim: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, region: :unset, sip_auth_username: :unset, sip_auth_password: :unset, dequeue_status_callback_event: :unset, post_work_activity_sid: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, jitter_buffer_size: :unset, if_match: :unset) ⇒ ReservationInstance
Update the ReservationInstance
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 233 def update( reservation_status: :unset, worker_activity_sid: :unset, instruction: :unset, dequeue_post_work_activity_sid: :unset, dequeue_from: :unset, dequeue_record: :unset, dequeue_timeout: :unset, dequeue_to: :unset, dequeue_status_callback_url: :unset, call_from: :unset, call_record: :unset, call_timeout: :unset, call_to: :unset, call_url: :unset, call_status_callback_url: :unset, call_accept: :unset, redirect_call_sid: :unset, redirect_accept: :unset, redirect_url: :unset, to: :unset, from: :unset, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, conference_record: :unset, conference_trim: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, region: :unset, sip_auth_username: :unset, sip_auth_password: :unset, dequeue_status_callback_event: :unset, post_work_activity_sid: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, jitter_buffer_size: :unset, if_match: :unset ) data = Twilio::Values.of({ 'ReservationStatus' => reservation_status, 'WorkerActivitySid' => worker_activity_sid, 'Instruction' => instruction, 'DequeuePostWorkActivitySid' => dequeue_post_work_activity_sid, 'DequeueFrom' => dequeue_from, 'DequeueRecord' => dequeue_record, 'DequeueTimeout' => dequeue_timeout, 'DequeueTo' => dequeue_to, 'DequeueStatusCallbackUrl' => dequeue_status_callback_url, 'CallFrom' => call_from, 'CallRecord' => call_record, 'CallTimeout' => call_timeout, 'CallTo' => call_to, 'CallUrl' => call_url, 'CallStatusCallbackUrl' => call_status_callback_url, 'CallAccept' => call_accept, 'RedirectCallSid' => redirect_call_sid, 'RedirectAccept' => redirect_accept, 'RedirectUrl' => redirect_url, 'To' => to, 'From' => from, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e }, 'Timeout' => timeout, 'Record' => record, 'Muted' => muted, 'Beep' => beep, 'StartConferenceOnEnter' => start_conference_on_enter, 'EndConferenceOnExit' => end_conference_on_exit, 'WaitUrl' => wait_url, 'WaitMethod' => wait_method, 'EarlyMedia' => early_media, 'MaxParticipants' => max_participants, 'ConferenceStatusCallback' => conference_status_callback, 'ConferenceStatusCallbackMethod' => conference_status_callback_method, 'ConferenceStatusCallbackEvent' => Twilio.serialize_list(conference_status_callback_event) { |e| e }, 'ConferenceRecord' => conference_record, 'ConferenceTrim' => conference_trim, 'RecordingChannels' => recording_channels, 'RecordingStatusCallback' => recording_status_callback, 'RecordingStatusCallbackMethod' => recording_status_callback_method, 'ConferenceRecordingStatusCallback' => conference_recording_status_callback, 'ConferenceRecordingStatusCallbackMethod' => conference_recording_status_callback_method, 'Region' => region, 'SipAuthUsername' => sip_auth_username, 'SipAuthPassword' => sip_auth_password, 'DequeueStatusCallbackEvent' => Twilio.serialize_list(dequeue_status_callback_event) { |e| e }, 'PostWorkActivitySid' => post_work_activity_sid, 'EndConferenceOnCustomerExit' => end_conference_on_customer_exit, 'BeepOnCustomerEntrance' => beep_on_customer_entrance, 'JitterBufferSize' => jitter_buffer_size, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) payload = @version.update('POST', @uri, data: data, headers: headers) ReservationInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], worker_sid: @solution[:worker_sid], sid: @solution[:sid], ) end |