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 that identifies the resource.
-
#invites ⇒ invites
Access the invites.
-
#links ⇒ String
The links.
-
#participants ⇒ participants
Access the participants.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ interaction_channel.ChannelStatus
The status of this channel.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ interaction_channel.Type
The Interaction Channel’s type.
-
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, interaction_sid: nil, sid: nil) ⇒ InteractionChannelInstance
Initialize the InteractionChannelInstance
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 270 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, '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
294 295 296 297 298 299 300 301 302 303 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 294 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.
331 332 333 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 331 def error_code @properties['error_code'] end |
#error_message ⇒ String
Returns The error message for a failed channel.
337 338 339 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 337 def @properties['error_message'] end |
#fetch ⇒ InteractionChannelInstance
Fetch the InteractionChannelInstance
356 357 358 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 356 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
396 397 398 399 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 396 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionChannelInstance #{values}>" end |
#interaction_sid ⇒ String
Returns The unique string that identifies the resource.
313 314 315 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 313 def interaction_sid @properties['interaction_sid'] end |
#invites ⇒ invites
Access the invites
376 377 378 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 376 def invites context.invites end |
#links ⇒ String
Returns The links.
349 350 351 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 349 def links @properties['links'] end |
#participants ⇒ participants
Access the participants
383 384 385 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 383 def participants context.participants end |
#sid ⇒ String
Returns The unique string that identifies the resource.
307 308 309 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 307 def sid @properties['sid'] end |
#status ⇒ interaction_channel.ChannelStatus
Returns The status of this channel.
325 326 327 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 325 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
389 390 391 392 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 389 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionChannelInstance #{values}>" end |
#type ⇒ interaction_channel.Type
Returns The Interaction Channel’s type.
319 320 321 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 319 def type @properties['type'] end |
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance
369 370 371 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 369 def update(status: nil, routing: :unset) context.update(status: status, routing: routing, ) end |
#url ⇒ String
Returns The url.
343 344 345 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 343 def url @properties['url'] end |