Class: SubskribeDevClient::OrdersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_dev/api/orders_api.rb,
lib/subskribe_dev2/api/orders_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrdersApi

Returns a new instance of OrdersApi.



19
20
21
# File 'lib/subskribe_dev/api/orders_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/subskribe_dev/api/orders_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_document_template(opts = {}) ⇒ String

Add new predefined terms Add a new predefined terms that can be attached to an order as part of PDF document generation.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (String)


27
28
29
30
# File 'lib/subskribe_dev/api/orders_api.rb', line 27

def add_document_template(opts = {})
  data, _status_code, _headers = add_document_template_with_http_info(opts)
  data
end

#add_document_template_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Add new predefined terms Add a new predefined terms that can be attached to an order as part of PDF document generation.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    String data, response status code and response headers



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
# File 'lib/subskribe_dev/api/orders_api.rb', line 37

def add_document_template_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.add_document_template ...'
  end
  # resource path
  local_var_path = '/templates'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#add_order(body, opts = {}) ⇒ OrderJson

Create an order creates an order with the specified parameters. On success the order id is returned.

Parameters:

  • body

    json representing the order details

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

    the optional parameters

Options Hash (opts):

  • :is_dry_run (BOOLEAN)

    indicates whether this order should be persisted

  • :populate_missing_lines (BOOLEAN)

    indicates whether an amendment should populate missing lines not provided here

Returns:



77
78
79
80
# File 'lib/subskribe_dev/api/orders_api.rb', line 77

def add_order(body, opts = {})
  data, _status_code, _headers = add_order_with_http_info(body, opts)
  data
end

#add_order_with_http_info(body, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Create an order creates an order with the specified parameters. On success the order id is returned.

Parameters:

  • body

    json representing the order details

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

    the optional parameters

Options Hash (opts):

  • :is_dry_run (BOOLEAN)

    indicates whether this order should be persisted

  • :populate_missing_lines (BOOLEAN)

    indicates whether an amendment should populate missing lines not provided here

Returns:

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

    OrderJson data, response status code and response headers



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
124
125
126
127
128
129
# File 'lib/subskribe_dev/api/orders_api.rb', line 89

def add_order_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.add_order ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OrdersApi.add_order"
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = {}
  query_params[:'isDryRun'] = opts[:'is_dry_run'] if !opts[:'is_dry_run'].nil?
  query_params[:'populateMissingLines'] = opts[:'populate_missing_lines'] if !opts[:'populate_missing_lines'].nil?

  # 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(body)
  auth_names = ['ApiKeyAuth']
  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 => 'OrderJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#add_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_composite_order_document(id, opts = {}) ⇒ nil

Generate a composite order PDF Generates a composite order form PDF. When completed this document can be downloaded via a get to /id/pdf.

Parameters:

  • id

    id of the composite order

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

    the optional parameters

Returns:

  • (nil)


135
136
137
138
# File 'lib/subskribe_dev/api/orders_api.rb', line 135

def create_composite_order_document(id, opts = {})
  create_composite_order_document_with_http_info(id, opts)
  nil
end

#create_composite_order_document_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Generate a composite order PDF Generates a composite order form PDF. When completed this document can be downloaded via a get to /id/pdf.

Parameters:

  • id

    id of the composite order

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
176
177
178
179
180
# File 'lib/subskribe_dev/api/orders_api.rb', line 145

def create_composite_order_document_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.create_composite_order_document ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.create_composite_order_document"
  end
  # resource path
  local_var_path = '/compositeOrders/{id}/pdf'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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: OrdersApi#create_composite_order_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_order_document(id, opts = {}) ⇒ nil

Generate an order PDF Generates an order form PDF. When completed this document can be downloaded via a get to /id/pdf.

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :force (BOOLEAN)

    force regeneration of the PDF document even if there has been no changes. Defaults to false

Returns:

  • (nil)


