Class: KoronaCloudClient::DiscountConfigurationsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DiscountConfigurationsApi

Returns a new instance of DiscountConfigurationsApi.



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

def api_client
  @api_client
end

Instance Method Details

#add_discount_configuration_discount_levels(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<AddOrUpdateResult>

adds a batch of new discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of new discount levels

  • 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; deprecated, use writeMode ADD_OR_UPDATE instead

  • :write_mode (String)

    DEFAULT &#x3D; insert; ADD_OR_UPDATE &#x3D; insert or update, overwrite all non-null fields; ADD_OR_REPLACE &#x3D; insert or update, overwrite all fields

Returns:



30
31
32
33
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 30

def add_discount_configuration_discount_levels(, discount_configuration_id, discount_level, opts = {})
  data, _status_code, _headers = add_discount_configuration_discount_levels_with_http_info(, discount_configuration_id, discount_level, opts)
  data
end

#add_discount_configuration_discount_levels_with_http_info(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

adds a batch of new discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of new discount levels

  • 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; deprecated, use writeMode ADD_OR_UPDATE instead

  • :write_mode (String)

    DEFAULT &#x3D; insert; ADD_OR_UPDATE &#x3D; insert or update, overwrite all non-null fields; ADD_OR_REPLACE &#x3D; insert or update, overwrite all fields

Returns:

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

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



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
99
100
101
102
103
104
105
106
107
108
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 43

