Class: KoronaCloudClient::Receipt
- Inherits:
-
Object
- Object
- KoronaCloudClient::Receipt
- Defined in:
- lib/korona-cloud-client/models/receipt.rb
Instance Attribute Summary collapse
-
#account_transactions ⇒ Object
Returns the value of attribute account_transactions.
-
#active ⇒ Object
indicates whether the object is active for use or not.
-
#additional_info ⇒ Object
Returns the value of attribute additional_info.
-
#booking_time ⇒ Object
Format: yyyy-MM-dd’T’HH:mm:ssXXX.
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#cashier ⇒ Object
Returns the value of attribute cashier.
-
#cashier_verification_results ⇒ Object
Returns the value of attribute cashier_verification_results.
-
#coupon_positions ⇒ Object
Returns the value of attribute coupon_positions.
-
#creation_time ⇒ Object
Format: yyyy-MM-dd’T’HH:mm:ssXXX.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#customer_group ⇒ Object
Returns the value of attribute customer_group.
-
#deposit_amount ⇒ Object
Returns the value of attribute deposit_amount.
-
#external_references ⇒ Object
Returns the value of attribute external_references.
-
#fiscal_transactions ⇒ Object
Returns the value of attribute fiscal_transactions.
-
#geo_location ⇒ Object
Returns the value of attribute geo_location.
-
#id ⇒ Object
global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
-
#info_texts ⇒ Object
Returns the value of attribute info_texts.
-
#items ⇒ Object
Returns the value of attribute items.
-
#max_revisions ⇒ Object
Returns the value of attribute max_revisions.
-
#number ⇒ Object
number of the object, like it is set in backoffice; will be removed when active=false.
-
#order_number ⇒ Object
Returns the value of attribute order_number.
-
#organizational_unit ⇒ Object
Returns the value of attribute organizational_unit.
-
#payments ⇒ Object
Returns the value of attribute payments.
-
#point_of_sale ⇒ Object
Returns the value of attribute point_of_sale.
-
#price_group ⇒ Object
Returns the value of attribute price_group.
-
#promotion_applications ⇒ Object
Returns the value of attribute promotion_applications.
-
#revenue ⇒ Object
Returns the value of attribute revenue.
-
#reversal ⇒ Object
Returns the value of attribute reversal.
-
#reversed_receipt ⇒ Object
Returns the value of attribute reversed_receipt.
-
#revision ⇒ Object
the revision number of the object.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#total ⇒ Object
Returns the value of attribute total.
-
#void_fiscal_transactions ⇒ Object
Returns the value of attribute void_fiscal_transactions.
-
#voided ⇒ Object
Returns the value of attribute voided.
-
#voided_items ⇒ Object
Returns the value of attribute voided_items.
-
#voucher_transaction_references ⇒ Object
Returns the value of attribute voucher_transaction_references.
-
#voucher_transactions ⇒ Object
Deprecated, please use voucherTransactionReferences instead.
-
#warehouse ⇒ Object
Returns the value of attribute warehouse.
-
#zcounter ⇒ Object
Returns the value of attribute zcounter.
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 = {}) ⇒ Receipt
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 = {}) ⇒ Receipt
Initializes the object
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 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 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 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 210 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaCloudClient::Receipt` 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 `KoronaCloudClient::Receipt`. 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?(:'active') self.active = attributes[:'active'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'revision') self.revision = attributes[:'revision'] end if attributes.key?(:'number') self.number = attributes[:'number'] end if attributes.key?(:'account_transactions') if (value = attributes[:'account_transactions']).is_a?(Array) self.account_transactions = value end end if attributes.key?(:'additional_info') if (value = attributes[:'additional_info']).is_a?(Array) self.additional_info = value end end if attributes.key?(:'booking_time') self.booking_time = attributes[:'booking_time'] end if attributes.key?(:'cancelled') self.cancelled = attributes[:'cancelled'] end if attributes.key?(:'cashier') self.cashier = attributes[:'cashier'] end if attributes.key?(:'creation_time') self.creation_time = attributes[:'creation_time'] end if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'reversed_receipt') self.reversed_receipt = attributes[:'reversed_receipt'] end if attributes.key?(:'customer') self.customer = attributes[:'customer'] end if attributes.key?(:'customer_group') self.customer_group = attributes[:'customer_group'] end if attributes.key?(:'deposit_amount') self.deposit_amount = attributes[:'deposit_amount'] end if attributes.key?(:'external_references') if (value = attributes[:'external_references']).is_a?(Hash) self.external_references = value end end if attributes.key?(:'reversal') self.reversal = attributes[:'reversal'] end if attributes.key?(:'fiscal_transactions') if (value = attributes[:'fiscal_transactions']).is_a?(Array) self.fiscal_transactions = value end end if attributes.key?(:'geo_location') self.geo_location = attributes[:'geo_location'] end if attributes.key?(:'info_texts') if (value = attributes[:'info_texts']).is_a?(Array) self.info_texts = value end end if attributes.key?(:'items') if (value = attributes[:'items']).is_a?(Array) self.items = value end end if attributes.key?(:'max_revisions') self.max_revisions = attributes[:'max_revisions'] end if attributes.key?(:'order_number') self.order_number = attributes[:'order_number'] end if attributes.key?(:'organizational_unit') self.organizational_unit = attributes[:'organizational_unit'] end if attributes.key?(:'payments') if (value = attributes[:'payments']).is_a?(Array) self.payments = value end end if attributes.key?(:'cashier_verification_results') if (value = attributes[:'cashier_verification_results']).is_a?(Array) self.cashier_verification_results = value end end if attributes.key?(:'point_of_sale') self.point_of_sale = attributes[:'point_of_sale'] end if attributes.key?(:'price_group') self.price_group = attributes[:'price_group'] end if attributes.key?(:'revenue') self.revenue = attributes[:'revenue'] end if attributes.key?(:'signature') self.signature = attributes[:'signature'] end if attributes.key?(:'total') self.total = attributes[:'total'] end if attributes.key?(:'voided') self.voided = attributes[:'voided'] end if attributes.key?(:'voided_items') if (value = attributes[:'voided_items']).is_a?(Array) self.voided_items = value end end if attributes.key?(:'void_fiscal_transactions') if (value = attributes[:'void_fiscal_transactions']).is_a?(Array) self.void_fiscal_transactions = value end end if attributes.key?(:'voucher_transactions') if (value = attributes[:'voucher_transactions']).is_a?(Array) self.voucher_transactions = value end end if attributes.key?(:'voucher_transaction_references') if (value = attributes[:'voucher_transaction_references']).is_a?(Array) self.voucher_transaction_references = value end end if attributes.key?(:'warehouse') self.warehouse = attributes[:'warehouse'] end if attributes.key?(:'promotion_applications') if (value = attributes[:'promotion_applications']).is_a?(Array) self.promotion_applications = value end end if attributes.key?(:'coupon_positions') if (value = attributes[:'coupon_positions']).is_a?(Array) self.coupon_positions = value end end if attributes.key?(:'zcounter') self.zcounter = attributes[:'zcounter'] end end |
Instance Attribute Details
#account_transactions ⇒ Object
Returns the value of attribute account_transactions.
30 31 32 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 30 def account_transactions @account_transactions end |
#active ⇒ Object
indicates whether the object is active for use or not
19 20 21 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 19 def active @active end |
#additional_info ⇒ Object
Returns the value of attribute additional_info.
32 33 34 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 32 def additional_info @additional_info end |
#booking_time ⇒ Object
Format: yyyy-MM-dd’T’HH:mm:ssXXX
35 36 37 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 35 def booking_time @booking_time end |
#cancelled ⇒ Object
Returns the value of attribute cancelled.
37 38 39 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 37 def cancelled @cancelled end |
#cashier ⇒ Object
Returns the value of attribute cashier.
39 40 41 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 39 def cashier @cashier end |
#cashier_verification_results ⇒ Object
Returns the value of attribute cashier_verification_results.
74 75 76 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 74 def cashier_verification_results @cashier_verification_results end |
#coupon_positions ⇒ Object
Returns the value of attribute coupon_positions.
101 102 103 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 101 def coupon_positions @coupon_positions end |
#creation_time ⇒ Object
Format: yyyy-MM-dd’T’HH:mm:ssXXX
42 43 44 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 42 def creation_time @creation_time end |
#currency ⇒ Object
Returns the value of attribute currency.
44 45 46 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 44 def currency @currency end |
#customer ⇒ Object
Returns the value of attribute customer.
48 49 50 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 48 def customer @customer end |
#customer_group ⇒ Object
Returns the value of attribute customer_group.
50 51 52 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 50 def customer_group @customer_group end |
#deposit_amount ⇒ Object
Returns the value of attribute deposit_amount.
52 53 54 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 52 def deposit_amount @deposit_amount end |
#external_references ⇒ Object
Returns the value of attribute external_references.
54 55 56 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 54 def external_references @external_references end |
#fiscal_transactions ⇒ Object
Returns the value of attribute fiscal_transactions.
58 59 60 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 58 def fiscal_transactions @fiscal_transactions end |
#geo_location ⇒ Object
Returns the value of attribute geo_location.
60 61 62 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 60 def geo_location @geo_location end |
#id ⇒ Object
global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
22 23 24 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 22 def id @id end |
#info_texts ⇒ Object
Returns the value of attribute info_texts.
62 63 64 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 62 def info_texts @info_texts end |
#items ⇒ Object
Returns the value of attribute items.
64 65 66 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 64 def items @items end |
#max_revisions ⇒ Object
Returns the value of attribute max_revisions.
66 67 68 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 66 def max_revisions @max_revisions end |
#number ⇒ Object
number of the object, like it is set in backoffice; will be removed when active=false
28 29 30 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 28 def number @number end |
#order_number ⇒ Object
Returns the value of attribute order_number.
68 69 70 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 68 def order_number @order_number end |
#organizational_unit ⇒ Object
Returns the value of attribute organizational_unit.
70 71 72 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 70 def organizational_unit @organizational_unit end |
#payments ⇒ Object
Returns the value of attribute payments.
72 73 74 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 72 def payments @payments end |
#point_of_sale ⇒ Object
Returns the value of attribute point_of_sale.
76 77 78 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 76 def point_of_sale @point_of_sale end |
#price_group ⇒ Object
Returns the value of attribute price_group.
78 79 80 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 78 def price_group @price_group end |
#promotion_applications ⇒ Object
Returns the value of attribute promotion_applications.
99 100 101 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 99 def promotion_applications @promotion_applications end |
#revenue ⇒ Object
Returns the value of attribute revenue.
80 81 82 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 80 def revenue @revenue end |
#reversal ⇒ Object
Returns the value of attribute reversal.
56 57 58 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 56 def reversal @reversal end |
#reversed_receipt ⇒ Object
Returns the value of attribute reversed_receipt.
46 47 48 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 46 def reversed_receipt @reversed_receipt end |
#revision ⇒ Object
the revision number of the object. revision numbers are unique per object-type. there is is no object of the same type with identical revision numbers.
25 26 27 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 25 def revision @revision end |
#signature ⇒ Object
Returns the value of attribute signature.
82 83 84 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 82 def signature @signature end |
#total ⇒ Object
Returns the value of attribute total.
84 85 86 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 84 def total @total end |
#void_fiscal_transactions ⇒ Object
Returns the value of attribute void_fiscal_transactions.
90 91 92 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 90 def void_fiscal_transactions @void_fiscal_transactions end |
#voided ⇒ Object
Returns the value of attribute voided.
86 87 88 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 86 def voided @voided end |
#voided_items ⇒ Object
Returns the value of attribute voided_items.
88 89 90 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 88 def voided_items @voided_items end |
#voucher_transaction_references ⇒ Object
Returns the value of attribute voucher_transaction_references.
95 96 97 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 95 def voucher_transaction_references @voucher_transaction_references end |
#voucher_transactions ⇒ Object
Deprecated, please use voucherTransactionReferences instead.
93 94 95 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 93 def voucher_transactions @voucher_transactions end |
#warehouse ⇒ Object
Returns the value of attribute warehouse.
97 98 99 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 97 def warehouse @warehouse end |
#zcounter ⇒ Object
Returns the value of attribute zcounter.
103 104 105 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 103 def zcounter @zcounter end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
152 153 154 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 152 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 106 def self.attribute_map { :'active' => :'active', :'id' => :'id', :'revision' => :'revision', :'number' => :'number', :'account_transactions' => :'accountTransactions', :'additional_info' => :'additionalInfo', :'booking_time' => :'bookingTime', :'cancelled' => :'cancelled', :'cashier' => :'cashier', :'creation_time' => :'creationTime', :'currency' => :'currency', :'reversed_receipt' => :'reversedReceipt', :'customer' => :'customer', :'customer_group' => :'customerGroup', :'deposit_amount' => :'depositAmount', :'external_references' => :'externalReferences', :'reversal' => :'reversal', :'fiscal_transactions' => :'fiscalTransactions', :'geo_location' => :'geoLocation', :'info_texts' => :'infoTexts', :'items' => :'items', :'max_revisions' => :'maxRevisions', :'order_number' => :'orderNumber', :'organizational_unit' => :'organizationalUnit', :'payments' => :'payments', :'cashier_verification_results' => :'cashierVerificationResults', :'point_of_sale' => :'pointOfSale', :'price_group' => :'priceGroup', :'revenue' => :'revenue', :'signature' => :'signature', :'total' => :'total', :'voided' => :'voided', :'voided_items' => :'voidedItems', :'void_fiscal_transactions' => :'voidFiscalTransactions', :'voucher_transactions' => :'voucherTransactions', :'voucher_transaction_references' => :'voucherTransactionReferences', :'warehouse' => :'warehouse', :'promotion_applications' => :'promotionApplications', :'coupon_positions' => :'couponPositions', :'zcounter' => :'zcounter' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
505 506 507 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 505 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
203 204 205 206 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 203 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 157 def self.openapi_types { :'active' => :'Boolean', :'id' => :'String', :'revision' => :'Integer', :'number' => :'String', :'account_transactions' => :'Array<AccountTransaction>', :'additional_info' => :'Array<AdditionalInfo>', :'booking_time' => :'Time', :'cancelled' => :'Boolean', :'cashier' => :'ModelReference', :'creation_time' => :'Time', :'currency' => :'ModelReference', :'reversed_receipt' => :'ModelReference', :'customer' => :'ModelReference', :'customer_group' => :'ModelReference', :'deposit_amount' => :'Float', :'external_references' => :'Hash<String, String>', :'reversal' => :'Boolean', :'fiscal_transactions' => :'Array<FiscalTransaction>', :'geo_location' => :'GeoLocation', :'info_texts' => :'Array<String>', :'items' => :'Array<ReceiptItem>', :'max_revisions' => :'ReceiptMaxRevisions', :'order_number' => :'String', :'organizational_unit' => :'ModelReference', :'payments' => :'Array<Payment>', :'cashier_verification_results' => :'Array<CashierVerificationResult>', :'point_of_sale' => :'ModelReference', :'price_group' => :'ModelReference', :'revenue' => :'ReceiptRevenue', :'signature' => :'Signature', :'total' => :'ReceiptTotal', :'voided' => :'Boolean', :'voided_items' => :'Array<VoidedReceiptItem>', :'void_fiscal_transactions' => :'Array<FiscalTransaction>', :'voucher_transactions' => :'Array<VoucherTransaction>', :'voucher_transaction_references' => :'Array<ModelReference>', :'warehouse' => :'ModelReference', :'promotion_applications' => :'Array<PromotionApplication>', :'coupon_positions' => :'Array<CouponPosition>', :'zcounter' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 445 def ==(o) return true if self.equal?(o) self.class == o.class && active == o.active && id == o.id && revision == o.revision && number == o.number && account_transactions == o.account_transactions && additional_info == o.additional_info && booking_time == o.booking_time && cancelled == o.cancelled && cashier == o.cashier && creation_time == o.creation_time && currency == o.currency && reversed_receipt == o.reversed_receipt && customer == o.customer && customer_group == o.customer_group && deposit_amount == o.deposit_amount && external_references == o.external_references && reversal == o.reversal && fiscal_transactions == o.fiscal_transactions && geo_location == o.geo_location && info_texts == o.info_texts && items == o.items && max_revisions == o.max_revisions && order_number == o.order_number && organizational_unit == o.organizational_unit && payments == o.payments && cashier_verification_results == o.cashier_verification_results && point_of_sale == o.point_of_sale && price_group == o.price_group && revenue == o.revenue && signature == o.signature && total == o.total && voided == o.voided && voided_items == o.voided_items && void_fiscal_transactions == o.void_fiscal_transactions && voucher_transactions == o.voucher_transactions && voucher_transaction_references == o.voucher_transaction_references && warehouse == o.warehouse && promotion_applications == o.promotion_applications && coupon_positions == o.coupon_positions && zcounter == o.zcounter end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 536 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 = KoronaCloudClient.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
607 608 609 610 611 612 613 614 615 616 617 618 619 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 607 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
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 512 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
492 493 494 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 492 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
498 499 500 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 498 def hash [active, id, revision, number, account_transactions, additional_info, booking_time, cancelled, cashier, creation_time, currency, reversed_receipt, customer, customer_group, deposit_amount, external_references, reversal, fiscal_transactions, geo_location, info_texts, items, max_revisions, order_number, organizational_unit, payments, cashier_verification_results, point_of_sale, price_group, revenue, signature, total, voided, voided_items, void_fiscal_transactions, voucher_transactions, voucher_transaction_references, warehouse, promotion_applications, coupon_positions, zcounter].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
414 415 416 417 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 414 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
583 584 585 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 583 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
589 590 591 592 593 594 595 596 597 598 599 600 601 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 589 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
577 578 579 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 577 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
421 422 423 |
# File 'lib/korona-cloud-client/models/receipt.rb', line 421 def valid? true end |