187
188
189
190
# File 'lib/subskribe_dev/api/orders_api.rb', line 187

def create_order_document(id, opts = {})
  create_order_document_with_http_info(id, opts)
  nil
end

#create_order_document_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Generate an order PDF Generates an order form PDF. When completed this document can be downloaded via a get to /id/pdf.

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :force (BOOLEAN)

    force regeneration of the PDF document even if there has been no changes. Defaults to false

Returns:

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

    nil, response status code and response headers



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
228
229
230
231
232
233
234
# File 'lib/subskribe_dev/api/orders_api.rb', line 198

def create_order_document_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.create_order_document ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.create_order_document"
  end
  # resource path
  local_var_path = '/orders/{id}/pdf'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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: OrdersApi#create_order_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_document_template(id, opts = {}) ⇒ DocumentTemplateJson

Delete predefined terms Deletes the predefined terms specified.

Parameters:

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

    the optional parameters

Returns:



240
241
242
243
# File 'lib/subskribe_dev/api/orders_api.rb', line 240

def delete_document_template(id, opts = {})
  data, _status_code, _headers = delete_document_template_with_http_info(id, opts)
  data
end

#delete_document_template_with_http_info(id, opts = {}) ⇒ Array<(DocumentTemplateJson, Fixnum, Hash)>

Delete predefined terms Deletes the predefined terms specified.

Parameters:

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

    the optional parameters

Returns:

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

    DocumentTemplateJson data, response status code and response headers



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
285
286
# File 'lib/subskribe_dev/api/orders_api.rb', line 250

def delete_document_template_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.delete_document_template ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.delete_document_template"
  end
  # resource path
  local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#delete_order(id, opts = {}) ⇒ OrderJson

Delete an order Deletes the specified order

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:



292
293
294
295
# File 'lib/subskribe_dev/api/orders_api.rb', line 292

def delete_order(id, opts = {})
  data, _status_code, _headers = delete_order_with_http_info(id, opts)
  data
end

#delete_order_with_http_info(id, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Delete an order Deletes the specified order

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

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

    OrderJson data, response status code and response headers



302
303
304
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
# File 'lib/subskribe_dev/api/orders_api.rb', line 302

def delete_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.delete_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.delete_order"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#execute_order(id, opts = {}) ⇒ OrderJson

Mark order as executed Marks the specified order as executed

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :executed_on (Integer)

    Order execution time

Returns:



345
346
347
348
# File 'lib/subskribe_dev/api/orders_api.rb', line 345

def execute_order(id, opts = {})
  data, _status_code, _headers = execute_order_with_http_info(id, opts)
  data
end

#execute_order_with_http_info(id, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Mark order as executed Marks the specified order as executed

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :executed_on (Integer)

    Order execution time

Returns:

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

    OrderJson data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
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
# File 'lib/subskribe_dev/api/orders_api.rb', line 356

def execute_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.execute_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.execute_order"
  end
  # resource path
  local_var_path = '/orders/{id}/execute'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'executedOn'] = opts[:'executed_on'] if !opts[:'executed_on'].nil?

  # 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 = nil
  auth_names = ['ApiKeyAuth']
  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 => 'OrderJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#execute_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#force_execute_order(id, opts = {}) ⇒ OrderJson

Mark order as executed Marks the specified order as executed

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :executed_on (Integer)

    Order execution time

  • :skip_approval_check (BOOLEAN)

    Skip approval check for imported orders. Defaults to false

Returns:



403
404
405
406
# File 'lib/subskribe_dev/api/orders_api.rb', line 403

def force_execute_order(id, opts = {})
  data, _status_code, _headers = force_execute_order_with_http_info(id, opts)
  data
end

#force_execute_order_with_http_info(id, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Mark order as executed Marks the specified order as executed

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :executed_on (Integer)

    Order execution time

  • :skip_approval_check (BOOLEAN)

    Skip approval check for imported orders. Defaults to false

