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 (Version)

    Version that contains the resource

  • conference_sid (String)

    The unique SID identifier of the Conference.

  • participant_sid (String)

    The unique SID identifier of the Participant.



186
187
188
189
190
191
192
193
194
195
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 186

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:

  • events (String) (defaults to: :unset)

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

  • metrics (String) (defaults to: :unset)

    Object. Contains participant call quality metrics.

Returns:



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 201

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:

  • events (String) (defaults to: :unset)

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

  • metrics (String) (defaults to: :unset)

    Object. Contains participant call quality metrics.

Returns:



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 230

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



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

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

#to_sObject

Provide a user friendly representation



263
264
265
266
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 263

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