class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskContext::ReservationInstance
Public Class Methods
Initialize the ReservationInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] workspace_sid
The SID of the Workspace that this task is
contained within.
@param [String] task_sid
The SID of the reserved Task resource. @param [String] sid The SID of the TaskReservation resource to fetch. @return [ReservationInstance] ReservationInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 419 def initialize(version, payload, workspace_sid: nil, task_sid: nil, sid: nil) 420 super(version) 421 422 # Marshaled Properties 423 @properties = { 424 'account_sid' => payload['account_sid'], 425 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 426 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 427 'reservation_status' => payload['reservation_status'], 428 'sid' => payload['sid'], 429 'task_sid' => payload['task_sid'], 430 'worker_name' => payload['worker_name'], 431 'worker_sid' => payload['worker_sid'], 432 'workspace_sid' => payload['workspace_sid'], 433 'url' => payload['url'], 434 'links' => payload['links'], 435 } 436 437 # Context 438 @instance_context = nil 439 @params = { 440 'workspace_sid' => workspace_sid, 441 'task_sid' => task_sid, 442 'sid' => sid || @properties['sid'], 443 } 444 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 464 def account_sid 465 @properties['account_sid'] 466 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ReservationContext] ReservationContext
for this ReservationInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 450 def context 451 unless @instance_context 452 @instance_context = ReservationContext.new( 453 @version, 454 @params['workspace_sid'], 455 @params['task_sid'], 456 @params['sid'], 457 ) 458 end 459 @instance_context 460 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 470 def date_created 471 @properties['date_created'] 472 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 476 def date_updated 477 @properties['date_updated'] 478 end
Fetch the ReservationInstance
@return [ReservationInstance] Fetched ReservationInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 531 def fetch 532 context.fetch 533 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 733 def inspect 734 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 735 "<Twilio.Taskrouter.V1.ReservationInstance #{values}>" 736 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 524 def links 525 @properties['links'] 526 end
@return [reservation.Status] The current status of the reservation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 482 def reservation_status 483 @properties['reservation_status'] 484 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 488 def sid 489 @properties['sid'] 490 end
@return [String] The SID of the reserved Task resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 494 def task_sid 495 @properties['task_sid'] 496 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 726 def to_s 727 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 728 "<Twilio.Taskrouter.V1.ReservationInstance #{values}>" 729 end
Update the ReservationInstance
@param [reservation.Status] reservation_status
The new status of the
reservation. Can be: `pending`, `accepted`, `rejected`, or `timeout`.
@param [String] worker_activity_sid The new worker activity SID if rejecting a
reservation.
@param [String] instruction The assignment instruction for reservation. @param [String] dequeue_post_work_activity_sid The SID of the Activity resource
to start after executing a Dequeue instruction.
@param [String] dequeue_from The Caller ID of the call to the worker when
executing a Dequeue instruction.
@param [String] dequeue_record Whether to record both legs of a call when
executing a Dequeue instruction or which leg to record.
@param [String] dequeue_timeout Timeout for call when executing a Dequeue
instruction.
@param [String] dequeue_to The Contact URI of the worker when executing a
Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the {E.164}[https://www.twilio.com/docs/glossary/what-e164] formatted phone number, depending on the destination.
@param [String] dequeue_status_callback_url The Callback URL for completed call
event when executing a Dequeue instruction.
@param [String] call_from The Caller ID of the outbound call when executing a
Call instruction.
@param [String] call_record Whether to record both legs of a call when executing
a Call instruction or which leg to record.
@param [String] call_timeout Timeout for call when executing a Call instruction. @param [String] call_to The Contact URI of the worker when executing a Call
instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the {E.164}[https://www.twilio.com/docs/glossary/what-e164] formatted phone number, depending on the destination.
@param [String] call_url TwiML
URI executed on answering the worker's leg as a
result of the Call instruction.
@param [String] call_status_callback_url The URL to call for the completed call
event when executing a Call instruction.
@param [Boolean] call_accept Whether to accept a reservation when executing a
Call instruction.
@param [String] redirect_call_sid The Call SID of the call parked in the queue
when executing a Redirect instruction.
@param [Boolean] redirect_accept Whether the reservation should be accepted when
executing a Redirect instruction.
@param [String] redirect_url TwiML
URI to redirect the call to when executing
the Redirect instruction.
@param [String] to The Contact URI of the worker when executing a Conference
instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the {E.164}[https://www.twilio.com/docs/glossary/what-e164] formatted phone number, depending on the destination.
@param [String] from The Caller ID of the call to the worker when executing a
Conference instruction.
@param [String] status_callback The URL we should call using the
`status_callback_method` to send status information to your application.
@param [String] status_callback_method The HTTP
method we should use to call
`status_callback`. Can be: `POST` or `GET` and the default is `POST`.
@param [Array] status_callback_event The call progress
events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`.
@param [String] timeout Timeout for call when executing a Conference
instruction.
@param [Boolean] record Whether to record the participant and their conferences,
including the time between conferences. The default is `false`.
@param [Boolean] muted Whether the agent is muted in the conference. The default
is `false`.
@param [String] beep Whether to play a notification beep when the participant
joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`.
@param [Boolean] start_conference_on_enter Whether to start the conference when
the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference.
@param [Boolean] end_conference_on_exit Whether to end the conference when the
agent leaves.
@param [String] wait_url The URL we should call using the `wait_method` for the
music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. {Learn more about hold music}[https://www.twilio.com/labs/twimlets/holdmusic].
@param [String] wait_method The HTTP
method we should use to call `wait_url`.
Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file.
@param [Boolean] early_media Whether to allow an agent to hear the state of the
outbound call, including ringing or disconnect messages. The default is `true`.
@param [String] max_participants The maximum number of participants in the
conference. Can be a positive integer from `2` to `250`. The default value is `250`.
@param [String] conference_status_callback The URL we should call using the
`conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored.
@param [String] conference_status_callback_method The HTTP
method we should use
to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
@param [Array] conference_status_callback_event The
conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`.
@param [String] conference_record Whether to record the conference the
participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`.
@param [String] conference_trim How to trim the leading and trailing silence
from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`.
@param [String] recording_channels The recording channels for the final
recording. Can be: `mono` or `dual` and the default is `mono`.
@param [String] recording_status_callback The URL that we should call using the
`recording_status_callback_method` when the recording status changes.
@param [String] recording_status_callback_method The HTTP
method we should use
when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
@param [String] conference_recording_status_callback The URL we should call
using the `conference_recording_status_callback_method` when the conference recording is available.
@param [String] conference_recording_status_callback_method The HTTP
method we
should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
@param [String] region The
{region}[https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls] where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
@param [String] sip_auth_username The SIP username used for authentication. @param [String] sip_auth_password The SIP password for authentication. @param [Array] dequeue_status_callback_event The Call progress events
sent via webhooks as a result of a Dequeue instruction.
@param [String] post_work_activity_sid The new worker activity SID after
executing a Conference instruction.
@param [reservation.SupervisorMode] supervisor_mode The Supervisor mode when
executing the Supervise instruction.
@param [String] supervisor The Supervisor SID/URI when executing the Supervise
instruction.
@param [Boolean] end_conference_on_customer_exit Whether to end the conference
when the customer leaves.
@param [Boolean] beep_on_customer_entrance Whether to play a notification beep
when the customer joins.
@return [ReservationInstance] Updated ReservationInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 666 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, supervisor_mode: :unset, supervisor: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset) 667 context.update( 668 reservation_status: reservation_status, 669 worker_activity_sid: worker_activity_sid, 670 instruction: instruction, 671 dequeue_post_work_activity_sid: dequeue_post_work_activity_sid, 672 dequeue_from: dequeue_from, 673 dequeue_record: dequeue_record, 674 dequeue_timeout: dequeue_timeout, 675 dequeue_to: dequeue_to, 676 dequeue_status_callback_url: dequeue_status_callback_url, 677 call_from: call_from, 678 call_record: call_record, 679 call_timeout: call_timeout, 680 call_to: call_to, 681 call_url: call_url, 682 call_status_callback_url: call_status_callback_url, 683 call_accept: call_accept, 684 redirect_call_sid: redirect_call_sid, 685 redirect_accept: redirect_accept, 686 redirect_url: redirect_url, 687 to: to, 688 from: from, 689 status_callback: status_callback, 690 status_callback_method: status_callback_method, 691 status_callback_event: status_callback_event, 692 timeout: timeout, 693 record: record, 694 muted: muted, 695 beep: beep, 696 start_conference_on_enter: start_conference_on_enter, 697 end_conference_on_exit: end_conference_on_exit, 698 wait_url: wait_url, 699 wait_method: wait_method, 700 early_media: early_media, 701 max_participants: max_participants, 702 conference_status_callback: conference_status_callback, 703 conference_status_callback_method: conference_status_callback_method, 704 conference_status_callback_event: conference_status_callback_event, 705 conference_record: conference_record, 706 conference_trim: conference_trim, 707 recording_channels: recording_channels, 708 recording_status_callback: recording_status_callback, 709 recording_status_callback_method: recording_status_callback_method, 710 conference_recording_status_callback: conference_recording_status_callback, 711 conference_recording_status_callback_method: conference_recording_status_callback_method, 712 region: region, 713 sip_auth_username: sip_auth_username, 714 sip_auth_password: sip_auth_password, 715 dequeue_status_callback_event: dequeue_status_callback_event, 716 post_work_activity_sid: post_work_activity_sid, 717 supervisor_mode: supervisor_mode, 718 supervisor: supervisor, 719 end_conference_on_customer_exit: end_conference_on_customer_exit, 720 beep_on_customer_entrance: beep_on_customer_entrance, 721 ) 722 end
@return [String] The absolute URL of the TaskReservation reservation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 518 def url 519 @properties['url'] 520 end
@return [String] The friendly_name of the Worker that is reserved
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 500 def worker_name 501 @properties['worker_name'] 502 end
@return [String] The SID of the reserved Worker resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 506 def worker_sid 507 @properties['worker_sid'] 508 end
@return [String] The SID of the Workspace that this task is contained within.
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb 512 def workspace_sid 513 @properties['workspace_sid'] 514 end