Class: KoronaCloudClient::ReceiptItem
- Inherits:
-
Object
- Object
- KoronaCloudClient::ReceiptItem
- Defined in:
- lib/korona-cloud-client/models/receipt_item.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#attendance ⇒ Object
Returns the value of attribute attendance.
-
#booking_time ⇒ Object
yyyy-MM-dd’T’HH:mm:ssXXX.
-
#commodity_group ⇒ Object
Returns the value of attribute commodity_group.
-
#container_quantity ⇒ Object
Returns the value of attribute container_quantity.
-
#costs ⇒ Object
Costs.
-
#delivery_date ⇒ Object
yyyy-MM-dd’T’HH:mm:ssXXX.
-
#description ⇒ Object
Returns the value of attribute description.
-
#discounts ⇒ Object
Returns the value of attribute discounts.
-
#external_references ⇒ Object
Returns the value of attribute external_references.
-
#id ⇒ Object
global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
-
#indent ⇒ Object
Returns the value of attribute indent.
-
#index ⇒ Object
Returns the value of attribute index.
-
#info_texts ⇒ Object
Returns the value of attribute info_texts.
-
#manual_price ⇒ Object
Returns the value of attribute manual_price.
-
#product ⇒ Object
Returns the value of attribute product.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#recognition_number ⇒ Object
the number referencing the product was typed/scanned to create the receipt item.
-
#return_original_receipt_reference ⇒ Object
Returns the value of attribute return_original_receipt_reference.
-
#return_reason ⇒ Object
Returns the value of attribute return_reason.
-
#sector ⇒ Object
Returns the value of attribute sector.
-
#seller ⇒ Object
Returns the value of attribute seller.
-
#serial_numbers ⇒ Object
Returns the value of attribute serial_numbers.
-
#special_price_configuration ⇒ Object
Returns the value of attribute special_price_configuration.
-
#total ⇒ Object
Returns the value of attribute total.
-
#type ⇒ Object
Returns the value of attribute type.
-
#voucher_transaction ⇒ Object
Returns the value of attribute voucher_transaction.
-
#voucher_transaction_reference ⇒ Object
Returns the value of attribute voucher_transaction_reference.
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 = {}) ⇒ ReceiptItem
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 = {}) ⇒ ReceiptItem
Initializes the object
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 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 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 178 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaCloudClient::ReceiptItem` 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::ReceiptItem`. 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?(:'attendance') self.attendance = attributes[:'attendance'] end if attributes.key?(:'booking_time') self.booking_time = attributes[:'booking_time'] end if attributes.key?(:'commodity_group') self.commodity_group = attributes[:'commodity_group'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'discounts') if (value = attributes[:'discounts']).is_a?(Array) self.discounts = value end end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'indent') self.indent = attributes[:'indent'] end if attributes.key?(:'index') self.index = attributes[:'index'] end if attributes.key?(:'info_texts') if (value = attributes[:'info_texts']).is_a?(Array) self.info_texts = value end end if attributes.key?(:'manual_price') self.manual_price = attributes[:'manual_price'] end if attributes.key?(:'product') self.product = attributes[:'product'] end if attributes.key?(:'quantity') self.quantity = attributes[:'quantity'] end if attributes.key?(:'sector') self.sector = attributes[:'sector'] end if attributes.key?(:'serial_numbers') if (value = attributes[:'serial_numbers']).is_a?(Array) self.serial_numbers = value end end if attributes.key?(:'total') self.total = attributes[:'total'] end if attributes.key?(:'delivery_date') self.delivery_date = attributes[:'delivery_date'] end if attributes.key?(:'external_references') if (value = attributes[:'external_references']).is_a?(Hash) self.external_references = value end end if attributes.key?(:'recognition_number') self.recognition_number = attributes[:'recognition_number'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'voucher_transaction') self.voucher_transaction = attributes[:'voucher_transaction'] end if attributes.key?(:'voucher_transaction_reference') self.voucher_transaction_reference = attributes[:'voucher_transaction_reference'] end if attributes.key?(:'special_price_configuration') self.special_price_configuration = attributes[:'special_price_configuration'] end if attributes.key?(:'return_original_receipt_reference') self.return_original_receipt_reference = attributes[:'return_original_receipt_reference'] end if attributes.key?(:'return_reason') self.return_reason = attributes[:'return_reason'] end if attributes.key?(:'seller') self.seller = attributes[:'seller'] end if attributes.key?(:'container_quantity') self.container_quantity = attributes[:'container_quantity'] end if attributes.key?(:'costs') self.costs = attributes[:'costs'] end end |
Instance Attribute Details
#attendance ⇒ Object
Returns the value of attribute attendance.
18 19 20 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 18 def attendance @attendance end |
#booking_time ⇒ Object
yyyy-MM-dd’T’HH:mm:ssXXX
21 22 23 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 21 def booking_time @booking_time end |
#commodity_group ⇒ Object
Returns the value of attribute commodity_group.
23 24 25 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 23 def commodity_group @commodity_group end |
#container_quantity ⇒ Object
Returns the value of attribute container_quantity.
72 73 74 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 72 def container_quantity @container_quantity end |
#costs ⇒ Object
Costs.
75 76 77 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 75 def costs @costs end |
#delivery_date ⇒ Object
yyyy-MM-dd’T’HH:mm:ssXXX
51 52 53 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 51 def delivery_date @delivery_date end |
#description ⇒ Object
Returns the value of attribute description.
25 26 27 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 25 def description @description end |
#discounts ⇒ Object
Returns the value of attribute discounts.
27 28 29 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 27 def discounts @discounts end |
#external_references ⇒ Object
Returns the value of attribute external_references.
53 54 55 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 53 def external_references @external_references end |
#id ⇒ Object
global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
30 31 32 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 30 def id @id end |
#indent ⇒ Object
Returns the value of attribute indent.
32 33 34 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 32 def indent @indent end |
#index ⇒ Object
Returns the value of attribute index.
34 35 36 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 34 def index @index end |
#info_texts ⇒ Object
Returns the value of attribute info_texts.
36 37 38 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 36 def info_texts @info_texts end |
#manual_price ⇒ Object
Returns the value of attribute manual_price.
38 39 40 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 38 def manual_price @manual_price end |
#product ⇒ Object
Returns the value of attribute product.
40 41 42 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 40 def product @product end |
#quantity ⇒ Object
Returns the value of attribute quantity.
42 43 44 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 42 def quantity @quantity end |
#recognition_number ⇒ Object
the number referencing the product was typed/scanned to create the receipt item
56 57 58 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 56 def recognition_number @recognition_number end |
#return_original_receipt_reference ⇒ Object
Returns the value of attribute return_original_receipt_reference.
66 67 68 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 66 def return_original_receipt_reference @return_original_receipt_reference end |
#return_reason ⇒ Object
Returns the value of attribute return_reason.
68 69 70 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 68 def return_reason @return_reason end |
#sector ⇒ Object
Returns the value of attribute sector.
44 45 46 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 44 def sector @sector end |
#seller ⇒ Object
Returns the value of attribute seller.
70 71 72 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 70 def seller @seller end |
#serial_numbers ⇒ Object
Returns the value of attribute serial_numbers.
46 47 48 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 46 def serial_numbers @serial_numbers end |
#special_price_configuration ⇒ Object
Returns the value of attribute special_price_configuration.
64 65 66 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 64 def special_price_configuration @special_price_configuration end |
#total ⇒ Object
Returns the value of attribute total.
48 49 50 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 48 def total @total end |
#type ⇒ Object
Returns the value of attribute type.
58 59 60 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 58 def type @type end |
#voucher_transaction ⇒ Object
Returns the value of attribute voucher_transaction.
60 61 62 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 60 def voucher_transaction @voucher_transaction end |
#voucher_transaction_reference ⇒ Object
Returns the value of attribute voucher_transaction_reference.
62 63 64 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 62 def voucher_transaction_reference @voucher_transaction_reference end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 456 457 458 459 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 422 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 = KoronaCloudClient.const_get(type) 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
133 134 135 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 133 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 124 125 126 127 128 129 130 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 100 def self.attribute_map { :'attendance' => :'attendance', :'booking_time' => :'bookingTime', :'commodity_group' => :'commodityGroup', :'description' => :'description', :'discounts' => :'discounts', :'id' => :'id', :'indent' => :'indent', :'index' => :'index', :'info_texts' => :'infoTexts', :'manual_price' => :'manualPrice', :'product' => :'product', :'quantity' => :'quantity', :'sector' => :'sector', :'serial_numbers' => :'serialNumbers', :'total' => :'total', :'delivery_date' => :'deliveryDate', :'external_references' => :'externalReferences', :'recognition_number' => :'recognitionNumber', :'type' => :'type', :'voucher_transaction' => :'voucherTransaction', :'voucher_transaction_reference' => :'voucherTransactionReference', :'special_price_configuration' => :'specialPriceConfiguration', :'return_original_receipt_reference' => :'returnOriginalReceiptReference', :'return_reason' => :'returnReason', :'seller' => :'seller', :'container_quantity' => :'containerQuantity', :'costs' => :'costs' } 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 414 415 416 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 398 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
171 172 173 174 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 171 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 138 def self.openapi_types { :'attendance' => :'ModelReference', :'booking_time' => :'Time', :'commodity_group' => :'ModelReference', :'description' => :'String', :'discounts' => :'Array<Discount>', :'id' => :'String', :'indent' => :'Integer', :'index' => :'Integer', :'info_texts' => :'Array<String>', :'manual_price' => :'Boolean', :'product' => :'ModelReference', :'quantity' => :'Float', :'sector' => :'ModelReference', :'serial_numbers' => :'Array<String>', :'total' => :'TotalPrice', :'delivery_date' => :'Time', :'external_references' => :'Hash<String, String>', :'recognition_number' => :'String', :'type' => :'String', :'voucher_transaction' => :'VoucherTransactionOld', :'voucher_transaction_reference' => :'ModelReference', :'special_price_configuration' => :'ModelReference', :'return_original_receipt_reference' => :'ModelReference', :'return_reason' => :'ReceiptItemReturnReason', :'seller' => :'ModelReference', :'container_quantity' => :'Float', :'costs' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 351 def ==(o) return true if self.equal?(o) self.class == o.class && attendance == o.attendance && booking_time == o.booking_time && commodity_group == o.commodity_group && description == o.description && discounts == o.discounts && id == o.id && indent == o.indent && index == o.index && info_texts == o.info_texts && manual_price == o.manual_price && product == o.product && quantity == o.quantity && sector == o.sector && serial_numbers == o.serial_numbers && total == o.total && delivery_date == o.delivery_date && external_references == o.external_references && recognition_number == o.recognition_number && type == o.type && voucher_transaction == o.voucher_transaction && voucher_transaction_reference == o.voucher_transaction_reference && special_price_configuration == o.special_price_configuration && return_original_receipt_reference == o.return_original_receipt_reference && return_reason == o.return_reason && seller == o.seller && container_quantity == o.container_quantity && costs == o.costs end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 493 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
385 386 387 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 385 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
391 392 393 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 391 def hash [attendance, booking_time, commodity_group, description, discounts, id, indent, index, info_texts, manual_price, product, quantity, sector, serial_numbers, total, delivery_date, external_references, recognition_number, type, voucher_transaction, voucher_transaction_reference, special_price_configuration, return_original_receipt_reference, return_reason, seller, container_quantity, costs].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
310 311 312 313 314 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 310 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
469 470 471 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 469 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 475 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
463 464 465 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 463 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
318 319 320 321 322 323 |
# File 'lib/korona-cloud-client/models/receipt_item.rb', line 318 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' type_validator = EnumAttributeValidator.new('String', ["PRODUCT", "VOUCHER"]) return false unless type_validator.valid?(@type) true end |