Class: WalmartApIs::ListingOffersRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::ListingOffersRequest
- Defined in:
- lib/walmart_ap_is/models/listing_offers_request.rb
Overview
List of request parameters accepted by the getListingOffers operation.
Instance Attribute Summary collapse
-
#customer_type ⇒ CustomerType
Indicates whether to request Consumer or Business offers.
-
#headers ⇒ Object
A mapping of additional HTTP headers to send for the individual batch request.
-
#item_condition ⇒ ConditionType2
Indicates the condition of the item.
-
#marketplace_id ⇒ String
A marketplace identifier.
-
#method ⇒ HttpMethod
The HTTP method associated with the individual APIs being called as part of the batch request.
-
#seller_sku ⇒ String
The seller stock keeping unit (SKU) of the item.
-
#uri ⇒ String
The resource path of the operation being called in batch, without query parameters.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(uri:, method:, marketplace_id:, item_condition:, seller_sku:, headers: SKIP, customer_type: SKIP, additional_properties: nil) ⇒ ListingOffersRequest
constructor
A new instance of ListingOffersRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(uri:, method:, marketplace_id:, item_condition:, seller_sku:, headers: SKIP, customer_type: SKIP, additional_properties: nil) ⇒ ListingOffersRequest
Returns a new instance of ListingOffersRequest.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 71 def initialize(uri:, method:, marketplace_id:, item_condition:, seller_sku:, headers: SKIP, customer_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @uri = uri @method = method @headers = headers unless headers == SKIP @marketplace_id = marketplace_id @item_condition = item_condition @customer_type = customer_type unless customer_type == SKIP @seller_sku = seller_sku @additional_properties = additional_properties end |
Instance Attribute Details
#customer_type ⇒ CustomerType
Indicates whether to request Consumer or Business offers. Default is Consumer.
39 40 41 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 39 def customer_type @customer_type end |
#headers ⇒ Object
A mapping of additional HTTP headers to send for the individual batch request.
25 26 27 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 25 def headers @headers end |
#item_condition ⇒ ConditionType2
Indicates the condition of the item. Possible values: New, Used, Collectible, Refurbished, Club.
34 35 36 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 34 def item_condition @item_condition end |
#marketplace_id ⇒ String
A marketplace identifier.
29 30 31 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 29 def marketplace_id @marketplace_id end |
#method ⇒ HttpMethod
The HTTP method associated with the individual APIs being called as part of the batch request.
20 21 22 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 20 def method @method end |
#seller_sku ⇒ String
The seller stock keeping unit (SKU) of the item.
43 44 45 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 43 def seller_sku @seller_sku end |
#uri ⇒ String
The resource path of the operation being called in batch, without query parameters.
15 16 17 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 15 def uri @uri end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. uri = hash.key?('uri') ? hash['uri'] : nil method = hash.key?('method') ? hash['method'] : nil marketplace_id = hash.key?('MarketplaceId') ? hash['MarketplaceId'] : nil item_condition = hash.key?('ItemCondition') ? hash['ItemCondition'] : nil seller_sku = hash.key?('SellerSKU') ? hash['SellerSKU'] : nil headers = hash.key?('headers') ? hash['headers'] : SKIP customer_type = hash.key?('CustomerType') ? hash['CustomerType'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ListingOffersRequest.new(uri: uri, method: method, marketplace_id: marketplace_id, item_condition: item_condition, seller_sku: seller_sku, headers: headers, customer_type: customer_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['uri'] = 'uri' @_hash['method'] = 'method' @_hash['headers'] = 'headers' @_hash['marketplace_id'] = 'MarketplaceId' @_hash['item_condition'] = 'ItemCondition' @_hash['customer_type'] = 'CustomerType' @_hash['seller_sku'] = 'SellerSKU' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 59 def self.optionals %w[ headers customer_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} uri: #{@uri.inspect}, method: #{@method.inspect}, headers:"\ " #{@headers.inspect}, marketplace_id: #{@marketplace_id.inspect}, item_condition:"\ " #{@item_condition.inspect}, customer_type: #{@customer_type.inspect}, seller_sku:"\ " #{@seller_sku.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/walmart_ap_is/models/listing_offers_request.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} uri: #{@uri}, method: #{@method}, headers: #{@headers}, marketplace_id:"\ " #{@marketplace_id}, item_condition: #{@item_condition}, customer_type: #{@customer_type},"\ " seller_sku: #{@seller_sku}, additional_properties: #{@additional_properties}>" end |