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.



43
44
45
46
47
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 43

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

Instance Attribute Details

#participantParticipant

A participant object

Returns:



14
15
16
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 14

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)


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

def token
  @token
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 50

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.key?('token') ? hash['token'] : SKIP

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

.namesObject

A mapping from model property names to API property names.



23
24
25
26
27
28
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 23

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

Instance Method Details

#nullablesObject

An array for nullable fields



39
40
41
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 39

def nullables
  []
end

#optionalsObject

An array for optional fields



31
32
33
34
35
36
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb', line 31

def optionals
  %w[
    participant
    token
  ]
end