zsgf_client 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AccessTokenApi.md +14 -14
  3. data/docs/AccessTokenPutRequest.md +2 -2
  4. data/docs/AppUserListResponse.md +12 -12
  5. data/docs/AppUserResetEmailRequest.md +20 -0
  6. data/docs/AppUserResetPhoneRequest.md +20 -0
  7. data/docs/AppUserResetPwdRequest.md +4 -8
  8. data/docs/CommonFriendModel.md +3 -3
  9. data/docs/EmailSignInRequest.md +3 -3
  10. data/docs/EmailSignUpRequest.md +5 -5
  11. data/docs/FileApi.md +4 -4
  12. data/docs/FollowerModel.md +12 -12
  13. data/docs/FollowerPutModel.md +6 -6
  14. data/docs/GeoLocation.md +62 -0
  15. data/docs/GeoLocationModel.md +4 -4
  16. data/docs/GeoLocationResponseModel.md +4 -4
  17. data/docs/GetUserProfileResult.md +24 -0
  18. data/docs/{UserFollowingResultApiResponse.md → GetUserProfileResultApiResponse.md} +3 -3
  19. data/docs/MySqlGeometry.md +26 -0
  20. data/docs/OAuthAccountSignInRequest.md +3 -3
  21. data/docs/PhoneSignInRequest.md +3 -3
  22. data/docs/PhoneSignUpRequest.md +7 -7
  23. data/docs/QRCodePreSignInRequest.md +3 -3
  24. data/docs/QRCodeScanRequest.md +1 -1
  25. data/docs/QRCodeSignInRequest.md +1 -1
  26. data/docs/QRCodeSignUpRequest.md +8 -8
  27. data/docs/RecommendFriend.md +21 -11
  28. data/docs/SendEmailCodeRequest.md +2 -2
  29. data/docs/SendSMSCodeRequest.md +2 -2
  30. data/docs/SignInRequest.md +3 -3
  31. data/docs/SignUpRequest.md +8 -8
  32. data/docs/StorageApi.md +86 -6
  33. data/docs/UnionIDSignInRequest.md +3 -3
  34. data/docs/UnionIDSignUpRequest.md +10 -10
  35. data/docs/UpdateProfileRequest.md +27 -15
  36. data/docs/UserApi.md +358 -54
  37. data/docs/UserFriendsNearByResult.md +3 -3
  38. data/docs/UserProfileResult.md +2 -28
  39. data/docs/WechatApi.md +86 -12
  40. data/lib/zsgf_client/api/access_token_api.rb +14 -14
  41. data/lib/zsgf_client/api/file_api.rb +3 -3
  42. data/lib/zsgf_client/api/storage_api.rb +105 -6
  43. data/lib/zsgf_client/api/user_api.rb +349 -60
  44. data/lib/zsgf_client/api/wechat_api.rb +88 -18
  45. data/lib/zsgf_client/models/access_token_put_request.rb +3 -27
  46. data/lib/zsgf_client/models/app_user_list_response.rb +12 -0
  47. data/lib/zsgf_client/models/app_user_reset_email_request.rb +269 -0
  48. data/lib/zsgf_client/models/app_user_reset_phone_request.rb +269 -0
  49. data/lib/zsgf_client/models/app_user_reset_pwd_request.rb +52 -70
  50. data/lib/zsgf_client/models/common_friend_model.rb +3 -0
  51. data/lib/zsgf_client/models/email_sign_in_request.rb +38 -1
  52. data/lib/zsgf_client/models/email_sign_up_request.rb +30 -8
  53. data/lib/zsgf_client/models/follower_model.rb +12 -0
  54. data/lib/zsgf_client/models/follower_put_model.rb +6 -0
  55. data/lib/zsgf_client/models/geo_location.rb +750 -0
  56. data/lib/zsgf_client/models/geo_location_model.rb +262 -12
  57. data/lib/zsgf_client/models/geo_location_response_model.rb +262 -12
  58. data/lib/zsgf_client/models/{user_following_result.rb → get_user_profile_result.rb} +37 -18
  59. data/lib/zsgf_client/models/{user_following_result_api_response.rb → get_user_profile_result_api_response.rb} +4 -4
  60. data/lib/zsgf_client/models/my_sql_geometry.rb +260 -0
  61. data/lib/zsgf_client/models/o_auth_account_sign_in_request.rb +78 -1
  62. data/lib/zsgf_client/models/phone_sign_in_request.rb +49 -1
  63. data/lib/zsgf_client/models/phone_sign_up_request.rb +29 -24
  64. data/lib/zsgf_client/models/qr_code_pre_sign_in_request.rb +97 -0
  65. data/lib/zsgf_client/models/qr_code_scan_request.rb +1 -0
  66. data/lib/zsgf_client/models/qr_code_sign_in_request.rb +1 -0
  67. data/lib/zsgf_client/models/qr_code_sign_up_request.rb +38 -33
  68. data/lib/zsgf_client/models/recommend_friend.rb +69 -4
  69. data/lib/zsgf_client/models/send_email_code_request.rb +2 -1
  70. data/lib/zsgf_client/models/send_sms_code_request.rb +2 -2
  71. data/lib/zsgf_client/models/sign_in_request.rb +77 -11
  72. data/lib/zsgf_client/models/sign_up_request.rb +47 -35
  73. data/lib/zsgf_client/models/union_id_sign_in_request.rb +78 -1
  74. data/lib/zsgf_client/models/union_id_sign_up_request.rb +92 -45
  75. data/lib/zsgf_client/models/update_profile_request.rb +99 -24
  76. data/lib/zsgf_client/models/user_friends_near_by_result.rb +10 -7
  77. data/lib/zsgf_client/models/user_profile_result.rb +7 -133
  78. data/lib/zsgf_client/version.rb +1 -1
  79. data/lib/zsgf_client.rb +6 -2
  80. data/spec/api/access_token_api_spec.rb +7 -7
  81. data/spec/api/file_api_spec.rb +1 -1
  82. data/spec/api/storage_api_spec.rb +17 -1
  83. data/spec/api/user_api_spec.rb +81 -23
  84. data/spec/api/wechat_api_spec.rb +19 -6
  85. data/spec/models/{user_following_result_spec.rb → app_user_reset_email_request_spec.rb} +8 -8
  86. data/spec/models/app_user_reset_phone_request_spec.rb +42 -0
  87. data/spec/models/app_user_reset_pwd_request_spec.rb +2 -14
  88. data/spec/models/geo_location_model_spec.rb +3 -3
  89. data/spec/models/geo_location_response_model_spec.rb +3 -3
  90. data/spec/models/geo_location_spec.rb +168 -0
  91. data/spec/models/{user_following_result_api_response_spec.rb → get_user_profile_result_api_response_spec.rb} +6 -6
  92. data/spec/models/get_user_profile_result_spec.rb +54 -0
  93. data/spec/models/my_sql_geometry_spec.rb +60 -0
  94. data/spec/models/recommend_friend_spec.rb +30 -0
  95. data/spec/models/update_profile_request_spec.rb +36 -0
  96. data/spec/models/user_friends_near_by_result_spec.rb +1 -1
  97. data/spec/models/user_profile_result_spec.rb +1 -79
  98. metadata +215 -199
  99. data/docs/UserFollowingResult.md +0 -20
