Class: ZoomUs::Models::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/zoom_us/models/body.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Body

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/zoom_us/models/body.rb', line 134

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'domain')
    self.domain = attributes[:'domain']
  end

  if attributes.has_key?(:'register_server')
    self.register_server = attributes[:'register_server']
  end

  if attributes.has_key?(:'transport_protocol')
    self.transport_protocol = attributes[:'transport_protocol']
  end

  if attributes.has_key?(:'proxy_server')
    self.proxy_server = attributes[:'proxy_server']
  end

  if attributes.has_key?(:'register_server2')
    self.register_server2 = attributes[:'register_server2']
  end

  if attributes.has_key?(:'transport_protocol2')
    self.transport_protocol2 = attributes[:'transport_protocol2']
  end

  if attributes.has_key?(:'proxy_server2')
    self.proxy_server2 = attributes[:'proxy_server2']
  end

  if attributes.has_key?(:'register_server3')
    self.register_server3 = attributes[:'register_server3']
  end

  if attributes.has_key?(:'transport_protocol3')
    self.transport_protocol3 = attributes[:'transport_protocol3']
  end

  if attributes.has_key?(:'proxy_server3')
    self.proxy_server3 = attributes[:'proxy_server3']
  end

  if attributes.has_key?(:'registration_expire_time')
    self.registration_expire_time = attributes[:'registration_expire_time']
  end

  if attributes.has_key?(:'user_name')
    self.user_name = attributes[:'user_name']
  end

  if attributes.has_key?(:'password')
    self.password = attributes[:'password']
  end

  if attributes.has_key?(:'authorization_name')
    self.authorization_name = attributes[:'authorization_name']
  end

  if attributes.has_key?(:'user_email')
    self.user_email = attributes[:'user_email']
  end

  if attributes.has_key?(:'voice_mail')
    self.voice_mail = attributes[:'voice_mail']
  end
end

Instance Attribute Details

#authorization_nameObject

Authorization name of the user registered for SIP Phone.



58
59
60
# File 'lib/zoom_us/models/body.rb', line 58

def authorization_name
  @authorization_name
end

#domainObject

The name or IP address of your provider’s SIP domain. (example: CDC.WEB).



19
20
21
# File 'lib/zoom_us/models/body.rb', line 19

def domain
  @domain
end

#passwordObject

The password generated for the user in the SIP account.



55
56
57
# File 'lib/zoom_us/models/body.rb', line 55

def password
  @password
end

#proxy_serverObject

IP address of the proxy server for SIP requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address. If you are not using a proxy server, this value can be the same as the Register Server.



28
29
30
# File 'lib/zoom_us/models/body.rb', line 28

def proxy_server
  @proxy_server
end

#proxy_server2Object

IP address of the proxy server for SIP requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address. If you are not using a proxy server, this value can be the same as the Register Server, or empty.



37
38
39
# File 'lib/zoom_us/models/body.rb', line 37

def proxy_server2
  @proxy_server2
end

#proxy_server3Object

IP address of the proxy server for SIP requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address. If you are not using a proxy server, this value can be the same as the Register Server, or empty.



46
47
48
# File 'lib/zoom_us/models/body.rb', line 46

def proxy_server3
  @proxy_server3
end

#register_serverObject

IP address of the server that accepts REGISTER requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address.



22
23
24
# File 'lib/zoom_us/models/body.rb', line 22

def register_server
  @register_server
end

#register_server2Object

IP address of the server that accepts REGISTER requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address.



31
32
33
# File 'lib/zoom_us/models/body.rb', line 31

def register_server2
  @register_server2
end

#register_server3Object

IP address of the server that accepts REGISTER requests. Note that if you are using the UDP transport protocol, the default port is 5060. If you are using UDP with a different port number, that port number must be included with the IP address.



40
41
42
# File 'lib/zoom_us/models/body.rb', line 40

def register_server3
  @register_server3
end

#registration_expire_timeObject

The number of minutes after which the SIP registration of the Zoom client user will expire, and the client will auto register to the SIP server.



49
50
51
# File 'lib/zoom_us/models/body.rb', line 49

