Class: Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantList
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
Instance Method Summary collapse
-
#create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset, time_limit: :unset, machine_detection: :unset, machine_detection_timeout: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, amd_status_callback: :unset, amd_status_callback_method: :unset, trim: :unset, call_token: :unset) ⇒ ParticipantInstance
Create the ParticipantInstance.
-
#each ⇒ Object
When passed a block, yields ParticipantInstance records from the API.
-
#get_page(target_url) ⇒ Page
Retrieve a single page of ParticipantInstance records from the API.
-
#initialize(version, account_sid: nil, conference_sid: nil) ⇒ ParticipantList
constructor
Initialize the ParticipantList.
-
#list(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) ⇒ Array
Lists ParticipantInstance records from the API as a list.
-
#page(muted: :unset, hold: :unset, coaching: :unset, page_token: :unset, page_number: :unset, page_size: :unset) ⇒ Page
Retrieve a single page of ParticipantInstance records from the API.
-
#stream(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) ⇒ Enumerable
Streams Instance records from the API as an Enumerable.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, account_sid: nil, conference_sid: nil) ⇒ ParticipantList
Initialize the ParticipantList
29 30 31 32 33 34 35 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 29 def initialize(version, account_sid: nil, conference_sid: nil) super(version) # Path Solution @solution = { account_sid: account_sid, conference_sid: conference_sid } @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:conference_sid]}/Participants.json" end |
Instance Method Details
#create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset, time_limit: :unset, machine_detection: :unset, machine_detection_timeout: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, amd_status_callback: :unset, amd_status_callback_method: :unset, trim: :unset, call_token: :unset) ⇒ ParticipantInstance
Create the ParticipantInstance
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 87 def create( from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset, time_limit: :unset, machine_detection: :unset, machine_detection_timeout: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, amd_status_callback: :unset, amd_status_callback_method: :unset, trim: :unset, call_token: :unset ) data = Twilio::Values.of({ 'From' => from, 'To' => to, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e }, 'Label' => label, 'Timeout' => timeout, 'Record' => record, 'Muted' => muted, 'Beep' => beep, 'StartConferenceOnEnter' => start_conference_on_enter, 'EndConferenceOnExit' => end_conference_on_exit, 'WaitUrl' => wait_url, 'WaitMethod' => wait_method, 'EarlyMedia' => early_media, 'MaxParticipants' => max_participants, 'ConferenceRecord' => conference_record, 'ConferenceTrim' => conference_trim, 'ConferenceStatusCallback' => conference_status_callback, 'ConferenceStatusCallbackMethod' => conference_status_callback_method, 'ConferenceStatusCallbackEvent' => Twilio.serialize_list(conference_status_callback_event) { |e| e }, 'RecordingChannels' => recording_channels, 'RecordingStatusCallback' => recording_status_callback, 'RecordingStatusCallbackMethod' => recording_status_callback_method, 'SipAuthUsername' => sip_auth_username, 'SipAuthPassword' => sip_auth_password, 'Region' => region, 'ConferenceRecordingStatusCallback' => conference_recording_status_callback, 'ConferenceRecordingStatusCallbackMethod' => conference_recording_status_callback_method, 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e }, 'ConferenceRecordingStatusCallbackEvent' => Twilio.serialize_list(conference_recording_status_callback_event) { |e| e }, 'Coaching' => coaching, 'CallSidToCoach' => call_sid_to_coach, 'JitterBufferSize' => jitter_buffer_size, 'Byoc' => byoc, 'CallerId' => caller_id, 'CallReason' => call_reason, 'RecordingTrack' => recording_track, 'TimeLimit' => time_limit, 'MachineDetection' => machine_detection, 'MachineDetectionTimeout' => machine_detection_timeout, 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold, 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold, 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout, 'AmdStatusCallback' => amd_status_callback, 'AmdStatusCallbackMethod' => amd_status_callback_method, 'Trim' => trim, 'CallToken' => call_token, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) ParticipantInstance.new( @version, payload, account_sid: @solution[:account_sid], conference_sid: @solution[:conference_sid], ) end |
#each ⇒ Object
When passed a block, yields ParticipantInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
259 260 261 262 263 264 265 266 267 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 259 def each limits = @version.read_limits page = self.page(page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]).each {|x| yield x} end |
#get_page(target_url) ⇒ Page
Retrieve a single page of ParticipantInstance records from the API. Request is executed immediately.
302 303 304 305 306 307 308 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 302 def get_page(target_url) response = @version.domain.request( 'GET', target_url ) ParticipantPage.new(@version, response, @solution) end |
#list(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) ⇒ Array
Lists ParticipantInstance records from the API as a list. Unlike stream(), this operation is eager and will load ‘limit` records into memory before returning.
219 220 221 222 223 224 225 226 227 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 219 def list(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) self.stream( muted: muted, hold: hold, coaching: coaching, limit: limit, page_size: page_size ).entries end |
#page(muted: :unset, hold: :unset, coaching: :unset, page_token: :unset, page_number: :unset, page_size: :unset) ⇒ Page
Retrieve a single page of ParticipantInstance records from the API. Request is executed immediately.
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 279 def page(muted: :unset, hold: :unset, coaching: :unset, page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ 'Muted' => muted, 'Hold' => hold, 'Coaching' => coaching, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) headers = Twilio::Values.of({}) response = @version.page('GET', @uri, params: params, headers: headers) ParticipantPage.new(@version, response, @solution) end |
#stream(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) ⇒ Enumerable
Streams Instance records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached.
243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 243 def stream(muted: :unset, hold: :unset, coaching: :unset, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( muted: muted, hold: hold, coaching: coaching, page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) end |
#to_s ⇒ Object
Provide a user friendly representation
313 314 315 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 313 def to_s '#<Twilio.Api.V2010.ParticipantList>' end |