Class: AmznSpApi::OrdersApiModel::OrderItem

Inherits:
Object
  • Object
show all
Defined in:
lib/orders_api_model/models/order_item.rb

Overview

A single order item.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OrderItem

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Raises:

  • (ArgumentError)


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
# File 'lib/orders_api_model/models/order_item.rb', line 186

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `AmznSpApi::OrdersApiModel::OrderItem` initialize method' unless attributes.is_a?(Hash)

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) do |(k, v), h|
    raise ArgumentError, "`#{k}` is not a valid attribute in `AmznSpApi::OrdersApiModel::OrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)

    h[k.to_sym] = v
  end

  self.asin = attributes[:asin] if attributes.key?(:asin)

  self.seller_sku = attributes[:seller_sku] if attributes.key?(:seller_sku)

  self.order_item_id = attributes[:order_item_id] if attributes.key?(:order_item_id)

  self.title = attributes[:title] if attributes.key?(:title)

  self.quantity_ordered = attributes[:quantity_ordered] if attributes.key?(:quantity_ordered)

  self.quantity_shipped = attributes[:quantity_shipped] if attributes.key?(:quantity_shipped)

  self.product_info = attributes[:product_info] if attributes.key?(:product_info)

  self.points_granted = attributes[:points_granted] if attributes.key?(:points_granted)

  self.item_price = attributes[:item_price] if attributes.key?(:item_price)

  self.shipping_price = attributes[:shipping_price] if attributes.key?(:shipping_price)

  self.item_tax = attributes[:item_tax] if attributes.key?(:item_tax)

  self.shipping_tax = attributes[:shipping_tax] if attributes.key?(:shipping_tax)

  self.shipping_discount = attributes[:shipping_discount] if attributes.key?(:shipping_discount)

  self.shipping_discount_tax = attributes[:shipping_discount_tax] if attributes.key?(:shipping_discount_tax)

  self.promotion_discount = attributes[:promotion_discount] if attributes.key?(:promotion_discount)

  self.promotion_discount_tax = attributes[:promotion_discount_tax] if attributes.key?(:promotion_discount_tax)

  self.promotion_ids = attributes[:promotion_ids] if attributes.key?(:promotion_ids)

  self.cod_fee = attributes[:cod_fee] if attributes.key?(:cod_fee)

  self.cod_fee_discount = attributes[:cod_fee_discount] if attributes.key?(:cod_fee_discount)

  self.is_gift = attributes[:is_gift] if attributes.key?(:is_gift)

  self.condition_note = attributes[:condition_note] if attributes.key?(:condition_note)

  self.condition_id = attributes[:condition_id] if attributes.key?(:condition_id)

  self.condition_subtype_id = attributes[:condition_subtype_id] if attributes.key?(:condition_subtype_id)

  self.scheduled_delivery_start_date = attributes[:scheduled_delivery_start_date] if attributes.key?(:scheduled_delivery_start_date)

  self.scheduled_delivery_end_date = attributes[:scheduled_delivery_end_date] if attributes.key?(:scheduled_delivery_end_date)

  self.price_designation = attributes[:price_designation] if attributes.key?(:price_designation)

  self.tax_collection = attributes[:tax_collection] if attributes.key?(:tax_collection)

  self.serial_number_required = attributes[:serial_number_required] if attributes.key?(:serial_number_required)

  self.is_transparency = attributes[:is_transparency] if attributes.key?(:is_transparency)

  self.ioss_number = attributes[:ioss_number] if attributes.key?(:ioss_number)

  self.store_chain_store_id = attributes[:store_chain_store_id] if attributes.key?(:store_chain_store_id)

  self.deemed_reseller_category = attributes[:deemed_reseller_category] if attributes.key?(:deemed_reseller_category)

  self.buyer_info = attributes[:buyer_info] if attributes.key?(:buyer_info)

  self.buyer_requested_cancel = attributes[:buyer_requested_cancel] if attributes.key?(:buyer_requested_cancel)

  self.item_approval_context = attributes[:item_approval_context] if attributes.key?(:item_approval_context)

  return unless attributes.key?(:serial_numbers)
  return unless (value = attributes[:serial_numbers]).is_a?(Array)

  self.serial_numbers = value
end

Instance Attribute Details

#asinObject

The Amazon Standard Identification Number (ASIN) of the item.



16
17
18
# File 'lib/orders_api_model/models/order_item.rb', line 16

def asin
  @asin
end

#buyer_infoObject

Returns the value of attribute buyer_info.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def buyer_info
  @buyer_info
end

#buyer_requested_cancelObject

Returns the value of attribute buyer_requested_cancel.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def buyer_requested_cancel
  @buyer_requested_cancel
