Class: TripletexRubyClient::FundingPartnerApplication
- Inherits:
-
Object
- Object
- TripletexRubyClient::FundingPartnerApplication
- Defined in:
- lib/tripletex_ruby_client/models/funding_partner_application.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#amount ⇒ Object
The amount property.
-
#changes ⇒ Object
Returns the value of attribute changes.
-
#comments ⇒ Object
The comment property.
-
#email ⇒ Object
The email property.
-
#first_name ⇒ Object
The firstname property.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
The lastName property.
-
#loan_type ⇒ Object
The loanType property.
-
#phone_number ⇒ Object
The phoneNumber property.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_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 ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ FundingPartnerApplication
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 = {}) ⇒ FundingPartnerApplication
Initializes the object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 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/tripletex_ruby_client/models/funding_partner_application.rb', line 102 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'version') self.version = attributes[:'version'] end if attributes.has_key?(:'changes') if (value = attributes[:'changes']).is_a?(Array) self.changes = value end end if attributes.has_key?(:'url') self.url = attributes[:'url'] end if attributes.has_key?(:'firstName') self.first_name = attributes[:'firstName'] end if attributes.has_key?(:'lastName') self.last_name = attributes[:'lastName'] end if attributes.has_key?(:'email') self.email = attributes[:'email'] end if attributes.has_key?(:'phoneNumber') self.phone_number = attributes[:'phoneNumber'] end if attributes.has_key?(:'comments') self.comments = attributes[:'comments'] end if attributes.has_key?(:'loanType') self.loan_type = attributes[:'loanType'] end if attributes.has_key?(:'amount') self.amount = attributes[:'amount'] end end |
Instance Attribute Details
#amount ⇒ Object
The amount property
42 43 44 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 42 def amount @amount end |
#changes ⇒ Object
Returns the value of attribute changes.
19 20 21 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 19 def changes @changes end |
#comments ⇒ Object
The comment property
36 37 38 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 36 def comments @comments end |
#email ⇒ Object
The email property
30 31 32 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 30 def email @email end |
#first_name ⇒ Object
The firstname property
24 25 26 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 24 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 15 def id @id end |
#last_name ⇒ Object
The lastName property
27 28 29 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 27 def last_name @last_name end |
#loan_type ⇒ Object
The loanType property
39 40 41 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 39 def loan_type @loan_type end |
#phone_number ⇒ Object
The phoneNumber property
33 34 35 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 33 def phone_number @phone_number end |
#url ⇒ Object
Returns the value of attribute url.
21 22 23 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 21 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
17 18 19 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 17 def version @version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 67 def self.attribute_map { :'id' => :'id', :'version' => :'version', :'changes' => :'changes', :'url' => :'url', :'first_name' => :'firstName', :'last_name' => :'lastName', :'email' => :'email', :'phone_number' => :'phoneNumber', :'comments' => :'comments', :'loan_type' => :'loanType', :'amount' => :'amount' } end |
.swagger_types ⇒ Object
Attribute type mapping.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 84 def self.swagger_types { :'id' => :'Integer', :'version' => :'Integer', :'changes' => :'Array<Change>', :'url' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'email' => :'String', :'phone_number' => :'String', :'comments' => :'String', :'loan_type' => :'String', :'amount' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 367 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && version == o.version && changes == o.changes && url == o.url && first_name == o.first_name && last_name == o.last_name && email == o.email && phone_number == o.phone_number && comments == o.comments && loan_type == o.loan_type && amount == o.amount end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 451 452 453 454 455 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 419 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 temp_model = TripletexRubyClient.const_get(type).new temp_model.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
485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 485 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
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 398 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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 # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
385 386 387 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 385 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
391 392 393 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 391 def hash [id, version, changes, url, first_name, last_name, email, phone_number, comments, loan_type, amount].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 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 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 157 def list_invalid_properties invalid_properties = Array.new if @first_name.nil? invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') end if @first_name.to_s.length > 100 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 100.') end if @first_name.to_s.length < 0 invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 0.') end if @last_name.nil? invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') end if @last_name.to_s.length > 100 invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 100.') end if @last_name.to_s.length < 0 invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 0.') end if !@email.nil? && @email.to_s.length > 100 invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.') end if !@email.nil? && @email.to_s.length < 0 invalid_properties.push('invalid value for "email", the character length must be great than or equal to 0.') end if @phone_number.nil? invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') end if @phone_number.to_s.length > 25 invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 25.') end if @phone_number.to_s.length < 8 invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 8.') end if !@comments.nil? && @comments.to_s.length > 500 invalid_properties.push('invalid value for "comments", the character length must be smaller than or equal to 500.') end if !@comments.nil? && @comments.to_s.length < 0 invalid_properties.push('invalid value for "comments", the character length must be great than or equal to 0.') end if @loan_type.nil? invalid_properties.push('invalid value for "loan_type", loan_type cannot be nil.') end if @amount.nil? invalid_properties.push('invalid value for "amount", amount cannot be nil.') end if @amount > 30000000 invalid_properties.push('invalid value for "amount", must be smaller than or equal to 30000000.') end if @amount < 1000000 invalid_properties.push('invalid value for "amount", must be greater than or equal to 1000000.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
465 466 467 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 465 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
471 472 473 474 475 476 477 478 479 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 471 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
459 460 461 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 459 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/tripletex_ruby_client/models/funding_partner_application.rb', line 232 def valid? return false if @first_name.nil? return false if @first_name.to_s.length > 100 return false if @first_name.to_s.length < 0 return false if @last_name.nil? return false if @last_name.to_s.length > 100 return false if @last_name.to_s.length < 0 return false if !@email.nil? && @email.to_s.length > 100 return false if !@email.nil? && @email.to_s.length < 0 return false if @phone_number.nil? return false if @phone_number.to_s.length > 25 return false if @phone_number.to_s.length < 8 return false if !@comments.nil? && @comments.to_s.length > 500 return false if !@comments.nil? && @comments.to_s.length < 0 return false if @loan_type.nil? loan_type_validator = EnumAttributeValidator.new('String', ['OTHER', 'REAL_ESTATE']) return false unless loan_type_validator.valid?(@loan_type) return false if @amount.nil? return false if @amount > 30000000 return false if @amount < 1000000 true end |