Class: WineShipping::SalesOrderApi

Inherits:
Object
  • Object
show all
Defined in:
lib/wine_shipping/api/sales_order_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SalesOrderApi

Returns a new instance of SalesOrderApi.



19
20
21
# File 'lib/wine_shipping/api/sales_order_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/wine_shipping/api/sales_order_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_sales_order(cancel_sales_order_request, opts = {}) ⇒ nil

Use this operation to cancel an existing open sales order. Successful execution of this method will cancel the sales order in Wineshipping system. If the order cannot be cancelled for some reason standard HTTP Status Code and a reason will be returned.

Parameters:

  • cancel_sales_order_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


26
27
28
29
# File 'lib/wine_shipping/api/sales_order_api.rb', line 26

def cancel_sales_order(cancel_sales_order_request, opts = {})
  cancel_sales_order_with_http_info(cancel_sales_order_request, opts)
  nil
end

#cancel_sales_order_with_http_info(cancel_sales_order_request, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Use this operation to cancel an existing open sales order. Successful execution of this method will cancel the sales order in Wineshipping system. If the order cannot be cancelled for some reason standard HTTP Status Code and a reason will be returned.

Parameters:

  • cancel_sales_order_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/wine_shipping/api/sales_order_api.rb', line 35

def cancel_sales_order_with_http_info(cancel_sales_order_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesOrderApi.cancel_sales_order ...'
  end
  # verify the required parameter 'cancel_sales_order_request' is set
  if @api_client.config.client_side_validation && cancel_sales_order_request.nil?
    fail ArgumentError, "Missing the required parameter 'cancel_sales_order_request' when calling SalesOrderApi.cancel_sales_order"
  end
  # resource path
  local_var_path = '/api/SalesOrder/CancelSalesOrder'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(cancel_sales_order_request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesOrderApi#cancel_sales_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_sales_order(order_details_info, opts = {}) ⇒ nil

Successful execution of this method will generate a new shipment order in Wineshipping’s system and will return a transaction reference identifier. Store this identifier back into your system for reference later in the event there is an issue with your order.

Parameters:

  • order_details_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


77
78
79
80
# File 'lib/wine_shipping/api/sales_order_api.rb', line 77

def create_sales_order(order_details_info, opts = {})
  create_sales_order_with_http_info(order_details_info, opts)
  nil
end

#create_sales_order_with_http_info(order_details_info, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Successful execution of this method will generate a new shipment order in Wineshipping&#39;s system and will return a transaction reference identifier. Store this identifier back into your system for reference later in the event there is an issue with your order.

Parameters:

  • order_details_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



86
87
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
117
118
119
120
121
122
123
# File 'lib/wine_shipping/api/sales_order_api.rb', line 86

def create_sales_order_with_http_info(order_details_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesOrderApi.create_sales_order ...'
  end
  # verify the required parameter 'order_details_info' is set
  if @api_client.config.client_side_validation && order_details_info.nil?
    fail ArgumentError, "Missing the required parameter 'order_details_info' when calling SalesOrderApi.create_sales_order"
  end
  # resource path
  local_var_path = '/api/SalesOrder/CreateSalesOrder'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(order_details_info)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesOrderApi#create_sales_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders_on_hold(authentication_details, opts = {}) ⇒ Array<OrderOnHold>

Use this operation to retrieve a list of on-hold orders for a customer. Successful execution of this method will generate a list of on hold orders from Wineshipping’s system and if no orders are on hold, HTTP status code Not Found response will be returned.

Parameters:

  • authentication_details
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



128
129
130
131
# File 'lib/wine_shipping/api/sales_order_api.rb', line 128

def get_orders_on_hold(authentication_details, opts = {})
  data, _status_code, _headers = get_orders_on_hold_with_http_info(authentication_details, opts)
  data
end

#get_orders_on_hold_with_http_info(authentication_details, opts = {}) ⇒ Array<(Array<OrderOnHold>, Fixnum, Hash)>

Use this operation to retrieve a list of on-hold orders for a customer. Successful execution of this method will generate a list of on hold orders from Wineshipping&#39;s system and if no orders are on hold, HTTP status code Not Found response will be returned.

Parameters:

  • authentication_details
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<OrderOnHold>, Fixnum, Hash)>)

    Array<OrderOnHold> data, response status code and response headers



137
138
139
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
169
170
171
172
173
174
175
# File 'lib/wine_shipping/api/sales_order_api.rb', line 137

def get_orders_on_hold_with_http_info(authentication_details, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesOrderApi.get_orders_on_hold ...'
  end
  # verify the required parameter 'authentication_details' is set
  if @api_client.config.client_side_validation && authentication_details.nil?
    fail ArgumentError, "Missing the required parameter 'authentication_details' when calling SalesOrderApi.get_orders_on_hold"
  end
  # resource path
  local_var_path = '/api/SalesOrder/GetOrdersOnHold'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(authentication_details)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<OrderOnHold>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesOrderApi#get_orders_on_hold\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_returns(returns_request_details, opts = {}) ⇒ ReturnResult

Use this operation to retrieve a list of return sales orders for a customer. Successful execution of this method will generate a list of returns from Wineshipping system.

Parameters:

  • returns_request_details
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



180
181
182
183
# File 'lib/wine_shipping/api/sales_order_api.rb', line 180

def get_returns(returns_request_details, opts = {})
  data, _status_code, _headers = get_returns_with_http_info(returns_request_details, opts)
  data
end

#get_returns_with_http_info(returns_request_details, opts = {}) ⇒ Array<(ReturnResult, Fixnum, Hash)>

Use this operation to retrieve a list of return sales orders for a customer. Successful execution of this method will generate a list of returns from Wineshipping system.

Parameters:

  • returns_request_details
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ReturnResult, Fixnum, Hash)>)

    ReturnResult data, response status code and response headers



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/wine_shipping/api/sales_order_api.rb', line 189