end

#cod_feeObject

Returns the value of attribute cod_fee.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def cod_fee
  @cod_fee
end

#cod_fee_discountObject

Returns the value of attribute cod_fee_discount.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def cod_fee_discount
  @cod_fee_discount
end

#condition_idObject

The condition of the item. Possible values: New, Used, Collectible, Refurbished, Preorder, Club.



42
43
44
# File 'lib/orders_api_model/models/order_item.rb', line 42

def condition_id
  @condition_id
end

#condition_noteObject

The condition of the item as described by the seller.



39
40
41
# File 'lib/orders_api_model/models/order_item.rb', line 39

def condition_note
  @condition_note
end

#condition_subtype_idObject

The subcondition of the item. Possible values: New, Mint, Very Good, Good, Acceptable, Poor, Club, OEM, Warranty, Refurbished Warranty, Refurbished, Open Box, Any, Other.



45
46
47
# File 'lib/orders_api_model/models/order_item.rb', line 45

def condition_subtype_id
  @condition_subtype_id
end

#deemed_reseller_categoryObject

The category of deemed reseller. This applies to selling partners that are not based in the EU and is used to help them meet the VAT Deemed Reseller tax laws in the EU and UK.



69
70
71
# File 'lib/orders_api_model/models/order_item.rb', line 69

def deemed_reseller_category
  @deemed_reseller_category
end

#ioss_numberObject

The IOSS number for the marketplace. Sellers shipping to the European Union (EU) from outside of the EU must provide this IOSS number to their carrier when Amazon has collected the VAT on the sale.



63
64
65
# File 'lib/orders_api_model/models/order_item.rb', line 63

def ioss_number
  @ioss_number
end

#is_giftObject

When true, the item is a gift.



36
37
38
# File 'lib/orders_api_model/models/order_item.rb', line 36

def is_gift
  @is_gift
end

#is_transparencyObject

When true, transparency codes are required.



60
61
62
# File 'lib/orders_api_model/models/order_item.rb', line 60

def is_transparency
  @is_transparency
end

#item_approval_contextObject

Returns the value of attribute item_approval_context.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def item_approval_context
  @item_approval_context
end

#item_priceObject

Returns the value of attribute item_price.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def item_price
  @item_price
end

#item_taxObject

Returns the value of attribute item_tax.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def item_tax
  @item_tax
end

#order_item_idObject

An Amazon-defined order item identifier.



22
23
24
# File 'lib/orders_api_model/models/order_item.rb', line 22

def order_item_id
  @order_item_id
end

#points_grantedObject

Returns the value of attribute points_granted.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def points_granted
  @points_granted
end

#price_designationObject

Indicates that the selling price is a special price that is available only for Amazon Business orders. For more information about the Amazon Business Seller Program, see the [Amazon Business website](www.amazon.com/b2b/info/amazon-business). Possible values: BusinessPrice - A special price that is available only for Amazon Business orders.



54
55
56
# File 'lib/orders_api_model/models/order_item.rb', line 54

def price_designation
  @price_designation
end

#product_infoObject

Returns the value of attribute product_info.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def product_info
  @product_info
end

#promotion_discountObject

Returns the value of attribute promotion_discount.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def promotion_discount
  @promotion_discount
end

#promotion_discount_taxObject

Returns the value of attribute promotion_discount_tax.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def promotion_discount_tax
  @promotion_discount_tax
end

#promotion_idsObject

Returns the value of attribute promotion_ids.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def promotion_ids
  @promotion_ids
end

#quantity_orderedObject

The number of items in the order.



28
29
30
# File 'lib/orders_api_model/models/order_item.rb', line 28

def quantity_ordered
  @quantity_ordered
end

#quantity_shippedObject

The number of items shipped.



31
32
33
# File 'lib/orders_api_model/models/order_item.rb', line 31

def quantity_shipped
  @quantity_shipped
end

#scheduled_delivery_end_dateObject

The end date of the scheduled delivery window in the time zone of the order destination. In ISO 8601 date time format.



51
52
53
# File 'lib/orders_api_model/models/order_item.rb', line 51

def scheduled_delivery_end_date
  @scheduled_delivery_end_date
end

#scheduled_delivery_start_dateObject

The start date of the scheduled delivery window in the time zone of the order destination. In ISO 8601 date time format.



48
49
50
# File 'lib/orders_api_model/models/order_item.rb', line 48

def scheduled_delivery_start_date
  @scheduled_delivery_start_date
end

#seller_skuObject

The seller stock keeping unit (SKU) of the item.



19
20
21
# File 'lib/orders_api_model/models/order_item.rb', line 19

