zsgf_client 1.0.20 → 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.
- checksums.yaml +4 -4
- data/docs/AccessTokenApi.md +14 -14
- data/docs/AccessTokenPutRequest.md +2 -2
- data/docs/AppUserListResponse.md +12 -12
- data/docs/AppUserResetEmailRequest.md +20 -0
- data/docs/AppUserResetPhoneRequest.md +20 -0
- data/docs/AppUserResetPwdRequest.md +4 -8
- data/docs/CommonFriendModel.md +3 -3
- data/docs/EmailSignInRequest.md +3 -3
- data/docs/EmailSignUpRequest.md +5 -5
- data/docs/FileApi.md +4 -4
- data/docs/FollowerModel.md +12 -12
- data/docs/FollowerPutModel.md +6 -6
- data/docs/GeoLocation.md +62 -0
- data/docs/GeoLocationModel.md +4 -4
- data/docs/GeoLocationResponseModel.md +4 -4
- data/docs/GetUserProfileResult.md +24 -0
- data/docs/{UserFollowingResultApiResponse.md → GetUserProfileResultApiResponse.md} +3 -3
- data/docs/MySqlGeometry.md +26 -0
- data/docs/OAuthAccountSignInRequest.md +3 -3
- data/docs/PhoneSignInRequest.md +3 -3
- data/docs/PhoneSignUpRequest.md +7 -7
- data/docs/QRCodePreSignInRequest.md +3 -3
- data/docs/QRCodeScanRequest.md +1 -1
- data/docs/QRCodeSignInRequest.md +1 -1
- data/docs/QRCodeSignUpRequest.md +8 -8
- data/docs/RecommendFriend.md +21 -11
- data/docs/SendEmailCodeRequest.md +2 -2
- data/docs/SendSMSCodeRequest.md +2 -2
- data/docs/SignInRequest.md +3 -3
- data/docs/SignUpRequest.md +8 -8
- data/docs/StorageApi.md +86 -6
- data/docs/UnionIDSignInRequest.md +3 -3
- data/docs/UnionIDSignUpRequest.md +10 -10
- data/docs/UpdateProfileRequest.md +27 -15
- data/docs/UserApi.md +358 -54
- data/docs/UserFriendsNearByResult.md +3 -3
- data/docs/UserProfileResult.md +2 -28
- data/docs/WechatApi.md +86 -12
- data/lib/zsgf_client/api/access_token_api.rb +14 -14
- data/lib/zsgf_client/api/file_api.rb +3 -3
- data/lib/zsgf_client/api/storage_api.rb +105 -6
- data/lib/zsgf_client/api/user_api.rb +349 -60
- data/lib/zsgf_client/api/wechat_api.rb +88 -18
- data/lib/zsgf_client/models/access_token_put_request.rb +3 -27
- data/lib/zsgf_client/models/app_user_list_response.rb +12 -0
- data/lib/zsgf_client/models/app_user_reset_email_request.rb +269 -0
- data/lib/zsgf_client/models/app_user_reset_phone_request.rb +269 -0
- data/lib/zsgf_client/models/app_user_reset_pwd_request.rb +52 -70
- data/lib/zsgf_client/models/common_friend_model.rb +3 -0
- data/lib/zsgf_client/models/email_sign_in_request.rb +38 -1
- data/lib/zsgf_client/models/email_sign_up_request.rb +30 -8
- data/lib/zsgf_client/models/follower_model.rb +12 -0
- data/lib/zsgf_client/models/follower_put_model.rb +6 -0
- data/lib/zsgf_client/models/geo_location.rb +750 -0
- data/lib/zsgf_client/models/geo_location_model.rb +262 -12
- data/lib/zsgf_client/models/geo_location_response_model.rb +262 -12
- data/lib/zsgf_client/models/{user_following_result.rb → get_user_profile_result.rb} +37 -18
- data/lib/zsgf_client/models/{user_following_result_api_response.rb → get_user_profile_result_api_response.rb} +4 -4
- data/lib/zsgf_client/models/my_sql_geometry.rb +260 -0
- data/lib/zsgf_client/models/o_auth_account_sign_in_request.rb +78 -1
- data/lib/zsgf_client/models/phone_sign_in_request.rb +49 -1
- data/lib/zsgf_client/models/phone_sign_up_request.rb +29 -24
- data/lib/zsgf_client/models/qr_code_pre_sign_in_request.rb +97 -0
- data/lib/zsgf_client/models/qr_code_scan_request.rb +1 -0
- data/lib/zsgf_client/models/qr_code_sign_in_request.rb +1 -0
- data/lib/zsgf_client/models/qr_code_sign_up_request.rb +38 -33
- data/lib/zsgf_client/models/recommend_friend.rb +69 -4
- data/lib/zsgf_client/models/send_email_code_request.rb +2 -1
- data/lib/zsgf_client/models/send_sms_code_request.rb +2 -2
- data/lib/zsgf_client/models/sign_in_request.rb +77 -11
- data/lib/zsgf_client/models/sign_up_request.rb +47 -35
- data/lib/zsgf_client/models/union_id_sign_in_request.rb +78 -1
- data/lib/zsgf_client/models/union_id_sign_up_request.rb +92 -45
- data/lib/zsgf_client/models/update_profile_request.rb +99 -24
- data/lib/zsgf_client/models/user_friends_near_by_result.rb +10 -7
- data/lib/zsgf_client/models/user_profile_result.rb +7 -133
- data/lib/zsgf_client/version.rb +1 -1
- data/lib/zsgf_client.rb +6 -2
- data/spec/api/access_token_api_spec.rb +7 -7
- data/spec/api/file_api_spec.rb +1 -1
- data/spec/api/storage_api_spec.rb +17 -1
- data/spec/api/user_api_spec.rb +81 -23
- data/spec/api/wechat_api_spec.rb +19 -6
- data/spec/models/{user_following_result_spec.rb → app_user_reset_email_request_spec.rb} +8 -8
- data/spec/models/app_user_reset_phone_request_spec.rb +42 -0
- data/spec/models/app_user_reset_pwd_request_spec.rb +2 -14
- data/spec/models/geo_location_model_spec.rb +3 -3
- data/spec/models/geo_location_response_model_spec.rb +3 -3
- data/spec/models/geo_location_spec.rb +168 -0
- data/spec/models/{user_following_result_api_response_spec.rb → get_user_profile_result_api_response_spec.rb} +6 -6
- data/spec/models/get_user_profile_result_spec.rb +54 -0
- data/spec/models/my_sql_geometry_spec.rb +60 -0
- data/spec/models/recommend_friend_spec.rb +30 -0
- data/spec/models/update_profile_request_spec.rb +36 -0
- data/spec/models/user_friends_near_by_result_spec.rb +1 -1
- data/spec/models/user_profile_result_spec.rb +1 -79
- data/zsgf_client.gemspec +3 -3
- metadata +214 -198
- data/docs/UserFollowingResult.md +0 -20
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#全部 API 文档
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.13.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module ZSGFClient
|
|
17
|
+
class MySqlGeometry
|
|
18
|
+
attr_accessor :x_coordinate
|
|
19
|
+
|
|
20
|
+
attr_accessor :y_coordinate
|
|
21
|
+
|
|
22
|
+
attr_accessor :srid
|
|
23
|
+
|
|
24
|
+
attr_accessor :is_null
|
|
25
|
+
|
|
26
|
+
attr_accessor :value
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'x_coordinate' => :'xCoordinate',
|
|
32
|
+
:'y_coordinate' => :'yCoordinate',
|
|
33
|
+
:'srid' => :'srid',
|
|
34
|
+
:'is_null' => :'isNull',
|
|
35
|
+
:'value' => :'value'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'x_coordinate' => :'Float',
|
|
53
|
+
:'y_coordinate' => :'Float',
|
|
54
|
+
:'srid' => :'Integer',
|
|
55
|
+
:'is_null' => :'Boolean',
|
|
56
|
+
:'value' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'x_coordinate',
|
|
64
|
+
:'y_coordinate',
|
|
65
|
+
:'srid',
|
|
66
|
+
:'value'
|
|
67
|
+
])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Initializes the object
|
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
if (!attributes.is_a?(Hash))
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ZSGFClient::MySqlGeometry` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ZSGFClient::MySqlGeometry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'x_coordinate')
|
|
87
|
+
self.x_coordinate = attributes[:'x_coordinate']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'y_coordinate')
|
|
91
|
+
self.y_coordinate = attributes[:'y_coordinate']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'srid')
|
|
95
|
+
self.srid = attributes[:'srid']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'is_null')
|
|
99
|
+
self.is_null = attributes[:'is_null']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'value')
|
|
103
|
+
self.value = attributes[:'value']
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
true
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Checks equality by comparing each attribute.
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def ==(o)
|
|
125
|
+
return true if self.equal?(o)
|
|
126
|
+
self.class == o.class &&
|
|
127
|
+
x_coordinate == o.x_coordinate &&
|
|
128
|
+
y_coordinate == o.y_coordinate &&
|
|
129
|
+
srid == o.srid &&
|
|
130
|
+
is_null == o.is_null &&
|
|
131
|
+
value == o.value
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# @see the `==` method
|
|
135
|
+
# @param [Object] Object to be compared
|
|
136
|
+
def eql?(o)
|
|
137
|
+
self == o
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Calculates hash code according to all attributes.
|
|
141
|
+
# @return [Integer] Hash code
|
|
142
|
+
def hash
|
|
143
|
+
[x_coordinate, y_coordinate, srid, is_null, value].hash
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Builds the object from hash
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
# @return [Object] Returns the model itself
|
|
149
|
+
def self.build_from_hash(attributes)
|
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
152
|
+
transformed_hash = {}
|
|
153
|
+
openapi_types.each_pair do |key, type|
|
|
154
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
155
|
+
transformed_hash["#{key}"] = nil
|
|
156
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
157
|
+
# check to ensure the input is an array given that the attribute
|
|
158
|
+
# is documented as an array but the input is not
|
|
159
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
160
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
161
|
+
end
|
|
162
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
163
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
new(transformed_hash)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Deserializes the data based on type
|
|
170
|
+
# @param string type Data type
|
|
171
|
+
# @param string value Value to be deserialized
|
|
172
|
+
# @return [Object] Deserialized data
|
|
173
|
+
def self._deserialize(type, value)
|
|
174
|
+
case type.to_sym
|
|
175
|
+
when :Time
|
|
176
|
+
Time.parse(value)
|
|
177
|
+
when :Date
|
|
178
|
+
Date.parse(value)
|
|
179
|
+
when :String
|
|
180
|
+
value.to_s
|
|
181
|
+
when :Integer
|
|
182
|
+
value.to_i
|
|
183
|
+
when :Float
|
|
184
|
+
value.to_f
|
|
185
|
+
when :Boolean
|
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
187
|
+
true
|
|
188
|
+
else
|
|
189
|
+
false
|
|
190
|
+
end
|
|
191
|
+
when :Object
|
|
192
|
+
# generic object (usually a Hash), return directly
|
|
193
|
+
value
|
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
|
200
|
+
{}.tap do |hash|
|
|
201
|
+
value.each do |k, v|
|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
else # model
|
|
206
|
+
# models (e.g. Pet) or oneOf
|
|
207
|
+
klass = ZSGFClient.const_get(type)
|
|
208
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the string representation of the object
|
|
213
|
+
# @return [String] String presentation of the object
|
|
214
|
+
def to_s
|
|
215
|
+
to_hash.to_s
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
|
220
|
+
def to_body
|
|
221
|
+
to_hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Outputs non-array value in the form of hash
|
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
242
|
+
# @param [Object] value Any valid value
|
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
|
244
|
+
def _to_hash(value)
|
|
245
|
+
if value.is_a?(Array)
|
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
|
247
|
+
elsif value.is_a?(Hash)
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
250
|
+
end
|
|
251
|
+
elsif value.respond_to? :to_hash
|
|
252
|
+
value.to_hash
|
|
253
|
+
else
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
@@ -15,11 +15,13 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module ZSGFClient
|
|
17
17
|
class OAuthAccountSignInRequest
|
|
18
|
+
# UnionID,长度必须在1到50个字符之间,只能包含字母、数字、下划线和连字符
|
|
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 > 50
|
|
105
|
+
invalid_properties.push('invalid value for "union_id", the character length must be smaller than or equal to 50.')
|
|
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 > 50
|
|
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 > 50
|
|
176
|
+
fail ArgumentError, 'invalid value for "union_id", the character length must be smaller than or equal to 50.'
|
|
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,11 +15,13 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module ZSGFClient
|
|
17
17
|
class PhoneSignInRequest
|
|
18
|
+
# 用户手机号
|
|
18
19
|
attr_accessor :phone
|
|
19
20
|
|
|
21
|
+
# 验证码,长度为4到8位的数字
|
|
20
22
|
attr_accessor :verify_code
|
|
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.
|
|
@@ -111,6 +113,24 @@ module ZSGFClient
|
|
|
111
113
|
invalid_properties.push('invalid value for "verify_code", the character length must be great than or equal to 1.')
|
|
112
114
|
end
|
|
113
115
|
|
|
116
|
+
pattern = Regexp.new(/\d{4,8}$/)
|
|
117
|
+
if @verify_code !~ pattern
|
|
118
|
+
invalid_properties.push("invalid value for \"verify_code\", must conform to the pattern #{pattern}.")
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if !@two_factor_code.nil? && @two_factor_code.to_s.length > 6
|
|
122
|
+
invalid_properties.push('invalid value for "two_factor_code", the character length must be smaller than or equal to 6.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if !@two_factor_code.nil? && @two_factor_code.to_s.length < 6
|
|
126
|
+
invalid_properties.push('invalid value for "two_factor_code", the character length must be great than or equal to 6.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
pattern = Regexp.new(/^[0-9]*$/)
|
|
130
|
+
if !@two_factor_code.nil? && @two_factor_code !~ pattern
|
|
131
|
+
invalid_properties.push("invalid value for \"two_factor_code\", must conform to the pattern #{pattern}.")
|
|
132
|
+
end
|
|
133
|
+
|
|
114
134
|
invalid_properties
|
|
115
135
|
end
|
|
116
136
|
|
|
@@ -122,6 +142,10 @@ module ZSGFClient
|
|
|
122
142
|
return false if @phone.to_s.length < 1
|
|
123
143
|
return false if @verify_code.nil?
|
|
124
144
|
return false if @verify_code.to_s.length < 1
|
|
145
|
+
return false if @verify_code !~ Regexp.new(/\d{4,8}$/)
|
|
146
|
+
return false if !@two_factor_code.nil? && @two_factor_code.to_s.length > 6
|
|
147
|
+
return false if !@two_factor_code.nil? && @two_factor_code.to_s.length < 6
|
|
148
|
+
return false if !@two_factor_code.nil? && @two_factor_code !~ Regexp.new(/^[0-9]*$/)
|
|
125
149
|
true
|
|
126
150
|
end
|
|
127
151
|
|
|
@@ -150,9 +174,33 @@ module ZSGFClient
|
|
|
150
174
|
fail ArgumentError, 'invalid value for "verify_code", the character length must be great than or equal to 1.'
|
|
151
175
|
end
|
|
152
176
|
|
|
177
|
+
pattern = Regexp.new(/\d{4,8}$/)
|
|
178
|
+
if verify_code !~ pattern
|
|
179
|
+
fail ArgumentError, "invalid value for \"verify_code\", must conform to the pattern #{pattern}."
|
|
180
|
+
end
|
|
181
|
+
|
|
153
182
|
@verify_code = verify_code
|
|
154
183
|
end
|
|
155
184
|
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] two_factor_code Value to be assigned
|
|
187
|
+
def two_factor_code=(two_factor_code)
|
|
188
|
+
if !two_factor_code.nil? && two_factor_code.to_s.length > 6
|
|
189
|
+
fail ArgumentError, 'invalid value for "two_factor_code", the character length must be smaller than or equal to 6.'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if !two_factor_code.nil? && two_factor_code.to_s.length < 6
|
|
193
|
+
fail ArgumentError, 'invalid value for "two_factor_code", the character length must be great than or equal to 6.'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
pattern = Regexp.new(/^[0-9]*$/)
|
|
197
|
+
if !two_factor_code.nil? && two_factor_code !~ pattern
|
|
198
|
+
fail ArgumentError, "invalid value for \"two_factor_code\", must conform to the pattern #{pattern}."
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
@two_factor_code = two_factor_code
|
|
202
|
+
end
|
|
203
|
+
|
|
156
204
|
# Checks equality by comparing each attribute.
|
|
157
205
|
# @param [Object] Object to be compared
|
|
158
206
|
def ==(o)
|
|
@@ -15,23 +15,25 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module ZSGFClient
|
|
17
17
|
class PhoneSignUpRequest
|
|
18
|
+
# 用户手机号
|
|
18
19
|
attr_accessor :phone
|
|
19
20
|
|
|
20
|
-
#
|
|
21
|
+
# 手机验证码,长度为4到8位的数字
|
|
21
22
|
attr_accessor :phone_code
|
|
22
23
|
|
|
24
|
+
# 用户密码,长度为6到32个字符
|
|
23
25
|
attr_accessor :pwd
|
|
24
26
|
|
|
25
|
-
#
|
|
27
|
+
# 用户邮箱
|
|
26
28
|
attr_accessor :email
|
|
27
29
|
|
|
28
|
-
#
|
|
30
|
+
# 邮箱验证码(只有启用的邮箱验证码功能时,才需要传入),长度为4到8位的数字
|
|
29
31
|
attr_accessor :email_code
|
|
30
32
|
|
|
31
|
-
#
|
|
33
|
+
# 用户昵称
|
|
32
34
|
attr_accessor :nick_name
|
|
33
35
|
|
|
34
|
-
#
|
|
36
|
+
# 用户头像URL
|
|
35
37
|
attr_accessor :avatar
|
|
36
38
|
|
|
37
39
|
# 自定义数据
|
|
@@ -179,9 +181,9 @@ module ZSGFClient
|
|
|
179
181
|
invalid_properties.push('invalid value for "pwd", the character length must be great than or equal to 6.')
|
|
180
182
|
end
|
|
181
183
|
|
|
182
|
-
pattern = Regexp.new(/^[a-zA-Z0-
|
|
183
|
-
if
|
|
184
|
-
invalid_properties.push("invalid value for \"
|
|
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}.")
|
|
185
187
|
end
|
|
186
188
|
|
|
187
189
|
pattern = Regexp.new(/\d{4,8}$/)
|
|
@@ -189,8 +191,12 @@ module ZSGFClient
|
|
|
189
191
|
invalid_properties.push("invalid value for \"email_code\", must conform to the pattern #{pattern}.")
|
|
190
192
|
end
|
|
191
193
|
|
|
192
|
-
if !@nick_name.nil? && @nick_name.to_s.length >
|
|
193
|
-
invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to
|
|
194
|
+
if !@nick_name.nil? && @nick_name.to_s.length > 32
|
|
195
|
+
invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 32.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if !@nick_name.nil? && @nick_name.to_s.length < 4
|
|
199
|
+
invalid_properties.push('invalid value for "nick_name", the character length must be great than or equal to 4.')
|
|
194
200
|
end
|
|
195
201
|
|
|
196
202
|
if !@avatar.nil? && @avatar.to_s.length > 999
|
|
@@ -216,9 +222,10 @@ module ZSGFClient
|
|
|
216
222
|
return false if @pwd.nil?
|
|
217
223
|
return false if @pwd.to_s.length > 32
|
|
218
224
|
return false if @pwd.to_s.length < 6
|
|
219
|
-
return false if
|
|
225
|
+
return false if @pwd !~ Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
|
|
220
226
|
return false if !@email_code.nil? && @email_code !~ Regexp.new(/\d{4,8}$/)
|
|
221
|
-
return false if !@nick_name.nil? && @nick_name.to_s.length >
|
|
227
|
+
return false if !@nick_name.nil? && @nick_name.to_s.length > 32
|
|
228
|
+
return false if !@nick_name.nil? && @nick_name.to_s.length < 4
|
|
222
229
|
return false if !@avatar.nil? && @avatar.to_s.length > 999
|
|
223
230
|
return false if !@data.nil? && @data.to_s.length > 9999
|
|
224
231
|
true
|
|
@@ -272,18 +279,12 @@ module ZSGFClient
|
|
|
272
279
|
fail ArgumentError, 'invalid value for "pwd", the character length must be great than or equal to 6.'
|
|
273
280
|
end
|
|
274
281
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
# Custom attribute writer method with validation
|
|
279
|
-
# @param [Object] email Value to be assigned
|
|
280
|
-
def email=(email)
|
|
281
|
-
pattern = Regexp.new(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/)
|
|
282
|
-
if !email.nil? && email !~ pattern
|
|
283
|
-
fail ArgumentError, "invalid value for \"email\", must conform to the pattern #{pattern}."
|
|
282
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-!@#$%^&*()]*$/)
|
|
283
|
+
if pwd !~ pattern
|
|
284
|
+
fail ArgumentError, "invalid value for \"pwd\", must conform to the pattern #{pattern}."
|
|
284
285
|
end
|
|
285
286
|
|
|
286
|
-
@
|
|
287
|
+
@pwd = pwd
|
|
287
288
|
end
|
|
288
289
|
|
|
289
290
|
# Custom attribute writer method with validation
|
|
@@ -300,8 +301,12 @@ module ZSGFClient
|
|
|
300
301
|
# Custom attribute writer method with validation
|
|
301
302
|
# @param [Object] nick_name Value to be assigned
|
|
302
303
|
def nick_name=(nick_name)
|
|
303
|
-
if !nick_name.nil? && nick_name.to_s.length >
|
|
304
|
-
fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to
|
|
304
|
+
if !nick_name.nil? && nick_name.to_s.length > 32
|
|
305
|
+
fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 32.'
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
if !nick_name.nil? && nick_name.to_s.length < 4
|
|
309
|
+
fail ArgumentError, 'invalid value for "nick_name", the character length must be great than or equal to 4.'
|
|
305
310
|
end
|
|
306
311
|
|
|
307
312
|
@nick_name = nick_name
|