/**
* 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 { Client } from '../model/Client.js';
import { User } from '../model/User.js';
/**
* UserController service.
* @module api/UserControllerApi
* @version v0
*/
export class UserControllerApi {
/**
* Constructs a new UserControllerApi.
* @alias module:api/UserControllerApi
* @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;
}
/**
* Check if the user is already authenticated
* Check if the user is already authenticated
* @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Boolean} and HTTP response
*/
authenticatedWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'Boolean';
return this.apiClient.callApi(
'/vrspace/api/user/authenticated', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Check if the user is already authenticated
* Check if the user is already authenticated
* @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Boolean}
*/
authenticated() {
return this.authenticatedWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
* Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
* @param {String} name user name to verify
* @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Boolean} and HTTP response
*/
checkNameWithHttpInfo(name) {
let postBody = null;
// verify the required parameter 'name' is set
if (name === undefined || name === null) {
throw new Error("Missing the required parameter 'name' when calling checkName");
}
let pathParams = {
};
let queryParams = {
'name': name
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'Boolean';
return this.apiClient.callApi(
'/vrspace/api/user/available', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
* Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
* @param {String} name user name to verify
* @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Boolean}
*/
checkName(name) {
return this.checkNameWithHttpInfo(name)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Find user by name.
* Find user by name. Only available to users currently connected.
* @param {String} name User name, case sensitive, exact match
* @return {Promise< Client >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Client} and HTTP response
*/
findWithHttpInfo(name) {
let postBody = null;
// verify the required parameter 'name' is set
if (name === undefined || name === null) {
throw new Error("Missing the required parameter 'name' when calling find");
}
let pathParams = {
};
let queryParams = {
'name': name
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = Client;
return this.apiClient.callApi(
'/vrspace/api/user/find', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Find user by name.
* Find user by name. Only available to users currently connected.
* @param {String} name User name, case sensitive, exact match
* @return {Promise< Client >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Client}
*/
find(name) {
return this.findWithHttpInfo(name)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Returns current user name
* Returns current user name
* @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link String} and HTTP response
*/
userNameWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'String';
return this.apiClient.callApi(
'/vrspace/api/user/name', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Returns current user name
* Returns current user name
* @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link String}
*/
userName() {
return this.userNameWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Returns current user object
* Returns current user object
* @return {Promise< User >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link User} and HTTP response
*/
userObjectWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['*/*'];
let returnType = User;
return this.apiClient.callApi(
'/vrspace/api/user/object', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Returns current user object
* Returns current user object
* @return {Promise< User >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link User}
*/
userObject() {
return this.userObjectWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
}