def seller_sku
  @seller_sku
end

#serial_number_requiredObject

When true, the product type for this item has a serial number. Returned only for Amazon Easy Ship orders.



57
58
59
# File 'lib/orders_api_model/models/order_item.rb', line 57

def serial_number_required
  @serial_number_required
end

#serial_numbersObject

A list of serial numbers for electronic products that are shipped to customers. Returned for FBA orders only.



72
73
74
# File 'lib/orders_api_model/models/order_item.rb', line 72

def serial_numbers
  @serial_numbers
end

#shipping_discountObject

Returns the value of attribute shipping_discount.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def shipping_discount
  @shipping_discount
end

#shipping_discount_taxObject

Returns the value of attribute shipping_discount_tax.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def shipping_discount_tax
  @shipping_discount_tax
end

#shipping_priceObject

Returns the value of attribute shipping_price.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def shipping_price
  @shipping_price
end

#shipping_taxObject

Returns the value of attribute shipping_tax.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def shipping_tax
  @shipping_tax
end

#store_chain_store_idObject

The store chain store identifier. Linked to a specific store in a store chain.



66
67
68
# File 'lib/orders_api_model/models/order_item.rb', line 66

def store_chain_store_id
  @store_chain_store_id
end

#tax_collectionObject

Returns the value of attribute tax_collection.



33
34
35
# File 'lib/orders_api_model/models/order_item.rb', line 33

def tax_collection
  @tax_collection
end

#titleObject

The name of the item.



25
26
27
# File 'lib/orders_api_model/models/order_item.rb', line 25

def title
  @title
end

Class Method Details

.attribute_mapObject

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



96
97
98
99
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
131
132
133
134
135
# File 'lib/orders_api_model/models/order_item.rb', line 96

def self.attribute_map
  {
    'asin': :ASIN,
    'seller_sku': :SellerSKU,
    'order_item_id': :OrderItemId,
    'title': :Title,
    'quantity_ordered': :QuantityOrdered,
    'quantity_shipped': :QuantityShipped,
    'product_info': :ProductInfo,
    'points_granted': :PointsGranted,
    'item_price': :ItemPrice,
    'shipping_price': :ShippingPrice,
    'item_tax': :ItemTax,
    'shipping_tax': :ShippingTax,
    'shipping_discount': :ShippingDiscount,
    'shipping_discount_tax': :ShippingDiscountTax,
    'promotion_discount': :PromotionDiscount,
    'promotion_discount_tax': :PromotionDiscountTax,
    'promotion_ids': :PromotionIds,
    'cod_fee': :CODFee,
    'cod_fee_discount': :CODFeeDiscount,
    'is_gift': :IsGift,
    'condition_note': :ConditionNote,
    'condition_id': :ConditionId,
    'condition_subtype_id': :ConditionSubtypeId,
    'scheduled_delivery_start_date': :ScheduledDeliveryStartDate,
    'scheduled_delivery_end_date': :ScheduledDeliveryEndDate,
    'price_designation': :PriceDesignation,
    'tax_collection': :TaxCollection,
    'serial_number_required': :SerialNumberRequired,
    'is_transparency': :IsTransparency,
    'ioss_number': :IossNumber,
    'store_chain_store_id': :StoreChainStoreId,
    'deemed_reseller_category': :DeemedResellerCategory,
    'buyer_info': :BuyerInfo,
    'buyer_requested_cancel': :BuyerRequestedCancel,
    'item_approval_context': :ItemApprovalContext,
    'serial_numbers': :SerialNumbers
  }
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



366
367
368
# File 'lib/orders_api_model/models/order_item.rb', line 366

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



180
181
182
# File 'lib/orders_api_model/models/order_item.rb', line 180

def self.openapi_nullable
  Set.new([])
end

.openapi_typesObject

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
169
170
171
172
173
174
175
176
177
# File 'lib/orders_api_model/models/order_item.rb', line 138