def add_discount_configuration_discount_levels_with_http_info(, discount_configuration_id, discount_level, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.add_discount_configuration_discount_levels ...'
  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 DiscountConfigurationsApi.add_discount_configuration_discount_levels"
  end
  # verify the required parameter 'discount_configuration_id' is set
  if @api_client.config.client_side_validation && discount_configuration_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration_id' when calling DiscountConfigurationsApi.add_discount_configuration_discount_levels"
  end
  # verify the required parameter 'discount_level' is set
  if @api_client.config.client_side_validation && discount_level.nil?
    fail ArgumentError, "Missing the required parameter 'discount_level' when calling DiscountConfigurationsApi.add_discount_configuration_discount_levels"
  end
  allowable_values = ["DEFAULT", "ADD_OR_UPDATE", "ADD_OR_REPLACE"]
  if @api_client.config.client_side_validation && opts[:'write_mode'] && !allowable_values.include?(opts[:'write_mode'])
    fail ArgumentError, "invalid value for \"write_mode\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations/{discountConfigurationId}/discountLevels'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s)).sub('{' + 'discountConfigurationId' + '}', CGI.escape(discount_configuration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'upsert'] = opts[:'upsert'] if !opts[:'upsert'].nil?
  query_params[:'writeMode'] = opts[:'write_mode'] if !opts[:'write_mode'].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(discount_level)

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.add_discount_configuration_discount_levels",
    :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: DiscountConfigurationsApi#add_discount_configuration_discount_levels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_discount_configuration_discounts(korona_account_id, discount_configuration, opts = {}) ⇒ Array<AddOrUpdateResult>

adds a batch of new discount configurations

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration (Array<DiscountConfiguration>)

    array of new discount configurations

  • 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; deprecated, use writeMode ADD_OR_UPDATE instead

  • :write_mode (String)

    DEFAULT &#x3D; insert; ADD_OR_UPDATE &#x3D; insert or update, overwrite all non-null fields; ADD_OR_REPLACE &#x3D; insert or update, overwrite all fields

Returns:



117
118
119
120
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 117

def add_discount_configuration_discounts(, discount_configuration, opts = {})
  data, _status_code, _headers = add_discount_configuration_discounts_with_http_info(, discount_configuration, opts)
  data
end

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

adds a batch of new discount configurations

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration (Array<DiscountConfiguration>)

    array of new discount configurations

  • 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; deprecated, use writeMode ADD_OR_UPDATE instead

  • :write_mode (String)

    DEFAULT &#x3D; insert; ADD_OR_UPDATE &#x3D; insert or update, overwrite all non-null fields; ADD_OR_REPLACE &#x3D; insert or update, overwrite all fields

Returns:

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

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



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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 129

def add_discount_configuration_discounts_with_http_info(, discount_configuration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.add_discount_configuration_discounts ...'
  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 DiscountConfigurationsApi.add_discount_configuration_discounts"
  end
  # verify the required parameter 'discount_configuration' is set
  if @api_client.config.client_side_validation && discount_configuration.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration' when calling DiscountConfigurationsApi.add_discount_configuration_discounts"
  end
  allowable_values = ["DEFAULT", "ADD_OR_UPDATE", "ADD_OR_REPLACE"]
  if @api_client.config.client_side_validation && opts[:'write_mode'] && !allowable_values.include?(opts[:'write_mode'])
    fail ArgumentError, "invalid value for \"write_mode\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'upsert'] = opts[:'upsert'] if !opts[:'upsert'].nil?
  query_params[:'writeMode'] = opts[:'write_mode'] if !opts[:'write_mode'].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(discount_configuration)

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.add_discount_configuration_discounts",
    :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: DiscountConfigurationsApi#add_discount_configuration_discounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_discount_configuration_discount_level(korona_account_id, discount_configuration_id, discount_level_id, opts = {}) ⇒ nil

deletes the single discount configuration discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

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

    the optional parameters

Returns:

  • (nil)


198
199
200
201
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 198

def delete_discount_configuration_discount_level(, discount_configuration_id, discount_level_id, opts = {})
  delete_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, opts)
  nil
end

#delete_discount_configuration_discount_level_with_http_info(korona_account_id, discount_configuration_id, discount_level_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

deletes the single discount configuration discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 209

def delete_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.delete_discount_configuration_discount_level ...'
  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 DiscountConfigurationsApi.delete_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_configuration_id' is set
  if @api_client.config.client_side_validation && discount_configuration_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration_id' when calling DiscountConfigurationsApi.delete_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_level_id' is set
  if @api_client.config.client_side_validation && discount_level_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_level_id' when calling DiscountConfigurationsApi.delete_discount_configuration_discount_level"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations/{discountConfigurationId}/discountLevels/{discountLevelId}'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s)).sub('{' + 'discountConfigurationId' + '}', CGI.escape(discount_configuration_id.to_s)).sub('{' + 'discountLevelId' + '}', CGI.escape(discount_level_id.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 => :"DiscountConfigurationsApi.delete_discount_configuration_discount_level",
    :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: DiscountConfigurationsApi#delete_discount_configuration_discount_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_discount_configuration_discount_levels(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<AddOrUpdateResult>

deletes a batch of discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of existing discount levels (id or number required)

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

    the optional parameters

Returns:



271
272
273
274
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 271

def delete_discount_configuration_discount_levels(, discount_configuration_id, discount_level, opts = {})
  data, _status_code, _headers = delete_discount_configuration_discount_levels_with_http_info(, discount_configuration_id, discount_level, opts)
  data
end

#delete_discount_configuration_discount_levels_with_http_info(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

deletes a batch of discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of existing discount levels (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



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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 282

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

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.delete_discount_configuration_discount_levels",
    :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: DiscountConfigurationsApi#delete_discount_configuration_discount_levels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_configuration(korona_account_id, discount_configuration_id, opts = {}) ⇒ DiscountConfiguration

returns the single discount configuration

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

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

    the optional parameters

Returns:



348
349
350
351
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 348

def get_discount_configuration(, discount_configuration_id, opts = {})
  data, _status_code, _headers = get_discount_configuration_with_http_info(, discount_configuration_id, opts)
  data
end

#get_discount_configuration_discount_level(korona_account_id, discount_configuration_id, discount_level_id, opts = {}) ⇒ DiscountLevel

returns the single discount configuration discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

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

    the optional parameters

Returns:



416
417
418
419
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 416

def get_discount_configuration_discount_level(, discount_configuration_id, discount_level_id, opts = {})
  data, _status_code, _headers = get_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, opts)
  data
end

#get_discount_configuration_discount_level_with_http_info(korona_account_id, discount_configuration_id, discount_level_id, opts = {}) ⇒ Array<(DiscountLevel, Integer, Hash)>

returns the single discount configuration discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

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

    the optional parameters

Returns:

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

    DiscountLevel data, response status code and response headers



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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 427

def get_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.get_discount_configuration_discount_level ...'
  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 DiscountConfigurationsApi.get_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_configuration_id' is set
  if @api_client.config.client_side_validation && discount_configuration_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration_id' when calling DiscountConfigurationsApi.get_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_level_id' is set
  if @api_client.config.client_side_validation && discount_level_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_level_id' when calling DiscountConfigurationsApi.get_discount_configuration_discount_level"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations/{discountConfigurationId}/discountLevels/{discountLevelId}'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s)).sub('{' + 'discountConfigurationId' + '}', CGI.escape(discount_configuration_id.to_s)).sub('{' + 'discountLevelId' + '}', CGI.escape(discount_level_id.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] || 'DiscountLevel'

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_configuration_discount_level",
    :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: DiscountConfigurationsApi#get_discount_configuration_discount_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_configuration_discount_levels(korona_account_id, discount_configuration_id, opts = {}) ⇒ ResultListDiscountLevel

lists all discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • 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)