Returns:

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

    OrderJson data, response status code and response headers



415
416
417
418
419
420
421
422
423
424
425
426
427
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
# File 'lib/subskribe_dev/api/orders_api.rb', line 415

def force_execute_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.force_execute_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.force_execute_order"
  end
  # resource path
  local_var_path = '/orders/{id}/execute/force'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'executedOn'] = opts[:'executed_on'] if !opts[:'executed_on'].nil?
  query_params[:'skipApprovalCheck'] = opts[:'skip_approval_check'] if !opts[:'skip_approval_check'].nil?

  # 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 = nil
  auth_names = ['ApiKeyAuth']
  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 => 'OrderJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#force_execute_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_composite_order_document(id, opts = {}) ⇒ nil

Fetch composite order form PDF Downloads the order form PDF for the specified order. This PDF must have been generated via a POST to /id/pdf. The response is the PDF document.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

  • (nil)


461
462
463
464
# File 'lib/subskribe_dev/api/orders_api.rb', line 461

def get_composite_order_document(id, opts = {})
  get_composite_order_document_with_http_info(id, opts)
  nil
end

#get_composite_order_document_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Fetch composite order form PDF Downloads the order form PDF for the specified order. This PDF must have been generated via a POST to /id/pdf. The response is the PDF document.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/subskribe_dev/api/orders_api.rb', line 471

def get_composite_order_document_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_composite_order_document ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_composite_order_document"
  end
  # resource path
  local_var_path = '/compositeOrders/{id}/pdf'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_document_template(id, opts = {}) ⇒ DocumentTemplateJson

Get predefined terms detail Returns a specific predefined terms by Id.

Parameters:

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

    the optional parameters

Returns:



512
513
514
515
# File 'lib/subskribe_dev/api/orders_api.rb', line 512

def get_document_template(id, opts = {})
  data, _status_code, _headers = get_document_template_with_http_info(id, opts)
  data
end

#get_document_template_with_http_info(id, opts = {}) ⇒ Array<(DocumentTemplateJson, Fixnum, Hash)>

Get predefined terms detail Returns a specific predefined terms by Id.

Parameters:

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

    the optional parameters

Returns:

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

    DocumentTemplateJson data, response status code and response headers



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
558
# File 'lib/subskribe_dev/api/orders_api.rb', line 522

def get_document_template_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_document_template ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_document_template"
  end
  # resource path
  local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_document_templates(opts = {}) ⇒ DocumentTemplateJson

Get predefined terms Returns predefined terms by type. These templates can be attached to orders as part of PDF document generation.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

Returns:



564
565
566
567
# File 'lib/subskribe_dev/api/orders_api.rb', line 564

def get_document_templates(opts = {})
  data, _status_code, _headers = get_document_templates_with_http_info(opts)
  data
end

#get_document_templates_with_http_info(opts = {}) ⇒ Array<(DocumentTemplateJson, Fixnum, Hash)>

Get predefined terms Returns predefined terms by type. These templates can be attached to orders as part of PDF document generation.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

Returns:

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

    DocumentTemplateJson data, response status code and response headers



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/subskribe_dev/api/orders_api.rb', line 574

