Class: Twilio::REST::Insights::V1::ConferenceContext::ConferenceParticipantContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, conference_sid, participant_sid) ⇒ ConferenceParticipantContext

Initialize the ConferenceParticipantContext

Parameters:

  • Version that contains the resource

  • The unique SID identifier of the Conference.

  • The unique SID identifier of the Participant.



194
195
196
197
198
199
200
201
202
203
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 194

def initialize(version, conference_sid, participant_sid)
    super(version)
    

    # Path Solution
    @solution = { conference_sid: conference_sid, participant_sid: participant_sid,  }
    @uri = "/Conferences/#{@solution[:conference_sid]}/Participants/#{@solution[:participant_sid]}"

    
end

Instance Method Details

#fetch(events: :unset, metrics: :unset) ⇒ ConferenceParticipantInstance

Fetch the ConferenceParticipantInstance

Parameters:

  • (defaults to: :unset)

    Conference events generated by application or participant activity; e.g. hold, mute, etc.

  • (defaults to: :unset)

    Object. Contains participant call quality metrics.

Returns:

  • Fetched ConferenceParticipantInstance



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 209

def fetch(
  events: :unset, 
  metrics: :unset
)

    params = Twilio::Values.of({
        'Events' => events,
        'Metrics' => metrics,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    ConferenceParticipantInstance.new(
        @version,
        payload,
        conference_sid: @solution[:conference_sid],
        participant_sid: @solution[:participant_sid],
    )
end

#fetch_with_metadata(events: :unset, metrics: :unset) ⇒ ConferenceParticipantInstance

Fetch the ConferenceParticipantInstanceMetadata

Parameters:

  • (defaults to: :unset)

    Conference events generated by application or participant activity; e.g. hold, mute, etc.

  • (defaults to: :unset)

    Object. Contains participant call quality metrics.

Returns:

  • Fetched ConferenceParticipantInstance



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 238

def (
  events: :unset, 
  metrics: :unset
)

    params = Twilio::Values.of({
        'Events' => events,
        'Metrics' => metrics,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    conference_participant_instance = ConferenceParticipantInstance.new(
        @version,
        response.body,
        conference_sid: @solution[:conference_sid],
        participant_sid: @solution[:participant_sid],
    )
    ConferenceParticipantInstanceMetadata.new(
        @version,
        conference_participant_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



278
279
280
281
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 278

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

#to_sObject

Provide a user friendly representation



271
272
273
274
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 271

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