@@ -15,31 +15,31 @@ require 'time'
15
15
 
16
16
  module ZSGFClient
17
17
  class SignUpRequest
18
- # 登录账号,4~18位
18
+ # 用户名,长度必须在6到32个字符之间,只能包含字母、数字、下划线和连字符
19
19
  attr_accessor :user_name
20
20
 
21
- # 登录密码,6~32
21
+ # 登录密码,长度必须在632个字符之间,只能包含字母和数字
22
22
  attr_accessor :pwd
23
23
 
24
- # 昵称
24
+ # 用户昵称,长度不能超过20个字符
25
25
  attr_accessor :nick_name
26
26
 
27
- # 头像
27
+ # 用户头像URL
28
28
  attr_accessor :avatar
29
29
 
30
30
  # 自定义数据
31
31
  attr_accessor :data
32
32
 
33
- # 邮箱
33
+ # 用户邮箱
34
34
  attr_accessor :email
35
35
 
36
- # 邮箱验证码(只有启用的邮箱验证码功能时,才需要传入)
36
+ # 邮箱验证码(只有启用的邮箱验证码功能时,才需要传入),长度为4到8位的数字
37
37
  attr_accessor :email_code
38
38
 
39
- # 手机号
39
+ # 用户手机号,必须为11位数字
40
40
  attr_accessor :phone
