Class: StickyIoRestfulApiV2025731::WarehouseController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb

Overview

WarehouseController

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, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#create_warehouse(name, description, address_1, address_2, city, state, zip, country_id, active, domain, v2_ext) ⇒ ApiResponse

This method is used to update a single warehouse details. ## Request Data Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | country_id | Required | - | Integer | This is the country id. | | name | Required | - | String(255) | This is the warehouse name. | | description | Optional | - | String(255) | This is the description of warehouse. | | address_1 | Optional | - | String(255) | This is the first address of warehouse. | | address_2 | Optional | - | String(255) | This is the second address of warehouse. | | city | Optional | - | String(255) | This is the city name where warehouse located. | | state | Optional | - | String(8) | This is the state code. | | zip | Optional | - | String(11) | This is the zip code. | | active | Optional | - | Boolean | This is the warehouse status. There value should be 0 or 1. | ## Response Parameters Response parameters contained within the ‘data` field object: | Parameter | Type | Description | | — | — | — | | id | Number | This is the warehouse ID. | | name | String | This is the warehouse name. | | description | String | This is the description of warehouse. | | address_1 | String | This is the first address of warehouse. | | address_2 | String | This is the second address of warehouse. | | city | String | This is the city name where warehouse located. | | state | String | This is the state code where warehouse located. | | zip | String | This is the zip code. | | country_id | Integer | This is the country id. | | active | Boolean Flag | This is the warehouse status. It’s return Boolean value 0/1. | | created_by | Integer | This is the id of the user who created this warehouse. | | updated_by | Integer | This is the id of the user who updated this warehouse. | description. code. id. should be Boolean value 0 or 1.

Parameters:

  • name (String)

    Required parameter: The warehouse name.

  • description (String)

    Required parameter: The warehouse

  • address_1 (String)

    Required parameter: The warehouse address 1.

  • address_2 (String)

    Required parameter: The warehouse address 2.

  • city (String)

    Required parameter: The warehouse city.

  • state (String)

    Required parameter: The warehouse located state

  • zip (Integer)

    Required parameter: The warehouse zip code.

  • country_id (Integer)

    Required parameter: The warehouse country

  • active (Integer)

    Required parameter: The warehouse status. It

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
# File 'lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb', line 255

def create_warehouse(name,
                     description,
                     address_1,
                     address_2,
                     city,
                     state,
                     zip,
                     country_id,
                     active,
                     domain,
                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}warehouse',
                                 Server::SERVER_1)
               .form_param(new_parameter(name, key: 'name')
                            .is_required(true))
               .form_param(new_parameter(description, key: 'description')
                            .is_required(true))
               .form_param(new_parameter(address_1, key: 'address_1')
                            .is_required(true))
               .form_param(new_parameter(address_2, key: 'address_2')
                            .is_required(true))
               .form_param(new_parameter(city, key: 'city')
                            .is_required(true))
               .form_param(new_parameter(state, key: 'state')
                            .is_required(true))
               .form_param(new_parameter(zip, key: 'zip')
                            .is_required(true))
               .form_param(new_parameter(country_id, key: 'country_id')
                            .is_required(true))
               .form_param(new_parameter(active, key: 'active')
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#delete_warehouse(domain, v2_ext, warehouse_id) ⇒ ApiResponse

Delete an existing warehouse. here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • warehouse_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb', line 178

def delete_warehouse(domain,
                     v2_ext,
                     warehouse_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}warehouse/{warehouse_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(warehouse_id, key: 'warehouse_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_all_warehouses(domain, v2_ext) ⇒ ApiResponse

This method is used to get all warehouse. ## Response Parameters Response parameters contained within the ‘data` field object: | Parameter | Type | Description | | — | — | — | | id | Number | This is the warehouse ID. | | name | String | This is the warehouse name. | | description | String | This is the description of warehouse. | | address_1 | String | This is the first address of warehouse. | | address_2 | String | This is the second address of warehouse. | | city | String | This is the city name where warehouse located. | | state | String | This is the state code where warehouse located. | | zip | Number | This is the zip code. | | country_id | Number | This is the country id. | | active | Boolean Flag | This is the warehouse status. It’s return Boolean value 0/1. | | created_by | Number | This is the id of the user who created this warehouse. | | updated_by | Number | This is the id of the user who updated this warehouse. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb', line 32

def get_all_warehouses(domain,
                       v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}warehouses',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_warehouse(domain, v2_ext, warehouse_id) ⇒ ApiResponse

This method is used to get a single warehouse details. ## Response Parameters Response parameters contained within the ‘data` field object: | Parameter | Type | Description | | — | — | — | | id | Number | This is the warehouse ID. | | name | String | This is the warehouse name. | | description | String | This is the description of warehouse. | | address_1 | String | This is the first address of warehouse. | | address_2 | String | This is the second address of warehouse. | | city | String | This is the city name where warehouse located. | | state | String | This is the state code where warehouse located. | | zip | Number | This is the zip code. | | country_id | Number | This is the country id. | | active | Boolean Flag | This is the warehouse status. It’s return Boolean value 0/1. | | created_by | Number | This is the id of the user who created this warehouse. | | updated_by | Number | This is the id of the user who updated this warehouse. | here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • warehouse_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb', line 76

def get_warehouse(domain,
                  v2_ext,
                  warehouse_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}warehouse/{warehouse_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(warehouse_id, key: 'warehouse_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_warehouse(body, domain, v2_ext, warehouse_id) ⇒ ApiResponse

This method is used to update a single warehouse details. ## Request Data Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | name | Optional | - | String | This is the warehouse name. | | description | Optional | - | String | This is the description of warehouse. | | address_1 | Optional | - | String | This is the first address of warehouse. | | address_2 | Optional | - | String | This is the second address of warehouse. | | city | Optional | - | String | This is the city name where warehouse located. | | state | Optional | - | String | This is the state code. | | zip | Optional | - | Numeric | This is the zip code. | | country_id | Optional | - | Numeric | This is the country id. | | active | Optional | - | Boolean | This is the warehouse status. There value should be 0 or 1. | ## Response Parameters Response parameters contained within the ‘data` field object: | Parameter | Type | Description | | — | — | — | | id | Number | This is the warehouse ID. | | name | String | This is the warehouse name. | | description | String | This is the description of warehouse. | | address_1 | String | This is the first address of warehouse. | | address_2 | String | This is the second address of warehouse. | | city | String | This is the city name where warehouse located. | | state | String | This is the state code where warehouse located. | | zip | Number | This is the zip code. | | country_id | Number | This is the country id. | | active | Boolean Flag | This is the warehouse status. It’s return Boolean value 0/1. | | created_by | Number | This is the id of the user who created this warehouse. | | updated_by | Number | This is the id of the user who updated this warehouse. | description here here

Parameters:

  • body (UpdateWarehouseRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • warehouse_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
169
170
# File 'lib/sticky_io_restful_api_v2025731/controllers/warehouse_controller.rb', line 144

def update_warehouse(body,
                     domain,
                     v2_ext,
                     warehouse_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}warehouse/{warehouse_id}',
                                 Server::SERVER_1)
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(warehouse_id, key: 'warehouse_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end