Class: AmznSpApi::OrdersApiModel::Order

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

Overview

Order information.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Order

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Raises:

  • (ArgumentError)


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

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `AmznSpApi::OrdersApiModel::Order` 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::Order`. 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.amazon_order_id = attributes[:amazon_order_id] if attributes.key?(:amazon_order_id)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:item_approval_types) && (value = attributes[:item_approval_types]).is_a?(Array)
    self.item_approval_types = value
  end

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

  self.item_approval_status = value
end

Instance Attribute Details

#amazon_order_idObject

An Amazon-defined order identifier, in 3-7-7 format.



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

def amazon_order_id
  @amazon_order_id
end

#automated_shipping_settingsObject

Returns the value of attribute automated_shipping_settings.



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

def automated_shipping_settings
  @automated_shipping_settings
end

#buyer_infoObject

Returns the value of attribute buyer_info.



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

def buyer_info
  @buyer_info
end

#buyer_invoice_preferenceObject

The buyer’s invoicing preference. Available only in the TR marketplace.



108
109
110
# File 'lib/orders_api_model/models/order.rb', line 108

def buyer_invoice_preference
  @buyer_invoice_preference
end

#buyer_tax_informationObject

Returns the value of attribute buyer_tax_information.



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

def buyer_tax_information
  @buyer_tax_information
end

#cba_displayable_shipping_labelObject

Custom ship label for Checkout by Amazon (CBA).



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

def cba_displayable_shipping_label
  @cba_displayable_shipping_label
end

#default_ship_from_location_addressObject

Returns the value of attribute default_ship_from_location_address.



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

def default_ship_from_location_address
  @default_ship_from_location_address
end

#earliest_delivery_dateObject

The start of the time period within which you have committed to fulfill the order. In ISO 8601 date time format. Returned only for seller-fulfilled orders.



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

def earliest_delivery_date
  @earliest_delivery_date
end

#earliest_ship_dateObject

The start of the time period within which you have committed to ship the order. In ISO 8601 date time format. Returned only for seller-fulfilled orders. __Note__: EarliestShipDate might not be returned for orders placed before February 1, 2013.



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

def earliest_ship_date
  @earliest_ship_date
end

#easy_ship_shipment_statusObject

Returns the value of attribute easy_ship_shipment_status.



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

def easy_ship_shipment_status
  @easy_ship_shipment_status
end

#electronic_invoice_statusObject

Returns the value of attribute electronic_invoice_status.



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

def electronic_invoice_status
  @electronic_invoice_status
end

#fulfillment_channelObject

Whether the order was fulfilled by Amazon (AFN) or by the seller (MFN).



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

def fulfillment_channel
  @fulfillment_channel
end

#fulfillment_instructionObject

Returns the value of attribute fulfillment_instruction.



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

def fulfillment_instruction
  @fulfillment_instruction
end

#has_regulated_itemsObject

Whether the order contains regulated items which may require additional approval steps before being fulfilled.



120
121
122
# File 'lib/orders_api_model/models/order.rb', line 120

def has_regulated_items
  @has_regulated_items
end

#is_access_point_orderObject

When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers.



114
115
116
# File 'lib/orders_api_model/models/order.rb', line 114

def is_access_point_order
  @is_access_point_order
end

#is_business_orderObject

When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer.



78
79
80
# File 'lib/orders_api_model/models/order.rb', line 78

def is_business_order
  @is_business_order
end

#is_estimated_ship_date_setObject

When true, the estimated ship date is set for the order. Returned only for Sourcing on Demand orders.



99
100
101
# File 'lib/orders_api_model/models/order.rb', line 99

def is_estimated_ship_date_set
  @is_estimated_ship_date_set
end

#is_global_express_enabledObject

When true, the order is a GlobalExpress order.



87
88
89
# File 'lib/orders_api_model/models/order.rb', line 87

def is_global_express_enabled
  @is_global_express_enabled
end

#is_ibaObject

When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.



105
106
107
# File 'lib/orders_api_model/models/order.rb', line 105

def is_iba
  @is_iba
end

#is_ispuObject

When true, this order is marked to be picked up from a store rather than delivered.



111
112
113
# File 'lib/orders_api_model/models/order.rb', line 111

def is_ispu
  @is_ispu
end

#is_premium_orderObject

When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, see "Premium Shipping Options" in the Seller Central Help for your marketplace.



84
85
86
# File 'lib/orders_api_model/models/order.rb', line 84

def is_premium_order
  @is_premium_order
end

#is_primeObject

When true, the order is a seller-fulfilled Amazon Prime order.



81
82
83
# File 'lib/orders_api_model/models/order.rb', line 81

def is_prime
  @is_prime
end

#is_replacement_orderObject

When true, this is a replacement order.



93
94
95
# File 'lib/orders_api_model/models/order.rb', line 93

def is_replacement_order
  @is_replacement_order
end

#is_sold_by_abObject

When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.



102
103
104
# File 'lib/orders_api_model/models/order.rb', line 102

def is_sold_by_ab
  @is_sold_by_ab
end

#item_approval_statusObject

Subset of all ItemApprovalStatus that are set in at least one of the order items subject to approvals.



126
127
128
# File 'lib/orders_api_model/models/order.rb', line 126

def item_approval_status
  @item_approval_status
end

#item_approval_typesObject

Set of approval types which applies to at least one order item in the order.



123
124
125
# File 'lib/orders_api_model/models/order.rb', line 123

def item_approval_types
  @item_approval_types
end

#last_update_dateObject

The date when the order was last updated. __Note__: LastUpdateDate is returned with an incorrect date for orders that were last updated before 2009-04-01.



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

def last_update_date
  @last_update_date
end

#latest_delivery_dateObject

The end of the time period within which you have committed to fulfill the order. In ISO 8601 date time format. Returned only for seller-fulfilled orders that do not have a PendingAvailability, Pending, or Canceled status.



75
76
77
# File 'lib/orders_api_model/models/order.rb', line 75

def latest_delivery_date
  @latest_delivery_date
end

#latest_ship_dateObject

The end of the time period within which you have committed to ship the order. In ISO 8601 date time format. Returned only for seller-fulfilled orders. __Note__: LatestShipDate might not be returned for orders placed before February 1, 2013.



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

def latest_ship_date
  @latest_ship_date
end

#marketplace_idObject

The identifier for the marketplace where the order was placed.



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

def marketplace_id
  @marketplace_id
end

#marketplace_tax_infoObject

Returns the value of attribute marketplace_tax_info.



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

def marketplace_tax_info
  @marketplace_tax_info
end

#number_of_items_shippedObject

The number of items shipped.



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

def number_of_items_shipped
  @number_of_items_shipped
end

#number_of_items_unshippedObject

The number of items unshipped.



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

def number_of_items_unshipped
  @number_of_items_unshipped
end

#order_channelObject

The order channel of the first item in the order.



37
38
39
# File 'lib/orders_api_model/models/order.rb', line 37

def order_channel
  @order_channel
end

#order_statusObject

The current order status.



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

def order_status
  @order_status
end

#order_totalObject

Returns the value of attribute order_total.



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

def order_total
  @order_total
end

#order_typeObject

The type of the order.



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

def order_type
  @order_type
end

#payment_execution_detailObject

Returns the value of attribute payment_execution_detail.



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

def payment_execution_detail
  @payment_execution_detail
end

#payment_methodObject

The payment method for the order. This property is limited to Cash On Delivery (COD) and Convenience Store (CVS) payment methods. Unless you need the specific COD payment information provided by the PaymentExecutionDetailItem object, we recommend using the PaymentMethodDetails property to get payment method information.



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

def payment_method
  @payment_method
end

#payment_method_detailsObject

Returns the value of attribute payment_method_details.



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

def payment_method_details
  @payment_method_details
end

#promise_response_due_dateObject

Indicates the date by which the seller must respond to the buyer with an estimated ship date. Returned only for Sourcing on Demand orders.



96
97
98
# File 'lib/orders_api_model/models/order.rb', line 96

def promise_response_due_date
  @promise_response_due_date
end

#purchase_dateObject

The date when the order was created.



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

def purchase_date
  @purchase_date
end

#replaced_order_idObject

The order ID value for the order that is being replaced. Returned only if IsReplacementOrder = true.



90
91
92
# File 'lib/orders_api_model/models/order.rb', line 90

def replaced_order_id
  @replaced_order_id
end

#sales_channelObject

The sales channel of the first item in the order.



34
35
36
# File 'lib/orders_api_model/models/order.rb', line 34

def sales_channel
  @sales_channel
end

#seller_display_nameObject

The seller’s friendly name registered in the marketplace.



117
118
119
# File 'lib/orders_api_model/models/order.rb', line 117

def seller_display_name
  @seller_display_name
end

#seller_order_idObject

A seller-defined order identifier.



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

def seller_order_id
  @seller_order_id
end

#ship_service_levelObject

The shipment service level of the order.



40
41
42
# File 'lib/orders_api_model/models/order.rb', line 40

def ship_service_level
  @ship_service_level
end

#shipment_service_level_categoryObject

The shipment service level category of the order. Possible values: Expedited, FreeEconomy, NextDay, SameDay, SecondDay, Scheduled, Standard.



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

def shipment_service_level_category
  @shipment_service_level_category
end

#shipping_addressObject

Returns the value of attribute shipping_address.



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

def shipping_address
  @shipping_address
end

Class Method Details

.attribute_mapObject

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



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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/orders_api_model/models/order.rb', line 150

def self.attribute_map
  {
    'amazon_order_id': :AmazonOrderId,
    'seller_order_id': :SellerOrderId,
    'purchase_date': :PurchaseDate,
    'last_update_date': :LastUpdateDate,
    'order_status': :OrderStatus,
    'fulfillment_channel': :FulfillmentChannel,
    'sales_channel': :SalesChannel,
    'order_channel': :OrderChannel,
    'ship_service_level': :ShipServiceLevel,
    'order_total': :OrderTotal,
    'number_of_items_shipped': :NumberOfItemsShipped,
    'number_of_items_unshipped': :NumberOfItemsUnshipped,
    'payment_execution_detail': :PaymentExecutionDetail,
    'payment_method': :PaymentMethod,
    'payment_method_details': :PaymentMethodDetails,
    'marketplace_id': :MarketplaceId,
    'shipment_service_level_category': :ShipmentServiceLevelCategory,
    'easy_ship_shipment_status': :EasyShipShipmentStatus,
    'cba_displayable_shipping_label': :CbaDisplayableShippingLabel,
    'order_type': :OrderType,
    'earliest_ship_date': :EarliestShipDate,
    'latest_ship_date': :LatestShipDate,
    'earliest_delivery_date': :EarliestDeliveryDate,
    'latest_delivery_date': :LatestDeliveryDate,
    'is_business_order': :IsBusinessOrder,
    'is_prime': :IsPrime,
    'is_premium_order': :IsPremiumOrder,
    'is_global_express_enabled': :IsGlobalExpressEnabled,
    'replaced_order_id': :ReplacedOrderId,
    'is_replacement_order': :IsReplacementOrder,
    'promise_response_due_date': :PromiseResponseDueDate,
    'is_estimated_ship_date_set': :IsEstimatedShipDateSet,
    'is_sold_by_ab': :IsSoldByAB,
    'is_iba': :IsIBA,
    'default_ship_from_location_address': :DefaultShipFromLocationAddress,
    'buyer_invoice_preference': :BuyerInvoicePreference,
    'buyer_tax_information': :BuyerTaxInformation,
    'fulfillment_instruction': :FulfillmentInstruction,
    'is_ispu': :IsISPU,
    'is_access_point_order': :IsAccessPointOrder,
    'marketplace_tax_info': :MarketplaceTaxInfo,
    'seller_display_name': :SellerDisplayName,
    'shipping_address': :ShippingAddress,
    'buyer_info': :BuyerInfo,
    'automated_shipping_settings': :AutomatedShippingSettings,
    'has_regulated_items': :HasRegulatedItems,
    'electronic_invoice_status': :ElectronicInvoiceStatus,
    'item_approval_types': :ItemApprovalTypes,
    'item_approval_status': :ItemApprovalStatus
  }
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



538
539
540
# File 'lib/orders_api_model/models/order.rb', line 538

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

.openapi_nullableObject

List of attributes with nullable: true



260
261
262
# File 'lib/orders_api_model/models/order.rb', line 260

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    'amazon_order_id': :Object,
    'seller_order_id': :Object,
    'purchase_date': :Object,
    'last_update_date': :Object,
    'order_status': :Object,
    'fulfillment_channel': :Object,
    'sales_channel': :Object,
    'order_channel': :Object,
    'ship_service_level': :Object,
    'order_total': :Object,
    'number_of_items_shipped': :Object,
    'number_of_items_unshipped': :Object,
    'payment_execution_detail': :Object,
    'payment_method': :Object,
    'payment_method_details': :Object,
    'marketplace_id': :Object,
    'shipment_service_level_category': :Object,
    'easy_ship_shipment_status': :Object,
    'cba_displayable_shipping_label': :Object,
    'order_type': :Object,
    'earliest_ship_date': :Object,
    'latest_ship_date': :Object,
    'earliest_delivery_date': :Object,
    'latest_delivery_date': :Object,
    'is_business_order': :Object,
    'is_prime': :Object,
    'is_premium_order': :Object,
    'is_global_express_enabled': :Object,
    'replaced_order_id': :Object,
    'is_replacement_order': :Object,
    'promise_response_due_date': :Object,
    'is_estimated_ship_date_set': :Object,
    'is_sold_by_ab': :Object,
    'is_iba': :Object,
    'default_ship_from_location_address': :Object,
    'buyer_invoice_preference': :Object,
    'buyer_tax_information': :Object,
    'fulfillment_instruction': :Object,
    'is_ispu': :Object,
    'is_access_point_order': :Object,
    'marketplace_tax_info': :Object,
    'seller_display_name': :Object,
    'shipping_address': :Object,
    'buyer_info': :Object,
    'automated_shipping_settings': :Object,
    'has_regulated_items': :Object,
    'electronic_invoice_status': :Object,
    'item_approval_types': :Object,
    'item_approval_status': :Object
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



468
469
470
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
519
520
521
# File 'lib/orders_api_model/models/order.rb', line 468

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

  self.class == other.class &&
    amazon_order_id == other.amazon_order_id &&
    seller_order_id == other.seller_order_id &&
    purchase_date == other.purchase_date &&
    last_update_date == other.last_update_date &&
    order_status == other.order_status &&
    fulfillment_channel == other.fulfillment_channel &&
    sales_channel == other.sales_channel &&
    order_channel == other.order_channel &&
    ship_service_level == other.ship_service_level &&
    order_total == other.order_total &&
    number_of_items_shipped == other.number_of_items_shipped &&
    number_of_items_unshipped == other.number_of_items_unshipped &&
    payment_execution_detail == other.payment_execution_detail &&
    payment_method == other.payment_method &&
    payment_method_details == other.payment_method_details &&
    marketplace_id == other.marketplace_id &&
    shipment_service_level_category == other.shipment_service_level_category &&
    easy_ship_shipment_status == other.easy_ship_shipment_status &&
    cba_displayable_shipping_label == other.cba_displayable_shipping_label &&
    order_type == other.order_type &&
    earliest_ship_date == other.earliest_ship_date &&
    latest_ship_date == other.latest_ship_date &&
    earliest_delivery_date == other.earliest_delivery_date &&
    latest_delivery_date == other.latest_delivery_date &&
    is_business_order == other.is_business_order &&
    is_prime == other.is_prime &&
    is_premium_order == other.is_premium_order &&
    is_global_express_enabled == other.is_global_express_enabled &&
    replaced_order_id == other.replaced_order_id &&
    is_replacement_order == other.is_replacement_order &&
    promise_response_due_date == other.promise_response_due_date &&
    is_estimated_ship_date_set == other.is_estimated_ship_date_set &&
    is_sold_by_ab == other.is_sold_by_ab &&
    is_iba == other.is_iba &&
    default_ship_from_location_address == other.default_ship_from_location_address &&
    buyer_invoice_preference == other.buyer_invoice_preference &&
    buyer_tax_information == other.buyer_tax_information &&
    fulfillment_instruction == other.fulfillment_instruction &&
    is_ispu == other.is_ispu &&
    is_access_point_order == other.is_access_point_order &&
    marketplace_tax_info == other.marketplace_tax_info &&
    seller_display_name == other.seller_display_name &&
    shipping_address == other.shipping_address &&
    buyer_info == other.buyer_info &&
    automated_shipping_settings == other.automated_shipping_settings &&
    has_regulated_items == other.has_regulated_items &&
    electronic_invoice_status == other.electronic_invoice_status &&
    item_approval_types == other.item_approval_types &&
    item_approval_status == other.item_approval_status
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



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
593
594
595
596
597
598
599
600
601
602
# File 'lib/orders_api_model/models/order.rb', line 567

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



636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/orders_api_model/models/order.rb', line 636

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



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/orders_api_model/models/order.rb', line 545

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


525
526
527
# File 'lib/orders_api_model/models/order.rb', line 525

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



531
532
533
# File 'lib/orders_api_model/models/order.rb', line 531

def hash
  [amazon_order_id, seller_order_id, purchase_date, last_update_date, order_status, fulfillment_channel, sales_channel, order_channel, ship_service_level, order_total, number_of_items_shipped, number_of_items_unshipped, payment_execution_detail, payment_method, payment_method_details, marketplace_id, shipment_service_level_category, easy_ship_shipment_status, cba_displayable_shipping_label, order_type, earliest_ship_date, latest_ship_date, earliest_delivery_date, latest_delivery_date, is_business_order, is_prime, is_premium_order, is_global_express_enabled, replaced_order_id, is_replacement_order, promise_response_due_date, is_estimated_ship_date_set, is_sold_by_ab, is_iba, default_ship_from_location_address, buyer_invoice_preference, buyer_tax_information, fulfillment_instruction, is_ispu, is_access_point_order, marketplace_tax_info, seller_display_name, shipping_address, buyer_info, automated_shipping_settings, has_regulated_items, electronic_invoice_status, item_approval_types, item_approval_status].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/orders_api_model/models/order.rb', line 382

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

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

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

  invalid_properties.push('invalid value for "order_status", order_status cannot be nil.') if @order_status.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



612
613
614
# File 'lib/orders_api_model/models/order.rb', line 612

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



618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/orders_api_model/models/order.rb', line 618

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



606
607
608
# File 'lib/orders_api_model/models/order.rb', line 606

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



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/orders_api_model/models/order.rb', line 397

def valid?
  return false if @amazon_order_id.nil?
  return false if @purchase_date.nil?
  return false if @last_update_date.nil?
  return false if @order_status.nil?

  order_status_validator = EnumAttributeValidator.new('Object', %w[Pending Unshipped PartiallyShipped Shipped Canceled Unfulfillable InvoiceUnconfirmed PendingAvailability])
  return false unless order_status_validator.valid?(@order_status)

  fulfillment_channel_validator = EnumAttributeValidator.new('Object', %w[MFN AFN])
  return false unless fulfillment_channel_validator.valid?(@fulfillment_channel)

  payment_method_validator = EnumAttributeValidator.new('Object', %w[COD CVS Other])
  return false unless payment_method_validator.valid?(@payment_method)

  order_type_validator = EnumAttributeValidator.new('Object', %w[StandardOrder LongLeadTimeOrder Preorder BackOrder SourcingOnDemandOrder])
  return false unless order_type_validator.valid?(@order_type)

  buyer_invoice_preference_validator = EnumAttributeValidator.new('Object', %w[INDIVIDUAL BUSINESS])
  return false unless buyer_invoice_preference_validator.valid?(@buyer_invoice_preference)

  true
end