Source: client/openapi/api/WorldObjectsApi.js

/**
 * 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 { VRObject } from '../model/VRObject.js';

/**
* WorldObjects service.
* @module api/WorldObjectsApi
* @version v0
*/
export class WorldObjectsApi {

    /**
    * Constructs a new WorldObjectsApi. 
    * @alias module:api/WorldObjectsApi
    * @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 {VRObject} vRObject 
     * @return {Promise< VRObject >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link VRObject} and HTTP response
     */
    addObjectWithHttpInfo(vRObject) {
      let postBody = vRObject;
      // verify the required parameter 'vRObject' is set
      if (vRObject === undefined || vRObject === null) {
        throw new Error("Missing the required parameter 'vRObject' when calling addObject");
      }

      let pathParams = {
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = [];
      let contentTypes = ['application/json'];
      let accepts = ['*/*'];
      let returnType = VRObject;
      return this.apiClient.callApi(
        '/vrspace/api/world/add', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null
      );
    }

    /**
     * @param {VRObject} vRObject 
     * @return {Promise< VRObject >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link VRObject}
     */
    addObject(vRObject) {
      return this.addObjectWithHttpInfo(vRObject)
        .then(function(response_and_data) {
          return response_and_data.data;
        });
    }


    /**
     * @param {VRObject} vRObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
     */
    objectCoordinatesWithHttpInfo(vRObject) {
      let postBody = vRObject;
      // verify the required parameter 'vRObject' is set
      if (vRObject === undefined || vRObject === null) {
        throw new Error("Missing the required parameter 'vRObject' when calling objectCoordinates");
      }

      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/world/coordinates', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null
      );
    }

    /**
     * @param {VRObject} vRObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}
     */
    objectCoordinates(vRObject) {
      return this.objectCoordinatesWithHttpInfo(vRObject)
        .then(function(response_and_data) {
          return response_and_data.data;
        });
    }


    /**
     * @param {String} id 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
     */
    removeObjectWithHttpInfo(id) {
      let postBody = null;
      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling removeObject");
      }

      let pathParams = {
      };
      let queryParams = {
        'id': id
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = [];
      let contentTypes = [];
      let accepts = [];
      let returnType = null;
      return this.apiClient.callApi(
        '/vrspace/api/world/remove', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null
      );
    }

    /**
     * @param {String} id 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}
     */
    removeObject(id) {
      return this.removeObjectWithHttpInfo(id)
        .then(function(response_and_data) {
          return response_and_data.data;
        });
    }


}