Class: OrderCloud::OrderApi

Inherits:
Object
  • Object
show all
Defined in:
lib/order_cloud/api/order_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrderApi

Returns a new instance of OrderApi.



30
31
32
# File 'lib/order_cloud/api/order_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/order_cloud/api/order_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#add_promotion(direction, order_id, promo_code, opts = {}) ⇒ Promotion

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

  • promo_code

    Promo code of the order.

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

    the optional parameters

Returns:



41
42
43
44
# File 'lib/order_cloud/api/order_api.rb', line 41

def add_promotion(direction, order_id, promo_code, opts = {})
  data, _status_code, _headers = add_promotion_with_http_info(direction, order_id, promo_code, opts)
  return data
end

#add_promotion_with_http_info(direction, order_id, promo_code, opts = {}) ⇒ Array<(Promotion, Fixnum, Hash)>

Returns Promotion data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

  • promo_code

    Promo code of the order.

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

    the optional parameters

Returns:

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

    Promotion data, response status code and response headers



53
54
55
56
57
58
59
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
93
94
95
96
97
# File 'lib/order_cloud/api/order_api.rb', line 53

def add_promotion_with_http_info(direction, order_id, promo_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.add_promotion ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.add_promotion" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.add_promotion" if order_id.nil?
  # verify the required parameter 'promo_code' is set
  fail ArgumentError, "Missing the required parameter 'promo_code' when calling OrderApi.add_promotion" if promo_code.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions/{promoCode}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'promoCode' + '}', promo_code.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Promotion')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#add_promotion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#approve(direction, order_id, info, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



106
107
108
109
# File 'lib/order_cloud/api/order_api.rb', line 106

def approve(direction, order_id, info, opts = {})
  data, _status_code, _headers = approve_with_http_info(direction, order_id, info, opts)
  return data
end

#approve_with_http_info(direction, order_id, info, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
# File 'lib/order_cloud/api/order_api.rb', line 118

def approve_with_http_info(direction, order_id, info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.approve ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.approve" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.approve" if order_id.nil?
  # verify the required parameter 'info' is set
  fail ArgumentError, "Missing the required parameter 'info' when calling OrderApi.approve" if info.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/approve".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(info)
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#approve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel(direction, order_id, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



170
171
172
173
# File 'lib/order_cloud/api/order_api.rb', line 170

def cancel(direction, order_id, opts = {})
  data, _status_code, _headers = cancel_with_http_info(direction, order_id, opts)
  return data
end

#cancel_with_http_info(direction, order_id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



181
182
183
184
185
186
187
188
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
# File 'lib/order_cloud/api/order_api.rb', line 181

def cancel_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.cancel ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.cancel" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.cancel" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/cancel".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create(direction, order, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

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

    the optional parameters

Returns:



231
232
233
234
# File 'lib/order_cloud/api/order_api.rb', line 231

def create(direction, order, opts = {})
  data, _status_code, _headers = create_with_http_info(direction, order, opts)
  return data
end

#create_with_http_info(direction, order, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



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
279
280
281
282
283
284
# File 'lib/order_cloud/api/order_api.rb', line 242

def create_with_http_info(direction, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.create ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.create" if direction.nil?
  # verify the required parameter 'order' is set
  fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.create" if order.nil?
  # resource path
  local_var_path = "/orders/{direction}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(order)
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#decline(direction, order_id, info, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



293
294
295
296
# File 'lib/order_cloud/api/order_api.rb', line 293

def decline(direction, order_id, info, opts = {})
  data, _status_code, _headers = decline_with_http_info(direction, order_id, info, opts)
  return data
end

#decline_with_http_info(direction, order_id, info, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/order_cloud/api/order_api.rb', line 305

def decline_with_http_info(direction, order_id, info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.decline ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.decline" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.decline" if order_id.nil?
  # verify the required parameter 'info' is set
  fail ArgumentError, "Missing the required parameter 'info' when calling OrderApi.decline" if info.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/decline".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(info)
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#decline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(direction, order_id, opts = {}) ⇒ nil

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

  • (nil)


357
358
359
360
# File 'lib/order_cloud/api/order_api.rb', line 357

def delete(direction, order_id, opts = {})
  delete_with_http_info(direction, order_id, opts)
  return nil
end

#delete_with_http_info(direction, order_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/order_cloud/api/order_api.rb', line 368

def delete_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.delete ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.delete" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.delete" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, 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: OrderApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(direction, order_id, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



417
418
419
420
# File 'lib/order_cloud/api/order_api.rb', line 417

def get(direction, order_id, opts = {})
  data, _status_code, _headers = get_with_http_info(direction, order_id, opts)
  return data
end

#get_with_http_info(direction, order_id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/order_cloud/api/order_api.rb', line 428

def get_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.get ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.get" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(direction, opts = {}) ⇒ ListOrder

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

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

    the optional parameters

Options Hash (opts):

  • :buyer_id (String)

    ID of the buyer.

  • :supplier_id (String)

    ID of the supplier.

  • :from (String)

    Lower bound of date range that the order was created.

  • :to (String)

    Upper bound of date range that the order was created.

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:



487
488
489
490
# File 'lib/order_cloud/api/order_api.rb', line 487

def list(direction, opts = {})
  data, _status_code, _headers = list_with_http_info(direction, opts)
  return data
end

#list_approvals(direction, order_id, opts = {}) ⇒ ListOrderApproval

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:



571
572
573
574
# File 'lib/order_cloud/api/order_api.rb', line 571

def list_approvals(direction, order_id, opts = {})
  data, _status_code, _headers = list_approvals_with_http_info(direction, order_id, opts)
  return data
end

#list_approvals_with_http_info(direction, order_id, opts = {}) ⇒ Array<(ListOrderApproval, Fixnum, Hash)>

Returns ListOrderApproval data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:

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

    ListOrderApproval data, response status code and response headers



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/order_cloud/api/order_api.rb', line 588

def list_approvals_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_approvals ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_approvals" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_approvals" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/approvals".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListOrderApproval')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_eligible_approvers(direction, order_id, opts = {}) ⇒ ListUser

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:



650
651
652
653
# File 'lib/order_cloud/api/order_api.rb', line 650

def list_eligible_approvers(direction, order_id, opts = {})
  data, _status_code, _headers = list_eligible_approvers_with_http_info(direction, order_id, opts)
  return data
end

#list_eligible_approvers_with_http_info(direction, order_id, opts = {}) ⇒ Array<(ListUser, Fixnum, Hash)>

Returns ListUser data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:

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

    ListUser data, response status code and response headers



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/order_cloud/api/order_api.rb', line 667

def list_eligible_approvers_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_eligible_approvers ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_eligible_approvers" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_eligible_approvers" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/eligibleapprovers".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListUser')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_eligible_approvers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_promotions(direction, order_id, opts = {}) ⇒ ListOrderPromotion

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:



729
730
731
732
# File 'lib/order_cloud/api/order_api.rb', line 729

def list_promotions(direction, order_id, opts = {})
  data, _status_code, _headers = list_promotions_with_http_info(direction, order_id, opts)
  return data
end

#list_promotions_with_http_info(direction, order_id, opts = {}) ⇒ Array<(ListOrderPromotion, Fixnum, Hash)>

Returns ListOrderPromotion data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:

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

    ListOrderPromotion data, response status code and response headers



746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
# File 'lib/order_cloud/api/order_api.rb', line 746

def list_promotions_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_promotions ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_promotions" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_promotions" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListOrderPromotion')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_promotions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_with_http_info(direction, opts = {}) ⇒ Array<(ListOrder, Fixnum, Hash)>

Returns ListOrder data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

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

    the optional parameters

Options Hash (opts):

  • :buyer_id (String)

    ID of the buyer.

  • :supplier_id (String)

    ID of the supplier.

  • :from (String)

    Lower bound of date range that the order was created.

  • :to (String)

    Upper bound of date range that the order was created.

  • :search (String)

    Search of the order.

  • :search_on (Array<String>)

    Search on of the order.

  • :sort_by (Array<String>)

    Sort by of the order.

  • :page (Integer)

    Page of the order.

  • :page_size (Integer)

    Page size of the order.

  • :filters (Hash<String, String>)

    Filters of the order.

Returns:

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

    ListOrder data, response status code and response headers



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/order_cloud/api/order_api.rb', line 507

def list_with_http_info(direction, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list" if direction.nil?
  # resource path
  local_var_path = "/orders/{direction}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s)

  # query parameters
  query_params = {}
  query_params[:'buyerID'] = opts[:'buyer_id'] if !opts[:'buyer_id'].nil?
  query_params[:'supplierID'] = opts[:'supplier_id'] if !opts[:'supplier_id'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListOrder')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch(direction, order_id, partial_order, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



803
804
805
806
# File 'lib/order_cloud/api/order_api.rb', line 803

def patch(direction, order_id, partial_order, opts = {})
  data, _status_code, _headers = patch_with_http_info(direction, order_id, partial_order, opts)
  return data
end

#patch_billing_address(direction, order_id, address, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



868
869
870
871
# File 'lib/order_cloud/api/order_api.rb', line 868

def patch_billing_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = patch_billing_address_with_http_info(direction, order_id, address, opts)
  return data
end

#patch_billing_address_with_http_info(direction, order_id, address, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
# File 'lib/order_cloud/api/order_api.rb', line 880

def patch_billing_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch_billing_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch_billing_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch_billing_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.patch_billing_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/billto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#patch_shipping_address(direction, order_id, address, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



933
934
935
936
# File 'lib/order_cloud/api/order_api.rb', line 933

def patch_shipping_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = patch_shipping_address_with_http_info(direction, order_id, address, opts)
  return data
end

#patch_shipping_address_with_http_info(direction, order_id, address, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/order_cloud/api/order_api.rb', line 945

def patch_shipping_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch_shipping_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch_shipping_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch_shipping_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.patch_shipping_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#patch_with_http_info(direction, order_id, partial_order, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/order_cloud/api/order_api.rb', line 815

def patch_with_http_info(direction, order_id, partial_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch" if order_id.nil?
  # verify the required parameter 'partial_order' is set
  fail ArgumentError, "Missing the required parameter 'partial_order' when calling OrderApi.patch" if partial_order.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#remove_promotion(direction, order_id, promo_code, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

  • promo_code

    Promo code of the order.

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

    the optional parameters

Returns:



998
999
1000
1001
# File 'lib/order_cloud/api/order_api.rb', line 998

def remove_promotion(direction, order_id, promo_code, opts = {})
  data, _status_code, _headers = remove_promotion_with_http_info(direction, order_id, promo_code, opts)
  return data
end

#remove_promotion_with_http_info(direction, order_id, promo_code, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

  • promo_code

    Promo code of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'lib/order_cloud/api/order_api.rb', line 1010

def remove_promotion_with_http_info(direction, order_id, promo_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.remove_promotion ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.remove_promotion" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.remove_promotion" if order_id.nil?
  # verify the required parameter 'promo_code' is set
  fail ArgumentError, "Missing the required parameter 'promo_code' when calling OrderApi.remove_promotion" if promo_code.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions/{promoCode}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'promoCode' + '}', promo_code.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#remove_promotion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_billing_address(direction, order_id, address, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



1063
1064
1065
1066
# File 'lib/order_cloud/api/order_api.rb', line 1063

def set_billing_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = set_billing_address_with_http_info(direction, order_id, address, opts)
  return data
end

#set_billing_address_with_http_info(direction, order_id, address, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/order_cloud/api/order_api.rb', line 1075

def set_billing_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.set_billing_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.set_billing_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.set_billing_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.set_billing_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/billto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#set_shipping_address(direction, order_id, address, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



1128
1129
1130
1131
# File 'lib/order_cloud/api/order_api.rb', line 1128

def set_shipping_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = set_shipping_address_with_http_info(direction, order_id, address, opts)
  return data
end

#set_shipping_address_with_http_info(direction, order_id, address, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
# File 'lib/order_cloud/api/order_api.rb', line 1140

def set_shipping_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.set_shipping_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.set_shipping_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.set_shipping_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.set_shipping_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#ship(direction, order_id, shipment, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



1193
1194
1195
1196
# File 'lib/order_cloud/api/order_api.rb', line 1193

def ship(direction, order_id, shipment, opts = {})
  data, _status_code, _headers = ship_with_http_info(direction, order_id, shipment, opts)
  return data
end

#ship_with_http_info(direction, order_id, shipment, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
# File 'lib/order_cloud/api/order_api.rb', line 1205

def ship_with_http_info(direction, order_id, shipment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.ship ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.ship" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.ship" if order_id.nil?
  # verify the required parameter 'shipment' is set
  fail ArgumentError, "Missing the required parameter 'shipment' when calling OrderApi.ship" if shipment.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/ship".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(shipment)
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#ship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit(direction, order_id, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



1257
1258
1259
1260
# File 'lib/order_cloud/api/order_api.rb', line 1257

def submit(direction, order_id, opts = {})
  data, _status_code, _headers = submit_with_http_info(direction, order_id, opts)
  return data
end

#submit_with_http_info(direction, order_id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
# File 'lib/order_cloud/api/order_api.rb', line 1268

def submit_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.submit ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.submit" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.submit" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/submit".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#submit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(direction, order_id, order, opts = {}) ⇒ Order

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:



1319
1320
1321
1322
# File 'lib/order_cloud/api/order_api.rb', line 1319

def update(direction, order_id, order, opts = {})
  data, _status_code, _headers = update_with_http_info(direction, order_id, order, opts)
  return data
end

#update_with_http_info(direction, order_id, order, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>

Returns Order data, response status code and response headers.

Parameters:

  • direction

    Direction of the order. Possible values: Incoming, Outgoing.

  • order_id

    ID of the order.

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

    the optional parameters

Returns:

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

    Order data, response status code and response headers



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/order_cloud/api/order_api.rb', line 1331

def update_with_http_info(direction, order_id, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.update ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.update" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.update" if order_id.nil?
  # verify the required parameter 'order' is set
  fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.update" if order.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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