Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::ReservationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ ReservationInstance

Initialize the ReservationInstance



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 351

def initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'reservation_status' => payload['reservation_status'],
      'sid' => payload['sid'],
      'task_sid' => payload['task_sid'],
      'worker_name' => payload['worker_name'],
      'worker_sid' => payload['worker_sid'],
      'workspace_sid' => payload['workspace_sid'],
      'url' => payload['url'],
      'links' => payload['links'],
  }

  # Context
  @instance_context = nil
  @params = {
      'workspace_sid' => workspace_sid,
      'worker_sid' => worker_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString



396
397
398
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 396

def 
  @properties['account_sid']
end

#contextReservationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



382
383
384
385
386
387
388
389
390
391
392
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 382

def context
  unless @instance_context
    @instance_context = ReservationContext.new(
        @version,
        @params['workspace_sid'],
        @params['worker_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#date_createdTime



402
403
404
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 402

def date_created
  @properties['date_created']
end

#date_updatedTime



408
409
410
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 408

def date_updated
  @properties['date_updated']
end

#fetchReservationInstance

Fetch a ReservationInstance



463
464
465
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 463

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



592
593
594
595
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 592

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Taskrouter.V1.ReservationInstance #{values}>"
end


456
457
458
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 456

def links
  @properties['links']
end

#reservation_statusreservation.Status



414
415
416
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 414

def reservation_status
  @properties['reservation_status']
end

#sidString



420
421
422
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 420

def sid
  @properties['sid']
end

#task_sidString



426
427
428
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 426

def task_sid
  @properties['task_sid']
end

#to_sObject

Provide a user friendly representation



585
586
587
588
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 585

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Taskrouter.V1.ReservationInstance #{values}>"
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) ⇒ ReservationInstance

Update the ReservationInstance



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 527

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)
  context.update(
      reservation_status: reservation_status,
      worker_activity_sid: worker_activity_sid,
      instruction: instruction,
      dequeue_post_work_activity_sid: dequeue_post_work_activity_sid,
      dequeue_from: dequeue_from,
      dequeue_record: dequeue_record,
      dequeue_timeout: dequeue_timeout,
      dequeue_to: dequeue_to,
      dequeue_status_callback_url: dequeue_status_callback_url,
      call_from: call_from,
      call_record: call_record,
      call_timeout: call_timeout,
      call_to: call_to,
      call_url: call_url,
      call_status_callback_url: call_status_callback_url,
      call_accept: call_accept,
      redirect_call_sid: redirect_call_sid,
      redirect_accept: redirect_accept,
      redirect_url: redirect_url,
      to: to,
      from: from,
      status_callback: status_callback,
      status_callback_method: status_callback_method,
      status_callback_event: status_callback_event,
      timeout: timeout,
      record: record,
      muted: muted,
      beep: beep,
      start_conference_on_enter: start_conference_on_enter,
      end_conference_on_exit: end_conference_on_exit,
      wait_url: wait_url,
      wait_method: wait_method,
      early_media: early_media,
      max_participants: max_participants,
      conference_status_callback: conference_status_callback,
      conference_status_callback_method: conference_status_callback_method,
      conference_status_callback_event: conference_status_callback_event,
      conference_record: conference_record,
      conference_trim: conference_trim,
      recording_channels: recording_channels,
      recording_status_callback: recording_status_callback,
      recording_status_callback_method: recording_status_callback_method,
      conference_recording_status_callback: conference_recording_status_callback,
      conference_recording_status_callback_method: conference_recording_status_callback_method,
      region: region,
      sip_auth_username: sip_auth_username,
      sip_auth_password: sip_auth_password,
      dequeue_status_callback_event: dequeue_status_callback_event,
      post_work_activity_sid: post_work_activity_sid,
      end_conference_on_customer_exit: end_conference_on_customer_exit,
      beep_on_customer_entrance: beep_on_customer_entrance,
  )
end

#urlString



450
451
452
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 450

def url
  @properties['url']
end

#worker_nameString



432
433
434
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 432

def worker_name
  @properties['worker_name']
end

#worker_sidString



438
439
440
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 438

def worker_sid
  @properties['worker_sid']
end

#workspace_sidString



444
445
446
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 444

def workspace_sid
  @properties['workspace_sid']
end