Class: NewStoreApi::CountingController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/counting_controller.rb

Overview

CountingController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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.
See API Lifecycle Documentation for details.
Returns list of count task line items count stock.

Parameters:

  • task_id (UUID | String)

    Required parameter: Represents a task to

  • offset (Integer) (defaults to: nil)

    Optional parameter: TODO: type description here

  • limit (Integer) (defaults to: nil)

    Optional parameter: TODO: type description here

  • accept (String) (defaults to: nil)

    Optional parameter: TODO: type description here

Returns:



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.

Parameters:

  • task_id (UUID | String)

    Required parameter: Represents a task to

  • product_id (String)

    Required parameter: Represents a product id

Returns:



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.
See API Lifecycle Documentation for details.
Returns list of zones for a count task count stock.

Parameters:

  • task_id (UUID | String)

    Required parameter: Represents a task to

  • accept (String) (defaults to: nil)

    Optional parameter: TODO: type description here

Returns:



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.
See API Lifecycle Documentation for details.
stock was counted. count stock. description here

Parameters:

  • zone_code (String)

    Required parameter: Represents the zone where

  • task_id (UUID | String)

    Required parameter: Represents a task to

  • body (CompleteZoneRequest)

    Required parameter: TODO: type



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