/**
* 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 { GltfModel } from '../model/GltfModel.js';
import { LoginResponse } from '../model/LoginResponse.js';
/**
* SketchfabController service.
* @module api/SketchfabControllerApi
* @version v0
*/
export class SketchfabControllerApi {
/**
* Constructs a new SketchfabControllerApi.
* @alias module:api/SketchfabControllerApi
* @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 download, as explained in https://sketchfab.com/developers/download-api/downloading-models Requires successful authentication, returns 401 unauthorised unless the server is authorised with sketchfab (token exists). In that case, client is expected to attempt to login.
* Sketchfab download, as explained in https://sketchfab.com/developers/download-api/downloading-models Requires successful authentication, returns 401 unauthorised unless the server is authorised with sketchfab (token exists). In that case, client is expected to attempt to login.
* @param {String} uid unique id of the model
* @return {Promise< GltfModel >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link GltfModel} and HTTP response
*/
downloadWithHttpInfo(uid) {
let postBody = null;
// verify the required parameter 'uid' is set
if (uid === undefined || uid === null) {
throw new Error("Missing the required parameter 'uid' when calling download");
}
let pathParams = {
};
let queryParams = {
'uid': uid
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = GltfModel;
return this.apiClient.callApi(
'/vrspace/api/sketchfab/download', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Sketchfab download, as explained in https://sketchfab.com/developers/download-api/downloading-models Requires successful authentication, returns 401 unauthorised unless the server is authorised with sketchfab (token exists). In that case, client is expected to attempt to login.
* Sketchfab download, as explained in https://sketchfab.com/developers/download-api/downloading-models Requires successful authentication, returns 401 unauthorised unless the server is authorised with sketchfab (token exists). In that case, client is expected to attempt to login.
* @param {String} uid unique id of the model
* @return {Promise< GltfModel >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link GltfModel}
*/
download(uid) {
return this.downloadWithHttpInfo(uid)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Sketchfab oauth2 callback, as explained in https://sketchfab.com/developers/oauth#implement-auth-code Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
* Sketchfab oauth2 callback, as explained in https://sketchfab.com/developers/oauth#implement-auth-code Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
* @param {String} code provided to the client by sketchfab
* @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link String} and HTTP response
*/
sketchfabCallbackWithHttpInfo(code) {
let postBody = null;
// verify the required parameter 'code' is set
if (code === undefined || code === null) {
throw new Error("Missing the required parameter 'code' when calling sketchfabCallback");
}
let pathParams = {
};
let queryParams = {
'code': code
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'String';
return this.apiClient.callApi(
'/vrspace/api/sketchfab/oauth2', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Sketchfab oauth2 callback, as explained in https://sketchfab.com/developers/oauth#implement-auth-code Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
* Sketchfab oauth2 callback, as explained in https://sketchfab.com/developers/oauth#implement-auth-code Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
* @param {String} code provided to the client by sketchfab
* @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link String}
*/
sketchfabCallback(code) {
return this.sketchfabCallbackWithHttpInfo(code)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Start of the login sequence.
* Start of the login sequence. Returns the sketchfab login url, containing client id and redirect url. Client is then expected to open that url and authorise there. Saves the referrer for later use in callback.
* @return {Promise< LoginResponse >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link LoginResponse} and HTTP response
*/
sketchfabLoginWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = LoginResponse;
return this.apiClient.callApi(
'/vrspace/api/sketchfab/login', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Start of the login sequence.
* Start of the login sequence. Returns the sketchfab login url, containing client id and redirect url. Client is then expected to open that url and authorise there. Saves the referrer for later use in callback.
* @return {Promise< LoginResponse >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link LoginResponse}
*/
sketchfabLogin() {
return this.sketchfabLoginWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
}