Class: ILoveVideoEditor::RenditionsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RenditionsApi

Returns a new instance of RenditionsApi.



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

def api_client
  @api_client
end

Instance Method Details

#batch_delete_renditions(batch_delete_projects_request, opts = {}) ⇒ BatchDeleteResult

Bulk delete renditions

Parameters:

Returns:



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

def batch_delete_renditions(batch_delete_projects_request, opts = {})
  data, _status_code, _headers = batch_delete_renditions_with_http_info(batch_delete_projects_request, opts)
  data
end

#batch_delete_renditions_with_http_info(batch_delete_projects_request, opts = {}) ⇒ Array<(BatchDeleteResult, Integer, Hash)>

Bulk delete renditions

Parameters:

Returns:

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

    BatchDeleteResult data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 35

def batch_delete_renditions_with_http_info(batch_delete_projects_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.batch_delete_renditions ...'
  end
  # verify the required parameter 'batch_delete_projects_request' is set
  if @api_client.config.client_side_validation && batch_delete_projects_request.nil?
    fail ArgumentError, "Missing the required parameter 'batch_delete_projects_request' when calling RenditionsApi.batch_delete_renditions"
  end
  # resource path
  local_var_path = '/v1/renditions/batch-delete'

  # 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(batch_delete_projects_request)

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

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

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

#cancel_rendition(id, opts = {}) ⇒ RenditionCancelResult

Cancel a rendition

Parameters:

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

    the optional parameters

Returns:



92
93
94
95
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 92

def cancel_rendition(id, opts = {})
  data, _status_code, _headers = cancel_rendition_with_http_info(id, opts)
  data
end

#cancel_rendition_with_http_info(id, opts = {}) ⇒ Array<(RenditionCancelResult, Integer, Hash)>

Cancel a rendition

Parameters:

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

    the optional parameters

Returns:

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

    RenditionCancelResult data, response status code and response headers



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
142
143
144
145
146
147
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 101

def cancel_rendition_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.cancel_rendition ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RenditionsApi.cancel_rendition"
  end
  # resource path
  local_var_path = '/v1/renditions/{id}/cancel'.sub('{id}', CGI.escape(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']) 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] || 'RenditionCancelResult'

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

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

#delete_rendition(id, opts = {}) ⇒ DeleteProject200Response

Delete a rendition

Parameters:

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

    the optional parameters

Returns:



153
154
155
156
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 153

def delete_rendition(id, opts = {})
  data, _status_code, _headers = delete_rendition_with_http_info(id, opts)
  data
end

#delete_rendition_with_http_info(id, opts = {}) ⇒ Array<(DeleteProject200Response, Integer, Hash)>

Delete a rendition

Parameters:

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

    the optional parameters

Returns:

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

    DeleteProject200Response data, response status code and response headers



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
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 162

def delete_rendition_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.delete_rendition ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RenditionsApi.delete_rendition"
  end
  # resource path
  local_var_path = '/v1/renditions/{id}'.sub('{id}', CGI.escape(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']) 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] || 'DeleteProject200Response'

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

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

#get_rendition(id, opts = {}) ⇒ GetRendition200Response

Get a single rendition

Parameters:

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

    the optional parameters

Returns:



214
215
216
217
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 214

def get_rendition(id, opts = {})
  data, _status_code, _headers = get_rendition_with_http_info(id, opts)
  data
end

#get_rendition_stats(opts = {}) ⇒ RenditionStats

Get render statistics

Parameters:

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

    the optional parameters

Returns:



274
275
276
277
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 274

def get_rendition_stats(opts = {})
  data, _status_code, _headers = get_rendition_stats_with_http_info(opts)
  data
end

#get_rendition_stats_with_http_info(opts = {}) ⇒ Array<(RenditionStats, Integer, Hash)>

Get render statistics

Parameters:

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

    the optional parameters

Returns:

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

    RenditionStats 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
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 282

def get_rendition_stats_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.get_rendition_stats ...'
  end
  # resource path
  local_var_path = '/v1/renditions/stats'

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

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

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

#get_rendition_with_http_info(id, opts = {}) ⇒ Array<(GetRendition200Response, Integer, Hash)>

Get a single rendition

Parameters:

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

    the optional parameters

Returns:

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

    GetRendition200Response data, response status code and response headers



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
264
265
266
267
268
269
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 223

def get_rendition_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.get_rendition ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RenditionsApi.get_rendition"
  end
  # resource path
  local_var_path = '/v1/renditions/{id}'.sub('{id}', CGI.escape(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']) 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] || 'GetRendition200Response'

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

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

#list_renditions(opts = {}) ⇒ ListRenditions200Response

List render history

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 25
  • :sort_by (String) — default: default to 'created_at'
  • :sort_order (String) — default: default to 'desc'
  • :status (String)
  • :search (String)
  • :from (Time)
  • :to (Time)
  • :project_id (String)

Returns:



338
339
340
341
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 338

def list_renditions(opts = {})
  data, _status_code, _headers = list_renditions_with_http_info(opts)
  data
end

#list_renditions_with_http_info(opts = {}) ⇒ Array<(ListRenditions200Response, Integer, Hash)>

List render history

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 25
  • :sort_by (String) — default: default to 'created_at'
  • :sort_order (String) — default: default to 'desc'
  • :status (String)
  • :search (String)
  • :from (Time)
  • :to (Time)
  • :project_id (String)

Returns:

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

    ListRenditions200Response data, response status code and response headers



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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb', line 355

def list_renditions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RenditionsApi.list_renditions ...'
  end
  allowable_values = ["created_at", "duration", "status", "cost", "job_id"]
  if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
    fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
    fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
  end
  allowable_values = ["queued", "processing", "rendering", "completed", "failed"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/renditions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].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] || 'ListRenditions200Response'

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

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