Spaces:
Runtime error
Runtime error
| /** | |
| * AI Mastering API | |
| * This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API. | |
| * | |
| * OpenAPI spec version: 1.0.0 | |
| * Contact: info@bakuage.com | |
| * | |
| * NOTE: This class is auto generated by the swagger code generator program. | |
| * https://github.com/swagger-api/swagger-codegen.git | |
| * | |
| * Swagger Codegen version: 2.3.1 | |
| * | |
| * Do not edit the class manually. | |
| * | |
| */ | |
| (function(root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| // AMD. Register as an anonymous module. | |
| define(['ApiClient', 'model/Video', 'model/VideoDownloadToken'], factory); | |
| } else if (typeof module === 'object' && module.exports) { | |
| // CommonJS-like environments that support module.exports, like Node. | |
| module.exports = factory(require('../ApiClient'), require('../model/Video'), require('../model/VideoDownloadToken')); | |
| } else { | |
| // Browser globals (root is window) | |
| if (!root.Aimastering) { | |
| root.Aimastering = {}; | |
| } | |
| root.Aimastering.VideoApi = factory(root.Aimastering.ApiClient, root.Aimastering.Video, root.Aimastering.VideoDownloadToken); | |
| } | |
| }(this, function(ApiClient, Video, VideoDownloadToken) { | |
| 'use strict'; | |
| /** | |
| * Video service. | |
| * @module api/VideoApi | |
| * @version 1.1.0 | |
| */ | |
| /** | |
| * Constructs a new VideoApi. | |
| * @alias module:api/VideoApi | |
| * @class | |
| * @param {module:ApiClient} [apiClient] Optional API client implementation to use, | |
| * default to {@link module:ApiClient#instance} if unspecified. | |
| */ | |
| var exports = function(apiClient) { | |
| this.apiClient = apiClient || ApiClient.instance; | |
| /** | |
| * Callback function to receive the result of the downloadVideo operation. | |
| * @callback module:api/VideoApi~downloadVideoCallback | |
| * @param {String} error Error message, if any. | |
| * @param {'Blob'} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Download an video data by id. | |
| * @param {Number} id Video id | |
| * @param {module:api/VideoApi~downloadVideoCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link 'Blob'} | |
| */ | |
| this.downloadVideo = function(id, callback) { | |
| var postBody = null; | |
| // verify the required parameter 'id' is set | |
| if (id === undefined || id === null) { | |
| throw new Error("Missing the required parameter 'id' when calling downloadVideo"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/octet-stream']; | |
| var returnType = 'Blob'; | |
| return this.apiClient.callApi( | |
| '/videos/{id}/download', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the downloadVideoByToken operation. | |
| * @callback module:api/VideoApi~downloadVideoByTokenCallback | |
| * @param {String} error Error message, if any. | |
| * @param {'Blob'} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Download an video data by video_download_token. | |
| * @param {String} downloadToken Video download token | |
| * @param {module:api/VideoApi~downloadVideoByTokenCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link 'Blob'} | |
| */ | |
| this.downloadVideoByToken = function(downloadToken, callback) { | |
| var postBody = null; | |
| // verify the required parameter 'downloadToken' is set | |
| if (downloadToken === undefined || downloadToken === null) { | |
| throw new Error("Missing the required parameter 'downloadToken' when calling downloadVideoByToken"); | |
| } | |
| var pathParams = { | |
| }; | |
| var queryParams = { | |
| 'download_token': downloadToken, | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/octet-stream']; | |
| var returnType = 'Blob'; | |
| return this.apiClient.callApi( | |
| '/videos/download_by_token', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the getVideo operation. | |
| * @callback module:api/VideoApi~getVideoCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/Video} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get an video by id. | |
| * @param {Number} id Video id | |
| * @param {module:api/VideoApi~getVideoCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/Video} | |
| */ | |
| this.getVideo = function(id, callback) { | |
| var postBody = null; | |
| // verify the required parameter 'id' is set | |
| if (id === undefined || id === null) { | |
| throw new Error("Missing the required parameter 'id' when calling getVideo"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/json']; | |
| var returnType = Video; | |
| return this.apiClient.callApi( | |
| '/videos/{id}', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the getVideoDownloadToken operation. | |
| * @callback module:api/VideoApi~getVideoDownloadTokenCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/VideoDownloadToken} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get an video download token by id. | |
| * @param {Number} id Video id | |
| * @param {module:api/VideoApi~getVideoDownloadTokenCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/VideoDownloadToken} | |
| */ | |
| this.getVideoDownloadToken = function(id, callback) { | |
| var postBody = null; | |
| // verify the required parameter 'id' is set | |
| if (id === undefined || id === null) { | |
| throw new Error("Missing the required parameter 'id' when calling getVideoDownloadToken"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/json']; | |
| var returnType = VideoDownloadToken; | |
| return this.apiClient.callApi( | |
| '/videos/{id}/download_token', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the listVideos operation. | |
| * @callback module:api/VideoApi~listVideosCallback | |
| * @param {String} error Error message, if any. | |
| * @param {Array.<module:model/Video>} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get all videos accessable. | |
| * @param {module:api/VideoApi~listVideosCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link Array.<module:model/Video>} | |
| */ | |
| this.listVideos = function(callback) { | |
| var postBody = null; | |
| var pathParams = { | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/json']; | |
| var returnType = [Video]; | |
| return this.apiClient.callApi( | |
| '/videos', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| }; | |
| return exports; | |
| })); | |