41
41
 
42
- # 手机验证码(只有启用的手机验证码功能时,才需要传入)
42
+ # 手机验证码(只有启用的手机验证码功能时,才需要传入),长度为4到8位的数字
43
43
  attr_accessor :phone_code
44
44
 
45
45
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -161,8 +161,12 @@ module ZSGFClient
161
161
  invalid_properties.push('invalid value for "user_name", user_name cannot be nil.')
162
162
  end
163
163
 
164
- if @user_name.to_s.length < 1
165
- invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 1.')
164
+ if @user_name.to_s.length > 32
165
+ invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 32.')
166
+ end
167
+
168
+ if @user_name.to_s.length < 6
169
+ invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 6.')
166
170
  end
167
171
 
168
172
  if @pwd.nil?
@@ -177,8 +181,17 @@ module ZSGFClient
177
181
  invalid_properties.push('invalid value for "pwd", the character length must be great than or equal to 6.')
178
182
  end
179
183
 
180
- if !@nick_name.nil? && @nick_name.to_s.length > 99
181
- invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 99.')
184
+ pattern = Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
185
+ if @pwd !~ pattern
186
+ invalid_properties.push("invalid value for \"pwd\", must conform to the pattern #{pattern}.")
187
+ end
188
+
189
+ if !@nick_name.nil? && @nick_name.to_s.length > 32
190
+ invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 32.')
191
+ end
192
+
193
+ if !@nick_name.nil? && @nick_name.to_s.length < 4
194
+ invalid_properties.push('invalid value for "nick_name", the character length must be great than or equal to 4.')
182
195
  end
183
196
 
184
197
  if !@avatar.nil? && @avatar.to_s.length > 999
@@ -189,11 +202,6 @@ module ZSGFClient
189
202
  invalid_properties.push('invalid value for "data", the character length must be smaller than or equal to 9999.')
190
203
  end
191
204
 
192
- pattern = Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
193
- if !@email.nil? && @email !~ pattern
194
- invalid_properties.push("invalid value for \"email\", must conform to the pattern #{pattern}.")
195
- end
196
-
197
205
  pattern = Regexp.new(/\d{4,8}$/)
198
206
  if !@email_code.nil? && @email_code !~ pattern
199
207
  invalid_properties.push("invalid value for \"email_code\", must conform to the pattern #{pattern}.")
@@ -217,14 +225,16 @@ module ZSGFClient
217
225
  def valid?
218
226
  warn '[DEPRECATED] the `valid?` method is obsolete'
219
227
  return false if @user_name.nil?
220
- return false if @user_name.to_s.length < 1
228
+ return false if @user_name.to_s.length > 32
229
+ return false if @user_name.to_s.length < 6
221
230
  return false if @pwd.nil?
222
231
  return false if @pwd.to_s.length > 32
223
232
  return false if @pwd.to_s.length < 6
224
- return false if !@nick_name.nil? && @nick_name.to_s.length > 99
233
+ return false if @pwd !~ Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
234
+ return false if !@nick_name.nil? && @nick_name.to_s.length > 32
235
+ return false if !@nick_name.nil? && @nick_name.to_s.length < 4
225
236
  return false if !@avatar.nil? && @avatar.to_s.length > 999
226
237
  return false if !@data.nil? && @data.to_s.length > 9999
227
- return false if !@email.nil? && @email !~ Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
228
238
  return false if !@email_code.nil? && @email_code !~ Regexp.new(/\d{4,8}$/)
229
239
  return false if !@phone.nil? && @phone !~ Regexp.new(/^(\d{11})?$/)
230
240
  return false if !@phone_code.nil? && @phone_code !~ Regexp.new(/\d{4,8}$/)
@@ -238,8 +248,12 @@ module ZSGFClient
238
248
  fail ArgumentError, 'user_name cannot be nil'
