Class: KoronaClient::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/korona_client/models/product.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Product

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/korona_client/models/product.rb', line 233

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?(:'active')
    self.active = attributes[:'active']
  end

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'number')
    self.number = attributes[:'number']
  end

  if attributes.has_key?(:'revision')
    self.revision = attributes[:'revision']
  end

  if attributes.has_key?(:'alternativeSector')
    self.alternative_sector = attributes[:'alternativeSector']
  end

  if attributes.has_key?(:'assortment')
    self.assortment = attributes[:'assortment']
  end

  if attributes.has_key?(:'codes')
    if (value = attributes[:'codes']).is_a?(Array)
      self.codes = value
    end
  end

  if attributes.has_key?(:'commodityGroup')
    self.commodity_group = attributes[:'commodityGroup']
  end

  if attributes.has_key?(:'conversion')
    self.conversion = attributes[:'conversion']
  end

  if attributes.has_key?(:'costs')
    self.costs = attributes[:'costs']
  end

  if attributes.has_key?(:'deactivated')
    self.deactivated = attributes[:'deactivated']
  end

  if attributes.has_key?(:'deposit')
    self.deposit = attributes[:'deposit']
  end

  if attributes.has_key?(:'descriptions')
    if (value = attributes[:'descriptions']).is_a?(Array)
      self.descriptions = value
    end
  end

  if attributes.has_key?(:'discountable')
    self.discountable = attributes[:'discountable']
  end

  if attributes.has_key?(:'image')
    self.image = attributes[:'image']
  end

  if attributes.has_key?(:'infoTexts')
    if (value = attributes[:'infoTexts']).is_a?(Array)
      self.info_texts = value
    end
  end

  if attributes.has_key?(:'itemSequence')
    self.item_sequence = attributes[:'itemSequence']
  end

  if attributes.has_key?(:'lastPurchasePrice')
    self.last_purchase_price = attributes[:'lastPurchasePrice']
  end

  if attributes.has_key?(:'listed')
    self.listed = attributes[:'listed']
  end

  if attributes.has_key?(:'listedSince')
    self.listed_since = attributes[:'listedSince']
  end

  if attributes.has_key?(:'maxPrice')
    self.max_price = attributes[:'maxPrice']
  end

  if attributes.has_key?(:'minPrice')
    self.min_price = attributes[:'minPrice']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'packagingQuantity')
    self.packaging_quantity = attributes[:'packagingQuantity']
  end

  if attributes.has_key?(:'packagingRequired')
    self.packaging_required = attributes[:'packagingRequired']
  end

  if attributes.has_key?(:'packagingUnit')
    self.packaging_unit = attributes[:'packagingUnit']
  end

  if attributes.has_key?(:'personalizationRequired')
    self.personalization_required = attributes[:'personalizationRequired']
  end

  if attributes.has_key?(:'priceChangable')
    self.price_changable = attributes[:'priceChangable']
  end

  if attributes.has_key?(:'prices')
    if (value = attributes[:'prices']).is_a?(Array)
      self.prices = value
    end
  end

  if attributes.has_key?(:'printTicketsSeparately')
    self.print_tickets_separately = attributes[:'printTicketsSeparately']
  end

  if attributes.has_key?(:'productionType')
    self.production_type = attributes[:'productionType']
  end

  if attributes.has_key?(:'recommendedRetailPrice')
    self.recommended_retail_price = attributes[:'recommendedRetailPrice']
  end

  if attributes.has_key?(:'relatedProducts')
    self.related_products = attributes[:'relatedProducts']
  end

  if attributes.has_key?(:'sector')
    self.sector = attributes[:'sector']
  end

  if attributes.has_key?(:'serialNumberRequired')
    self.serial_number_required = attributes[:'serialNumberRequired']
  end

  if attributes.has_key?(:'subproductPresentation')
    self.subproduct_presentation = attributes[:'subproductPresentation']
  end

  if attributes.has_key?(:'subproducts')
    if (value = attributes[:'subproducts']).is_a?(Array)
      self.subproducts = value
    end
  end

  if attributes.has_key?(:'supplierPrices')
    if (value = attributes[:'supplierPrices']).is_a?(Array)
      self.supplier_prices = value
    end
  end

  if attributes.has_key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end

  if attributes.has_key?(:'ticketDefinition')
    self.ticket_definition = attributes[:'ticketDefinition']
  end

  if attributes.has_key?(:'trackInventory')
    self.track_inventory = attributes[:'trackInventory']
  end

  if attributes.has_key?(:'mediaUrls')
    if (value = attributes[:'mediaUrls']).is_a?(Array)
      self.media_urls = value
    end
  end

  if attributes.has_key?(:'quantityDenomination')
    self.quantity_denomination = attributes[:'quantityDenomination']
  end

  if attributes.has_key?(:'stockReturnUnsellable')
    self.stock_return_unsellable = attributes[:'stockReturnUnsellable']
  end
