UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

264 lines (231 loc) 7.85 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 { UserData } from '../model/UserData.js'; /** * Data service. * @module api/DataApi * @version v0 */ export class DataApi { /** * Constructs a new DataApi. * @alias module:api/DataApi * @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; } /** * Delete all user data belonging to the client. * Delete all user data belonging to the client. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ clearUserDataWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/user-data', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Delete all user data belonging to the client. * Delete all user data belonging to the client. * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ clearUserData() { return this.clearUserDataWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Delete a value for the given key. * Delete a value for the given key. * @param {String} key * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ deleteUserDataWithHttpInfo(key) { let postBody = null; // verify the required parameter 'key' is set if (key === undefined || key === null) { throw new Error("Missing the required parameter 'key' when calling deleteUserData"); } let pathParams = { 'key': key }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/user-data/{key}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Delete a value for the given key. * Delete a value for the given key. * @param {String} key * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ deleteUserData(key) { return this.deleteUserDataWithHttpInfo(key) .then(function(response_and_data) { return response_and_data.data; }); } /** * Get user data for the key * Get user data for the key * @param {String} key specifies which value to get * @return {Promise< UserData >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link UserData} and HTTP response */ getUserDataWithHttpInfo(key) { let postBody = null; // verify the required parameter 'key' is set if (key === undefined || key === null) { throw new Error("Missing the required parameter 'key' when calling getUserData"); } let pathParams = { 'key': key }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = UserData; return this.apiClient.callApi( '/vrspace/api/user-data/{key}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Get user data for the key * Get user data for the key * @param {String} key specifies which value to get * @return {Promise< UserData >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link UserData} */ getUserData(key) { return this.getUserDataWithHttpInfo(key) .then(function(response_and_data) { return response_and_data.data; }); } /** * List all user data belonging to the client. * List all user data belonging to the client. * @return {Promise< Array.<UserData> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<UserData>} and HTTP response */ listUserDataWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [UserData]; return this.apiClient.callApi( '/vrspace/api/user-data', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List all user data belonging to the client. * List all user data belonging to the client. * @return {Promise< Array.<UserData> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<UserData>} */ listUserData() { return this.listUserDataWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Add or replace existing user data. * Add or replace existing user data. * @param {UserData} userData the key-value pair. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ setUserDataWithHttpInfo(userData) { let postBody = userData; // verify the required parameter 'userData' is set if (userData === undefined || userData === null) { throw new Error("Missing the required parameter 'userData' when calling setUserData"); } let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = ['application/json']; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/user-data', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Add or replace existing user data. * Add or replace existing user data. * @param {UserData} userData the key-value pair. * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ setUserData(userData) { return this.setUserDataWithHttpInfo(userData) .then(function(response_and_data) { return response_and_data.data; }); } }