Class: Twilio::REST::Api::V2010::AccountContext::ConferenceInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/conference.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ConferenceInstance

Initialize the ConferenceInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Conference resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 332

def initialize(version, payload , account_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'api_version' => payload['api_version'],
        'friendly_name' => payload['friendly_name'],
        'region' => payload['region'],
        'sid' => payload['sid'],
        'status' => payload['status'],
        'uri' => payload['uri'],
        'subresource_uris' => payload['subresource_uris'],
        'reason_conference_ended' => payload['reason_conference_ended'],
        'call_sid_ending_conference' => payload['call_sid_ending_conference'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Conference resource.

Returns:



369
370
371
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 369

def 
    @properties['account_sid']
end

#api_versionString

Returns The API version used to create this conference.

Returns:

  • (String)

    The API version used to create this conference.



387
388
389
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 387

def api_version
    @properties['api_version']
end

#call_sid_ending_conferenceString

Returns The call SID that caused the conference to end.

Returns:

  • (String)

    The call SID that caused the conference to end.



435
436
437
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 435

def call_sid_ending_conference
    @properties['call_sid_ending_conference']
end

#contextConferenceContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



360
361
362
363
364
365
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 360

def context
    unless @instance_context
        @instance_context = ConferenceContext.new(@version , @params['account_sid'], @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date and time in UTC that this resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



375
376
377
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 375

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in UTC that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



381
382
383
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 381

def date_updated
    @properties['date_updated']
end

#fetchConferenceInstance

Fetch the ConferenceInstance

Returns:



442
443
444
445
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 442

def fetch

    context.fetch
end

#friendly_nameString

Returns A string that you assigned to describe this conference room. Maximum length is 128 characters.

Returns:

  • (String)

    A string that you assigned to describe this conference room. Maximum length is 128 characters.



393
394
395
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 393

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



489
490
491
492
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 489

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.ConferenceInstance #{values}>"
end

#participantsparticipants

Access the participants

Returns:



476
477
478
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 476

def participants
    context.participants
end

#reason_conference_endedReasonConferenceEnded

Returns:

  • (ReasonConferenceEnded)


429
430
431
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 429

def reason_conference_ended
    @properties['reason_conference_ended']
end

#recordingsrecordings

Access the recordings

Returns:



469
470
471
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 469

def recordings
    context.recordings
end

#regionString

Returns A string that represents the Twilio Region where the conference audio was mixed. May be ‘us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.

Returns:

  • (String)

    A string that represents the Twilio Region where the conference audio was mixed. May be ‘us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.



399
400
401
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 399

def region
    @properties['region']
end

#sidString

Returns The unique, Twilio-provided string used to identify this Conference resource.

Returns:

  • (String)

    The unique, Twilio-provided string used to identify this Conference resource.



405
406
407
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 405

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


411
412
413
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 411

def status
    @properties['status']
end

#subresource_urisHash

Returns A list of related resources identified by their URIs relative to ‘api.twilio.com`.

Returns:

  • (Hash)

    A list of related resources identified by their URIs relative to ‘api.twilio.com`.



423
424
425
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 423

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



482
483
484
485
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 482

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.ConferenceInstance #{values}>"
end

#update(status: :unset, announce_url: :unset, announce_method: :unset) ⇒ ConferenceInstance

Update the ConferenceInstance

Parameters:

  • status (UpdateStatus) (defaults to: :unset)
  • announce_url (String) (defaults to: :unset)

    The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ‘<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs.

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

    The HTTP method used to call ‘announce_url`. Can be: `GET` or `POST` and the default is `POST`

Returns:



453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 453

def update(
    status: :unset, 
    announce_url: :unset, 
    announce_method: :unset
)

    context.update(
        status: status, 
        announce_url: announce_url, 
        announce_method: announce_method, 
    )
end

#uriString

Returns The URI of this resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI of this resource, relative to ‘api.twilio.com`.



417
418
419
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 417

def uri
    @properties['uri']
end