end

Instance Attribute Details

#activeObject

indicates whether the object is active for use or not



18
19
20
# File 'lib/korona_client/models/product.rb', line 18

def active
  @active
end

#alternative_sectorObject

Returns the value of attribute alternative_sector.



29
30
31
# File 'lib/korona_client/models/product.rb', line 29

def alternative_sector
  @alternative_sector
end

#assortmentObject

Returns the value of attribute assortment.



31
32
33
# File 'lib/korona_client/models/product.rb', line 31

def assortment
  @assortment
end

#codesObject

Returns the value of attribute codes.



33
34
35
# File 'lib/korona_client/models/product.rb', line 33

def codes
  @codes
end

#commodity_groupObject

Returns the value of attribute commodity_group.



35
36
37
# File 'lib/korona_client/models/product.rb', line 35

def commodity_group
  @commodity_group
end

#conversionObject

Returns the value of attribute conversion.



37
38
39
# File 'lib/korona_client/models/product.rb', line 37

def conversion
  @conversion
end

#costsObject

Returns the value of attribute costs.



39
40
41
# File 'lib/korona_client/models/product.rb', line 39

def costs
  @costs
end

#deactivatedObject

Returns the value of attribute deactivated.



41
42
43
# File 'lib/korona_client/models/product.rb', line 41

def deactivated
  @deactivated
end

#depositObject

Returns the value of attribute deposit.



43
44
45
# File 'lib/korona_client/models/product.rb', line 43

def deposit
  @deposit
end

#descriptionsObject

Returns the value of attribute descriptions.



45
46
47
# File 'lib/korona_client/models/product.rb', line 45

def descriptions
  @descriptions
end

#discountableObject

Returns the value of attribute discountable.



47
48
49
# File 'lib/korona_client/models/product.rb', line 47

def discountable
  @discountable
end

#idObject

global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)



21
22
23
# File 'lib/korona_client/models/product.rb', line 21

def id
  @id
end

#imageObject

Returns the value of attribute image.



49
50
51
# File 'lib/korona_client/models/product.rb', line 49

def image
  @image
end

#info_textsObject

Returns the value of attribute info_texts.



51
52
53
# File 'lib/korona_client/models/product.rb', line 51

def info_texts
  @info_texts
end

#item_sequenceObject

Returns the value of attribute item_sequence.



53
54
55
# File 'lib/korona_client/models/product.rb', line 53

def item_sequence
  @item_sequence
end

#last_purchase_priceObject

Returns the value of attribute last_purchase_price.



55
56
57
# File 'lib/korona_client/models/product.rb', line 55

def last_purchase_price
  @last_purchase_price
end

#listedObject

Returns the value of attribute listed.



57
58
59
# File 'lib/korona_client/models/product.rb', line 57

def listed
  @listed
end

#listed_sinceObject

Returns the value of attribute listed_since.



59
60
61
# File 'lib/korona_client/models/product.rb', line 59

def listed_since
  @listed_since
end

#max_priceObject

Returns the value of attribute max_price.



61
62
63
# File 'lib/korona_client/models/product.rb', line 61

def max_price
  @max_price
end

#media_urlsObject

Returns the value of attribute media_urls.



103
104
105
# File 'lib/korona_client/models/product.rb', line 103

def media_urls
  @media_urls
end

