Class: GPDDebtPositions::PaymentPositionModel
- Inherits:
-
Object
- Object
- GPDDebtPositions::PaymentPositionModel
- Defined in:
- lib/gpd_debtposition_api/models/payment_position_model.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#aca ⇒ Object
Returns the value of attribute aca.
-
#city ⇒ Object
Returns the value of attribute city.
-
#civic_number ⇒ Object
Returns the value of attribute civic_number.
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#fiscal_code ⇒ Object
Returns the value of attribute fiscal_code.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#iupd ⇒ Object
Returns the value of attribute iupd.
-
#office_name ⇒ Object
Returns the value of attribute office_name.
-
#pay_stand_in ⇒ Object
feature flag to enable a debt position in stand-in mode.
-
#payment_date ⇒ Object
Returns the value of attribute payment_date.
-
#payment_option ⇒ Object
Returns the value of attribute payment_option.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#province ⇒ Object
Returns the value of attribute province.
-
#region ⇒ Object
Returns the value of attribute region.
-
#status ⇒ Object
Returns the value of attribute status.
-
#street_name ⇒ Object
Returns the value of attribute street_name.
-
#switch_to_expired ⇒ Object
feature flag to enable the debt position to expire after the due date.
-
#type ⇒ Object
Returns the value of attribute type.
-
#validity_date ⇒ Object
Returns the value of attribute validity_date.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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 = {}) ⇒ PaymentPositionModel
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 = {}) ⇒ PaymentPositionModel
Initializes the object
155 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 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 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 155 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::PaymentPositionModel` 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 `GPDDebtPositions::PaymentPositionModel`. 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?(:'iupd') self.iupd = attributes[:'iupd'] else self.iupd = nil end if attributes.key?(:'aca') self.aca = attributes[:'aca'] else self.aca = false end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = nil end if attributes.key?(:'pay_stand_in') self.pay_stand_in = attributes[:'pay_stand_in'] else self.pay_stand_in = true end if attributes.key?(:'fiscal_code') self.fiscal_code = attributes[:'fiscal_code'] else self.fiscal_code = nil end if attributes.key?(:'full_name') self.full_name = attributes[:'full_name'] else self.full_name = nil end if attributes.key?(:'street_name') self.street_name = attributes[:'street_name'] end if attributes.key?(:'civic_number') self.civic_number = attributes[:'civic_number'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'province') self.province = attributes[:'province'] end if attributes.key?(:'region') self.region = attributes[:'region'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'phone') self.phone = attributes[:'phone'] end if attributes.key?(:'switch_to_expired') self.switch_to_expired = attributes[:'switch_to_expired'] else self.switch_to_expired = false end if attributes.key?(:'company_name') self.company_name = attributes[:'company_name'] else self.company_name = nil end if attributes.key?(:'office_name') self.office_name = attributes[:'office_name'] end if attributes.key?(:'validity_date') self.validity_date = attributes[:'validity_date'] end if attributes.key?(:'payment_date') self.payment_date = attributes[:'payment_date'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'payment_option') if (value = attributes[:'payment_option']).is_a?(Array) self.payment_option = value end end end |
Instance Attribute Details
#aca ⇒ Object
Returns the value of attribute aca.
20 21 22 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 20 def aca @aca end |
#city ⇒ Object
Returns the value of attribute city.
37 38 39 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 37 def city @city end |
#civic_number ⇒ Object
Returns the value of attribute civic_number.
33 34 35 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 33 def civic_number @civic_number end |
#company_name ⇒ Object
Returns the value of attribute company_name.
52 53 54 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 52 def company_name @company_name end |
#country ⇒ Object
Returns the value of attribute country.
43 44 45 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 43 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
45 46 47 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 45 def email @email end |
#fiscal_code ⇒ Object
Returns the value of attribute fiscal_code.
27 28 29 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 27 def fiscal_code @fiscal_code end |
#full_name ⇒ Object
Returns the value of attribute full_name.
29 30 31 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 29 def full_name @full_name end |
#iupd ⇒ Object
Returns the value of attribute iupd.
18 19 20 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 18 def iupd @iupd end |
#office_name ⇒ Object
Returns the value of attribute office_name.
54 55 56 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 54 def office_name @office_name end |
#pay_stand_in ⇒ Object
feature flag to enable a debt position in stand-in mode
25 26 27 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 25 def pay_stand_in @pay_stand_in end |
#payment_date ⇒ Object
Returns the value of attribute payment_date.
58 59 60 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 58 def payment_date @payment_date end |
#payment_option ⇒ Object
Returns the value of attribute payment_option.
62 63 64 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 62 def payment_option @payment_option end |
#phone ⇒ Object
Returns the value of attribute phone.
47 48 49 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 47 def phone @phone end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
35 36 37 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 35 def postal_code @postal_code end |
#province ⇒ Object
Returns the value of attribute province.
39 40 41 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 39 def province @province end |
#region ⇒ Object
Returns the value of attribute region.
41 42 43 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 41 def region @region end |
#status ⇒ Object
Returns the value of attribute status.
60 61 62 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 60 def status @status end |
#street_name ⇒ Object
Returns the value of attribute street_name.
31 32 33 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 31 def street_name @street_name end |
#switch_to_expired ⇒ Object
feature flag to enable the debt position to expire after the due date
50 51 52 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 50 def switch_to_expired @switch_to_expired end |
#type ⇒ Object
Returns the value of attribute type.
22 23 24 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 22 def type @type end |
#validity_date ⇒ Object
Returns the value of attribute validity_date.
56 57 58 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 56 def validity_date @validity_date end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 481 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 = GPDDebtPositions.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_attributes ⇒ Object
Returns all the JSON keys this model knows about
115 116 117 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 115 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 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 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 87 def self.attribute_map { :'iupd' => :'iupd', :'aca' => :'aca', :'type' => :'type', :'pay_stand_in' => :'payStandIn', :'fiscal_code' => :'fiscalCode', :'full_name' => :'fullName', :'street_name' => :'streetName', :'civic_number' => :'civicNumber', :'postal_code' => :'postalCode', :'city' => :'city', :'province' => :'province', :'region' => :'region', :'country' => :'country', :'email' => :'email', :'phone' => :'phone', :'switch_to_expired' => :'switchToExpired', :'company_name' => :'companyName', :'office_name' => :'officeName', :'validity_date' => :'validityDate', :'payment_date' => :'paymentDate', :'status' => :'status', :'payment_option' => :'paymentOption' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 457 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
148 149 150 151 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 148 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 120 def self.openapi_types { :'iupd' => :'String', :'aca' => :'Boolean', :'type' => :'String', :'pay_stand_in' => :'Boolean', :'fiscal_code' => :'String', :'full_name' => :'String', :'street_name' => :'String', :'civic_number' => :'String', :'postal_code' => :'String', :'city' => :'String', :'province' => :'String', :'region' => :'String', :'country' => :'String', :'email' => :'String', :'phone' => :'String', :'switch_to_expired' => :'Boolean', :'company_name' => :'String', :'office_name' => :'String', :'validity_date' => :'Time', :'payment_date' => :'Time', :'status' => :'String', :'payment_option' => :'Array<PaymentOptionModel>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 415 def ==(o) return true if self.equal?(o) self.class == o.class && iupd == o.iupd && aca == o.aca && type == o.type && pay_stand_in == o.pay_stand_in && fiscal_code == o.fiscal_code && full_name == o.full_name && street_name == o.street_name && civic_number == o.civic_number && postal_code == o.postal_code && city == o.city && province == o.province && region == o.region && country == o.country && email == o.email && phone == o.phone && switch_to_expired == o.switch_to_expired && company_name == o.company_name && office_name == o.office_name && validity_date == o.validity_date && payment_date == o.payment_date && status == o.status && payment_option == o.payment_option end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
552 553 554 555 556 557 558 559 560 561 562 563 564 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 552 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
444 445 446 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 444 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
450 451 452 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 450 def hash [iupd, aca, type, pay_stand_in, fiscal_code, full_name, street_name, civic_number, postal_code, city, province, region, country, email, phone, switch_to_expired, company_name, office_name, validity_date, payment_date, status, payment_option].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 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 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 277 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @iupd.nil? invalid_properties.push('invalid value for "iupd", iupd cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end if @fiscal_code.nil? invalid_properties.push('invalid value for "fiscal_code", fiscal_code cannot be nil.') end if @full_name.nil? invalid_properties.push('invalid value for "full_name", full_name cannot be nil.') end pattern = Regexp.new(/[A-Z]{2}/) if !@country.nil? && @country !~ pattern invalid_properties.push("invalid value for \"country\", must conform to the pattern #{pattern}.") end if @switch_to_expired.nil? invalid_properties.push('invalid value for "switch_to_expired", switch_to_expired cannot be nil.') end if @company_name.nil? invalid_properties.push('invalid value for "company_name", company_name cannot be nil.') end if @company_name.to_s.length > 140 invalid_properties.push('invalid value for "company_name", the character length must be smaller than or equal to 140.') end if @company_name.to_s.length < 0 invalid_properties.push('invalid value for "company_name", the character length must be great than or equal to 0.') end if !@office_name.nil? && @office_name.to_s.length > 140 invalid_properties.push('invalid value for "office_name", the character length must be smaller than or equal to 140.') end if !@office_name.nil? && @office_name.to_s.length < 0 invalid_properties.push('invalid value for "office_name", the character length must be great than or equal to 0.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
528 529 530 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 528 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 534 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
522 523 524 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 522 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/gpd_debtposition_api/models/payment_position_model.rb', line 330 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @iupd.nil? return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["F", "G"]) return false unless type_validator.valid?(@type) return false if @fiscal_code.nil? return false if @full_name.nil? return false if !@country.nil? && @country !~ Regexp.new(/[A-Z]{2}/) return false if @switch_to_expired.nil? return false if @company_name.nil? return false if @company_name.to_s.length > 140 return false if @company_name.to_s.length < 0 return false if !@office_name.nil? && @office_name.to_s.length > 140 return false if !@office_name.nil? && @office_name.to_s.length < 0 status_validator = EnumAttributeValidator.new('String', ["DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED"]) return false unless status_validator.valid?(@status) true end |