Class: NewStoreApi::CountingController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::CountingController
- Defined in:
- lib/new_store_api/controllers/counting_controller.rb
Overview
CountingController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#list_count_tasks_line_items(task_id, offset: nil, limit: nil, accept: nil) ⇒ ListCountTaskLineItemsResponse
🚧 BETA: This endpoint is in beta and may change.
- #list_product_zones(task_id, product_id) ⇒ ListProductZonesResponse
Returns list of zones where a product was scanned.
- #list_zones(task_id, accept: nil) ⇒ ListZonesResponse
🚧 BETA: This endpoint is in beta and may change.- #replace_count_task_zone(zone_code, task_id, body) ⇒ void
🚧 BETA: This endpoint is in beta and may change.Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#list_count_tasks_line_items(task_id, offset: nil, limit: nil, accept: nil) ⇒ ListCountTaskLineItemsResponse
🚧 BETA: This endpoint is in beta and may change.Returns list of count task line items count stock.
See API Lifecycle Documentation for details.25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
# File 'lib/new_store_api/controllers/counting_controller.rb', line 25 def list_count_tasks_line_items(task_id, offset: nil, limit: nil, accept: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/inventory/count-tasks/{task_id}/line-items', Server::API) .template_param(new_parameter(task_id, key: 'task_id') .should_encode(true)) .query_param(new_parameter(offset, key: 'offset')) .query_param(new_parameter(limit, key: 'limit')) .header_param(new_parameter(accept, key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListCountTaskLineItemsResponse.method(:from_hash))) .execute end
#list_product_zones(task_id, product_id) ⇒ ListProductZonesResponse
Returns list of zones where a product was scanned. count stock.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
# File 'lib/new_store_api/controllers/counting_controller.rb', line 50 def list_product_zones(task_id, product_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/inventory/count-tasks/{task_id}/products/{product_id}', Server::API) .template_param(new_parameter(task_id, key: 'task_id') .should_encode(true)) .template_param(new_parameter(product_id, key: 'product_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListProductZonesResponse.method(:from_hash))) .execute end
#list_zones(task_id, accept: nil) ⇒ ListZonesResponse
🚧 BETA: This endpoint is in beta and may change.Returns list of zones for a count task count stock.
See API Lifecycle Documentation for details.82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
# File 'lib/new_store_api/controllers/counting_controller.rb', line 82 def list_zones(task_id, accept: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/inventory/count-tasks/{task_id}/zones', Server::API) .template_param(new_parameter(task_id, key: 'task_id') .should_encode(true)) .header_param(new_parameter(accept, key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListZonesResponse.method(:from_hash))) .execute end
#replace_count_task_zone(zone_code, task_id, body) ⇒ void
This method returns an undefined value.
🚧 BETA: This endpoint is in beta and may change.stock was counted. count stock. description here
See API Lifecycle Documentation for details.114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
# File 'lib/new_store_api/controllers/counting_controller.rb', line 114 def replace_count_task_zone(zone_code, task_id, body) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/inventory/count-tasks/{task_id}/zones/{zone_code}', Server::API) .template_param(new_parameter(zone_code, key: 'zone_code') .should_encode(true)) .template_param(new_parameter(task_id, key: 'task_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .is_response_void(true)) .execute end
- #list_product_zones(task_id, product_id) ⇒ ListProductZonesResponse