#min_priceObject

Returns the value of attribute min_price.



63
64
65
# File 'lib/korona_client/models/product.rb', line 63

def min_price
  @min_price
end

#nameObject

Returns the value of attribute name.



65
66
67
# File 'lib/korona_client/models/product.rb', line 65

def name
  @name
end

#numberObject

number of the object, like it is set in backoffice; will be removed when active=false



24
25
26
# File 'lib/korona_client/models/product.rb', line 24

def number
  @number
end

#packaging_quantityObject

Returns the value of attribute packaging_quantity.



67
68
69
# File 'lib/korona_client/models/product.rb', line 67

def packaging_quantity
  @packaging_quantity
end

#packaging_requiredObject

Returns the value of attribute packaging_required.



69
70
71
# File 'lib/korona_client/models/product.rb', line 69

def packaging_required
  @packaging_required
end

#packaging_unitObject

Returns the value of attribute packaging_unit.



71
72
73
# File 'lib/korona_client/models/product.rb', line 71

def packaging_unit
  @packaging_unit
end

#personalization_requiredObject

Returns the value of attribute personalization_required.



73
74
75
# File 'lib/korona_client/models/product.rb', line 73

def personalization_required
  @personalization_required
end

#price_changableObject

Returns the value of attribute price_changable.



75
76
77
# File 'lib/korona_client/models/product.rb', line 75

def price_changable
  @price_changable
end

#pricesObject

Returns the value of attribute prices.



77
78
79
# File 'lib/korona_client/models/product.rb', line 77

def prices
  @prices
end

Returns the value of attribute print_tickets_separately.



79
80
81
# File 'lib/korona_client/models/product.rb', line 79

def print_tickets_separately
  @print_tickets_separately
end

#production_typeObject

Returns the value of attribute production_type.



81
82
83
# File 'lib/korona_client/models/product.rb', line 81

def production_type
  @production_type
end

#quantity_denominationObject

Returns the value of attribute quantity_denomination.



105
106
107
# File 'lib/korona_client/models/product.rb', line 105

def quantity_denomination
  @quantity_denomination
end

Returns the value of attribute recommended_retail_price.



83
84
85
# File 'lib/korona_client/models/product.rb', line 83

def recommended_retail_price
  @recommended_retail_price
end

Returns the value of attribute related_products.



85
86
87
# File 'lib/korona_client/models/product.rb', line 85

def related_products
  @related_products
end

#revisionObject

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.



27
28
29
# File 'lib/korona_client/models/product.rb', line 27

def revision
  @revision
end

#sectorObject

Returns the value of attribute sector.



87
88
89
# File 'lib/korona_client/models/product.rb', line 87

def sector
  @sector
end

#serial_number_requiredObject

Returns the value of attribute serial_number_required.



89
90
91
# File 'lib/korona_client/models/product.rb', line 89

def serial_number_required
  @serial_number_required
end

#stock_return_unsellableObject

Returns the value of attribute stock_return_unsellable.



107
108
109
# File 'lib/korona_client/models/product.rb', line 107

def stock_return_unsellable
  @stock_return_unsellable
end

#subproduct_presentationObject

Returns the value of attribute subproduct_presentation.



91
92
93
# File 'lib/korona_client/models/product.rb', line 91

def subproduct_presentation
  @subproduct_presentation
end

#subproductsObject

Returns the value of attribute subproducts.



93
94
95
# File 'lib/korona_client/models/product.rb', line 93

def subproducts
  @subproducts
end

#supplier_pricesObject

Returns the value of attribute supplier_prices.



95
96
97
# File 'lib/korona_client/models/product.rb', line 95

def supplier_prices
  @supplier_prices
end

#tagsObject

Returns the value of attribute tags.



97
98
99
# File 'lib/korona_client/models/product.rb', line 97

def tags
  @tags
end

#ticket_definitionObject

Returns the value of attribute ticket_definition.



99
100
101
# File 'lib/korona_client/models/product.rb', line 99

def ticket_definition
  @ticket_definition
end

#track_inventoryObject

Returns the value of attribute track_inventory.



101
102
103
# File 'lib/korona_client/models/product.rb', line 101