239
249
  end
240
250
 
241
- if user_name.to_s.length < 1
242
- fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 1.'
251
+ if user_name.to_s.length > 32
252
+ fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 32.'
253
+ end
254
+
255
+ if user_name.to_s.length < 6
256
+ fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 6.'
243
257
  end
244
258
 
245
259
  @user_name = user_name
@@ -260,14 +274,23 @@ module ZSGFClient
260
274
  fail ArgumentError, 'invalid value for "pwd", the character length must be great than or equal to 6.'
261
275
  end
262
276
 
277
+ pattern = Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
278
+ if pwd !~ pattern
279
+ fail ArgumentError, "invalid value for \"pwd\", must conform to the pattern #{pattern}."
280
+ end
281
+
263
282
  @pwd = pwd
264
283
  end
265
284
 
266
285
  # Custom attribute writer method with validation
267
286
  # @param [Object] nick_name Value to be assigned
268
287
  def nick_name=(nick_name)
269
- if !nick_name.nil? && nick_name.to_s.length > 99
270
- fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 99.'
288
+ if !nick_name.nil? && nick_name.to_s.length > 32
289
+ fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 32.'
290
+ end
291
+
292
+ if !nick_name.nil? && nick_name.to_s.length < 4
293
+ fail ArgumentError, 'invalid value for "nick_name", the character length must be great than or equal to 4.'
271
294
  end
272
295
 
273
296
  @nick_name = nick_name
@@ -293,17 +316,6 @@ module ZSGFClient
293
316
  @data = data
294
317
  end
295
318
 
296
- # Custom attribute writer method with validation
297
- # @param [Object] email Value to be assigned
298
- def email=(email)
299
- pattern = Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
300
- if !email.nil? && email !~ pattern
301
- fail ArgumentError, "invalid value for \"email\", must conform to the pattern #{pattern}."
302
- end
303
-
304
- @email = email
305
- end
306
-
307
319
  # Custom attribute writer method with validation
308
320
  # @param [Object] email_code Value to be assigned
309
321
  def email_code=(email_code)
@@ -15,11 +15,13 @@ require 'time'
15
15
 
16
16
  module ZSGFClient
17
17
  class UnionIDSignInRequest
18
+ # UnionID,长度必须在1到99个字符之间,只能包含字母、数字、下划线和连字符
18
19
  attr_accessor :union_id
19
20
 
21
+ # 平台,长度必须在1到20个字符之间,只能包含字母和数字
20
22
  attr_accessor :platform
21
23
 
22
- # 如果启用双因素认证登录,则必填
24
+ # 双因素认证代码,如果启用双因素认证登录,则必填,长度必须为6个字符,只能包含数字
23
25
  attr_accessor :two_factor_code
24
26
 
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -99,18 +101,49 @@ module ZSGFClient
99
101
  invalid_properties.push('invalid value for "union_id", union_id cannot be nil.')
100
102
  end
101
103
 
104
+ if @union_id.to_s.length > 99
105
+ invalid_properties.push('invalid value for "union_id", the character length must be smaller than or equal to 99.')
106
+ end
107
+
102
108
  if @union_id.to_s.length < 1
103
109
  invalid_properties.push('invalid value for "union_id", the character length must be great than or equal to 1.')
104
110
  end
105
111
 
112
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]*$/)
113
+ if @union_id !~ pattern
114
+ invalid_properties.push("invalid value for \"union_id\", must conform to the pattern #{pattern}.")
115
+ end
116
+
106
117
  if @platform.nil?
107
118
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
108
119
  end
109
120
 
121
+ if @platform.to_s.length > 20
122
+ invalid_properties.push('invalid value for "platform", the character length must be smaller than or equal to 20.')
123
+ end
124
+
110
125
  if @platform.to_s.length < 1
111
126
  invalid_properties.push('invalid value for "platform", the character length must be great than or equal to 1.')
112
127
  end
113
128
 