def get_document_templates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_document_templates ...'
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['ORDER', 'INVOICE', 'CREDIT_MEMO', 'EMAIL', 'UPSELL_EARLY_RENEWAL', 'DUNNING', 'CANCEL_AND_RESTRUCTURE'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of ORDER, INVOICE, CREDIT_MEMO, EMAIL, UPSELL_EARLY_RENEWAL, DUNNING, CANCEL_AND_RESTRUCTURE'
  end
  # resource path
  local_var_path = '/templates'

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

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

  # form parameters
  form_params = {}

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

#get_opportunities(account_id, opts = {}) ⇒ OpportunityPaginationResponse

Return all opportunities Returns all opportunities associated with the specified account. The results are paginated. To fetch all results, pass the cursor returned from a call to subsequent calls.

Parameters:

  • account_id

    id of account

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    pass the cursor returned from a call to to subsequent calls until all values are fetched

  • :limit (Integer)

    number of results per page

  • :crm_id (String)

    CRM ID of the opportunity

Returns:



619
620
621
622
# File 'lib/subskribe_dev/api/orders_api.rb', line 619

def get_opportunities(, opts = {})
  data, _status_code, _headers = get_opportunities_with_http_info(, opts)
  data
end

#get_opportunities_with_http_info(account_id, opts = {}) ⇒ Array<(OpportunityPaginationResponse, Fixnum, Hash)>

Return all opportunities Returns all opportunities associated with the specified account. The results are paginated. To fetch all results, pass the cursor returned from a call to subsequent calls.

Parameters:

  • account_id

    id of account

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    pass the cursor returned from a call to to subsequent calls until all values are fetched

  • :limit (Integer)

    number of results per page

  • :crm_id (String)

    CRM ID of the opportunity

Returns:



632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/subskribe_dev/api/orders_api.rb', line 632

def get_opportunities_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_opportunities ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling OrdersApi.get_opportunities"
  end
  # resource path
  local_var_path = '/opportunity'

  # query parameters
  query_params = {}
  query_params[:'accountId'] = 
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'crmId'] = opts[:'crm_id'] if !opts[:'crm_id'].nil?

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

  # form parameters
  form_params = {}

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

#get_opportunity_by_crm_opportunity_id(id, opts = {}) ⇒ OpportunityJson

Return details of an opportunity Returns the details of a specified opportunity

Parameters:

  • id

    id of the opportunity

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

    the optional parameters

Returns:



678
679
680
681
# File 'lib/subskribe_dev/api/orders_api.rb', line 678

def get_opportunity_by_crm_opportunity_id(id, opts = {})
  data, _status_code, _headers = get_opportunity_by_crm_opportunity_id_with_http_info(id, opts)
  data
end

#get_opportunity_by_crm_opportunity_id_with_http_info(id, opts = {}) ⇒ Array<(OpportunityJson, Fixnum, Hash)>

Return details of an opportunity Returns the details of a specified opportunity

Parameters:

  • id

    id of the opportunity

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

    the optional parameters

Returns:

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

    OpportunityJson data, response status code and response headers



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
716
717
718
719
720
721
722
723
724
# File 'lib/subskribe_dev/api/orders_api.rb', line 688

def get_opportunity_by_crm_opportunity_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_opportunity_by_crm_opportunity_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_opportunity_by_crm_opportunity_id"
  end
  # resource path
  local_var_path = '/opportunity/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_order(id, opts = {}) ⇒ OrderJson

Get order details Get the details of the specified order

Parameters:

  • id

    order id

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

    the optional parameters

Returns:



730
731
732
733
# File 'lib/subskribe_dev/api/orders_api.rb', line 730

def get_order(id, opts = {})
  data, _status_code, _headers = get_order_with_http_info(id, opts)
  data
end

#get_order_document1(id, opts = {}) ⇒ nil

Fetch order form PDF Downloads the order form PDF for the specified order. This PDF must have been generated via a POST to /id/pdf. The response is the PDF document.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

  • (nil)


782
783
784
785
# File 'lib/subskribe_dev/api/orders_api.rb', line 782

def get_order_document1(id, opts = {})
  get_order_document1_with_http_info(id, opts)
  nil
end

#get_order_document1_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Fetch order form PDF Downloads the order form PDF for the specified order. This PDF must have been generated via a POST to /id/pdf. The response is the PDF document.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
# File 'lib/subskribe_dev/api/orders_api.rb', line 792

def get_order_document1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order_document1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order_document1"
  end
  # resource path
  local_var_path = '/orders/{id}/pdf'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_order_document_doc(id, opts = {}) ⇒ nil

