Class: WalmartApIs::InventoryApi
- Defined in:
- lib/walmart_ap_is/apis/inventory_api.rb
Overview
InventoryApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#bulk_update_inventory(body) ⇒ ApiResponse
Bulk inventory update.
-
#get_inventory_for_sku(sku, ship_node: nil) ⇒ ApiResponse
TODO: type endpoint description here multi-node sellers).
-
#get_inventory_summaries(skus: nil, ship_node: nil, fulfillment_type: nil, page_size: 100, next_token: nil) ⇒ ApiResponse
TODO: type endpoint description here 50) multi-node sellers) fulfillment type here.
-
#update_inventory_for_sku(sku, body) ⇒ ApiResponse
TODO: type endpoint description here description here.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from WalmartApIs::BaseApi
Instance Method Details
#bulk_update_inventory(body) ⇒ ApiResponse
Bulk inventory update. Max 500 items per request. description here
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 |
# File 'lib/walmart_ap_is/apis/inventory_api.rb', line 140 def bulk_update_inventory(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/inventory/v4/items/bulk', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(BulkUpdateInventoryResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_inventory_for_sku(sku, ship_node: nil) ⇒ ApiResponse
TODO: type endpoint description here multi-node sellers)
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/walmart_ap_is/apis/inventory_api.rb', line 60 def get_inventory_for_sku(sku, ship_node: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/inventory/v4/items/{sku}', Server::DEFAULT1) .template_param(new_parameter(sku, key: 'sku') .is_required(true) .should_encode(true)) .query_param(new_parameter(ship_node, key: 'shipNode')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(InventorySummary.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_inventory_summaries(skus: nil, ship_node: nil, fulfillment_type: nil, page_size: 100, next_token: nil) ⇒ ApiResponse
TODO: type endpoint description here 50) multi-node sellers) fulfillment type here
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/walmart_ap_is/apis/inventory_api.rb', line 20 def get_inventory_summaries(skus: nil, ship_node: nil, fulfillment_type: nil, page_size: 100, next_token: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/inventory/v4/items', Server::DEFAULT1) .query_param(new_parameter(skus, key: 'skus')) .query_param(new_parameter(ship_node, key: 'shipNode')) .query_param(new_parameter(fulfillment_type, key: 'fulfillmentType')) .query_param(new_parameter(page_size, key: 'pageSize')) .query_param(new_parameter(next_token, key: 'nextToken')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetInventorySummariesResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#update_inventory_for_sku(sku, body) ⇒ ApiResponse
TODO: type endpoint description here description here
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 |
# File 'lib/walmart_ap_is/apis/inventory_api.rb', line 99 def update_inventory_for_sku(sku, body) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/inventory/v4/items/{sku}', Server::DEFAULT1) .template_param(new_parameter(sku, key: 'sku') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(UpdateInventoryResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |