Class: Twilio::REST::FlexApi::V1::InteractionContext::InteractionChannelInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V1::InteractionContext::InteractionChannelInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb
Instance Method Summary collapse
-
#context ⇒ InteractionChannelContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#error_code ⇒ String
The Twilio error code for a failed channel.
-
#error_message ⇒ String
The error message for a failed channel.
-
#fetch ⇒ InteractionChannelInstance
Fetch the InteractionChannelInstance.
-
#initialize(version, payload, interaction_sid: nil, sid: nil) ⇒ InteractionChannelInstance
constructor
Initialize the InteractionChannelInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#interaction_sid ⇒ String
The unique string created by Twilio to identify an Interaction resource, prefixed with KD.
-
#invites ⇒ invites
Access the invites.
- #links ⇒ Hash
-
#participants ⇒ participants
Access the participants.
-
#sid ⇒ String
The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO.
- #status ⇒ ChannelStatus
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transfers ⇒ transfers
Access the transfers.
- #type ⇒ Type
-
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance.
- #url ⇒ String
Constructor Details
#initialize(version, payload, interaction_sid: nil, sid: nil) ⇒ InteractionChannelInstance
Initialize the InteractionChannelInstance
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 498 def initialize(version, payload , interaction_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'interaction_sid' => payload['interaction_sid'], 'type' => payload['type'], 'status' => payload['status'], 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i, 'error_message' => payload['error_message'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'interaction_sid' => interaction_sid || @properties['interaction_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#context ⇒ InteractionChannelContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
523 524 525 526 527 528 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 523 def context unless @instance_context @instance_context = InteractionChannelContext.new(@version , @params['interaction_sid'], @params['sid']) end @instance_context end |
#error_code ⇒ String
Returns The Twilio error code for a failed channel.
556 557 558 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 556 def error_code @properties['error_code'] end |
#error_message ⇒ String
Returns The error message for a failed channel.
562 563 564 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 562 def @properties['error_message'] end |
#fetch ⇒ InteractionChannelInstance
Fetch the InteractionChannelInstance
581 582 583 584 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 581 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
632 633 634 635 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 632 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionChannelInstance #{values}>" end |
#interaction_sid ⇒ String
Returns The unique string created by Twilio to identify an Interaction resource, prefixed with KD.
538 539 540 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 538 def interaction_sid @properties['interaction_sid'] end |
#invites ⇒ invites
Access the invites
605 606 607 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 605 def invites context.invites end |
#links ⇒ Hash
574 575 576 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 574 def links @properties['links'] end |
#participants ⇒ participants
Access the participants
619 620 621 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 619 def participants context.participants end |
#sid ⇒ String
Returns The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO.
532 533 534 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 532 def sid @properties['sid'] end |
#status ⇒ ChannelStatus
550 551 552 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 550 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
625 626 627 628 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 625 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionChannelInstance #{values}>" end |
#transfers ⇒ transfers
Access the transfers
612 613 614 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 612 def transfers context.transfers end |
#type ⇒ Type
544 545 546 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 544 def type @properties['type'] end |
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance
591 592 593 594 595 596 597 598 599 600 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 591 def update( status: nil, routing: :unset ) context.update( status: status, routing: routing, ) end |
#url ⇒ String
568 569 570 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 568 def url @properties['url'] end |