Class: Bandwidth::ConferenceMemberState

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/bandwidth/voice_lib/voice/models/conference_member_state.rb

Overview

ConferenceMemberState Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(call_id = nil, conference_id = nil, member_url = nil, mute = nil, hold = nil, call_ids_to_coach = nil) ⇒ ConferenceMemberState

Returns a new instance of ConferenceMemberState.



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 67

def initialize(call_id = nil,
               conference_id = nil,
               member_url = nil,
               mute = nil,
               hold = nil,
               call_ids_to_coach = nil)
  @call_id = call_id unless call_id == SKIP
  @conference_id = conference_id unless conference_id == SKIP
  @member_url = member_url unless member_url == SKIP
  @mute = mute unless mute == SKIP
  @hold = hold unless hold == SKIP
  @call_ids_to_coach = call_ids_to_coach unless call_ids_to_coach == SKIP
end

Instance Attribute Details

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 14

def call_id
  @call_id
end

#call_ids_to_coachList of String

TODO: Write general description for this method

Returns:

  • (List of String)


34
35
36
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 34

def call_ids_to_coach
  @call_ids_to_coach
end

#conference_idString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 18

def conference_id
  @conference_id
end

#holdBoolean

TODO: Write general description for this method

Returns:

  • (Boolean)


30
31
32
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 30

def hold
  @hold
end

#member_urlString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 22

def member_url
  @member_url
end

#muteBoolean

TODO: Write general description for this method

Returns:

  • (Boolean)


26
27
28
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 26

def mute
  @mute
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  call_id = hash.key?('callId') ? hash['callId'] : SKIP
  conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP
  member_url = hash.key?('memberUrl') ? hash['memberUrl'] : SKIP
  mute = hash.key?('mute') ? hash['mute'] : SKIP
  hold = hash.key?('hold') ? hash['hold'] : SKIP
  call_ids_to_coach =
    hash.key?('callIdsToCoach') ? hash['callIdsToCoach'] : SKIP

  # Create object from extracted values.
  ConferenceMemberState.new(call_id,
                            conference_id,
                            member_url,
                            mute,
                            hold,
                            call_ids_to_coach)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['call_id'] = 'callId'
  @_hash['conference_id'] = 'conferenceId'
  @_hash['member_url'] = 'memberUrl'
  @_hash['mute'] = 'mute'
  @_hash['hold'] = 'hold'
  @_hash['call_ids_to_coach'] = 'callIdsToCoach'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



61
62
63
64
65
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 61

def nullables
  %w[
    call_ids_to_coach
  ]
end

#optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/bandwidth/voice_lib/voice/models/conference_member_state.rb', line 49

def optionals
  %w[
    call_id
    conference_id
    member_url
    mute
    hold
    call_ids_to_coach
  ]
end