def self.openapi_types
  {
    'asin': :Object,
    'seller_sku': :Object,
    'order_item_id': :Object,
    'title': :Object,
    'quantity_ordered': :Object,
    'quantity_shipped': :Object,
    'product_info': :Object,
    'points_granted': :Object,
    'item_price': :Object,
    'shipping_price': :Object,
    'item_tax': :Object,
    'shipping_tax': :Object,
    'shipping_discount': :Object,
    'shipping_discount_tax': :Object,
    'promotion_discount': :Object,
    'promotion_discount_tax': :Object,
    'promotion_ids': :Object,
    'cod_fee': :Object,
    'cod_fee_discount': :Object,
    'is_gift': :Object,
    'condition_note': :Object,
    'condition_id': :Object,
    'condition_subtype_id': :Object,
    'scheduled_delivery_start_date': :Object,
    'scheduled_delivery_end_date': :Object,
    'price_designation': :Object,
    'tax_collection': :Object,
    'serial_number_required': :Object,
    'is_transparency': :Object,
    'ioss_number': :Object,
    'store_chain_store_id': :Object,
    'deemed_reseller_category': :Object,
    'buyer_info': :Object,
    'buyer_requested_cancel': :Object,
    'item_approval_context': :Object,
    'serial_numbers': :Object
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/orders_api_model/models/order_item.rb', line 309

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    asin == other.asin &&
    seller_sku == other.seller_sku &&
    order_item_id == other.order_item_id &&
    title == other.title &&
    quantity_ordered == other.quantity_ordered &&
    quantity_shipped == other.quantity_shipped &&
    product_info == other.product_info &&
    points_granted == other.points_granted &&
    item_price == other.item_price &&
    shipping_price == other.shipping_price &&
    item_tax == other.item_tax &&
    shipping_tax == other.shipping_tax &&
    shipping_discount == other.shipping_discount &&
    shipping_discount_tax == other.shipping_discount_tax &&
    promotion_discount == other.promotion_discount &&
    promotion_discount_tax == other.promotion_discount_tax &&
    promotion_ids == other.promotion_ids &&
    cod_fee == other.cod_fee &&
    cod_fee_discount == other.cod_fee_discount &&
    is_gift == other.is_gift &&
    condition_note == other.condition_note &&
    condition_id == other.condition_id &&
    condition_subtype_id == other.condition_subtype_id &&
    scheduled_delivery_start_date == other.scheduled_delivery_start_date &&
    scheduled_delivery_end_date == other.scheduled_delivery_end_date &&
    price_designation == other.price_designation &&
    tax_collection == other.tax_collection &&
    serial_number_required == other.serial_number_required &&
    is_transparency == other.is_transparency &&
    ioss_number == other.ioss_number &&
    store_chain_store_id == other.store_chain_store_id &&
    deemed_reseller_category == other.deemed_reseller_category &&
    buyer_info == other.buyer_info &&
    buyer_requested_cancel == other.buyer_requested_cancel &&
    item_approval_context == other.item_approval_context &&
    serial_numbers == other.serial_numbers
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



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/orders_api_model/models/order_item.rb', line 395

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
    AmznSpApi::OrdersApiModel.const_get(type).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



464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/orders_api_model/models/order_item.rb', line 464

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



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/orders_api_model/models/order_item.rb', line 373

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array)
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      send("#{key}=", nil)
    end
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


353
354
355
# File 'lib/orders_api_model/models/order_item.rb', line 353

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



359
360
361
# File 'lib/orders_api_model/models/order_item.rb', line 359

def hash
  [asin, seller_sku, order_item_id, title, quantity_ordered, quantity_shipped, product_info, points_granted, item_price, shipping_price, item_tax, shipping_tax, shipping_discount, shipping_discount_tax, promotion_discount, promotion_discount_tax, promotion_ids, cod_fee, cod_fee_discount, is_gift, condition_note, condition_id, condition_subtype_id, scheduled_delivery_start_date, scheduled_delivery_end_date, price_designation, tax_collection, serial_number_required, is_transparency, ioss_number, store_chain_store_id, deemed_reseller_category, buyer_info, buyer_requested_cancel, item_approval_context, serial_numbers].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



274
275
276
277
278
279
280
281
282
283
# File 'lib/orders_api_model/models/order_item.rb', line 274

def list_invalid_properties
  invalid_properties = []
  invalid_properties.push('invalid value for "asin", asin cannot be nil.') if @asin.nil?

  invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') if @order_item_id.nil?

  invalid_properties.push('invalid value for "quantity_ordered", quantity_ordered cannot be nil.') if @quantity_ordered.nil?

  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



440
441
442
# File 'lib/orders_api_model/models/order_item.rb', line 440

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



446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/orders_api_model/models/order_item.rb', line 446

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = 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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



434
435
436
# File 'lib/orders_api_model/models/order_item.rb', line 434

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



287
288
289
290
291
292
293
294
295
296
# File 'lib/orders_api_model/models/order_item.rb', line 287

def valid?
  return false if @asin.nil?
  return false if @order_item_id.nil?
  return false if @quantity_ordered.nil?

  deemed_reseller_category_validator = EnumAttributeValidator.new('Object', %w[IOSS UOSS])
  return false unless deemed_reseller_category_validator.valid?(@deemed_reseller_category)

  true
end