Download word doc version of order form Download the order form as a Microsoft Word document. This document must have been generated via a POST to /id/pdf. The response is the Word Document.

Parameters:

  • id

    id of the document

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

    the optional parameters

Returns:

  • (nil)


833
834
835
836
# File 'lib/subskribe_dev/api/orders_api.rb', line 833

def get_order_document_doc(id, opts = {})
  get_order_document_doc_with_http_info(id, opts)
  nil
end

#get_order_document_doc_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Download word doc version of order form Download the order form as a Microsoft Word document. This document must have been generated via a POST to /id/pdf. The response is the Word Document.

Parameters:

  • id

    id of the document

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
# File 'lib/subskribe_dev/api/orders_api.rb', line 843

def get_order_document_doc_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order_document_doc ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order_document_doc"
  end
  # resource path
  local_var_path = '/orders/{id}/doc'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_order_line_metrics(id, opts = {}) ⇒ Hash<String, MetricsJson>

Get order line metrics Returns the metrics associated with an order’s line items. This includes ARR, TCV, etc.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:



884
885
886
887
# File 'lib/subskribe_dev/api/orders_api.rb', line 884

def get_order_line_metrics(id, opts = {})
  data, _status_code, _headers = get_order_line_metrics_with_http_info(id, opts)
  data
end

#get_order_line_metrics_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, MetricsJson>, Fixnum, Hash)>

Get order line metrics Returns the metrics associated with an order&#39;s line items. This includes ARR, TCV, etc.

Parameters:

  • id

    id of the order

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

    the optional parameters

Returns:

  • (Array<(Hash<String, MetricsJson>, Fixnum, Hash)>)

    Hash<String, MetricsJson> data, response status code and response headers



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
925
926
927
928
929
930
# File 'lib/subskribe_dev/api/orders_api.rb', line 894

def get_order_line_metrics_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order_line_metrics ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order_line_metrics"
  end
  # resource path
  local_var_path = '/orders/{id}/lineItems/metrics'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_order_metrics(id, opts = {}) ⇒ MetricsJson

Get order metrics Returns the metrics associated with an order. This includes ARR, TCV, etc.

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

    date to generate metrics as of. Defaults to now.

Returns:



937
938
939
940
# File 'lib/subskribe_dev/api/orders_api.rb', line 937

def get_order_metrics(id, opts = {})
  data, _status_code, _headers = get_order_metrics_with_http_info(id, opts)
  data
end

#get_order_metrics_with_http_info(id, opts = {}) ⇒ Array<(MetricsJson, Fixnum, Hash)>

Get order metrics Returns the metrics associated with an order. This includes ARR, TCV, etc.

Parameters:

  • id

    id of the order

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

    date to generate metrics as of. Defaults to now.

Returns:

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

    MetricsJson data, response status code and response headers



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
# File 'lib/subskribe_dev/api/orders_api.rb', line 948

def get_order_metrics_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order_metrics ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order_metrics"
  end
  # resource path
  local_var_path = '/orders/{id}/metrics'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'targetDate'] = opts[:'target_date'] if !opts[:'target_date'].nil?

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

  # form parameters
  form_params = {}

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

#get_order_with_http_info(id, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Get order details Get the details of the specified order

Parameters:

  • id

    order id

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

    the optional parameters

Returns:

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

    OrderJson data, response status code and response headers



740
741
742
743
744
745
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
# File 'lib/subskribe_dev/api/orders_api.rb', line 740

def get_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_orders(opts = {}) ⇒ OrderJsonPaginationResponse

Get all Orders Gets all orders for your tenant. The results are paginated. To fetch all results, take the cursor returned from a call and pass it to subsequent calls.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor returned from previous call

  • :limit (Integer)

    number of results per page

Returns:



992
993
994
995
# File 'lib/subskribe_dev/api/orders_api.rb', line 992

def get_orders(opts = {})
  data, _status_code, _headers = get_orders_with_http_info(opts)
  data
