Class: ZSGFClient::User

Inherits:
Object
  • Object
show all
Defined in:
lib/zsgf_client/models/user.rb

Overview

用户

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

Initializes the object

Parameters:

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

    Model attributes in the form of hash



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/zsgf_client/models/user.rb', line 258

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `ZSGFClient::User` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `ZSGFClient::User`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'platform')
    self.platform = attributes[:'platform']
  end

  if attributes.key?(:'union_id')
    self.union_id = attributes[:'union_id']
  end

  if attributes.key?(:'nick_name')
    self.nick_name = attributes[:'nick_name']
  end

  if attributes.key?(:'avatar')
    self.avatar = attributes[:'avatar']
  end

  if attributes.key?(:'data')
    self.data = attributes[:'data']
  end

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

  if attributes.key?(:'pwd')
    self.pwd = attributes[:'pwd']
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'email_is_valid')
    self.email_is_valid = attributes[:'email_is_valid']
  end

  if attributes.key?(:'phone')
    self.phone = attributes[:'phone']
  end

  if attributes.key?(:'phone_is_valid')
    self.phone_is_valid = attributes[:'phone_is_valid']
  end

  if attributes.key?(:'relation_chain')
    self.relation_chain = attributes[:'relation_chain']
  end

  if attributes.key?(:'interest_tags')
    self.interest_tags = attributes[:'interest_tags']
  end

  if attributes.key?(:'biography')
    self.biography = attributes[:'biography']
  end

  if attributes.key?(:'gender')
    self.gender = attributes[:'gender']
  end

  if attributes.key?(:'birthday')
    self.birthday = attributes[:'birthday']
  end

  if attributes.key?(:'occupation')
    self.occupation = attributes[:'occupation']
  end

  if attributes.key?(:'education')
    self.education = attributes[:'education']
  end

  if attributes.key?(:'contact')
    self.contact = attributes[:'contact']
  end

  if attributes.key?(:'languages')
    self.languages = attributes[:'languages']
  end

  if attributes.key?(:'social_links')
    self.social_links = attributes[:'social_links']
  end

  if attributes.key?(:'relationship_status')
    self.relationship_status = attributes[:'relationship_status']
  end

  if attributes.key?(:'company')
    self.company = attributes[:'company']
  end

  if attributes.key?(:'industry')
    self.industry = attributes[:'industry']
  end

  if attributes.key?(:'company_position')
    self.company_position = attributes[:'company_position']
  end

  if attributes.key?(:'private_settings')
    self.private_settings = attributes[:'private_settings']
  end

  if attributes.key?(:'is_lock')
    self.is_lock = attributes[:'is_lock']
  end

  if attributes.key?(:'lock_until')
    self.lock_until = attributes[:'lock_until']
  end

  if attributes.key?(:'enable_user_name_sign_in')
    self. = attributes[:'enable_user_name_sign_in']
  end

  if attributes.key?(:'enable_email_sign_in')
    self. = attributes[:'enable_email_sign_in']
  end

  if attributes.key?(:'enable_phone_sign_in')
    self. = attributes[:'enable_phone_sign_in']
  end

  if attributes.key?(:'enable_union_id_sign_in')
    self. = attributes[:'enable_union_id_sign_in']
  end

  if attributes.key?(:'enable_o_auth')
    self.enable_o_auth = attributes[:'enable_o_auth']
  end

  if attributes.key?(:'enable2_fa_auth')
    self.enable2_fa_auth = attributes[:'enable2_fa_auth']
  end

  if attributes.key?(:'create_date')
    self.create_date = attributes[:'create_date']
  end

  if attributes.key?(:'last_update')
    self.last_update = attributes[:'last_update']
  end
end

Instance Attribute Details

#avatarObject

头像



32
33
34
# File 'lib/zsgf_client/models/user.rb', line 32

def avatar
  @avatar
end

#biographyObject

个人简介



62
63
64
# File 'lib/zsgf_client/models/user.rb', line 62

def biography
  @biography
end

#birthdayObject

生日



68
69
70
# File 'lib/zsgf_client/models/user.rb', line 68

def birthday
  @birthday
end

#companyObject

公司



89
90
91
# File 'lib/zsgf_client/models/user.rb', line 89

def company
  @company
end

#company_positionObject

行业职位



95
96
97
# File 'lib/zsgf_client/models/user.rb', line 95

def company_position
  @company_position
end

#contactObject

联系方式



77
78
79
# File 'lib/zsgf_client/models/user.rb', line 77

def contact
  @contact
end

#create_dateObject

创建时间



125
126
127
# File 'lib/zsgf_client/models/user.rb', line 125

def create_date
  @create_date
end

#dataObject

其他数据



35
36
37
# File 'lib/zsgf_client/models/user.rb', line 35

def data
  @data
end

#educationObject

