Class: Twilio::REST::FlexApi::V1::InteractionContext::InteractionChannelContext::InteractionChannelParticipantInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, interaction_sid: nil, channel_sid: nil, sid: nil) ⇒ InteractionChannelParticipantInstance

Initialize the InteractionChannelParticipantInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this InteractionChannelParticipant resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 265

def initialize(version, payload , interaction_sid: nil, channel_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'type' => payload['type'],
        'interaction_sid' => payload['interaction_sid'],
        'channel_sid' => payload['channel_sid'],
        'url' => payload['url'],
        'routing_properties' => payload['routing_properties'],
    }

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

Instance Method Details

#channel_sidString

Returns The Channel Sid for this Participant.

Returns:

  • (String)

    The Channel Sid for this Participant.



314
315
316
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 314

def channel_sid
    @properties['channel_sid']
end

#contextInteractionChannelParticipantContext

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

Returns:



287
288
289
290
291
292
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 287

def context
    unless @instance_context
        @instance_context = InteractionChannelParticipantContext.new(@version , @params['interaction_sid'], @params['channel_sid'], @params['sid'])
    end
    @instance_context
end

#inspectObject

Provide a detailed, user friendly representation



352
353
354
355
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 352

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

#interaction_sidString

Returns The Interaction Sid for this channel.

Returns:

  • (String)

    The Interaction Sid for this channel.



308
309
310
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 308

def interaction_sid
    @properties['interaction_sid']
end

#routing_propertiesHash

Returns The Participant’s routing properties.

Returns:

  • (Hash)

    The Participant’s routing properties.



326
327
328
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 326

def routing_properties
    @properties['routing_properties']
end

#sidString

Returns The unique string created by Twilio to identify an Interaction Channel Participant resource.

Returns:

  • (String)

    The unique string created by Twilio to identify an Interaction Channel Participant resource.



296
297
298
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 296

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



345
346
347
348
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 345

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.FlexApi.V1.InteractionChannelParticipantInstance #{values}>"
end

#typeType

Returns:

  • (Type)


302
303
304
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 302

def type
    @properties['type']
end

#update(status: nil) ⇒ InteractionChannelParticipantInstance

Update the InteractionChannelParticipantInstance

Parameters:

  • status (Status) (defaults to: nil)

Returns:



334
335
336
337
338
339
340
341
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 334

def update(
    status: nil
)

    context.update(
        status: status, 
    )
end

#urlString

Returns:

  • (String)


320
321
322
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 320

def url
    @properties['url']
end