end

#get_orders_by_crm_opportunity_id(id, opts = {}) ⇒ Array<Object>

Return a list of orders associated with a CRM opportunity id Returns the details of orders

Parameters:

  • id

    crm id of the opportunity

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

    the optional parameters

Returns:

  • (Array<Object>)


1043
1044
1045
1046
# File 'lib/subskribe_dev/api/orders_api.rb', line 1043

def get_orders_by_crm_opportunity_id(id, opts = {})
  data, _status_code, _headers = get_orders_by_crm_opportunity_id_with_http_info(id, opts)
  data
end

#get_orders_by_crm_opportunity_id_with_http_info(id, opts = {}) ⇒ Array<(Array<Object>, Fixnum, Hash)>

Return a list of orders associated with a CRM opportunity id Returns the details of orders

Parameters:

  • id

    crm id of the opportunity

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

    the optional parameters

Returns:

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

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



1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/subskribe_dev/api/orders_api.rb', line 1053

def get_orders_by_crm_opportunity_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_orders_by_crm_opportunity_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_orders_by_crm_opportunity_id"
  end
  # resource path
  local_var_path = '/opportunity/crm/{id}/orders'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#get_orders_with_http_info(opts = {}) ⇒ Array<(OrderJsonPaginationResponse, Fixnum, Hash)>

Get all Orders Gets all orders for your tenant. The results are paginated. To fetch all results, take the cursor returned from a call and pass it to subsequent calls.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor returned from previous call

  • :limit (Integer)

    number of results per page

Returns:



1003
1004
1005
1006
1007
1008
1009
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
# File 'lib/subskribe_dev/api/orders_api.rb', line 1003

def get_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_orders ...'
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

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

  # form parameters
  form_params = {}

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

#rebase_amendment(order_id, opts = {}) ⇒ OrderJson

Mark order as executed Rebase the given amendment order onto the latest subscription version

Parameters:

  • order_id

    id of the order

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

    the optional parameters

Returns:



1095
1096
1097
1098
# File 'lib/subskribe_dev/api/orders_api.rb', line 1095

def rebase_amendment(order_id, opts = {})
  data, _status_code, _headers = rebase_amendment_with_http_info(order_id, opts)
  data
end

#rebase_amendment_with_http_info(order_id, opts = {}) ⇒ Array<(OrderJson, Fixnum, Hash)>

Mark order as executed Rebase the given amendment order onto the latest subscription version

Parameters:

  • order_id

    id of the order

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

    the optional parameters

Returns:

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

    OrderJson data, response status code and response headers



1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
# File 'lib/subskribe_dev/api/orders_api.rb', line 1105