学历



74
75
76
# File 'lib/zsgf_client/models/user.rb', line 74

def education
  @education
end

#emailObject

邮箱地址



44
45
46
# File 'lib/zsgf_client/models/user.rb', line 44

def email
  @email
end

#email_is_validObject

邮箱已验证



47
48
49
# File 'lib/zsgf_client/models/user.rb', line 47

def email_is_valid
  @email_is_valid
end

#enable2_fa_authObject

启用双因素认证登录



122
123
124
# File 'lib/zsgf_client/models/user.rb', line 122

def enable2_fa_auth
  @enable2_fa_auth
end

#enable_email_sign_inObject

能使用邮箱登录



110
111
112
# File 'lib/zsgf_client/models/user.rb', line 110

def 
  @enable_email_sign_in
end

#enable_o_authObject

能使用OAuth认证方式登录



119
120
121
# File 'lib/zsgf_client/models/user.rb', line 119

def enable_o_auth
  @enable_o_auth
end

#enable_phone_sign_inObject

能使用电话号码登录



113
114
115
# File 'lib/zsgf_client/models/user.rb', line 113

def 
  @enable_phone_sign_in
end

#enable_union_id_sign_inObject

能使用联合身份标识登录



116
117
118
# File 'lib/zsgf_client/models/user.rb', line 116

def 
  @enable_union_id_sign_in
end

#enable_user_name_sign_inObject

能使用用户名登录



107
108
109
# File 'lib/zsgf_client/models/user.rb', line 107

def 
  @enable_user_name_sign_in
end

#genderObject

性别



65
66
67
# File 'lib/zsgf_client/models/user.rb', line 65

def gender
  @gender
end

#idObject

用户唯一标识



20
21
22
# File 'lib/zsgf_client/models/user.rb', line 20

def id
  @id
end

#industryObject

行业



92
93
94
# File 'lib/zsgf_client/models/user.rb', line 92

def industry
  @industry
end

#interest_tagsObject

兴趣标签



59
60
61
# File 'lib/zsgf_client/models/user.rb', line 59

def interest_tags
  @interest_tags
end

#is_lockObject

账户是否锁定



101
102
103
# File 'lib/zsgf_client/models/user.rb', line 101

def is_lock
  @is_lock
end

#languagesObject

语言



80
81
82
# File 'lib/zsgf_client/models/user.rb', line 80

def languages
  @languages
end

#last_updateObject

最后更新时间



128
129
130
# File 'lib/zsgf_client/models/user.rb', line 128

def last_update
  @last_update
end

#lock_untilObject

账户锁定截止时间



104
105
106
# File 'lib/zsgf_client/models/user.rb', line 104

def lock_until
  @lock_until
end

#nick_nameObject

昵称



29
30
31
# File 'lib/zsgf_client/models/user.rb', line 29

def nick_name
  @nick_name
end

#occupationObject

职业



71
72
73
# File 'lib/zsgf_client/models/user.rb', line 71

def occupation
  @occupation
end

#phoneObject

手机号码



50
51
52
# File 'lib/zsgf_client/models/user.rb', line 50

def phone
  @phone
end

#phone_is_validObject

手机号码已验证



53
54
55
# File 'lib/zsgf_client/models/user.rb', line 53

def phone_is_valid
  @phone_is_valid
end

#platformObject

用户所在平台



23
24
25
# File 'lib/zsgf_client/models/user.rb', line 23

def platform
  @platform
end

#private_settingsObject

私密设置



98
99
100
# File 'lib/zsgf_client/models/user.rb', line 98

def private_settings
  @private_settings
end

#pwdObject

用户密码



41
42
43
# File 'lib/zsgf_client/models/user.rb', line 41

def pwd
  @pwd
end

#relation_chainObject

关系链



56
57
58
# File 'lib/zsgf_client/models/user.rb', line 56

def relation_chain
  @relation_chain
end

#relationship_statusObject

婚姻状态



86
87
88
# File 'lib/zsgf_client/models/user.rb', line 86

def relationship_status
  @relationship_status
end

社交网络链接



83
84
85
# File 'lib/zsgf_client/models/user.rb', line 83

def social_links
  @social_links
end

#union_idObject

用户所在平台的唯一标识



26
27
28
# File 'lib/zsgf_client/models/user.rb', line 26

def union_id
  @union_id
end

#user_nameObject

用户名



38
39
40
# File 'lib/zsgf_client/models/user.rb', line 38

def user_name
  @user_name
end

Class Method Details

._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



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/zsgf_client/models/user.rb', line 819

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = ZSGFClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



174
175
176
# File 'lib/zsgf_client/models/user.rb', line 174

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



179
180
181
# File 'lib/zsgf_client/models/user.rb', line 179

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



131
132
133
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
# File 'lib/zsgf_client/models/user.rb', line 131

