Class: AmzSpApi::OrdersApiModel::OrderItem
- Inherits:
-
Object
- Object
- AmzSpApi::OrdersApiModel::OrderItem
- Defined in:
- lib/orders-api-model/models/order_item.rb
Overview
A single order item.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#asin ⇒ Object
The Amazon Standard Identification Number (ASIN) of the item.
-
#buyer_info ⇒ Object
Returns the value of attribute buyer_info.
-
#buyer_requested_cancel ⇒ Object
Returns the value of attribute buyer_requested_cancel.
-
#cod_fee ⇒ Object
Returns the value of attribute cod_fee.
-
#cod_fee_discount ⇒ Object
Returns the value of attribute cod_fee_discount.
-
#condition_id ⇒ Object
The condition of the item.
-
#condition_note ⇒ Object
The condition of the item as described by the seller.
-
#condition_subtype_id ⇒ Object
The subcondition of the item.
-
#deemed_reseller_category ⇒ Object
The category of deemed reseller.
-
#ioss_number ⇒ Object
The IOSS number for the marketplace.
-
#is_gift ⇒ Object
When true, the item is a gift.
-
#is_transparency ⇒ Object
When true, transparency codes are required.
-
#item_price ⇒ Object
Returns the value of attribute item_price.
-
#item_tax ⇒ Object
Returns the value of attribute item_tax.
-
#order_item_id ⇒ Object
An Amazon-defined order item identifier.
-
#points_granted ⇒ Object
Returns the value of attribute points_granted.
-
#price_designation ⇒ Object
Indicates that the selling price is a special price that is available only for Amazon Business orders.
-
#product_info ⇒ Object
Returns the value of attribute product_info.
-
#promotion_discount ⇒ Object
Returns the value of attribute promotion_discount.
-
#promotion_discount_tax ⇒ Object
Returns the value of attribute promotion_discount_tax.
-
#promotion_ids ⇒ Object
Returns the value of attribute promotion_ids.
-
#quantity_ordered ⇒ Object
The number of items in the order.
-
#quantity_shipped ⇒ Object
The number of items shipped.
-
#scheduled_delivery_end_date ⇒ Object
The end date of the scheduled delivery window in the time zone of the order destination.
-
#scheduled_delivery_start_date ⇒ Object
The start date of the scheduled delivery window in the time zone of the order destination.
-
#seller_sku ⇒ Object
The seller stock keeping unit (SKU) of the item.
-
#serial_number_required ⇒ Object
When true, the product type for this item has a serial number.
-
#shipping_discount ⇒ Object
Returns the value of attribute shipping_discount.
-
#shipping_discount_tax ⇒ Object
Returns the value of attribute shipping_discount_tax.
-
#shipping_price ⇒ Object
Returns the value of attribute shipping_price.
-
#shipping_tax ⇒ Object
Returns the value of attribute shipping_tax.
-
#store_chain_store_id ⇒ Object
The store chain store identifier.
-
#tax_collection ⇒ Object
Returns the value of attribute tax_collection.
-
#title ⇒ Object
The name of the item.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OrderItem
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 = {}) ⇒ OrderItem
Initializes the object
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/orders-api-model/models/order_item.rb', line 213 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `AmzSpApi::OrdersApiModel::OrderItem` 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 `AmzSpApi::OrdersApiModel::OrderItem`. 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?(:'asin') self.asin = attributes[:'asin'] end if attributes.key?(:'seller_sku') self.seller_sku = attributes[:'seller_sku'] end if attributes.key?(:'order_item_id') self.order_item_id = attributes[:'order_item_id'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'quantity_ordered') self.quantity_ordered = attributes[:'quantity_ordered'] end if attributes.key?(:'quantity_shipped') self.quantity_shipped = attributes[:'quantity_shipped'] end if attributes.key?(:'product_info') self.product_info = attributes[:'product_info'] end if attributes.key?(:'points_granted') self.points_granted = attributes[:'points_granted'] end if attributes.key?(:'item_price') self.item_price = attributes[:'item_price'] end if attributes.key?(:'shipping_price') self.shipping_price = attributes[:'shipping_price'] end if attributes.key?(:'item_tax') self.item_tax = attributes[:'item_tax'] end if attributes.key?(:'shipping_tax') self.shipping_tax = attributes[:'shipping_tax'] end if attributes.key?(:'shipping_discount') self.shipping_discount = attributes[:'shipping_discount'] end if attributes.key?(:'shipping_discount_tax') self.shipping_discount_tax = attributes[:'shipping_discount_tax'] end if attributes.key?(:'promotion_discount') self.promotion_discount = attributes[:'promotion_discount'] end if attributes.key?(:'promotion_discount_tax') self.promotion_discount_tax = attributes[:'promotion_discount_tax'] end if attributes.key?(:'promotion_ids') self.promotion_ids = attributes[:'promotion_ids'] end if attributes.key?(:'cod_fee') self.cod_fee = attributes[:'cod_fee'] end if attributes.key?(:'cod_fee_discount') self.cod_fee_discount = attributes[:'cod_fee_discount'] end if attributes.key?(:'is_gift') self.is_gift = attributes[:'is_gift'] end if attributes.key?(:'condition_note') self.condition_note = attributes[:'condition_note'] end if attributes.key?(:'condition_id') self.condition_id = attributes[:'condition_id'] end if attributes.key?(:'condition_subtype_id') self.condition_subtype_id = attributes[:'condition_subtype_id'] end if attributes.key?(:'scheduled_delivery_start_date') self.scheduled_delivery_start_date = attributes[:'scheduled_delivery_start_date'] end if attributes.key?(:'scheduled_delivery_end_date') self.scheduled_delivery_end_date = attributes[:'scheduled_delivery_end_date'] end if attributes.key?(:'price_designation') self.price_designation = attributes[:'price_designation'] end if attributes.key?(:'tax_collection') self.tax_collection = attributes[:'tax_collection'] end if attributes.key?(:'serial_number_required') self.serial_number_required = attributes[:'serial_number_required'] end if attributes.key?(:'is_transparency') self.is_transparency = attributes[:'is_transparency'] end if attributes.key?(:'ioss_number') self.ioss_number = attributes[:'ioss_number'] end if attributes.key?(:'store_chain_store_id') self.store_chain_store_id = attributes[:'store_chain_store_id'] end if attributes.key?(:'deemed_reseller_category') self.deemed_reseller_category = attributes[:'deemed_reseller_category'] end if attributes.key?(:'buyer_info') self.buyer_info = attributes[:'buyer_info'] end if attributes.key?(:'buyer_requested_cancel') self.buyer_requested_cancel = attributes[:'buyer_requested_cancel'] end end |
Instance Attribute Details
#asin ⇒ Object
The Amazon Standard Identification Number (ASIN) of the item.
18 19 20 |
# File 'lib/orders-api-model/models/order_item.rb', line 18 def asin @asin end |
#buyer_info ⇒ Object
Returns the value of attribute buyer_info.
99 100 101 |
# File 'lib/orders-api-model/models/order_item.rb', line 99 def buyer_info @buyer_info end |
#buyer_requested_cancel ⇒ Object
Returns the value of attribute buyer_requested_cancel.
101 102 103 |
# File 'lib/orders-api-model/models/order_item.rb', line 101 def buyer_requested_cancel @buyer_requested_cancel end |
#cod_fee ⇒ Object
Returns the value of attribute cod_fee.
57 58 59 |
# File 'lib/orders-api-model/models/order_item.rb', line 57 def cod_fee @cod_fee end |
#cod_fee_discount ⇒ Object
Returns the value of attribute cod_fee_discount.
59 60 61 |
# File 'lib/orders-api-model/models/order_item.rb', line 59 def cod_fee_discount @cod_fee_discount end |
#condition_id ⇒ Object
The condition of the item. Possible values: New, Used, Collectible, Refurbished, Preorder, Club.
68 69 70 |
# File 'lib/orders-api-model/models/order_item.rb', line 68 def condition_id @condition_id end |
#condition_note ⇒ Object
The condition of the item as described by the seller.
65 66 67 |
# File 'lib/orders-api-model/models/order_item.rb', line 65 def condition_note @condition_note end |
#condition_subtype_id ⇒ Object
The subcondition of the item. Possible values: New, Mint, Very Good, Good, Acceptable, Poor, Club, OEM, Warranty, Refurbished Warranty, Refurbished, Open Box, Any, Other.
71 72 73 |
# File 'lib/orders-api-model/models/order_item.rb', line 71 def condition_subtype_id @condition_subtype_id end |
#deemed_reseller_category ⇒ Object
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.
97 98 99 |
# File 'lib/orders-api-model/models/order_item.rb', line 97 def deemed_reseller_category @deemed_reseller_category end |
#ioss_number ⇒ Object
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.
91 92 93 |
# File 'lib/orders-api-model/models/order_item.rb', line 91 def ioss_number @ioss_number end |
#is_gift ⇒ Object
When true, the item is a gift.
62 63 64 |
# File 'lib/orders-api-model/models/order_item.rb', line 62 def is_gift @is_gift end |
#is_transparency ⇒ Object
When true, transparency codes are required.
88 89 90 |
# File 'lib/orders-api-model/models/order_item.rb', line 88 def is_transparency @is_transparency end |
#item_price ⇒ Object
Returns the value of attribute item_price.
39 40 41 |
# File 'lib/orders-api-model/models/order_item.rb', line 39 def item_price @item_price end |
#item_tax ⇒ Object
Returns the value of attribute item_tax.
43 44 45 |
# File 'lib/orders-api-model/models/order_item.rb', line 43 def item_tax @item_tax end |
#order_item_id ⇒ Object
An Amazon-defined order item identifier.
24 25 26 |
# File 'lib/orders-api-model/models/order_item.rb', line 24 def order_item_id @order_item_id end |
#points_granted ⇒ Object
Returns the value of attribute points_granted.
37 38 39 |
# File 'lib/orders-api-model/models/order_item.rb', line 37 def points_granted @points_granted end |
#price_designation ⇒ Object
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.
80 81 82 |
# File 'lib/orders-api-model/models/order_item.rb', line 80 def price_designation @price_designation end |
#product_info ⇒ Object
Returns the value of attribute product_info.
35 36 37 |
# File 'lib/orders-api-model/models/order_item.rb', line 35 def product_info @product_info end |
#promotion_discount ⇒ Object
Returns the value of attribute promotion_discount.
51 52 53 |
# File 'lib/orders-api-model/models/order_item.rb', line 51 def promotion_discount @promotion_discount end |
#promotion_discount_tax ⇒ Object
Returns the value of attribute promotion_discount_tax.
53 54 55 |
# File 'lib/orders-api-model/models/order_item.rb', line 53 def promotion_discount_tax @promotion_discount_tax end |
#promotion_ids ⇒ Object
Returns the value of attribute promotion_ids.
55 56 57 |
# File 'lib/orders-api-model/models/order_item.rb', line 55 def promotion_ids @promotion_ids end |
#quantity_ordered ⇒ Object
The number of items in the order.
30 31 32 |
# File 'lib/orders-api-model/models/order_item.rb', line 30 def quantity_ordered @quantity_ordered end |
#quantity_shipped ⇒ Object
The number of items shipped.
33 34 35 |
# File 'lib/orders-api-model/models/order_item.rb', line 33 def quantity_shipped @quantity_shipped end |
#scheduled_delivery_end_date ⇒ Object
The end date of the scheduled delivery window in the time zone of the order destination. In ISO 8601 date time format.
77 78 79 |
# File 'lib/orders-api-model/models/order_item.rb', line 77 def scheduled_delivery_end_date @scheduled_delivery_end_date end |
#scheduled_delivery_start_date ⇒ Object
The start date of the scheduled delivery window in the time zone of the order destination. In ISO 8601 date time format.
74 75 76 |
# File 'lib/orders-api-model/models/order_item.rb', line 74 def scheduled_delivery_start_date @scheduled_delivery_start_date end |
#seller_sku ⇒ Object
The seller stock keeping unit (SKU) of the item.
21 22 23 |
# File 'lib/orders-api-model/models/order_item.rb', line 21 def seller_sku @seller_sku end |
#serial_number_required ⇒ Object
When true, the product type for this item has a serial number. Returned only for Amazon Easy Ship orders.
85 86 87 |
# File 'lib/orders-api-model/models/order_item.rb', line 85 def serial_number_required @serial_number_required end |
#shipping_discount ⇒ Object
Returns the value of attribute shipping_discount.
47 48 49 |
# File 'lib/orders-api-model/models/order_item.rb', line 47 def shipping_discount @shipping_discount end |
#shipping_discount_tax ⇒ Object
Returns the value of attribute shipping_discount_tax.
49 50 51 |
# File 'lib/orders-api-model/models/order_item.rb', line 49 def shipping_discount_tax @shipping_discount_tax end |
#shipping_price ⇒ Object
Returns the value of attribute shipping_price.
41 42 43 |
# File 'lib/orders-api-model/models/order_item.rb', line 41 def shipping_price @shipping_price end |
#shipping_tax ⇒ Object
Returns the value of attribute shipping_tax.
45 46 47 |
# File 'lib/orders-api-model/models/order_item.rb', line 45 def shipping_tax @shipping_tax end |
#store_chain_store_id ⇒ Object
The store chain store identifier. Linked to a specific store in a store chain.
94 95 96 |
# File 'lib/orders-api-model/models/order_item.rb', line 94 def store_chain_store_id @store_chain_store_id end |
#tax_collection ⇒ Object
Returns the value of attribute tax_collection.
82 83 84 |
# File 'lib/orders-api-model/models/order_item.rb', line 82 def tax_collection @tax_collection end |
#title ⇒ Object
The name of the item.
27 28 29 |
# File 'lib/orders-api-model/models/order_item.rb', line 27 def title @title end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
126 127 128 129 130 131 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 |
# File 'lib/orders-api-model/models/order_item.rb', line 126 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' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
459 460 461 |
# File 'lib/orders-api-model/models/order_item.rb', line 459 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
206 207 208 209 |
# File 'lib/orders-api-model/models/order_item.rb', line 206 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 203 |
# File 'lib/orders-api-model/models/order_item.rb', line 166 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' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/orders-api-model/models/order_item.rb', line 405 def ==(o) return true if self.equal?(o) self.class == o.class && asin == o.asin && seller_sku == o.seller_sku && order_item_id == o.order_item_id && title == o.title && quantity_ordered == o.quantity_ordered && quantity_shipped == o.quantity_shipped && product_info == o.product_info && points_granted == o.points_granted && item_price == o.item_price && shipping_price == o.shipping_price && item_tax == o.item_tax && shipping_tax == o.shipping_tax && shipping_discount == o.shipping_discount && shipping_discount_tax == o.shipping_discount_tax && promotion_discount == o.promotion_discount && promotion_discount_tax == o.promotion_discount_tax && promotion_ids == o.promotion_ids && cod_fee == o.cod_fee && cod_fee_discount == o.cod_fee_discount && is_gift == o.is_gift && condition_note == o.condition_note && condition_id == o.condition_id && condition_subtype_id == o.condition_subtype_id && scheduled_delivery_start_date == o.scheduled_delivery_start_date && scheduled_delivery_end_date == o.scheduled_delivery_end_date && price_designation == o.price_designation && tax_collection == o.tax_collection && serial_number_required == o.serial_number_required && is_transparency == o.is_transparency && ioss_number == o.ioss_number && store_chain_store_id == o.store_chain_store_id && deemed_reseller_category == o.deemed_reseller_category && buyer_info == o.buyer_info && buyer_requested_cancel == o.buyer_requested_cancel end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 522 523 524 |
# File 'lib/orders-api-model/models/order_item.rb', line 489 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 AmzSpApi::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
558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/orders-api-model/models/order_item.rb', line 558 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
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/orders-api-model/models/order_item.rb', line 466 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 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]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) end end self end |
#eql?(o) ⇒ Boolean
446 447 448 |
# File 'lib/orders-api-model/models/order_item.rb', line 446 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
452 453 454 |
# File 'lib/orders-api-model/models/order_item.rb', line 452 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].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/orders-api-model/models/order_item.rb', line 365 def list_invalid_properties invalid_properties = Array.new if @asin.nil? invalid_properties.push('invalid value for "asin", asin cannot be nil.') end if @order_item_id.nil? invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') end if @quantity_ordered.nil? invalid_properties.push('invalid value for "quantity_ordered", quantity_ordered cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
534 535 536 |
# File 'lib/orders-api-model/models/order_item.rb', line 534 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/orders-api-model/models/order_item.rb', line 540 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
528 529 530 |
# File 'lib/orders-api-model/models/order_item.rb', line 528 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
384 385 386 387 388 389 390 391 |
# File 'lib/orders-api-model/models/order_item.rb', line 384 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', ['IOSS', 'UOSS']) return false unless deemed_reseller_category_validator.valid?(@deemed_reseller_category) true end |