Class: KoronaCloudClient::VouchersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/korona-cloud-client/api/vouchers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VouchersApi

Returns a new instance of VouchersApi.



19
20
21
# File 'lib/korona-cloud-client/api/vouchers_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/korona-cloud-client/api/vouchers_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_voucher_voucher_transactions(voucher_id, korona_account_id, body, opts = {}) ⇒ Array<AddOrUpdateResult>

adds a batch of new voucher transactions

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherTransactionResource>)

    array of new voucher transactions

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 28

def add_voucher_voucher_transactions(voucher_id, , body, opts = {})
  data, _status_code, _headers = add_voucher_voucher_transactions_with_http_info(voucher_id, , body, opts)
  data
end

#add_voucher_voucher_transactions_with_http_info(voucher_id, korona_account_id, body, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

adds a batch of new voucher transactions

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherTransactionResource>)

    array of new voucher transactions

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

    the optional parameters

Returns:

  • (Array<(Array<AddOrUpdateResult>, Integer, Hash)>)

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



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
98
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 39

def add_voucher_voucher_transactions_with_http_info(voucher_id, , body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.add_voucher_voucher_transactions ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.add_voucher_voucher_transactions"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.add_voucher_voucher_transactions"
  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 VouchersApi.add_voucher_voucher_transactions"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AddOrUpdateResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.add_voucher_voucher_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#add_voucher_voucher_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_vouchers(korona_account_id, body, opts = {}) ⇒ Array<AddOrUpdateResult>

adds a batch of new vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    array of new vouchers

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

    the optional parameters

Options Hash (opts):

  • :upsert (Boolean)

    when set to true, updates the object instead of generating a already-exists-error

Returns:



106
107
108
109
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 106

def add_vouchers(, body, opts = {})
  data, _status_code, _headers = add_vouchers_with_http_info(, body, opts)
  data
end

#add_vouchers_with_http_info(korona_account_id, body, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

adds a batch of new vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    array of new vouchers

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

    the optional parameters

Options Hash (opts):

  • :upsert (Boolean)

    when set to true, updates the object instead of generating a already-exists-error

Returns:

  • (Array<(Array<AddOrUpdateResult>, Integer, Hash)>)

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



117
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
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 117

def add_vouchers_with_http_info(, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.add_vouchers ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.add_vouchers"
  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 VouchersApi.add_vouchers"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AddOrUpdateResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.add_vouchers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#add_vouchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_voucher(voucher_id, korona_account_id, opts = {}) ⇒ nil

deletes the single voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

  • (nil)


180
181
182
183
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 180

def delete_voucher(voucher_id, , opts = {})
  delete_voucher_with_http_info(voucher_id, , opts)
  nil
end

#delete_voucher_with_http_info(voucher_id, korona_account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

deletes the single voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 190

def delete_voucher_with_http_info(voucher_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.delete_voucher ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.delete_voucher"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.delete_voucher"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.delete_voucher",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#delete_voucher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_vouchers(korona_account_id, body, opts = {}) ⇒ Array<AddOrUpdateResult>

deletes a batch of vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    array of existing vouchers (id or number required)

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

    the optional parameters

Returns:



247
248
249
250
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 247

def delete_vouchers(, body, opts = {})
  data, _status_code, _headers = delete_vouchers_with_http_info(, body, opts)
  data
end

#delete_vouchers_with_http_info(korona_account_id, body, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

deletes a batch of vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    array of existing vouchers (id or number required)

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

    the optional parameters

Returns:

  • (Array<(Array<AddOrUpdateResult>, Integer, Hash)>)

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



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 257

def delete_vouchers_with_http_info(, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.delete_vouchers ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.delete_vouchers"
  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 VouchersApi.delete_vouchers"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AddOrUpdateResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.delete_vouchers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#delete_vouchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_voucher(voucher_id, korona_account_id, opts = {}) ⇒ VoucherResource

returns the single voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:



319
320
321
322
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 319

def get_voucher(voucher_id, , opts = {})
  data, _status_code, _headers = get_voucher_with_http_info(voucher_id, , opts)
  data
end

#get_voucher_transaction(voucher_transaction_id, korona_account_id, opts = {}) ⇒ VoucherTransactionResource

returns the single voucher transaction

Parameters:

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:



386
387
388
389
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 386

def get_voucher_transaction(voucher_transaction_id, , opts = {})
  data, _status_code, _headers = get_voucher_transaction_with_http_info(voucher_transaction_id, , opts)
  data
end

#get_voucher_transaction_with_http_info(voucher_transaction_id, korona_account_id, opts = {}) ⇒ Array<(VoucherTransactionResource, Integer, Hash)>

returns the single voucher transaction

Parameters:

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

  • (Array<(VoucherTransactionResource, Integer, Hash)>)

    VoucherTransactionResource data, response status code and response headers



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
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
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 396

def get_voucher_transaction_with_http_info(voucher_transaction_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_voucher_transaction ...'
  end
  # verify the required parameter 'voucher_transaction_id' is set
  if @api_client.config.client_side_validation && voucher_transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_transaction_id' when calling VouchersApi.get_voucher_transaction"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_voucher_transaction"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/voucherTransactions/{voucherTransactionId}'.sub('{' + 'voucherTransactionId' + '}', CGI.escape(voucher_transaction_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VoucherTransactionResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_voucher_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_voucher_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_voucher_transactions(korona_account_id, opts = {}) ⇒ ResultListVoucherTransactionResource

returns all voucher transactions

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

Returns:



456
457
458
459
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 456

def get_voucher_transactions(, opts = {})
  data, _status_code, _headers = get_voucher_transactions_with_http_info(, opts)
  data
end

#get_voucher_transactions_with_http_info(korona_account_id, opts = {}) ⇒ Array<(ResultListVoucherTransactionResource, Integer, Hash)>

returns all voucher transactions

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

Returns:



469
470
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
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 469

def get_voucher_transactions_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_voucher_transactions ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_voucher_transactions"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/voucherTransactions'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResultListVoucherTransactionResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_voucher_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_voucher_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_voucher_voucher_transaction(voucher_id, voucher_transaction_id, korona_account_id, opts = {}) ⇒ VoucherTransactionResource

returns the single voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:



527
528
529
530
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 527

def get_voucher_voucher_transaction(voucher_id, voucher_transaction_id, , opts = {})
  data, _status_code, _headers = get_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , opts)
  data
end

#get_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, korona_account_id, opts = {}) ⇒ Array<(VoucherTransactionResource, Integer, Hash)>

returns the single voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

  • (Array<(VoucherTransactionResource, Integer, Hash)>)

    VoucherTransactionResource data, response status code and response headers



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 538

def get_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_voucher_voucher_transaction ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.get_voucher_voucher_transaction"
  end
  # verify the required parameter 'voucher_transaction_id' is set
  if @api_client.config.client_side_validation && voucher_transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_transaction_id' when calling VouchersApi.get_voucher_voucher_transaction"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_voucher_voucher_transaction"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions/{voucherTransactionId}'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'voucherTransactionId' + '}', CGI.escape(voucher_transaction_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VoucherTransactionResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_voucher_voucher_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_voucher_voucher_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_voucher_voucher_transactions(voucher_id, korona_account_id, opts = {}) ⇒ ResultListVoucherTransactionResource

returns all voucher transaction of specified voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

Returns:



603
604
605
606
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 603

def get_voucher_voucher_transactions(voucher_id, , opts = {})
  data, _status_code, _headers = get_voucher_voucher_transactions_with_http_info(voucher_id, , opts)
  data
end

#get_voucher_voucher_transactions_with_http_info(voucher_id, korona_account_id, opts = {}) ⇒ Array<(ResultListVoucherTransactionResource, Integer, Hash)>

returns all voucher transaction of specified voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

Returns:



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
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
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 617

def get_voucher_voucher_transactions_with_http_info(voucher_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_voucher_voucher_transactions ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.get_voucher_voucher_transactions"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_voucher_voucher_transactions"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResultListVoucherTransactionResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_voucher_voucher_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_voucher_voucher_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_voucher_with_http_info(voucher_id, korona_account_id, opts = {}) ⇒ Array<(VoucherResource, Integer, Hash)>

returns the single voucher

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

  • (Array<(VoucherResource, Integer, Hash)>)

    VoucherResource data, response status code and response headers



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 329

def get_voucher_with_http_info(voucher_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_voucher ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.get_voucher"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_voucher"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VoucherResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_voucher",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_voucher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vouchers(korona_account_id, opts = {}) ⇒ ResultListVoucherResource

lists all vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

  • :include_deleted (Boolean)

    indicates deleted objects should be loaded or not (default: false)

  • :tag (String)

    voucher configuration id to filter by

  • :customer (String)

    voucher configuration id to filter by

  • :number (String)

    number of the related object

Returns:



685
686
687
688
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 685

def get_vouchers(, opts = {})
  data, _status_code, _headers = get_vouchers_with_http_info(, opts)
  data
end

#get_vouchers_with_http_info(korona_account_id, opts = {}) ⇒ Array<(ResultListVoucherResource, Integer, Hash)>

lists all vouchers

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    number of the page to fetch

  • :size (Integer)

    amount of objects to return per page

  • :sort (String)

    attribute to sort by (multiple separated by comma; max. 5)

  • :revision (Integer)

    last revision number, objects with a greater revision than this will be returned

  • :include_deleted (Boolean)

    indicates deleted objects should be loaded or not (default: false)

  • :tag (String)

    voucher configuration id to filter by

  • :customer (String)

    voucher configuration id to filter by

  • :number (String)

    number of the related object

Returns:

  • (Array<(ResultListVoucherResource, Integer, Hash)>)

    ResultListVoucherResource data, response status code and response headers



702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 702

def get_vouchers_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.get_vouchers ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.get_vouchers"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?
  query_params[:'includeDeleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
  query_params[:'customer'] = opts[:'customer'] if !opts[:'customer'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResultListVoucherResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.get_vouchers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#get_vouchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_voucher(voucher_id, korona_account_id, body, opts = {}) ⇒ nil

updates the single voucher if [number] is set, the number of the object will change and the resource location as well

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (VoucherResource)

    the properties to update of the voucher

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

    the optional parameters

Returns:

  • (nil)


765
766
767
768
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 765

def update_voucher(voucher_id, , body, opts = {})
  update_voucher_with_http_info(voucher_id, , body, opts)
  nil
end

#update_voucher_voucher_transaction(voucher_id, voucher_transaction_id, korona_account_id, body, opts = {}) ⇒ nil

updates the voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (VoucherTransactionResource)

    the properties to update of the voucher transaction

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

    the optional parameters

Returns:

  • (nil)


845
846
847
848
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 845

def update_voucher_voucher_transaction(voucher_id, voucher_transaction_id, , body, opts = {})
  update_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , body, opts)
  nil
end

#update_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, korona_account_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

updates the voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (VoucherTransactionResource)

    the properties to update of the voucher transaction

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
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
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 857

def update_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.update_voucher_voucher_transaction ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.update_voucher_voucher_transaction"
  end
  # verify the required parameter 'voucher_transaction_id' is set
  if @api_client.config.client_side_validation && voucher_transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_transaction_id' when calling VouchersApi.update_voucher_voucher_transaction"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.update_voucher_voucher_transaction"
  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 VouchersApi.update_voucher_voucher_transaction"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions/{voucherTransactionId}'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'voucherTransactionId' + '}', CGI.escape(voucher_transaction_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.update_voucher_voucher_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#update_voucher_voucher_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_voucher_voucher_transactions(voucher_id, korona_account_id, body, opts = {}) ⇒ Array<AddOrUpdateResult>

updates a batch of vouchers

id

must be set in the objects, otherwise the object cannot be updated

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherTransactionResource>)

    an array of existing voucher transactions

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

    the optional parameters

Returns:



929
930
931
932
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 929

def update_voucher_voucher_transactions(voucher_id, , body, opts = {})
  data, _status_code, _headers = update_voucher_voucher_transactions_with_http_info(voucher_id, , body, opts)
  data
end

#update_voucher_voucher_transactions_with_http_info(voucher_id, korona_account_id, body, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

updates a batch of vouchers

id

must be set in the objects, otherwise the object cannot be updated

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherTransactionResource>)

    an array of existing voucher transactions

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

    the optional parameters

Returns:

  • (Array<(Array<AddOrUpdateResult>, Integer, Hash)>)

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



941
942
943
944
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
990
991
992
993
994
995
996
997
998
999
1000
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 941

def update_voucher_voucher_transactions_with_http_info(voucher_id, , body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.update_voucher_voucher_transactions ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.update_voucher_voucher_transactions"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.update_voucher_voucher_transactions"
  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 VouchersApi.update_voucher_voucher_transactions"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AddOrUpdateResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.update_voucher_voucher_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#update_voucher_voucher_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_voucher_with_http_info(voucher_id, korona_account_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

updates the single voucher if [number] is set, the number of the object will change and the resource location as well

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (VoucherResource)

    the properties to update of the voucher

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
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
828
829
830
831
832
833
834
835
836
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 777

def update_voucher_with_http_info(voucher_id, , body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.update_voucher ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.update_voucher"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.update_voucher"
  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 VouchersApi.update_voucher"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.update_voucher",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#update_voucher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_vouchers(korona_account_id, body, opts = {}) ⇒ Array<AddOrUpdateResult>

updates a batch of vouchers

number

must be set in the objects, otherwise the object cannot be updated

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    an array of existing vouchers

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

    the optional parameters

Returns:



1008
1009
1010
1011
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 1008

def update_vouchers(, body, opts = {})
  data, _status_code, _headers = update_vouchers_with_http_info(, body, opts)
  data
end

#update_vouchers_with_http_info(korona_account_id, body, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

updates a batch of vouchers

number

must be set in the objects, otherwise the object cannot be updated

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • body (Array<VoucherResource>)

    an array of existing vouchers

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

    the optional parameters

Returns:

  • (Array<(Array<AddOrUpdateResult>, Integer, Hash)>)

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



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
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 1019

def update_vouchers_with_http_info(, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.update_vouchers ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.update_vouchers"
  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 VouchersApi.update_vouchers"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AddOrUpdateResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.update_vouchers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#update_vouchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#void_voucher_voucher_transaction(voucher_id, voucher_transaction_id, korona_account_id, opts = {}) ⇒ nil

voids the voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

  • (nil)


1082
1083
1084
1085
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 1082

def void_voucher_voucher_transaction(voucher_id, voucher_transaction_id, , opts = {})
  void_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , opts)
  nil
end

#void_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, korona_account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

voids the voucher transaction

Parameters:

  • voucher_id (String)

    id of the related object (important: id should match the uuid-format)

  • voucher_transaction_id (String)

    id of the related object (important: id should match the uuid-format)

  • korona_account_id (String)

    account id of the KORONA.cloud account

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/korona-cloud-client/api/vouchers_api.rb', line 1093

def void_voucher_voucher_transaction_with_http_info(voucher_id, voucher_transaction_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VouchersApi.void_voucher_voucher_transaction ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling VouchersApi.void_voucher_voucher_transaction"
  end
  # verify the required parameter 'voucher_transaction_id' is set
  if @api_client.config.client_side_validation && voucher_transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_transaction_id' when calling VouchersApi.void_voucher_voucher_transaction"
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling VouchersApi.void_voucher_voucher_transaction"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/vouchers/{voucherId}/transactions/{voucherTransactionId}/void'.sub('{' + 'voucherId' + '}', CGI.escape(voucher_id.to_s)).sub('{' + 'voucherTransactionId' + '}', CGI.escape(voucher_transaction_id.to_s)).sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"VouchersApi.void_voucher_voucher_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VouchersApi#void_voucher_voucher_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end