def track_inventory
  @track_inventory
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



132
133
134
135
136
137
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
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/korona_client/models/product.rb', line 132

def self.attribute_map
  {
    :'active' => :'active',
    :'id' => :'id',
    :'number' => :'number',
    :'revision' => :'revision',
    :'alternative_sector' => :'alternativeSector',
    :'assortment' => :'assortment',
    :'codes' => :'codes',
    :'commodity_group' => :'commodityGroup',
    :'conversion' => :'conversion',
    :'costs' => :'costs',
    :'deactivated' => :'deactivated',
    :'deposit' => :'deposit',
    :'descriptions' => :'descriptions',
    :'discountable' => :'discountable',
    :'image' => :'image',
    :'info_texts' => :'infoTexts',
    :'item_sequence' => :'itemSequence',
    :'last_purchase_price' => :'lastPurchasePrice',
    :'listed' => :'listed',
    :'listed_since' => :'listedSince',
    :'max_price' => :'maxPrice',
    :'min_price' => :'minPrice',
    :'name' => :'name',
    :'packaging_quantity' => :'packagingQuantity',
    :'packaging_required' => :'packagingRequired',
    :'packaging_unit' => :'packagingUnit',
    :'personalization_required' => :'personalizationRequired',
    :'price_changable' => :'priceChangable',
    :'prices' => :'prices',
    :'print_tickets_separately' => :'printTicketsSeparately',
    :'production_type' => :'productionType',
    :'recommended_retail_price' => :'recommendedRetailPrice',
    :'related_products' => :'relatedProducts',
    :'sector' => :'sector',
    :'serial_number_required' => :'serialNumberRequired',
    :'subproduct_presentation' => :'subproductPresentation',
    :'subproducts' => :'subproducts',
    :'supplier_prices' => :'supplierPrices',
    :'tags' => :'tags',
    :'ticket_definition' => :'ticketDefinition',
    :'track_inventory' => :'trackInventory',
    :'media_urls' => :'mediaUrls',
    :'quantity_denomination' => :'quantityDenomination',
    :'stock_return_unsellable' => :'stockReturnUnsellable'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/korona_client/models/product.rb', line 182

def self.swagger_types
  {
    :'active' => :'BOOLEAN',
    :'id' => :'String',
    :'number' => :'String',
    :'revision' => :'Integer',
    :'alternative_sector' => :'ModelReference',
    :'assortment' => :'ModelReference',
    :'codes' => :'Array<ProductCode>',
    :'commodity_group' => :'ModelReference',
    :'conversion' => :'BOOLEAN',
    :'costs' => :'Float',
    :'deactivated' => :'BOOLEAN',
    :'deposit' => :'BOOLEAN',
    :'descriptions' => :'Array<ProductDescription>',
    :'discountable' => :'BOOLEAN',
    :'image' => :'ModelReference',
    :'info_texts' => :'Array<ModelReference>',
    :'item_sequence' => :'ModelReference',
    :'last_purchase_price' => :'Float',
    :'listed' => :'BOOLEAN',
    :'listed_since' => :'DateTime',
    :'max_price' => :'Float',
    :'min_price' => :'Float',
    :'name' => :'String',
    :'packaging_quantity' => :'Float',
    :'packaging_required' => :'BOOLEAN',
    :'packaging_unit' => :'String',
    :'personalization_required' => :'BOOLEAN',
    :'price_changable' => :'BOOLEAN',
    :'prices' => :'Array<ProductPrice>',
    :'print_tickets_separately' => :'BOOLEAN',
    :'production_type' => :'ModelReference',
    :'recommended_retail_price' => :'Float',
    :'related_products' => :'ModelReference',
    :'sector' => :'ModelReference',
    :'serial_number_required' => :'BOOLEAN',
    :'subproduct_presentation' => :'String',
    :'subproducts' => :'Array<ProductSubproduct>',
    :'supplier_prices' => :'Array<ProductSupplierPrice>',
    :'tags' => :'Array<ModelReference>',
    :'ticket_definition' => :'ModelReference',
    :'track_inventory' => :'BOOLEAN',
    :'media_urls' => :'Array<MediaUrl>',
    :'quantity_denomination' => :'Float',
    :'stock_return_unsellable' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



471
472
473
474
475
476
477
478
479
480
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/korona_client/models/product.rb', line 471

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      active == o.active &&
      id == o.id &&
      number == o.number &&
      revision == o.revision &&
      alternative_sector == o.alternative_sector &&
      assortment == o.assortment &&
      codes == o.codes &&
      commodity_group == o.commodity_group &&
      conversion == o.conversion &&
      costs == o.costs &&
      deactivated == o.deactivated &&
      deposit == o.deposit &&
      descriptions == o.descriptions &&
      discountable == o.discountable &&
      image == o.image &&
      info_texts == o.info_texts &&
      item_sequence == o.item_sequence &&
      last_purchase_price == o.last_purchase_price &&
      listed == o.listed &&
      listed_since == o.listed_since &&
      max_price == o.max_price &&
      min_price == o.min_price &&
      name == o.name &&
      packaging_quantity == o.packaging_quantity &&
      packaging_required == o.packaging_required &&
      packaging_unit == o.packaging_unit &&
      personalization_required == o.personalization_required &&
      price_changable == o.price_changable &&
      prices == o.prices &&
      print_tickets_separately == o.print_tickets_separately &&
      production_type == o.production_type &&
      recommended_retail_price == o.recommended_retail_price &&
      related_products == o.related_products &&
      sector == o.sector &&
      serial_number_required == o.serial_number_required &&
      subproduct_presentation == o.subproduct_presentation &&
      subproducts == o.subproducts &&
      supplier_prices == o.supplier_prices &&
      tags == o.tags &&
      ticket_definition == o.ticket_definition &&
      track_inventory == o.track_inventory &&
      media_urls == o.media_urls &&
      quantity_denomination == o.quantity_denomination &&
      stock_return_unsellable == o.stock_return_unsellable
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/korona_client/models/product.rb', line 556

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 = KoronaClient.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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



622
623
624
625
626
627
628
629
630
631
632
633
634
# File 'lib/korona_client/models/product.rb', line 622

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/korona_client/models/product.rb', line 535

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 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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


522
523
524
# File 'lib/korona_client/models/product.rb', line 522

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



528
529
530
# File 'lib/korona_client/models/product.rb', line 528

def hash
  [active, id, number, revision, alternative_sector, assortment, codes, commodity_group, conversion, costs, deactivated, deposit, descriptions, discountable, image, info_texts, item_sequence, last_purchase_price, listed, listed_since, max_price, min_price, name, packaging_quantity, packaging_required, packaging_unit, personalization_required, price_changable, prices, print_tickets_separately, production_type, recommended_retail_price, related_products, sector, serial_number_required, subproduct_presentation, subproducts, supplier_prices, tags, ticket_definition, track_inventory, media_urls, quantity_denomination, stock_return_unsellable].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



434
435
436
437
# File 'lib/korona_client/models/product.rb', line 434

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



602
603
604
# File 'lib/korona_client/models/product.rb', line 602

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



608
609
610
611
612
613
614
615
616
# File 'lib/korona_client/models/product.rb', line 608

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



596
597
598
# File 'lib/korona_client/models/product.rb', line 596

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



441
442
443
444
445
446
447
# File 'lib/korona_client/models/product.rb', line 441

def valid?
  packaging_unit_validator = EnumAttributeValidator.new('String', ['CUBIC_INCH', 'CUBIC_METER', 'FLUID_OUNCE', 'GALLON_FL', 'GRAM', 'INCH', 'KILOGRAM', 'LITER', 'METER', 'MILLILITER', 'OUNCE', 'POUND', 'SQUARE_INCH', 'SQUARE_METER'])
  return false unless packaging_unit_validator.valid?(@packaging_unit)
  subproduct_presentation_validator = EnumAttributeValidator.new('String', ['DEFAULT', 'HIDE_ALL', 'HIDE_PRICES', 'HIDE_QUANTITIES'])
  return false unless subproduct_presentation_validator.valid?(@subproduct_presentation)
  true
end