129
+ pattern = Regexp.new(/^[a-zA-Z0-9]*$/)
130
+ if @platform !~ pattern
131
+ invalid_properties.push("invalid value for \"platform\", must conform to the pattern #{pattern}.")
132
+ end
133
+
134
+ if !@two_factor_code.nil? && @two_factor_code.to_s.length > 6
135
+ invalid_properties.push('invalid value for "two_factor_code", the character length must be smaller than or equal to 6.')
136
+ end
137
+
138
+ if !@two_factor_code.nil? && @two_factor_code.to_s.length < 6
139
+ invalid_properties.push('invalid value for "two_factor_code", the character length must be great than or equal to 6.')
140
+ end
141
+
142
+ pattern = Regexp.new(/^[0-9]*$/)
143
+ if !@two_factor_code.nil? && @two_factor_code !~ pattern
144
+ invalid_properties.push("invalid value for \"two_factor_code\", must conform to the pattern #{pattern}.")
145
+ end
146
+
114
147
  invalid_properties
115
148
  end
116
149
 
@@ -119,9 +152,16 @@ module ZSGFClient
119
152
  def valid?
120
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
121
154
  return false if @union_id.nil?
155
+ return false if @union_id.to_s.length > 99
122
156
  return false if @union_id.to_s.length < 1
157
+ return false if @union_id !~ Regexp.new(/^[a-zA-Z0-9_-]*$/)
123
158
  return false if @platform.nil?
159
+ return false if @platform.to_s.length > 20
124
160
  return false if @platform.to_s.length < 1
161
+ return false if @platform !~ Regexp.new(/^[a-zA-Z0-9]*$/)
162
+ return false if !@two_factor_code.nil? && @two_factor_code.to_s.length > 6
163
+ return false if !@two_factor_code.nil? && @two_factor_code.to_s.length < 6
164
+ return false if !@two_factor_code.nil? && @two_factor_code !~ Regexp.new(/^[0-9]*$/)
125
165
  true
126
166
  end
127
167
 
@@ -132,10 +172,19 @@ module ZSGFClient
132
172
  fail ArgumentError, 'union_id cannot be nil'
133
173
  end
134
174
 
175
+ if union_id.to_s.length > 99
176
+ fail ArgumentError, 'invalid value for "union_id", the character length must be smaller than or equal to 99.'
177
+ end
178
+
135
179
  if union_id.to_s.length < 1
136
180
  fail ArgumentError, 'invalid value for "union_id", the character length must be great than or equal to 1.'
137
181
  end
138
182
 
183
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]*$/)
184
+ if union_id !~ pattern
185
+ fail ArgumentError, "invalid value for \"union_id\", must conform to the pattern #{pattern}."
186
+ end
187
+
139
188
  @union_id = union_id
140
189
  end
141
190
 
@@ -146,13 +195,41 @@ module ZSGFClient
146
195
  fail ArgumentError, 'platform cannot be nil'
147
196
  end
148
197
 
198
+ if platform.to_s.length > 20
199
+ fail ArgumentError, 'invalid value for "platform", the character length must be smaller than or equal to 20.'
200
+ end
201
+
149
202
  if platform.to_s.length < 1
150
203
  fail ArgumentError, 'invalid value for "platform", the character length must be great than or equal to 1.'
151
204
  end
152
205
 
206
+ pattern = Regexp.new(/^[a-zA-Z0-9]*$/)
207
+ if platform !~ pattern
208
+ fail ArgumentError, "invalid value for \"platform\", must conform to the pattern #{pattern}."
209
+ end
210
+
153
211
  @platform = platform
154
212
  end
155
213
 
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] two_factor_code Value to be assigned
216
+ def two_factor_code=(two_factor_code)
217
+ if !two_factor_code.nil? && two_factor_code.to_s.length > 6
218
+ fail ArgumentError, 'invalid value for "two_factor_code", the character length must be smaller than or equal to 6.'
219
+ end
220
+
221
+ if !two_factor_code.nil? && two_factor_code.to_s.length < 6
222
+ fail ArgumentError, 'invalid value for "two_factor_code", the character length must be great than or equal to 6.'
223
+ end
224
+
225
+ pattern = Regexp.new(/^[0-9]*$/)
226
+ if !two_factor_code.nil? && two_factor_code !~ pattern
227
+ fail ArgumentError, "invalid value for \"two_factor_code\", must conform to the pattern #{pattern}."
228
+ end
229
+
230
+ @two_factor_code = two_factor_code
231
+ end
232
+
156
233
  # Checks equality by comparing each attribute.
