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/LibraryAudio', 'model/LibraryAudioAnalysis', 'model/LibraryAudioLike'], factory); | |
| } else if (typeof module === 'object' && module.exports) { | |
| // CommonJS-like environments that support module.exports, like Node. | |
| module.exports = factory(require('../ApiClient'), require('../model/LibraryAudio'), require('../model/LibraryAudioAnalysis'), require('../model/LibraryAudioLike')); | |
| } else { | |
| // Browser globals (root is window) | |
| if (!root.Aimastering) { | |
| root.Aimastering = {}; | |
| } | |
| root.Aimastering.LibraryAudioApi = factory(root.Aimastering.ApiClient, root.Aimastering.LibraryAudio, root.Aimastering.LibraryAudioAnalysis, root.Aimastering.LibraryAudioLike); | |
| } | |
| }(this, function(ApiClient, LibraryAudio, LibraryAudioAnalysis, LibraryAudioLike) { | |
| 'use strict'; | |
| /** | |
| * LibraryAudio service. | |
| * @module api/LibraryAudioApi | |
| * @version 1.1.0 | |
| */ | |
| /** | |
| * Constructs a new LibraryAudioApi. | |
| * @alias module:api/LibraryAudioApi | |
| * @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 createLibraryAudio operation. | |
| * @callback module:api/LibraryAudioApi~createLibraryAudioCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudio} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Create a new library audio. | |
| * @param {Object} opts Optional parameters | |
| * @param {File} opts.file The file to upload. | |
| * @param {module:api/LibraryAudioApi~createLibraryAudioCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudio} | |
| */ | |
| this.createLibraryAudio = function(opts, callback) { | |
| opts = opts || {}; | |
| var postBody = null; | |
| var pathParams = { | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| 'file': opts['file'] | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = ['multipart/form-data']; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudio; | |
| return this.apiClient.callApi( | |
| '/library_audios', 'POST', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the createLibraryAudioLike operation. | |
| * @callback module:api/LibraryAudioApi~createLibraryAudioLikeCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudioLike} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Create a new library audio like. | |
| * @param {Number} id Library audio id | |
| * @param {module:api/LibraryAudioApi~createLibraryAudioLikeCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudioLike} | |
| */ | |
| this.createLibraryAudioLike = 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 createLibraryAudioLike"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = ['multipart/form-data']; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudioLike; | |
| return this.apiClient.callApi( | |
| '/library_audios/{id}/like', 'POST', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the deleteLibraryAudio operation. | |
| * @callback module:api/LibraryAudioApi~deleteLibraryAudioCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudio} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Delete library audio. | |
| * @param {Number} id Library audio id | |
| * @param {module:api/LibraryAudioApi~deleteLibraryAudioCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudio} | |
| */ | |
| this.deleteLibraryAudio = 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 deleteLibraryAudio"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = ['multipart/form-data']; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudio; | |
| return this.apiClient.callApi( | |
| '/library_audios/{id}', 'DELETE', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the getLibraryAudio operation. | |
| * @callback module:api/LibraryAudioApi~getLibraryAudioCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudio} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get a library audio by id. | |
| * @param {Number} id Library audio id | |
| * @param {module:api/LibraryAudioApi~getLibraryAudioCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudio} | |
| */ | |
| this.getLibraryAudio = 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 getLibraryAudio"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudio; | |
| return this.apiClient.callApi( | |
| '/library_audios/{id}', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the getLibraryAudioAnalysis operation. | |
| * @callback module:api/LibraryAudioApi~getLibraryAudioAnalysisCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudioAnalysis} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get a library audio analysis by id. | |
| * @param {Number} id Library audio id | |
| * @param {module:api/LibraryAudioApi~getLibraryAudioAnalysisCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudioAnalysis} | |
| */ | |
| this.getLibraryAudioAnalysis = 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 getLibraryAudioAnalysis"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = []; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudioAnalysis; | |
| return this.apiClient.callApi( | |
| '/library_audios/{id}/analysis', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the listLibraryAudios operation. | |
| * @callback module:api/LibraryAudioApi~listLibraryAudiosCallback | |
| * @param {String} error Error message, if any. | |
| * @param {Array.<module:model/LibraryAudio>} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Get all library audios accessable. | |
| * @param {module:api/LibraryAudioApi~listLibraryAudiosCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link Array.<module:model/LibraryAudio>} | |
| */ | |
| this.listLibraryAudios = 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 = [LibraryAudio]; | |
| return this.apiClient.callApi( | |
| '/library_audios', 'GET', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| /** | |
| * Callback function to receive the result of the updateLibraryAudio operation. | |
| * @callback module:api/LibraryAudioApi~updateLibraryAudioCallback | |
| * @param {String} error Error message, if any. | |
| * @param {module:model/LibraryAudio} data The data returned by the service call. | |
| * @param {String} response The complete HTTP response. | |
| */ | |
| /** | |
| * Update library audio. | |
| * @param {Number} id Library audio id | |
| * @param {Object} opts Optional parameters | |
| * @param {Boolean} opts.isPublic Whether the library audio is public. | |
| * @param {module:api/LibraryAudioApi~updateLibraryAudioCallback} callback The callback function, accepting three arguments: error, data, response | |
| * data is of type: {@link module:model/LibraryAudio} | |
| */ | |
| this.updateLibraryAudio = function(id, opts, callback) { | |
| opts = opts || {}; | |
| 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 updateLibraryAudio"); | |
| } | |
| var pathParams = { | |
| 'id': id | |
| }; | |
| var queryParams = { | |
| }; | |
| var collectionQueryParams = { | |
| }; | |
| var headerParams = { | |
| }; | |
| var formParams = { | |
| 'is_public': opts['isPublic'] | |
| }; | |
| var authNames = ['bearer']; | |
| var contentTypes = ['multipart/form-data']; | |
| var accepts = ['application/json']; | |
| var returnType = LibraryAudio; | |
| return this.apiClient.callApi( | |
| '/library_audios/{id}', 'PUT', | |
| pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, | |
| authNames, contentTypes, accepts, returnType, callback | |
| ); | |
| } | |
| }; | |
| return exports; | |
| })); | |