UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

137 lines (124 loc) 4.61 kB
/** * OpenAPI definition * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ import {ApiClient} from "../ApiClient.js"; import { AttachRequest } from '../model/AttachRequest.js'; /** * SharedContent service. * @module api/SharedContentApi * @version v0 */ export class SharedContentApi { /** * Constructs a new SharedContentApi. * @alias module:api/SharedContentApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || ApiClient.instance; } /** * @param {String} fileName * @param {String} contentType * @param {Number} x * @param {Number} y * @param {Number} z * @param {Number} rotX * @param {Number} rotY * @param {Number} rotZ * @param {Object} opts Optional parameters * @param {AttachRequest} [attachRequest] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ uploadWithHttpInfo(fileName, contentType, x, y, z, rotX, rotY, rotZ, opts) { opts = opts || {}; let postBody = opts['attachRequest']; // verify the required parameter 'fileName' is set if (fileName === undefined || fileName === null) { throw new Error("Missing the required parameter 'fileName' when calling upload"); } // verify the required parameter 'contentType' is set if (contentType === undefined || contentType === null) { throw new Error("Missing the required parameter 'contentType' when calling upload"); } // verify the required parameter 'x' is set if (x === undefined || x === null) { throw new Error("Missing the required parameter 'x' when calling upload"); } // verify the required parameter 'y' is set if (y === undefined || y === null) { throw new Error("Missing the required parameter 'y' when calling upload"); } // verify the required parameter 'z' is set if (z === undefined || z === null) { throw new Error("Missing the required parameter 'z' when calling upload"); } // verify the required parameter 'rotX' is set if (rotX === undefined || rotX === null) { throw new Error("Missing the required parameter 'rotX' when calling upload"); } // verify the required parameter 'rotY' is set if (rotY === undefined || rotY === null) { throw new Error("Missing the required parameter 'rotY' when calling upload"); } // verify the required parameter 'rotZ' is set if (rotZ === undefined || rotZ === null) { throw new Error("Missing the required parameter 'rotZ' when calling upload"); } let pathParams = { }; let queryParams = { 'fileName': fileName, 'contentType': contentType, 'x': x, 'y': y, 'z': z, 'rotX': rotX, 'rotY': rotY, 'rotZ': rotZ }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = ['application/json']; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/files/upload', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * @param {String} fileName * @param {String} contentType * @param {Number} x * @param {Number} y * @param {Number} z * @param {Number} rotX * @param {Number} rotY * @param {Number} rotZ * @param {Object} opts Optional parameters * @param {AttachRequest} opts.attachRequest * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ upload(fileName, contentType, x, y, z, rotX, rotY, rotZ, opts) { return this.uploadWithHttpInfo(fileName, contentType, x, y, z, rotX, rotY, rotZ, opts) .then(function(response_and_data) { return response_and_data.data; }); } }