def get_returns_with_http_info(returns_request_details, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesOrderApi.get_returns ...'
  end
  # verify the required parameter 'returns_request_details' is set
  if @api_client.config.client_side_validation && returns_request_details.nil?
    fail ArgumentError, "Missing the required parameter 'returns_request_details' when calling SalesOrderApi.get_returns"
  end
  # resource path
  local_var_path = '/api/SalesOrder/GetReturns'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(returns_request_details)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ReturnResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesOrderApi#get_returns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#replace_sales_order(order_details_info, opts = {}) ⇒ nil

Use this operation to replace/update an existing open sales order. Successful execution of this method will replace an open sales order in Wineshipping system and will return a transaction reference identifier. Store this identifier back into your system for reference later in the event there is an issue with your replacement order. If the order cannot be replaced for some, reason standard HTTP Status Code and a reason message will be returned.

Parameters:

  • order_details_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


232
233
234
235
# File 'lib/wine_shipping/api/sales_order_api.rb', line 232

def replace_sales_order(order_details_info, opts = {})
  replace_sales_order_with_http_info(order_details_info, opts)
  nil
end

#replace_sales_order_with_http_info(order_details_info, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Use this operation to replace/update an existing open sales order. Successful execution of this method will replace an open sales order in Wineshipping system and will return a transaction reference identifier. Store this identifier back into your system for reference later in the event there is an issue with your replacement order. If the order cannot be replaced for some, reason standard HTTP Status Code and a reason message will be returned.

Parameters:

  • order_details_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/wine_shipping/api/sales_order_api.rb', line 241

def replace_sales_order_with_http_info(order_details_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesOrderApi.replace_sales_order ...'
  end
  # verify the required parameter 'order_details_info' is set
  if @api_client.config.client_side_validation && order_details_info.nil?
    fail ArgumentError, "Missing the required parameter 'order_details_info' when calling SalesOrderApi.replace_sales_order"
  end
  # resource path
  local_var_path = '/api/SalesOrder/ReplaceSalesOrder'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(order_details_info)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesOrderApi#replace_sales_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end