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

Inherits:
InstanceContext
  • 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, interaction_sid, channel_sid, sid) ⇒ InteractionChannelParticipantContext

Initialize the InteractionChannelParticipantContext

Parameters:

  • version (Version)

    Version that contains the resource

  • interaction_sid (String)

    The Interaction Sid for this channel.

  • channel_sid (String)

    The Channel Sid for this Participant.

  • sid (String)

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



174
175
176
177
178
179
180
181
182
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 174

def initialize(version, interaction_sid, channel_sid, sid)
    super(version)

    # Path Solution
    @solution = { interaction_sid: interaction_sid, channel_sid: channel_sid, sid: sid,  }
    @uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Participants/#{@solution[:sid]}"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



221
222
223
224
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 221

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InteractionChannelParticipantContext #{context}>"
end

#to_sObject

Provide a user friendly representation



214
215
216
217
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 214

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InteractionChannelParticipantContext #{context}>"
end

#update(status: nil) ⇒ InteractionChannelParticipantInstance

Update the InteractionChannelParticipantInstance

Parameters:

  • status (Status) (defaults to: nil)

Returns:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb', line 187

def update(
    status: nil
)

    data = Twilio::Values.of({
        'Status' => status,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InteractionChannelParticipantInstance.new(
        @version,
        payload,
        interaction_sid: @solution[:interaction_sid],
        channel_sid: @solution[:channel_sid],
        sid: @solution[:sid],
    )
end