def self.attribute_map
  {
    :'id' => :'id',
    :'platform' => :'platform',
    :'union_id' => :'unionID',
    :'nick_name' => :'nickName',
    :'avatar' => :'avatar',
    :'data' => :'data',
    :'user_name' => :'userName',
    :'pwd' => :'pwd',
    :'email' => :'email',
    :'email_is_valid' => :'emailIsValid',
    :'phone' => :'phone',
    :'phone_is_valid' => :'phoneIsValid',
    :'relation_chain' => :'relationChain',
    :'interest_tags' => :'interestTags',
    :'biography' => :'biography',
    :'gender' => :'gender',
    :'birthday' => :'birthday',
    :'occupation' => :'occupation',
    :'education' => :'education',
    :'contact' => :'contact',
    :'languages' => :'languages',
    :'social_links' => :'socialLinks',
    :'relationship_status' => :'relationshipStatus',
    :'company' => :'company',
    :'industry' => :'industry',
    :'company_position' => :'companyPosition',
    :'private_settings' => :'privateSettings',
    :'is_lock' => :'isLock',
    :'lock_until' => :'lockUntil',
    :'enable_user_name_sign_in' => :'enableUserNameSignIn',
    :'enable_email_sign_in' => :'enableEmailSignIn',
    :'enable_phone_sign_in' => :'enablePhoneSignIn',
    :'enable_union_id_sign_in' => :'enableUnionIDSignIn',
    :'enable_o_auth' => :'enableOAuth',
    :'enable2_fa_auth' => :'enable2FAAuth',
    :'create_date' => :'createDate',
    :'last_update' => :'lastUpdate'
  }
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



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
# File 'lib/zsgf_client/models/user.rb', line 795

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



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
# File 'lib/zsgf_client/models/user.rb', line 227

def self.openapi_nullable
  Set.new([
    :'platform',
    :'union_id',
    :'nick_name',
    :'avatar',
    :'data',
    :'user_name',
    :'pwd',
    :'email',
    :'phone',
    :'relation_chain',
    :'interest_tags',
    :'biography',
    :'gender',
    :'birthday',
    :'occupation',
    :'education',
    :'contact',
    :'languages',
    :'social_links',
    :'relationship_status',
    :'company',
    :'industry',
    :'company_position',
    :'private_settings',
  ])
end

.openapi_typesObject

Attribute type mapping.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/zsgf_client/models/user.rb', line 184

