Class: ZSGFClient::UpdateProfileRequest
- Inherits:
-
Object
- Object
- ZSGFClient::UpdateProfileRequest
- Defined in:
- lib/zsgf_client/models/update_profile_request.rb
Instance Attribute Summary collapse
-
#avatar ⇒ Object
用户头像的链接或路径,长度不能超过255个字符.
-
#biography ⇒ Object
个人简介,长度不能超过500个字符.
-
#birthday ⇒ Object
生日.
-
#company ⇒ Object
公司,长度不能超过100个字符.
-
#company_position ⇒ Object
行业职位,长度不能超过50个字符.
-
#contact ⇒ Object
联系方式,长度不能超过255个字符.
-
#data ⇒ Object
用户的其他数据,可以是序列化后的对象或JSON字符串.
-
#education ⇒ Object
学历,长度不能超过50个字符.
-
#enable2_fa_auth ⇒ Object
是否启用二步验证.
-
#enable_email_sign_in ⇒ Object
是否启用邮箱登录.
-
#enable_o_auth ⇒ Object
是否启用OAuth2登录.
-
#enable_phone_sign_in ⇒ Object
是否启用手机登录.
-
#enable_union_id_sign_in ⇒ Object
是否启用UnionID登录.
-
#enable_user_name_sign_in ⇒ Object
是否启用账号登录.
-
#gender ⇒ Object
性别,长度不能超过15个字符.
-
#industry ⇒ Object
行业,长度不能超过50个字符.
-
#interest_tags ⇒ Object
兴趣标签.
-
#languages ⇒ Object
语言,长度不能超过50个字符.
-
#nick_name ⇒ Object
用户的昵称,长度不能超过50个字符.
-
#occupation ⇒ Object
职业,长度不能超过50个字符.
-
#private_settings ⇒ Object
私密设置,长度不能超过500个字符.
-
#relationship_status ⇒ Object
婚姻状态,长度不能超过20个字符.
-
#social_links ⇒ Object
社交网络链接,长度不能超过255个字符.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UpdateProfileRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ UpdateProfileRequest
Initializes the object
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 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 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 186 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `ZSGFClient::UpdateProfileRequest` 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::UpdateProfileRequest`. 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?(:'avatar') self.avatar = attributes[:'avatar'] end if attributes.key?(:'data') self.data = attributes[:'data'] end if attributes.key?(:'nick_name') self.nick_name = attributes[:'nick_name'] end if attributes.key?(:'interest_tags') self. = 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. = 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?(:'enable2_fa_auth') self.enable2_fa_auth = attributes[:'enable2_fa_auth'] end if attributes.key?(:'enable_user_name_sign_in') self.enable_user_name_sign_in = attributes[:'enable_user_name_sign_in'] end if attributes.key?(:'enable_email_sign_in') self.enable_email_sign_in = attributes[:'enable_email_sign_in'] end if attributes.key?(:'enable_phone_sign_in') self.enable_phone_sign_in = attributes[:'enable_phone_sign_in'] end if attributes.key?(:'enable_union_id_sign_in') self.enable_union_id_sign_in = attributes[:'enable_union_id_sign_in'] end if attributes.key?(:'enable_o_auth') self.enable_o_auth = attributes[:'enable_o_auth'] end end |
Instance Attribute Details
#avatar ⇒ Object
用户头像的链接或路径,长度不能超过255个字符
19 20 21 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 19 def avatar @avatar end |
#biography ⇒ Object
个人简介,长度不能超过500个字符
31 32 33 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 31 def biography @biography end |
#birthday ⇒ Object
生日
37 38 39 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 37 def birthday @birthday end |
#company ⇒ Object
公司,长度不能超过100个字符
58 59 60 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 58 def company @company end |
#company_position ⇒ Object
行业职位,长度不能超过50个字符
64 65 66 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 64 def company_position @company_position end |
#contact ⇒ Object
联系方式,长度不能超过255个字符
46 47 48 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 46 def contact @contact end |
#data ⇒ Object
用户的其他数据,可以是序列化后的对象或JSON字符串
22 23 24 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 22 def data @data end |
#education ⇒ Object
学历,长度不能超过50个字符
43 44 45 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 43 def education @education end |
#enable2_fa_auth ⇒ Object
是否启用二步验证
70 71 72 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 70 def enable2_fa_auth @enable2_fa_auth end |
#enable_email_sign_in ⇒ Object
是否启用邮箱登录
76 77 78 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 76 def enable_email_sign_in @enable_email_sign_in end |
#enable_o_auth ⇒ Object
是否启用OAuth2登录
85 86 87 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 85 def enable_o_auth @enable_o_auth end |
#enable_phone_sign_in ⇒ Object
是否启用手机登录
79 80 81 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 79 def enable_phone_sign_in @enable_phone_sign_in end |
#enable_union_id_sign_in ⇒ Object
是否启用UnionID登录
82 83 84 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 82 def enable_union_id_sign_in @enable_union_id_sign_in end |
#enable_user_name_sign_in ⇒ Object
是否启用账号登录
73 74 75 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 73 def enable_user_name_sign_in @enable_user_name_sign_in end |
#gender ⇒ Object
性别,长度不能超过15个字符
34 35 36 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 34 def gender @gender end |
#industry ⇒ Object
行业,长度不能超过50个字符
61 62 63 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 61 def industry @industry end |
#interest_tags ⇒ Object
兴趣标签
28 29 30 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 28 def end |
#languages ⇒ Object
语言,长度不能超过50个字符
49 50 51 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 49 def languages @languages end |
#nick_name ⇒ Object
用户的昵称,长度不能超过50个字符
25 26 27 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 25 def nick_name @nick_name end |
#occupation ⇒ Object
职业,长度不能超过50个字符
40 41 42 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 40 def occupation @occupation end |
#private_settings ⇒ Object
私密设置,长度不能超过500个字符
67 68 69 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 67 def private_settings @private_settings end |
#relationship_status ⇒ Object
婚姻状态,长度不能超过20个字符
55 56 57 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 55 def relationship_status @relationship_status end |
#social_links ⇒ Object
社交网络链接,长度不能超过255个字符
52 53 54 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 52 def end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 596 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_map ⇒ Object
Returns attribute mapping this model knows about
117 118 119 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 117 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
122 123 124 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 122 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 88 def self.attribute_map { :'avatar' => :'avatar', :'data' => :'data', :'nick_name' => :'nickName', :'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', :'enable2_fa_auth' => :'enable2FAAuth', :'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' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 572 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_nullable ⇒ Object
List of attributes with nullable: true
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 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 156 def self.openapi_nullable Set.new([ :'avatar', :'data', :'nick_name', :'interest_tags', :'biography', :'gender', :'birthday', :'occupation', :'education', :'contact', :'languages', :'social_links', :'relationship_status', :'company', :'industry', :'company_position', :'private_settings', :'enable2_fa_auth', :'enable_user_name_sign_in', :'enable_email_sign_in', :'enable_phone_sign_in', :'enable_union_id_sign_in', :'enable_o_auth' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 127 def self.openapi_types { :'avatar' => :'String', :'data' => :'String', :'nick_name' => :'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', :'enable2_fa_auth' => :'Boolean', :'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' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 529 def ==(o) return true if self.equal?(o) self.class == o.class && avatar == o.avatar && data == o.data && nick_name == o.nick_name && == o. && biography == o.biography && gender == o.gender && birthday == o.birthday && occupation == o.occupation && education == o.education && contact == o.contact && languages == o.languages && == o. && relationship_status == o.relationship_status && company == o.company && industry == o.industry && company_position == o.company_position && private_settings == o.private_settings && enable2_fa_auth == o.enable2_fa_auth && enable_user_name_sign_in == o.enable_user_name_sign_in && enable_email_sign_in == o.enable_email_sign_in && enable_phone_sign_in == o.enable_phone_sign_in && enable_union_id_sign_in == o.enable_union_id_sign_in && enable_o_auth == o.enable_o_auth end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
667 668 669 670 671 672 673 674 675 676 677 678 679 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 667 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
559 560 561 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 559 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
565 566 567 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 565 def hash [avatar, data, nick_name, , biography, gender, birthday, occupation, education, contact, languages, , relationship_status, company, industry, company_position, private_settings, enable2_fa_auth, enable_user_name_sign_in, enable_email_sign_in, enable_phone_sign_in, enable_union_id_sign_in, enable_o_auth].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 295 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new 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 !@nick_name.nil? && @nick_name.to_s.length > 32 invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 32.') end if !@nick_name.nil? && @nick_name.to_s.length < 4 invalid_properties.push('invalid value for "nick_name", the character length must be great than or equal to 4.') 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 !.nil? && .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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
643 644 645 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 643 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
649 650 651 652 653 654 655 656 657 658 659 660 661 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 649 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_s ⇒ String
Returns the string representation of the object
637 638 639 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 637 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/zsgf_client/models/update_profile_request.rb', line 363 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@avatar.nil? && @avatar.to_s.length > 255 return false if !@nick_name.nil? && @nick_name.to_s.length > 32 return false if !@nick_name.nil? && @nick_name.to_s.length < 4 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 !.nil? && .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 |