157
234
  # @param [Object] Object to be compared
158
235
  def ==(o)
@@ -15,37 +15,37 @@ require 'time'
15
15
 
16
16
  module ZSGFClient
17
17
  class UnionIDSignUpRequest
18
- # 登录账号,可空
18
+ # 登录账号,可空,只能包含字母、数字、下划线和连字符
19
19
  attr_accessor :user_name
20
20
 
21
- # UnionID
21
+ # UnionID,长度不能超过99个字符,只能包含字母、数字、下划线和连字符
22
22
  attr_accessor :union_id
23
23
 
24
- # 平台标识
24
+ # 平台标识,长度必须在1到20个字符之间,只能包含字母和数字
25
25
  attr_accessor :platform
26
26
 
27
- # 密码,6~32
27
+ # 密码,长度必须在632个字符之间,只允许英文大小写、数字、标点符号
28
28
  attr_accessor :pwd
29
29
 
30
- # 昵称
30
+ # 用户昵称
31
31
  attr_accessor :nick_name
32
32
 
33
- # 头像
33
+ # 用户头像URL
34
34
  attr_accessor :avatar
35
35
 
36
36
  # 自定义数据
37
37
  attr_accessor :data
38
38
 
39
- # 邮箱
39
+ # 用户邮箱
40
40
  attr_accessor :email
41
41
 
42
- # 邮箱验证码(只有启用的邮箱验证码功能时,才需要传入)
42
+ # 邮箱验证码(只有启用的邮箱验证码功能时,才需要传入),长度为4到8位的数字
43
43
  attr_accessor :email_code
44
44
 
45
- # 手机号
45
+ # 用户手机号,必须为11位数字
46
46
  attr_accessor :phone
47
47
 
48
- # 手机验证码(只有启用的手机验证码功能时,才需要传入)
48
+ # 手机验证码(只有启用的手机验证码功能时,才需要传入),长度为4到8位的数字
49
49
  attr_accessor :phone_code
50
50
 
51
51
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -178,6 +178,14 @@ module ZSGFClient
178
178
  def list_invalid_properties
179
179
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
180
180
  invalid_properties = Array.new
181
+ if !@user_name.nil? && @user_name.to_s.length > 32
182
+ invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 32.')
183
+ end
184
+
185
+ if !@user_name.nil? && @user_name.to_s.length < 6
186
+ invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 6.')
187
+ end
188
+
181
189
  if @union_id.nil?
182
190
  invalid_properties.push('invalid value for "union_id", union_id cannot be nil.')
183
191
  end
@@ -190,33 +198,51 @@ module ZSGFClient
190
198
  invalid_properties.push('invalid value for "union_id", the character length must be great than or equal to 1.')
191
199
  end
192
200
 
201
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]*$/)
202
+ if @union_id !~ pattern
203
+ invalid_properties.push("invalid value for \"union_id\", must conform to the pattern #{pattern}.")
204
+ end
205
+
193
206
  if @platform.nil?
194
207
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
195
208
  end
196
209
 
197
- if @platform.to_s.length > 99
198
- invalid_properties.push('invalid value for "platform", the character length must be smaller than or equal to 99.')
210
+ if @platform.to_s.length > 20
211
+ invalid_properties.push('invalid value for "platform", the character length must be smaller than or equal to 20.')
199
212
  end
200
213
 
201
214
  if @platform.to_s.length < 1
202
215
  invalid_properties.push('invalid value for "platform", the character length must be great than or equal to 1.')
203
216
  end
204
217
 
218
+ pattern = Regexp.new(/^[a-zA-Z0-9]*$/)
219
+ if @platform !~ pattern
220
+ invalid_properties.push("invalid value for \"platform\", must conform to the pattern #{pattern}.")
221
+ end
222
+
205
223
  if @pwd.nil?
206
224
  invalid_properties.push('invalid value for "pwd", pwd cannot be nil.')
207
225
  end
208
226
 
