Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::ReservationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::ReservationInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the WorkerReservation resource.
-
#context ⇒ ReservationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#fetch ⇒ ReservationInstance
Fetch the ReservationInstance.
-
#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ ReservationInstance
constructor
Initialize the ReservationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
- #reservation_status ⇒ Status
-
#sid ⇒ String
The unique string that we created to identify the WorkerReservation resource.
-
#task_sid ⇒ String
The SID of the reserved Task resource.
-
#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.
-
#url ⇒ String
The absolute URL of the WorkerReservation resource.
-
#worker_name ⇒ String
The ‘friendly_name` of the Worker that is reserved.
-
#worker_sid ⇒ String
The SID of the reserved Worker resource.
-
#workspace_sid ⇒ String
The SID of the Workspace that this worker is contained within.
Constructor Details
#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ ReservationInstance
Initialize the ReservationInstance
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 414 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 || @properties['workspace_sid'] ,'worker_sid' => worker_sid || @properties['worker_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the WorkerReservation resource.
450 451 452 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 450 def account_sid @properties['account_sid'] end |
#context ⇒ ReservationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
441 442 443 444 445 446 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 441 def context unless @instance_context @instance_context = ReservationContext.new(@version , @params['workspace_sid'], @params['worker_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
456 457 458 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 456 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
462 463 464 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 462 def date_updated @properties['date_updated'] end |
#fetch ⇒ ReservationInstance
Fetch the ReservationInstance
517 518 519 520 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 517 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
700 701 702 703 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 700 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.ReservationInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
510 511 512 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 510 def links @properties['links'] end |
#reservation_status ⇒ Status
468 469 470 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 468 def reservation_status @properties['reservation_status'] end |
#sid ⇒ String
Returns The unique string that we created to identify the WorkerReservation resource.
474 475 476 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 474 def sid @properties['sid'] end |
#task_sid ⇒ String
Returns The SID of the reserved Task resource.
480 481 482 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 480 def task_sid @properties['task_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
693 694 695 696 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 693 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, jitter_buffer_size: :unset, if_match: :unset) ⇒ ReservationInstance
Update the ReservationInstance
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 578 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 ) 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, jitter_buffer_size: jitter_buffer_size, if_match: if_match, ) end |
#url ⇒ String
Returns The absolute URL of the WorkerReservation resource.
504 505 506 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 504 def url @properties['url'] end |
#worker_name ⇒ String
Returns The ‘friendly_name` of the Worker that is reserved.
486 487 488 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 486 def worker_name @properties['worker_name'] end |
#worker_sid ⇒ String
Returns The SID of the reserved Worker resource.
492 493 494 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 492 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that this worker is contained within.
498 499 500 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb', line 498 def workspace_sid @properties['workspace_sid'] end |