class Twilio::REST::Api::V2010::AccountContext::ConferenceContext
Public Class Methods
Initialize the ConferenceContext
@param [Version] version Version
that contains the resource @param [String] account_sid The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created the Conference resource(s) to fetch.
@param [String] sid The Twilio-provided string that uniquely identifies the
Conference resource to fetch
@return [ConferenceContext] ConferenceContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 215 def initialize(version, account_sid, sid) 216 super(version) 217 218 # Path Solution 219 @solution = {account_sid: account_sid, sid: sid, } 220 @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:sid]}.json" 221 222 # Dependents 223 @participants = nil 224 @recordings = nil 225 end
Public Instance Methods
Fetch the ConferenceInstance
@return [ConferenceInstance] Fetched ConferenceInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 230 def fetch 231 payload = @version.fetch('GET', @uri) 232 233 ConferenceInstance.new( 234 @version, 235 payload, 236 account_sid: @solution[:account_sid], 237 sid: @solution[:sid], 238 ) 239 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 322 def inspect 323 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 324 "#<Twilio.Api.V2010.ConferenceContext #{context}>" 325 end
Access the participants @return [ParticipantList] @return [ParticipantContext] if call_sid was passed.
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 273 def participants(call_sid=:unset) 274 raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil? 275 276 if call_sid != :unset 277 return ParticipantContext.new(@version, @solution[:account_sid], @solution[:sid], call_sid, ) 278 end 279 280 unless @participants 281 @participants = ParticipantList.new( 282 @version, 283 account_sid: @solution[:account_sid], 284 conference_sid: @solution[:sid], 285 ) 286 end 287 288 @participants 289 end
Access the recordings @return [RecordingList] @return [RecordingContext] if sid was passed.
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 295 def recordings(sid=:unset) 296 raise ArgumentError, 'sid cannot be nil' if sid.nil? 297 298 if sid != :unset 299 return RecordingContext.new(@version, @solution[:account_sid], @solution[:sid], sid, ) 300 end 301 302 unless @recordings 303 @recordings = RecordingList.new( 304 @version, 305 account_sid: @solution[:account_sid], 306 conference_sid: @solution[:sid], 307 ) 308 end 309 310 @recordings 311 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 315 def to_s 316 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 317 "#<Twilio.Api.V2010.ConferenceContext #{context}>" 318 end
Update the ConferenceInstance
@param [conference.UpdateStatus] status The new status of the resource. Can be:
Can be: `init`, `in-progress`, or `completed`. Specifying `completed` will end the conference and hang up all participants
@param [String] announce_url The URL we should call to announce something into
the conference. The URL can return an MP3, a WAV, or a TwiML document with `<Play>` or `<Say>`.
@param [String] announce_method The HTTP
method used to call `announce_url`. Can
be: `GET` or `POST` and the default is `POST`
@return [ConferenceInstance] Updated ConferenceInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 252 def update(status: :unset, announce_url: :unset, announce_method: :unset) 253 data = Twilio::Values.of({ 254 'Status' => status, 255 'AnnounceUrl' => announce_url, 256 'AnnounceMethod' => announce_method, 257 }) 258 259 payload = @version.update('POST', @uri, data: data) 260 261 ConferenceInstance.new( 262 @version, 263 payload, 264 account_sid: @solution[:account_sid], 265 sid: @solution[:sid], 266 ) 267 end