209
- if @pwd.to_s.length < 1
210
- invalid_properties.push('invalid value for "pwd", the character length must be great than or equal to 1.')
227
+ if @pwd.to_s.length > 32
228
+ invalid_properties.push('invalid value for "pwd", the character length must be smaller than or equal to 32.')
211
229
  end
212
230
 
213
- pattern = Regexp.new(/^[a-zA-Z0-9_-~!@#$%^&*]{6,32}$/)
231
+ if @pwd.to_s.length < 6
232
+ invalid_properties.push('invalid value for "pwd", the character length must be great than or equal to 6.')
233
+ end
234
+
235
+ pattern = Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
214
236
  if @pwd !~ pattern
215
237
  invalid_properties.push("invalid value for \"pwd\", must conform to the pattern #{pattern}.")
216
238
  end
217
239
 
218
- if !@nick_name.nil? && @nick_name.to_s.length > 99
219
- invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 99.')
240
+ if !@nick_name.nil? && @nick_name.to_s.length > 32
241
+ invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 32.')
242
+ end
243
+
244
+ if !@nick_name.nil? && @nick_name.to_s.length < 4
245
+ invalid_properties.push('invalid value for "nick_name", the character length must be great than or equal to 4.')
220
246
  end
221
247
 
222
248
  if !@avatar.nil? && @avatar.to_s.length > 999
@@ -227,11 +253,6 @@ module ZSGFClient
227
253
  invalid_properties.push('invalid value for "data", the character length must be smaller than or equal to 9999.')
228
254
  end
229
255
 
230
- pattern = Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
231
- if !@email.nil? && @email !~ pattern
232
- invalid_properties.push("invalid value for \"email\", must conform to the pattern #{pattern}.")
233
- end
234
-
235
256
  pattern = Regexp.new(/\d{4,8}$/)
236
257
  if !@email_code.nil? && @email_code !~ pattern
237
258
  invalid_properties.push("invalid value for \"email_code\", must conform to the pattern #{pattern}.")
@@ -254,25 +275,44 @@ module ZSGFClient
254
275
  # @return true if the model is valid
255
276
  def valid?
256
277
  warn '[DEPRECATED] the `valid?` method is obsolete'
278
+ return false if !@user_name.nil? && @user_name.to_s.length > 32
279
+ return false if !@user_name.nil? && @user_name.to_s.length < 6
257
280
  return false if @union_id.nil?
258
281
  return false if @union_id.to_s.length > 99
259
282
  return false if @union_id.to_s.length < 1
283
+ return false if @union_id !~ Regexp.new(/^[a-zA-Z0-9_-]*$/)
260
284
  return false if @platform.nil?
261
- return false if @platform.to_s.length > 99
285
+ return false if @platform.to_s.length > 20
262
286
  return false if @platform.to_s.length < 1
287
+ return false if @platform !~ Regexp.new(/^[a-zA-Z0-9]*$/)
263
288
  return false if @pwd.nil?
264
- return false if @pwd.to_s.length < 1
265
- return false if @pwd !~ Regexp.new(/^[a-zA-Z0-9_-~!@#$%^&*]{6,32}$/)
266
- return false if !@nick_name.nil? && @nick_name.to_s.length > 99
289
+ return false if @pwd.to_s.length > 32
290
+ return false if @pwd.to_s.length < 6
291
+ return false if @pwd !~ Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
292
+ return false if !@nick_name.nil? && @nick_name.to_s.length > 32
293
+ return false if !@nick_name.nil? && @nick_name.to_s.length < 4
267
294
  return false if !@avatar.nil? && @avatar.to_s.length > 999
268
295
  return false if !@data.nil? && @data.to_s.length > 9999
269
- return false if !@email.nil? && @email !~ Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
270
296
  return false if !@email_code.nil? && @email_code !~ Regexp.new(/\d{4,8}$/)
271
297
  return false if !@phone.nil? && @phone !~ Regexp.new(/^(\d{11})?$/)
272
298
  return false if !@phone_code.nil? && @phone_code !~ Regexp.new(/\d{4,8}$/)
273
299
  true
274
300
  end
275
301
 
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] user_name Value to be assigned
304
+ def user_name=(user_name)
305
+ if !user_name.nil? && user_name.to_s.length > 32
306
+ fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 32.'
307
+ end
308
+
309
+ if !user_name.nil? && user_name.to_s.length < 6
310
+ fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 6.'
311
+ end
312
+
313
+ @user_name = user_name
314
+ end
315
+
276
316
  # Custom attribute writer method with validation
277
317
  # @param [Object] union_id Value to be assigned
278
318
  def union_id=(union_id)
@@ -288,6 +328,11 @@ module ZSGFClient
288
328
  fail ArgumentError, 'invalid value for "union_id", the character length must be great than or equal to 1.'
289
329
  end
290
330
 
331
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]*$/)
332
+ if union_id !~ pattern
333
+ fail ArgumentError, "invalid value for \"union_id\", must conform to the pattern #{pattern}."
334
+ end
335
+
291
336
  @union_id = union_id
292
337
  end
293
338
 
@@ -298,14 +343,19 @@ module ZSGFClient
298
343
  fail ArgumentError, 'platform cannot be nil'
299
344
  end
300
345
 
301
- if platform.to_s.length > 99
302
- fail ArgumentError, 'invalid value for "platform", the character length must be smaller than or equal to 99.'
346
+ if platform.to_s.length > 20
347
+ fail ArgumentError, 'invalid value for "platform", the character length must be smaller than or equal to 20.'
303
348
  end
304
349
 
305
350
  if platform.to_s.length < 1
306
351
  fail ArgumentError, 'invalid value for "platform", the character length must be great than or equal to 1.'
307
352
  end
308
353
 
354
+ pattern = Regexp.new(/^[a-zA-Z0-9]*$/)
355
+ if platform !~ pattern
356
+ fail ArgumentError, "invalid value for \"platform\", must conform to the pattern #{pattern}."
357
+ end
358
+
309
359
  @platform = platform
310
360
  end
311
361
 
@@ -316,11 +366,15 @@ module ZSGFClient
316
366
  fail ArgumentError, 'pwd cannot be nil'
317
367
  end
318
368
 
319
- if pwd.to_s.length < 1
320
- fail ArgumentError, 'invalid value for "pwd", the character length must be great than or equal to 1.'
369
+ if pwd.to_s.length > 32
370
+ fail ArgumentError, 'invalid value for "pwd", the character length must be smaller than or equal to 32.'
321
371
  end
322
372
 
323
- pattern = Regexp.new(/^[a-zA-Z0-9_-~!@#$%^&*]{6,32}$/)
373
+ if pwd.to_s.length < 6
374
+ fail ArgumentError, 'invalid value for "pwd", the character length must be great than or equal to 6.'
375
+ end
376
+
377
+ pattern = Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
324
378
  if pwd !~ pattern
325
379
  fail ArgumentError, "invalid value for \"pwd\", must conform to the pattern #{pattern}."
326
380
  end
@@ -331,8 +385,12 @@ module ZSGFClient
331
385
  # Custom attribute writer method with validation
332
386
  # @param [Object] nick_name Value to be assigned
333
387
  def nick_name=(nick_name)
334
- if !nick_name.nil? && nick_name.to_s.length > 99
335
- fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 99.'
388
+ if !nick_name.nil? && nick_name.to_s.length > 32
389
+ fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 32.'
390
+ end
391
+
392
+ if !nick_name.nil? && nick_name.to_s.length < 4
393
+ fail ArgumentError, 'invalid value for "nick_name", the character length must be great than or equal to 4.'
336
394
  end
337
395
 
338
396
  @nick_name = nick_name
@@ -358,17 +416,6 @@ module ZSGFClient
358
416
  @data = data
359
417
  end
360
418
 
361
- # Custom attribute writer method with validation
362
- # @param [Object] email Value to be assigned
363
- def email=(email)
364
- pattern = Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
365
- if !email.nil? && email !~ pattern
366
- fail ArgumentError, "invalid value for \"email\", must conform to the pattern #{pattern}."
367
- end
368
-
369
- @email = email
370
- end
371
-
372
419
  # Custom attribute writer method with validation
373
420
  # @param [Object] email_code Value to be assigned
374
421
  def email_code=(email_code)