Source: client/openapi/api/AgentsApi.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 { SearchAgentResponse } from '../model/SearchAgentResponse.js';

/**
* Agents service.
* @module api/AgentsApi
* @version v0
*/
export class AgentsApi {

    /**
    * Constructs a new AgentsApi. 
    * @alias module:api/AgentsApi
    * @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;
    }



    /**
     * Sketchfab search agent.
     * Sketchfab search agent.
     * @param {String} body 
     * @return {Promise< SearchAgentResponse >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link SearchAgentResponse} and HTTP response
     */
    searchAgentWithHttpInfo(body) {
      let postBody = body;
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling searchAgent");
      }

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

      let authNames = [];
      let contentTypes = ['application/json'];
      let accepts = ['*/*'];
      let returnType = SearchAgentResponse;
      return this.apiClient.callApi(
        '/vrspace/api/agents/search', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null
      );
    }

    /**
     * Sketchfab search agent.
     * Sketchfab search agent.
     * @param {String} body 
     * @return {Promise< SearchAgentResponse >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link SearchAgentResponse}
     */
    searchAgent(body) {
      return this.searchAgentWithHttpInfo(body)
        .then(function(response_and_data) {
          return response_and_data.data;
        });
    }


}