Returns:



493
494
495
496
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 493

def get_discount_configuration_discount_levels(, discount_configuration_id, opts = {})
  data, _status_code, _headers = get_discount_configuration_discount_levels_with_http_info(, discount_configuration_id, opts)
  data
end

#get_discount_configuration_discount_levels_with_http_info(korona_account_id, discount_configuration_id, opts = {}) ⇒ Array<(ResultListDiscountLevel, Integer, Hash)>

lists all discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • 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)

Returns:

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

    ResultListDiscountLevel data, response status code and response headers



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

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

  # 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] || 'ResultListDiscountLevel'

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_configuration_discount_levels",
    :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: DiscountConfigurationsApi#get_discount_configuration_discount_levels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_configuration_with_http_info(korona_account_id, discount_configuration_id, opts = {}) ⇒ Array<(DiscountConfiguration, Integer, Hash)>

returns the single discount configuration

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

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

    the optional parameters

Returns:

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

    DiscountConfiguration data, response status code and response headers



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
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 358

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_configuration",
    :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: DiscountConfigurationsApi#get_discount_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_configurations(korona_account_id, opts = {}) ⇒ ResultListDiscountConfiguration

lists all discount configurations

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)

  • :number (String)

    number of the related object

Returns:



575
576
577
578
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 575

def get_discount_configurations(, opts = {})
  data, _status_code, _headers = get_discount_configurations_with_http_info(, opts)
  data
end

#get_discount_configurations_with_http_info(korona_account_id, opts = {}) ⇒ Array<(ResultListDiscountConfiguration, Integer, Hash)>

lists all discount configurations

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)

  • :number (String)

    number of the related object

Returns:



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 590

def get_discount_configurations_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.get_discount_configurations ...'
  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 DiscountConfigurationsApi.get_discount_configurations"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations'.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[:'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] || 'ResultListDiscountConfiguration'

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_configurations",
    :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: DiscountConfigurationsApi#get_discount_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_level(korona_account_id, discount_level_id, opts = {}) ⇒ DiscountLevel

returns the single discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_level_id (String)

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

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

    the optional parameters

Returns:



649
650
651
652
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 649

def get_discount_level(, discount_level_id, opts = {})
  data, _status_code, _headers = get_discount_level_with_http_info(, discount_level_id, opts)
  data
end

#get_discount_level_with_http_info(korona_account_id, discount_level_id, opts = {}) ⇒ Array<(DiscountLevel, Integer, Hash)>

returns the single discount level

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_level_id (String)

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

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

    the optional parameters

Returns:

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

    DiscountLevel data, response status code and response headers



659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 659

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_level",
    :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: DiscountConfigurationsApi#get_discount_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_discount_levels(korona_account_id, opts = {}) ⇒ ResultListDiscountLevel

lists all discount levels

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)

  • :number (String)

    number of the related object

Returns:



721
722
723
724
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 721

def get_discount_levels(, opts = {})
  data, _status_code, _headers = get_discount_levels_with_http_info(, opts)
  data
end

#get_discount_levels_with_http_info(korona_account_id, opts = {}) ⇒ Array<(ResultListDiscountLevel, Integer, Hash)>

lists all discount levels

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)

  • :number (String)

    number of the related object

Returns:

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

    ResultListDiscountLevel data, response status code and response headers



736
737
738
739
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
777
778
779
780
781
782
783
784
785
786
787
788
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 736

def get_discount_levels_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.get_discount_levels ...'
  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 DiscountConfigurationsApi.get_discount_levels"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountLevels'.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[:'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] || 'ResultListDiscountLevel'

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.get_discount_levels",
    :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: DiscountConfigurationsApi#get_discount_levels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_discount_configuration(korona_account_id, discount_configuration_id, discount_configuration, opts = {}) ⇒ nil

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

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_configuration (DiscountConfiguration)

    the properties to update of the discount configuration

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

    the optional parameters

Returns:

  • (nil)


796
797
798
799
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 796

def update_discount_configuration(, discount_configuration_id, discount_configuration, opts = {})
  update_discount_configuration_with_http_info(, discount_configuration_id, discount_configuration, opts)
  nil
end

#update_discount_configuration_discount_level(korona_account_id, discount_configuration_id, discount_level_id, discount_level, opts = {}) ⇒ nil

updates the single discount configuration discount level; if [number] is set, the number of the object will change and the resource location as well

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

  • discount_level (DiscountLevel)

    the properties to update of the discount level

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

    the optional parameters

Returns:

  • (nil)


875
876
877
878
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 875

def update_discount_configuration_discount_level(, discount_configuration_id, discount_level_id, discount_level, opts = {})
  update_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, discount_level, opts)
  nil