def registration_expire_time
  @registration_expire_time
end

#transport_protocolObject

Protocols supported by the SIP provider.
The value must be either ‘UDP`, `TCP`, `TLS`, `AUTO`.



25
26
27
# File 'lib/zoom_us/models/body.rb', line 25

def transport_protocol
  @transport_protocol
end

#transport_protocol2Object

Protocols supported by the SIP provider.
The value must be either ‘UDP`, `TCP`, `TLS`, `AUTO`.



34
35
36
# File 'lib/zoom_us/models/body.rb', line 34

def transport_protocol2
  @transport_protocol2
end

#transport_protocol3Object

Protocols supported by the SIP provider.
The value must be either ‘UDP`, `TCP`, `TLS`, `AUTO`.



43
44
45
# File 'lib/zoom_us/models/body.rb', line 43

def transport_protocol3
  @transport_protocol3
end

#user_emailObject

The email address of the user to associate with the SIP Phone. Can add [.win, .mac, .android, .ipad, .iphone, .linux, .pc, .mobile, .pad] at the end of the email (ex. [email protected]) to add accounts for different platforms for the same user.



61
62
63
# File 'lib/zoom_us/models/body.rb', line 61

def user_email
  @user_email
end

#user_nameObject

The phone number associated with the user in the SIP account.



52
53
54
# File 'lib/zoom_us/models/body.rb', line 52

def user_name
  @user_name
end

#voice_mailObject

The number to dial for checking voicemail.



64
65
66
# File 'lib/zoom_us/models/body.rb', line 64

def voice_mail
  @voice_mail
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/zoom_us/models/body.rb', line 89

def self.attribute_map
  {
    :'domain' => :'domain',
    :'register_server' => :'register_server',
    :'transport_protocol' => :'transport_protocol',
    :'proxy_server' => :'proxy_server',
    :'register_server2' => :'register_server2',
    :'transport_protocol2' => :'transport_protocol2',
    :'proxy_server2' => :'proxy_server2',
    :'register_server3' => :'register_server3',
    :'transport_protocol3' => :'transport_protocol3',
    :'proxy_server3' => :'proxy_server3',
    :'registration_expire_time' => :'registration_expire_time',
    :'user_name' => :'user_name',
    :'password' => :'password',
    :'authorization_name' => :'authorization_name',
    :'user_email' => :'user_email',
    :'voice_mail' => :'voice_mail'
  }
end

.swagger_typesObject

Attribute type mapping.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/zoom_us/models/body.rb', line 111

def self.swagger_types
  {
    :'domain' => :'String',
    :'register_server' => :'String',
    :'transport_protocol' => :'String',
    :'proxy_server' => :'String',
    :'register_server2' => :'String',
    :'transport_protocol2' => :'String',
    :'proxy_server2' => :'String',
    :'register_server3' => :'String',
    :'transport_protocol3' => :'String',
    :'proxy_server3' => :'String',
    :'registration_expire_time' => :'Integer',
    :'user_name' => :'String',
    :'password' => :'String',
    :'authorization_name' => :'String',
    :'user_email' => :'String',
    :'voice_mail' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/zoom_us/models/body.rb', line 415

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
    domain == o.domain &&
    register_server == o.register_server &&
    transport_protocol == o.transport_protocol &&
    proxy_server == o.proxy_server &&
    register_server2 == o.register_server2 &&
    transport_protocol2 == o.transport_protocol2 &&
    proxy_server2 == o.proxy_server2 &&
    register_server3 == o.register_server3 &&
    transport_protocol3 == o.transport_protocol3 &&
    proxy_server3 == o.proxy_server3 &&
    registration_expire_time == o.registration_expire_time &&
    user_name == o.user_name &&
    password == o.password &&
    authorization_name == o.authorization_name &&
    user_email == o.user_email &&
    voice_mail == o.voice_mail
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# File 'lib/zoom_us/models/body.rb', line 472

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    ::DateTime.parse(value)
  when :Date
    ::Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = Models.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/zoom_us/models/body.rb', line 538

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/zoom_us/models/body.rb', line 451

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


438
439
440
# File 'lib/zoom_us/models/body.rb', line 438

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



444
445
446
# File 'lib/zoom_us/models/body.rb', line 444

def hash
  [domain, register_server, transport_protocol, proxy_server, register_server2, transport_protocol2, proxy_server2, register_server3, transport_protocol3, proxy_server3, registration_expire_time, user_name, password, authorization_name, user_email, voice_mail].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/zoom_us/models/body.rb', line 207

def list_invalid_properties
  invalid_properties = Array.new
  if @domain.nil?
    invalid_properties.push('invalid value for "domain", domain cannot be nil.')
  end

  if @domain.to_s.length > 64
    invalid_properties.push('invalid value for "domain", the character length must be smaller than or equal to 64.')
  end

  if @register_server.nil?
    invalid_properties.push('invalid value for "register_server", register_server cannot be nil.')
  end

  if @proxy_server.nil?
    invalid_properties.push('invalid value for "proxy_server", proxy_server cannot be nil.')
  end

  if !@registration_expire_time.nil? && @registration_expire_time > 127
    invalid_properties.push('invalid value for "registration_expire_time", must be smaller than or equal to 127.')
  end

  if !@registration_expire_time.nil? && @registration_expire_time < 1
    invalid_properties.push('invalid value for "registration_expire_time", must be greater than or equal to 1.')
  end

  if @user_name.nil?
    invalid_properties.push('invalid value for "user_name", user_name cannot be nil.')
  end

  if @user_name.to_s.length > 64
    invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 64.')
  end

  if @password.nil?
    invalid_properties.push('invalid value for "password", password cannot be nil.')
  end

  if @authorization_name.nil?
    invalid_properties.push('invalid value for "authorization_name", authorization_name cannot be nil.')
  end

  if @authorization_name.to_s.length > 64
    invalid_properties.push('invalid value for "authorization_name", the character length must be smaller than or equal to 64.')
  end

  if @user_email.nil?
    invalid_properties.push('invalid value for "user_email", user_email cannot be nil.')
  end

  if @user_email.to_s.length > 64
    invalid_properties.push('invalid value for "user_email", the character length must be smaller than or equal to 64.')
  end

  if @voice_mail.nil?
    invalid_properties.push('invalid value for "voice_mail", voice_mail cannot be nil.')
  end

  if @voice_mail.to_s.length > 255
    invalid_properties.push('invalid value for "voice_mail", the character length must be smaller than or equal to 255.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



518
519
520
# File 'lib/zoom_us/models/body.rb', line 518

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



524
525
526
527
528
529
530
531
532
# File 'lib/zoom_us/models/body.rb', line 524

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



512
513
514
# File 'lib/zoom_us/models/body.rb', line 512

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/zoom_us/models/body.rb', line 274

def valid?
  return false if @domain.nil?
  return false if @domain.to_s.length > 64
  return false if @register_server.nil?
  transport_protocol_validator = EnumAttributeValidator.new('String', ['UDP', 'TCP', 'TLS', 'AUTO'])
  return false unless transport_protocol_validator.valid?(@transport_protocol)
  return false if @proxy_server.nil?
  transport_protocol2_validator = EnumAttributeValidator.new('String', ['UDP', 'TCP', 'TLS', 'AUTO'])
  return false unless transport_protocol2_validator.valid?(@transport_protocol2)
  transport_protocol3_validator = EnumAttributeValidator.new('String', ['UDP', 'TCP', 'TLS', 'AUTO'])
  return false unless transport_protocol3_validator.valid?(@transport_protocol3)
  return false if !@registration_expire_time.nil? && @registration_expire_time > 127
  return false if !@registration_expire_time.nil? && @registration_expire_time < 1
  return false if @user_name.nil?
  return false if @user_name.to_s.length > 64
  return false if @password.nil?
  return false if @authorization_name.nil?
  return false if @authorization_name.to_s.length > 64
  return false if @user_email.nil?
  return false if @user_email.to_s.length > 64
  return false if @voice_mail.nil?
  return false if @voice_mail.to_s.length > 255
  true
end