Class: MassPayRubySdk::StoredUser
- Inherits:
-
Object
- Object
- MassPayRubySdk::StoredUser
- Defined in:
- lib/masspay_ruby_sdk/models/stored_user.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#address1 ⇒ Object
The user’s street address.
-
#address2 ⇒ Object
The user’s street address, line 2.
-
#business_name ⇒ Object
Company legal name (Only if Business account).
-
#city ⇒ Object
The user’s city.
-
#country ⇒ Object
The user’s country code.
-
#created_on ⇒ Object
The timestamp the user was created in the system.
-
#date_of_birth ⇒ Object
Date of birth.
-
#email ⇒ Object
The user’s e-mail address.
-
#first_name ⇒ Object
The user’s first name.
-
#internal_user_id ⇒ Object
A client-defined identifier for the user.
-
#language ⇒ Object
The user’s preferred language of communication.
-
#last_name ⇒ Object
The user’s last name.
-
#metadata ⇒ Object
Optional JSON object with attributes that can later be searched to locate this user.
-
#middle_name ⇒ Object
The user’s middle name.
-
#mobile_number ⇒ Object
(Optional) Mobile number of user.
-
#postal_code ⇒ Object
The user’s postal code.
-
#state_province ⇒ Object
The user’s state/province.
-
#status ⇒ Object
The status of the user.
-
#timezone ⇒ Object
User’s computed timezone.
-
#user_token ⇒ Object
Token representing the user that was just created.
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ StoredUser
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 = {}) ⇒ StoredUser
Initializes the object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 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 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 164 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `MassPayRubySdk::StoredUser` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `MassPayRubySdk::StoredUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'user_token') self.user_token = attributes[:'user_token'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'created_on') self.created_on = attributes[:'created_on'] end if attributes.key?(:'internal_user_id') self.internal_user_id = attributes[:'internal_user_id'] end if attributes.key?(:'address1') self.address1 = attributes[:'address1'] end if attributes.key?(:'address2') self.address2 = attributes[:'address2'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'state_province') self.state_province = attributes[:'state_province'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'middle_name') self.middle_name = attributes[:'middle_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'language') self.language = attributes[:'language'] end if attributes.key?(:'mobile_number') self.mobile_number = attributes[:'mobile_number'] end if attributes.key?(:'business_name') self.business_name = attributes[:'business_name'] end if attributes.key?(:'timezone') self.timezone = attributes[:'timezone'] end if attributes.key?(:'date_of_birth') self.date_of_birth = attributes[:'date_of_birth'] end if attributes.key?(:'metadata') self. = attributes[:'metadata'] end end |
Instance Attribute Details
#address1 ⇒ Object
The user’s street address.
30 31 32 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 30 def address1 @address1 end |
#address2 ⇒ Object
The user’s street address, line 2.
33 34 35 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 33 def address2 @address2 end |
#business_name ⇒ Object
Company legal name (Only if Business account)
66 67 68 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 66 def business_name @business_name end |
#city ⇒ Object
The user’s city.
36 37 38 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 36 def city @city end |
#country ⇒ Object
The user’s country code. ISO_3166-1_alpha-3 code
45 46 47 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 45 def country @country end |
#created_on ⇒ Object
The timestamp the user was created in the system. Using UTC timestamp.[ISO 8601](en.wikipedia.org/wiki/ISO_8601)
24 25 26 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 24 def created_on @created_on end |
#date_of_birth ⇒ Object
Date of birth. (optional). Minimum 18 years old
72 73 74 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 72 def date_of_birth @date_of_birth end |
#email ⇒ Object
The user’s e-mail address. Must be unique. Cannot have two users with the same e-mail address.
57 58 59 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 57 def email @email end |
#first_name ⇒ Object
The user’s first name. (If Business account, the first name of the representative)
48 49 50 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 48 def first_name @first_name end |
#internal_user_id ⇒ Object
A client-defined identifier for the user. This is the unique ID assigned to the user on your system. Max 75 characters. Allows letters, numbers, and + , - . / _ ~ |
27 28 29 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 27 def internal_user_id @internal_user_id end |
#language ⇒ Object
The user’s preferred language of communication. If not provided, defaults to English (en)
60 61 62 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 60 def language @language end |
#last_name ⇒ Object
The user’s last name. (If Business account, the last name of the representative)
54 55 56 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 54 def last_name @last_name end |
#metadata ⇒ Object
Optional JSON object with attributes that can later be searched to locate this user. Do not include PII as this object is not encrypted.
75 76 77 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 75 def @metadata end |
#middle_name ⇒ Object
The user’s middle name. (If Business account, the middle name of the representative)
51 52 53 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 51 def middle_name @middle_name end |
#mobile_number ⇒ Object
(Optional) Mobile number of user. Allows for SMS notifications upon availability of funds
63 64 65 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 63 def mobile_number @mobile_number end |
#postal_code ⇒ Object
The user’s postal code.
42 43 44 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 42 def postal_code @postal_code end |
#state_province ⇒ Object
The user’s state/province.
39 40 41 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 39 def state_province @state_province end |
#status ⇒ Object
The status of the user
21 22 23 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 21 def status @status end |
#timezone ⇒ Object
User’s computed timezone
69 70 71 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 69 def timezone @timezone end |
#user_token ⇒ Object
Token representing the user that was just created
18 19 20 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 18 def user_token @user_token end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
126 127 128 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 126 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 100 def self.attribute_map { :'user_token' => :'user_token', :'status' => :'status', :'created_on' => :'created_on', :'internal_user_id' => :'internal_user_id', :'address1' => :'address1', :'address2' => :'address2', :'city' => :'city', :'state_province' => :'state_province', :'postal_code' => :'postal_code', :'country' => :'country', :'first_name' => :'first_name', :'middle_name' => :'middle_name', :'last_name' => :'last_name', :'email' => :'email', :'language' => :'language', :'mobile_number' => :'mobile_number', :'business_name' => :'business_name', :'timezone' => :'timezone', :'date_of_birth' => :'date_of_birth', :'metadata' => :'metadata' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
382 383 384 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 382 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
157 158 159 160 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 157 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 131 def self.openapi_types { :'user_token' => :'String', :'status' => :'String', :'created_on' => :'String', :'internal_user_id' => :'String', :'address1' => :'String', :'address2' => :'String', :'city' => :'String', :'state_province' => :'String', :'postal_code' => :'String', :'country' => :'String', :'first_name' => :'String', :'middle_name' => :'String', :'last_name' => :'String', :'email' => :'String', :'language' => :'String', :'mobile_number' => :'String', :'business_name' => :'String', :'timezone' => :'String', :'date_of_birth' => :'Date', :'metadata' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 342 def ==(o) return true if self.equal?(o) self.class == o.class && user_token == o.user_token && status == o.status && created_on == o.created_on && internal_user_id == o.internal_user_id && address1 == o.address1 && address2 == o.address2 && city == o.city && state_province == o.state_province && postal_code == o.postal_code && country == o.country && first_name == o.first_name && middle_name == o.middle_name && last_name == o.last_name && email == o.email && language == o.language && mobile_number == o.mobile_number && business_name == o.business_name && timezone == o.timezone && date_of_birth == o.date_of_birth && == o. end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
413 414 415 416 417 418 419 420 421 422 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 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 413 def _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 = MassPayRubySdk.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 484 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 389 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
369 370 371 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 369 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
375 376 377 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 375 def hash [user_token, status, created_on, internal_user_id, address1, address2, city, state_province, postal_code, country, first_name, middle_name, last_name, email, language, mobile_number, business_name, timezone, date_of_birth, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 260 def list_invalid_properties invalid_properties = Array.new if @user_token.nil? invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @created_on.nil? invalid_properties.push('invalid value for "created_on", created_on cannot be nil.') end if @internal_user_id.nil? invalid_properties.push('invalid value for "internal_user_id", internal_user_id cannot be nil.') end if @first_name.nil? invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') end if @last_name.nil? invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') end if @email.nil? invalid_properties.push('invalid value for "email", email cannot be nil.') end pattern = Regexp.new(/^[0-9]+$/) if !@mobile_number.nil? && @mobile_number !~ pattern invalid_properties.push("invalid value for \"mobile_number\", must conform to the pattern #{pattern}.") end if @timezone.nil? invalid_properties.push('invalid value for "timezone", timezone cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
460 461 462 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 460 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 466 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
454 455 456 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 454 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/masspay_ruby_sdk/models/stored_user.rb', line 304 def valid? return false if @user_token.nil? return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED", "DEACTIVE"]) return false unless status_validator.valid?(@status) return false if @created_on.nil? return false if @internal_user_id.nil? return false if @first_name.nil? return false if @last_name.nil? return false if @email.nil? return false if !@mobile_number.nil? && @mobile_number !~ Regexp.new(/^[0-9]+$/) return false if @timezone.nil? true end |