def rebase_amendment_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.rebase_amendment ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrdersApi.rebase_amendment"
  end
  # resource path
  local_var_path = '/orders/{orderId}/rebase'.sub('{' + 'orderId' + '}', order_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#update_document_template(id, opts = {}) ⇒ nil

Update predefined terms Updates a predefined terms

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1148
1149
1150
1151
# File 'lib/subskribe_dev/api/orders_api.rb', line 1148

def update_document_template(id, opts = {})
  update_document_template_with_http_info(id, opts)
  nil
end

#update_document_template_status(id, status, opts = {}) ⇒ nil

Update predefined terms status Updates the status of a predefined terms

Parameters:

  • id

    id of the predefined terms

  • status

    new status to set

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

    the optional parameters

Returns:

  • (nil)


1201
1202
1203
1204
# File 'lib/subskribe_dev/api/orders_api.rb', line 1201

def update_document_template_status(id, status, opts = {})
  update_document_template_status_with_http_info(id, status, opts)
  nil
end

#update_document_template_status_with_http_info(id, status, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update predefined terms status Updates the status of a predefined terms

Parameters:

  • id

    id of the predefined terms

  • status

    new status to set

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
1250
1251
1252
1253
1254
1255
1256
1257
# File 'lib/subskribe_dev/api/orders_api.rb', line 1212

def update_document_template_status_with_http_info(id, status, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.update_document_template_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.update_document_template_status"
  end
  # verify the required parameter 'status' is set
  if @api_client.config.client_side_validation && status.nil?
    fail ArgumentError, "Missing the required parameter 'status' when calling OrdersApi.update_document_template_status"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['DRAFT', 'ACTIVE', 'DEPRECATED'].include?(status)
    fail ArgumentError, "invalid value for 'status', must be one of DRAFT, ACTIVE, DEPRECATED"
  end
  # resource path
  local_var_path = '/templates/{id}/status/{status}'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'status' + '}', status.to_s)

  # 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 = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#update_document_template_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_document_template_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update predefined terms Updates a predefined terms

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



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
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
# File 'lib/subskribe_dev/api/orders_api.rb', line 1159

def update_document_template_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.update_document_template ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.update_document_template"
  end
  # resource path
  local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#update_order(body, opts = {}) ⇒ nil

Update order details Updates the details of the specified order

Parameters:

  • body

    json representing the order details

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

    the optional parameters

Options Hash (opts):

  • :is_dry_run (BOOLEAN)

    true if the order should not be persisted

Returns:

  • (nil)


1264
1265
1266
1267
# File 'lib/subskribe_dev/api/orders_api.rb', line 1264

def update_order(body, opts = {})
  update_order_with_http_info(body, opts)
  nil
end

#update_order_status(id, status, opts = {}) ⇒ nil

Update order status Updates the status of the specified order to the specified value

Parameters:

  • id

    id of the order

  • status

    new status

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

    the optional parameters

Options Hash (opts):

  • :status_updated_on (Integer)

    Order status update time

Returns:

  • (nil)


1321
1322
1323
1324
# File 'lib/subskribe_dev/api/orders_api.rb', line 1321

def update_order_status(id, status, opts = {})
  update_order_status_with_http_info(id, status, opts)
  nil
end

#update_order_status_with_http_info(id, status, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update order status Updates the status of the specified order to the specified value

Parameters:

  • id

    id of the order

  • status

    new status

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

    the optional parameters

Options Hash (opts):

  • :status_updated_on (Integer)

    Order status update time

Returns:

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

    nil, response status code and response headers



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
1376
1377
1378
1379
# File 'lib/subskribe_dev/api/orders_api.rb', line 1333

def update_order_status_with_http_info(id, status, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.update_order_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.update_order_status"
  end
  # verify the required parameter 'status' is set
  if @api_client.config.client_side_validation && status.nil?
    fail ArgumentError, "Missing the required parameter 'status' when calling OrdersApi.update_order_status"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['DRAFT', 'SUBMITTED', 'EXECUTED', 'CANCELLED'].include?(status)
    fail ArgumentError, "invalid value for 'status', must be one of DRAFT, SUBMITTED, EXECUTED, CANCELLED"
  end
  # resource path
  local_var_path = '/orders/{id}/status/{status}'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'status' + '}', status.to_s)

  # query parameters
  query_params = {}
  query_params[:'statusUpdatedOn'] = opts[:'status_updated_on'] if !opts[:'status_updated_on'].nil?

  # 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 = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#update_order_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_order_with_http_info(body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update order details Updates the details of the specified order

Parameters:

  • body

    json representing the order details

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

    the optional parameters

Options Hash (opts):

  • :is_dry_run (BOOLEAN)

    true if the order should not be persisted

Returns:

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

    nil, response status code and response headers



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
1311
1312
1313
# File 'lib/subskribe_dev/api/orders_api.rb', line 1275

def update_order_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.update_order ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OrdersApi.update_order"
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = {}
  query_params[:'isDryRun'] = opts[:'is_dry_run'] if !opts[:'is_dry_run'].nil?

  # 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(body)
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#update_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end