Class: ILoveVideoEditor::BillingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/generated/ilovevideoeditor-sdk/api/billing_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BillingApi

Returns a new instance of BillingApi.



19
20
21
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_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/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_subscription(opts = {}) ⇒ UploadAsset200Response

Cancel active subscription

Parameters:

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

    the optional parameters

Returns:



25
26
27
28
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 25

def cancel_subscription(opts = {})
  data, _status_code, _headers = cancel_subscription_with_http_info(opts)
  data
end

#cancel_subscription_with_http_info(opts = {}) ⇒ Array<(UploadAsset200Response, Integer, Hash)>

Cancel active subscription

Parameters:

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

    the optional parameters

Returns:

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

    UploadAsset200Response data, response status code and response headers



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

def cancel_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.cancel_subscription ...'
  end
  # resource path
  local_var_path = '/billing/cancel'

  # 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']) unless header_params['Accept']

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

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

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

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

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

#create_checkout_session(create_checkout_session_request, opts = {}) ⇒ CreateCheckoutSession200Response

Create checkout session

Parameters:

Returns:



81
82
83
84
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 81

def create_checkout_session(create_checkout_session_request, opts = {})
  data, _status_code, _headers = create_checkout_session_with_http_info(create_checkout_session_request, opts)
  data
end

#create_checkout_session_with_http_info(create_checkout_session_request, opts = {}) ⇒ Array<(CreateCheckoutSession200Response, Integer, Hash)>

Create checkout session

Parameters:

Returns:



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 90

def create_checkout_session_with_http_info(create_checkout_session_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.create_checkout_session ...'
  end
  # verify the required parameter 'create_checkout_session_request' is set
  if @api_client.config.client_side_validation && create_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_checkout_session_request' when calling BillingApi.create_checkout_session"
  end
  # resource path
  local_var_path = '/billing/checkout'

  # 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']) unless header_params['Accept']
  # 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(create_checkout_session_request)

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

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

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

#get_credits(opts = {}) ⇒ CreditBalance

Get credit balance and history

Parameters:

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

    the optional parameters

Returns:



146
147
148
149
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 146

def get_credits(opts = {})
  data, _status_code, _headers = get_credits_with_http_info(opts)
  data
end

#get_credits_with_http_info(opts = {}) ⇒ Array<(CreditBalance, Integer, Hash)>

Get credit balance and history

Parameters:

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

    the optional parameters

Returns:

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

    CreditBalance data, response status code and response headers



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
191
192
193
194
195
196
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 154

def get_credits_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_credits ...'
  end
  # resource path
  local_var_path = '/billing/credits'

  # 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']) unless header_params['Accept']

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

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

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

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

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

#get_subscription(opts = {}) ⇒ GetSubscription200Response

Get subscription

Parameters:

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

    the optional parameters

Returns:



201
202
203
204
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 201

def get_subscription(opts = {})
  data, _status_code, _headers = get_subscription_with_http_info(opts)
  data
end

#get_subscription_with_http_info(opts = {}) ⇒ Array<(GetSubscription200Response, Integer, Hash)>

Get subscription

Parameters:

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

    the optional parameters

Returns:

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

    GetSubscription200Response data, 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
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 209

def get_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_subscription ...'
  end
  # resource path
  local_var_path = '/billing/subscription'

  # 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']) unless header_params['Accept']

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

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

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

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

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

#get_usage(opts = {}) ⇒ GetUsage200Response

Get usage log history

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 30
  • :type (String)

Returns:



258
259
260
261
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 258

def get_usage(opts = {})
  data, _status_code, _headers = get_usage_with_http_info(opts)
  data
end

#get_usage_with_http_info(opts = {}) ⇒ Array<(GetUsage200Response, Integer, Hash)>

Get usage log history

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 30
  • :type (String)

Returns:

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

    GetUsage200Response data, response status code and response headers



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
313
314
315
316
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 268

def get_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_usage ...'
  end
  allowable_values = ["storage", "bandwidth"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/billing/usage'

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

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

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

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

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

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

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

#list_invoices(opts = {}) ⇒ ListInvoices200Response

List invoices

Parameters:

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

    the optional parameters

Returns:



321
322
323
324
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 321

def list_invoices(opts = {})
  data, _status_code, _headers = list_invoices_with_http_info(opts)
  data
end

#list_invoices_with_http_info(opts = {}) ⇒ Array<(ListInvoices200Response, Integer, Hash)>

List invoices

Parameters:

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

    the optional parameters

Returns:

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

    ListInvoices200Response 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
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 329

def list_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.list_invoices ...'
  end
  # resource path
  local_var_path = '/billing/invoices'

  # 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']) unless header_params['Accept']

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

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

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

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

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

#list_prices(opts = {}) ⇒ BillingPrices

List available prices

Parameters:

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

    the optional parameters

Returns:



376
377
378
379
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 376

def list_prices(opts = {})
  data, _status_code, _headers = list_prices_with_http_info(opts)
  data
end

#list_prices_with_http_info(opts = {}) ⇒ Array<(BillingPrices, Integer, Hash)>

List available prices

Parameters:

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

    the optional parameters

Returns:

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

    BillingPrices data, response status code and response headers



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/generated/ilovevideoeditor-sdk/api/billing_api.rb', line 384

def list_prices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.list_prices ...'
  end
  # resource path
  local_var_path = '/billing/prices'

  # 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']) unless header_params['Accept']

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

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

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

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

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