Class: Bandwidth::AccountsParticipantsResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb

Overview

AccountsParticipantsResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(participant = nil, token = nil) ⇒ AccountsParticipantsResponse

Returns a new instance of AccountsParticipantsResponse.



27
28
29
30
31
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 27

def initialize(participant = nil,
               token = nil)
  @participant = participant
  @token = token
end

Instance Attribute Details

#participantParticipant

A participant object

Returns:



11
12
13
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 11

def participant
  @participant
end

#tokenString

Auth token for the returned participant This should be passed to the participant so that they can connect to the platform

Returns:

  • (String)


17
18
19
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 17

def token
  @token
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 34

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  participant = Participant.from_hash(hash['participant']) if
    hash['participant']
  token = hash['token']

  # Create object from extracted values.
  AccountsParticipantsResponse.new(participant,
                                   token)
end

.namesObject

A mapping from model property names to API property names.



20
21
22
23
24
25
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 20

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['participant'] = 'participant'
  @_hash['token'] = 'token'
  @_hash
end