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

  • interaction_sid (String) (defaults to: nil)

    The Interaction Sid for this channel.

  • channel_sid (String) (defaults to: nil)

    The Channel Sid for this Participant.

  • sid (String) (defaults to: nil)

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


235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 235

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'],
  }

  # Context
  @instance_context = nil
  @params = {
      'interaction_sid' => interaction_sid,
      'channel_sid' => 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.


292
293
294
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 292

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:


260
261
262
263
264
265
266
267
268
269
270
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 260

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


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

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.


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

def interaction_sid
  @properties['interaction_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


274
275
276
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 274

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


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

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

#typeinteraction_channel_participant.Type

Returns Participant type.

Returns:

  • (interaction_channel_participant.Type)

    Participant type.


280
281
282
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 280

def type
  @properties['type']
end

#update(status: nil) ⇒ InteractionChannelParticipantInstance

Update the InteractionChannelParticipantInstance

Parameters:

  • status (interaction_channel_participant.Status) (defaults to: nil)

    The Participant's status. Can be: `closed` or `wrapup`. Participant must be an agent.

Returns:


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

def update(status: nil)
  context.update(status: status, )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


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

def url
  @properties['url']
end