def self.openapi_types
  {
    :'id' => :'Integer',
    :'platform' => :'String',
    :'union_id' => :'String',
    :'nick_name' => :'String',
    :'avatar' => :'String',
    :'data' => :'String',
    :'user_name' => :'String',
    :'pwd' => :'String',
    :'email' => :'String',
    :'email_is_valid' => :'Boolean',
    :'phone' => :'String',
    :'phone_is_valid' => :'Boolean',
    :'relation_chain' => :'String',
    :'interest_tags' => :'String',
    :'biography' => :'String',
    :'gender' => :'String',
    :'birthday' => :'Time',
    :'occupation' => :'String',
    :'education' => :'String',
    :'contact' => :'String',
    :'languages' => :'String',
    :'social_links' => :'String',
    :'relationship_status' => :'String',
    :'company' => :'String',
    :'industry' => :'String',
    :'company_position' => :'String',
    :'private_settings' => :'String',
    :'is_lock' => :'Boolean',
    :'lock_until' => :'Time',
    :'enable_user_name_sign_in' => :'Boolean',
    :'enable_email_sign_in' => :'Boolean',
    :'enable_phone_sign_in' => :'Boolean',
    :'enable_union_id_sign_in' => :'Boolean',
    :'enable_o_auth' => :'Boolean',
    :'enable2_fa_auth' => :'Boolean',
    :'create_date' => :'Time',
    :'last_update' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/zsgf_client/models/user.rb', line 738

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      platform == o.platform &&
      union_id == o.union_id &&
      nick_name == o.nick_name &&
      avatar == o.avatar &&
      data == o.data &&
      user_name == o.user_name &&
      pwd == o.pwd &&
      email == o.email &&
      email_is_valid == o.email_is_valid &&
      phone == o.phone &&
      phone_is_valid == o.phone_is_valid &&
      relation_chain == o.relation_chain &&
      interest_tags == o.interest_tags &&
      biography == o.biography &&
      gender == o.gender &&
      birthday == o.birthday &&
      occupation == o.occupation &&
      education == o.education &&
      contact == o.contact &&
      languages == o.languages &&
      social_links == o.social_links &&
      relationship_status == o.relationship_status &&
      company == o.company &&
      industry == o.industry &&
      company_position == o.company_position &&
      private_settings == o.private_settings &&
      is_lock == o.is_lock &&
      lock_until == o.lock_until &&
       == o. &&
       == o. &&
       == o. &&
       == o. &&
      enable_o_auth == o.enable_o_auth &&
      enable2_fa_auth == o.enable2_fa_auth &&
      create_date == o.create_date &&
      last_update == o.last_update
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



890
891
892
893
894
895
896
897
898
899
900
901
902
# File 'lib/zsgf_client/models/user.rb', line 890

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


782
783
784
# File 'lib/zsgf_client/models/user.rb', line 782

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



788
789
790
# File 'lib/zsgf_client/models/user.rb', line 788

def hash
  [id, platform, union_id, nick_name, avatar, data, user_name, pwd, email, email_is_valid, phone, phone_is_valid, relation_chain, interest_tags, biography, gender, birthday, occupation, education, contact, languages, social_links, relationship_status, company, industry, company_position, private_settings, is_lock, lock_until, , , , , enable_o_auth, enable2_fa_auth, create_date, last_update].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
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
# File 'lib/zsgf_client/models/user.rb', line 423

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if !@platform.nil? && @platform.to_s.length > 50
    invalid_properties.push('invalid value for "platform", the character length must be smaller than or equal to 50.')
  end

  if !@union_id.nil? && @union_id.to_s.length > 100
    invalid_properties.push('invalid value for "union_id", the character length must be smaller than or equal to 100.')
  end

  if !@nick_name.nil? && @nick_name.to_s.length > 50
    invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 50.')
  end

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

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

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

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

  if !@phone.nil? && @phone.to_s.length > 20
    invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 20.')
  end

  if !@biography.nil? && @biography.to_s.length > 500
    invalid_properties.push('invalid value for "biography", the character length must be smaller than or equal to 500.')
  end

  if !@gender.nil? && @gender.to_s.length > 15
    invalid_properties.push('invalid value for "gender", the character length must be smaller than or equal to 15.')
  end

  if !@occupation.nil? && @occupation.to_s.length > 50
    invalid_properties.push('invalid value for "occupation", the character length must be smaller than or equal to 50.')
  end

  if !@education.nil? && @education.to_s.length > 50
    invalid_properties.push('invalid value for "education", the character length must be smaller than or equal to 50.')
  end

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

  if !@languages.nil? && @languages.to_s.length > 50
    invalid_properties.push('invalid value for "languages", the character length must be smaller than or equal to 50.')
  end

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

  if !@relationship_status.nil? && @relationship_status.to_s.length > 20
    invalid_properties.push('invalid value for "relationship_status", the character length must be smaller than or equal to 20.')
  end

  if !@company.nil? && @company.to_s.length > 100
    invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 100.')
  end

  if !@industry.nil? && @industry.to_s.length > 50
    invalid_properties.push('invalid value for "industry", the character length must be smaller than or equal to 50.')
  end

  if !@company_position.nil? && @company_position.to_s.length > 50
    invalid_properties.push('invalid value for "company_position", the character length must be smaller than or equal to 50.')
  end

  if !@private_settings.nil? && @private_settings.to_s.length > 500
    invalid_properties.push('invalid value for "private_settings", the character length must be smaller than or equal to 500.')
  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



866
867
868
# File 'lib/zsgf_client/models/user.rb', line 866

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



872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/zsgf_client/models/user.rb', line 872

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



860
861
862
# File 'lib/zsgf_client/models/user.rb', line 860

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



511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'lib/zsgf_client/models/user.rb', line 511

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@platform.nil? && @platform.to_s.length > 50
  return false if !@union_id.nil? && @union_id.to_s.length > 100
  return false if !@nick_name.nil? && @nick_name.to_s.length > 50
  return false if !@avatar.nil? && @avatar.to_s.length > 255
  return false if !@user_name.nil? && @user_name.to_s.length > 50
  return false if !@pwd.nil? && @pwd.to_s.length > 255
  return false if !@email.nil? && @email.to_s.length > 255
  return false if !@phone.nil? && @phone.to_s.length > 20
  return false if !@biography.nil? && @biography.to_s.length > 500
  return false if !@gender.nil? && @gender.to_s.length > 15
  return false if !@occupation.nil? && @occupation.to_s.length > 50
  return false if !@education.nil? && @education.to_s.length > 50
  return false if !@contact.nil? && @contact.to_s.length > 255
  return false if !@languages.nil? && @languages.to_s.length > 50
  return false if !@social_links.nil? && @social_links.to_s.length > 255
  return false if !@relationship_status.nil? && @relationship_status.to_s.length > 20
  return false if !@company.nil? && @company.to_s.length > 100
  return false if !@industry.nil? && @industry.to_s.length > 50
  return false if !@company_position.nil? && @company_position.to_s.length > 50
  return false if !@private_settings.nil? && @private_settings.to_s.length > 500
  true
end