end

#update_discount_configuration_discount_level_with_http_info(korona_account_id, discount_configuration_id, discount_level_id, discount_level, opts = {}) ⇒ Array<(nil, Integer, Hash)>

updates the single discount configuration discount level; if [number] is set, the number of the object will change and the resource location as well

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level_id (String)

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

  • discount_level (DiscountLevel)

    the properties to update of the discount level

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 887

def update_discount_configuration_discount_level_with_http_info(, discount_configuration_id, discount_level_id, discount_level, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.update_discount_configuration_discount_level ...'
  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 DiscountConfigurationsApi.update_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_configuration_id' is set
  if @api_client.config.client_side_validation && discount_configuration_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration_id' when calling DiscountConfigurationsApi.update_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_level_id' is set
  if @api_client.config.client_side_validation && discount_level_id.nil?
    fail ArgumentError, "Missing the required parameter 'discount_level_id' when calling DiscountConfigurationsApi.update_discount_configuration_discount_level"
  end
  # verify the required parameter 'discount_level' is set
  if @api_client.config.client_side_validation && discount_level.nil?
    fail ArgumentError, "Missing the required parameter 'discount_level' when calling DiscountConfigurationsApi.update_discount_configuration_discount_level"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations/{discountConfigurationId}/discountLevels/{discountLevelId}'.sub('{' + 'koronaAccountId' + '}', CGI.escape(.to_s)).sub('{' + 'discountConfigurationId' + '}', CGI.escape(discount_configuration_id.to_s)).sub('{' + 'discountLevelId' + '}', CGI.escape(discount_level_id.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(discount_level)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.update_discount_configuration_discount_level",
    :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: DiscountConfigurationsApi#update_discount_configuration_discount_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_discount_configuration_discount_levels(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<AddOrUpdateResult>

updates a batch of discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of discount levels

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

    the optional parameters

Returns:



958
959
960
961
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 958

def update_discount_configuration_discount_levels(, discount_configuration_id, discount_level, opts = {})
  data, _status_code, _headers = update_discount_configuration_discount_levels_with_http_info(, discount_configuration_id, discount_level, opts)
  data
end

#update_discount_configuration_discount_levels_with_http_info(korona_account_id, discount_configuration_id, discount_level, opts = {}) ⇒ Array<(Array<AddOrUpdateResult>, Integer, Hash)>

updates a batch of discount configuration discount levels

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_level (Array<DiscountLevel>)

    array of discount levels

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

    the optional parameters

Returns:

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

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



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
1001
1002
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
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 969

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

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.update_discount_configuration_discount_levels",
    :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: DiscountConfigurationsApi#update_discount_configuration_discount_levels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_discount_configuration_with_http_info(korona_account_id, discount_configuration_id, discount_configuration, opts = {}) ⇒ Array<(nil, Integer, Hash)>

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

Parameters:

  • korona_account_id (String)

    account id of the KORONA.cloud account

  • discount_configuration_id (String)

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

  • discount_configuration (DiscountConfiguration)

    the properties to update of the discount configuration

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 807

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.update_discount_configuration",
    :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: DiscountConfigurationsApi#update_discount_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_discount_configurations(korona_account_id, discount_configuration, opts = {}) ⇒ Array<AddOrUpdateResult>

updates a batch of discountConfigurations; [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

  • discount_configuration (Array<DiscountConfiguration>)

    an array of existing discountConfigurations

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

    the optional parameters

Returns:



1035
1036
1037
1038
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 1035

def update_discount_configurations(, discount_configuration, opts = {})
  data, _status_code, _headers = update_discount_configurations_with_http_info(, discount_configuration, opts)
  data
end

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

updates a batch of discountConfigurations; [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

  • discount_configuration (Array<DiscountConfiguration>)

    an array of existing discountConfigurations

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

    the optional parameters

Returns:

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

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



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
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/korona-cloud-client/api/discount_configurations_api.rb', line 1045

def update_discount_configurations_with_http_info(, discount_configuration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DiscountConfigurationsApi.update_discount_configurations ...'
  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 DiscountConfigurationsApi.update_discount_configurations"
  end
  # verify the required parameter 'discount_configuration' is set
  if @api_client.config.client_side_validation && discount_configuration.nil?
    fail ArgumentError, "Missing the required parameter 'discount_configuration' when calling DiscountConfigurationsApi.update_discount_configurations"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/discountConfigurations'.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(discount_configuration)

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

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

  new_options = opts.merge(
    :operation => :"DiscountConfigurationsApi.update_discount_configurations",
    :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: DiscountConfigurationsApi#update_discount_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end