UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

1,265 lines (1,137 loc) 43.7 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 { AttachRequest } from '../model/AttachRequest.js'; import { Client } from '../model/Client.js'; import { GroupMember } from '../model/GroupMember.js'; import { GroupMessage } from '../model/GroupMessage.js'; import { UserGroup } from '../model/UserGroup.js'; /** * Groups service. * @module api/GroupsApi * @version v0 */ export class GroupsApi { /** * Constructs a new GroupsApi. * @alias module:api/GroupsApi * @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; } /** * Accept invitation to a private group. * Accept invitation to a private group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ acceptWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling accept"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/accept', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Accept invitation to a private group. * Accept invitation to a private group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ accept(groupId) { return this.acceptWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Allow a user (who asked) to join a private group. * Allow a user (who asked) to join a private group. Only group owner(s) can do that. * @param {String} groupId Group to join * @param {String} clientId Client that asked to join * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ allowWithHttpInfo(groupId, clientId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling allow"); } // verify the required parameter 'clientId' is set if (clientId === undefined || clientId === null) { throw new Error("Missing the required parameter 'clientId' when calling allow"); } let pathParams = { 'groupId': groupId }; let queryParams = { 'clientId': clientId }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/allow', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Allow a user (who asked) to join a private group. * Allow a user (who asked) to join a private group. Only group owner(s) can do that. * @param {String} groupId Group to join * @param {String} clientId Client that asked to join * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ allow(groupId, clientId) { return this.allowWithHttpInfo(groupId, clientId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Ask to join a private group. * Ask to join a private group. Group owner needs to allow new members to join. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ askWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling ask"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/ask', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Ask to join a private group. * Ask to join a private group. Group owner needs to allow new members to join. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ ask(groupId) { return this.askWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Add an attachment to a message: upload file to the server, and notify all message recipients. * Add an attachment to a message: upload file to the server, and notify all message recipients. * @param {String} fileName * @param {String} contentType * @param {String} groupId * @param {String} messageId * @param {Object} opts Optional parameters * @param {AttachRequest} [attachRequest] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ attachWithHttpInfo(fileName, contentType, groupId, messageId, opts) { opts = opts || {}; let postBody = opts['attachRequest']; // verify the required parameter 'fileName' is set if (fileName === undefined || fileName === null) { throw new Error("Missing the required parameter 'fileName' when calling attach"); } // verify the required parameter 'contentType' is set if (contentType === undefined || contentType === null) { throw new Error("Missing the required parameter 'contentType' when calling attach"); } // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling attach"); } // verify the required parameter 'messageId' is set if (messageId === undefined || messageId === null) { throw new Error("Missing the required parameter 'messageId' when calling attach"); } let pathParams = { 'groupId': groupId, 'messageId': messageId }; let queryParams = { 'fileName': fileName, 'contentType': contentType }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = ['application/json']; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/{messageId}/attachment', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Add an attachment to a message: upload file to the server, and notify all message recipients. * Add an attachment to a message: upload file to the server, and notify all message recipients. * @param {String} fileName * @param {String} contentType * @param {String} groupId * @param {String} messageId * @param {Object} opts Optional parameters * @param {AttachRequest} opts.attachRequest * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ attach(fileName, contentType, groupId, messageId, opts) { return this.attachWithHttpInfo(fileName, contentType, groupId, messageId, opts) .then(function(response_and_data) { return response_and_data.data; }); } /** * Create a group. * Create a group. * @param {String} name Group name * @param {Object} opts Optional parameters * @param {Boolean} [isPublic] Create a public group? Defaults to false. * @param {Boolean} [isTemporary] Create a temporary group? Defaults to false. * @param {Boolean} [isDirect] Create a direct messaging group? Defaults to false. * @return {Promise< UserGroup >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link UserGroup} and HTTP response */ createWithHttpInfo(name, opts) { opts = opts || {}; 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 create"); } let pathParams = { }; let queryParams = { 'name': name, 'isPublic': opts['isPublic'], 'isTemporary': opts['isTemporary'], 'isDirect': opts['isDirect'] }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['application/json']; let returnType = UserGroup; return this.apiClient.callApi( '/vrspace/api/groups', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Create a group. * Create a group. * @param {String} name Group name * @param {Object} opts Optional parameters * @param {Boolean} opts.isPublic Create a public group? Defaults to false. * @param {Boolean} opts.isTemporary Create a temporary group? Defaults to false. * @param {Boolean} opts.isDirect Create a direct messaging group? Defaults to false. * @return {Promise< UserGroup >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link UserGroup} */ create(name, opts) { return this.createWithHttpInfo(name, opts) .then(function(response_and_data) { return response_and_data.data; }); } /** * Delete a group. * Delete a group. A group can only be deleted by the owner(s). * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ deleteGroupWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling deleteGroup"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Delete a group. * Delete a group. A group can only be deleted by the owner(s). * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ deleteGroup(groupId) { return this.deleteGroupWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Remove an attachment from a message. * Remove an attachment from a message. Removes the file from the server and notifies all other clients. * @param {String} fileName * @param {String} groupId * @param {String} messageId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ detachWithHttpInfo(fileName, groupId, messageId) { let postBody = null; // verify the required parameter 'fileName' is set if (fileName === undefined || fileName === null) { throw new Error("Missing the required parameter 'fileName' when calling detach"); } // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling detach"); } // verify the required parameter 'messageId' is set if (messageId === undefined || messageId === null) { throw new Error("Missing the required parameter 'messageId' when calling detach"); } let pathParams = { 'groupId': groupId, 'messageId': messageId }; let queryParams = { 'fileName': fileName }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/{messageId}/attachment', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Remove an attachment from a message. * Remove an attachment from a message. Removes the file from the server and notifies all other clients. * @param {String} fileName * @param {String} groupId * @param {String} messageId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ detach(fileName, groupId, messageId) { return this.detachWithHttpInfo(fileName, groupId, messageId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Get an attachment for a message. * Get an attachment for a message. Only users that can read the message can do that. * @param {String} groupId * @param {String} messageId * @param {String} fileName * @return {Promise< Object >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ getAttachmentWithHttpInfo(groupId, messageId, fileName) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling getAttachment"); } // verify the required parameter 'messageId' is set if (messageId === undefined || messageId === null) { throw new Error("Missing the required parameter 'messageId' when calling getAttachment"); } // verify the required parameter 'fileName' is set if (fileName === undefined || fileName === null) { throw new Error("Missing the required parameter 'fileName' when calling getAttachment"); } let pathParams = { 'groupId': groupId, 'messageId': messageId, 'fileName': fileName }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = Object; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/{messageId}/attachment/{fileName}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Get an attachment for a message. * Get an attachment for a message. Only users that can read the message can do that. * @param {String} groupId * @param {String} messageId * @param {String} fileName * @return {Promise< Object >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ getAttachment(groupId, messageId, fileName) { return this.getAttachmentWithHttpInfo(groupId, messageId, fileName) .then(function(response_and_data) { return response_and_data.data; }); } /** * Get a group. * Get a group. * @param {String} groupId * @return {Promise< UserGroup >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link UserGroup} and HTTP response */ getGroupWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling getGroup"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = UserGroup; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Get a group. * Get a group. * @param {String} groupId * @return {Promise< UserGroup >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link UserGroup} */ getGroup(groupId) { return this.getGroupWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Invite a user to a group. * Invite a user to a group. Only group owner(s) can invite users to private groups. Invited users have to accept invitation. Offline users may get web push notification, if these are configured. * @param {String} groupId Group to invite to * @param {String} clientId Client to invite * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ inviteWithHttpInfo(groupId, clientId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling invite"); } // verify the required parameter 'clientId' is set if (clientId === undefined || clientId === null) { throw new Error("Missing the required parameter 'clientId' when calling invite"); } let pathParams = { 'groupId': groupId }; let queryParams = { 'clientId': clientId }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/invite', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Invite a user to a group. * Invite a user to a group. Only group owner(s) can invite users to private groups. Invited users have to accept invitation. Offline users may get web push notification, if these are configured. * @param {String} groupId Group to invite to * @param {String} clientId Client to invite * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ invite(groupId, clientId) { return this.inviteWithHttpInfo(groupId, clientId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Join a public group. * Join a public group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ joinWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling join"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/join', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Join a public group. * Join a public group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ join(groupId) { return this.joinWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Kick a user from a group. * Kick a user from a group. Only group owner(s) can do that. Also used to reject request to join. * @param {String} groupId Where to kick from * @param {String} clientId Whom to kick * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ kickWithHttpInfo(groupId, clientId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling kick"); } // verify the required parameter 'clientId' is set if (clientId === undefined || clientId === null) { throw new Error("Missing the required parameter 'clientId' when calling kick"); } let pathParams = { 'groupId': groupId }; let queryParams = { 'clientId': clientId }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/kick', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Kick a user from a group. * Kick a user from a group. Only group owner(s) can do that. Also used to reject request to join. * @param {String} groupId Where to kick from * @param {String} clientId Whom to kick * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ kick(groupId, clientId) { return this.kickWithHttpInfo(groupId, clientId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Leave a group. * Leave a group. Group owners can not leave. Also used to reject invitation to join the group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ leaveWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling leave"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/leave', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Leave a group. * Leave a group. Group owners can not leave. Also used to reject invitation to join the group. * @param {String} groupId * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ leave(groupId) { return this.leaveWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * List pending invitations to groups for the current user. * List pending invitations to groups for the current user. * @return {Promise< Array.<GroupMember> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<GroupMember>} and HTTP response */ listInvitesWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [GroupMember]; return this.apiClient.callApi( '/vrspace/api/groups/invitations', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List pending invitations to groups for the current user. * List pending invitations to groups for the current user. * @return {Promise< Array.<GroupMember> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<GroupMember>} */ listInvites() { return this.listInvitesWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * List all user groups the user is member of. * List all user groups the user is member of. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<UserGroup>} and HTTP response */ listMyGroupsWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [UserGroup]; return this.apiClient.callApi( '/vrspace/api/groups', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List all user groups the user is member of. * List all user groups the user is member of. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<UserGroup>} */ listMyGroups() { return this.listMyGroupsWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * List all user groups the user owns. * List all user groups the user owns. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<UserGroup>} and HTTP response */ listOwnedGroupsWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [UserGroup]; return this.apiClient.callApi( '/vrspace/api/groups/owned', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List all user groups the user owns. * List all user groups the user owns. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<UserGroup>} */ listOwnedGroups() { return this.listOwnedGroupsWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * List owners of a group. * List owners of a group. Needed e.g. to ask to join a private group. * @param {String} groupId group identifier * @return {Promise< Array.<Client> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<Client>} and HTTP response */ listOwnersWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling listOwners"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [Client]; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/owners', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List owners of a group. * List owners of a group. Needed e.g. to ask to join a private group. * @param {String} groupId group identifier * @return {Promise< Array.<Client> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<Client>} */ listOwners(groupId) { return this.listOwnersWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * List pending requests to join the group. * List pending requests to join the group. Only group owners can do that. * @param {String} groupId * @return {Promise< Array.<GroupMember> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<GroupMember>} and HTTP response */ listRequestsWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling listRequests"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [GroupMember]; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/requests', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List pending requests to join the group. * List pending requests to join the group. Only group owners can do that. * @param {String} groupId * @return {Promise< Array.<GroupMember> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<GroupMember>} */ listRequests(groupId) { return this.listRequestsWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * List groups containing unread messages. * List groups containing unread messages. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<UserGroup>} and HTTP response */ listUnreadGroupsWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [UserGroup]; return this.apiClient.callApi( '/vrspace/api/groups/unread', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List groups containing unread messages. * List groups containing unread messages. * @return {Promise< Array.<UserGroup> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<UserGroup>} */ listUnreadGroups() { return this.listUnreadGroupsWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * List unread messages for the group * List unread messages for the group * @param {String} groupId group identifier * @return {Promise< Array.<GroupMessage> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<GroupMessage>} and HTTP response */ listUnreadMessagesWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling listUnreadMessages"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [GroupMessage]; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/unread', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * List unread messages for the group * List unread messages for the group * @param {String} groupId group identifier * @return {Promise< Array.<GroupMessage> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<GroupMessage>} */ listUnreadMessages(groupId) { return this.listUnreadMessagesWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Share a world link with the group. * Share a world link with the group. Online users are notified right away over the web socket, offline users may get web push notification, if these are configured. * @param {String} groupId The group * @param {GroupMessage} groupMessage The message containing url and name of the world in link and content fields * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ shareWorldWithHttpInfo(groupId, groupMessage) { let postBody = groupMessage; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling shareWorld"); } // verify the required parameter 'groupMessage' is set if (groupMessage === undefined || groupMessage === null) { throw new Error("Missing the required parameter 'groupMessage' when calling shareWorld"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = ['application/json']; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/share', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Share a world link with the group. * Share a world link with the group. Online users are notified right away over the web socket, offline users may get web push notification, if these are configured. * @param {String} groupId The group * @param {GroupMessage} groupMessage The message containing url and name of the world in link and content fields * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ shareWorld(groupId, groupMessage) { return this.shareWorldWithHttpInfo(groupId, groupMessage) .then(function(response_and_data) { return response_and_data.data; }); } /** * Show all members of a group. * Show all members of a group. * @param {String} groupId * @return {Promise< Array.<Client> >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<Client>} and HTTP response */ showWithHttpInfo(groupId) { let postBody = null; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling show"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = [Client]; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/show', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Show all members of a group. * Show all members of a group. * @param {String} groupId * @return {Promise< Array.<Client> >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<Client>} */ show(groupId) { return this.showWithHttpInfo(groupId) .then(function(response_and_data) { return response_and_data.data; }); } /** * Update a group. * Update a group. * @param {UserGroup} userGroup updated group * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ updateWithHttpInfo(userGroup) { let postBody = userGroup; // verify the required parameter 'userGroup' is set if (userGroup === undefined || userGroup === null) { throw new Error("Missing the required parameter 'userGroup' when calling update"); } 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/groups', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Update a group. * Update a group. * @param {UserGroup} userGroup updated group * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ update(userGroup) { return this.updateWithHttpInfo(userGroup) .then(function(response_and_data) { return response_and_data.data; }); } /** * Write something to a group. * Write something to a group. Online users are notified right away over the web socket, offline users may get web push notification, if these are configured. * @param {String} groupId The group * @param {String} body The message * @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link String} and HTTP response */ writeWithHttpInfo(groupId, body) { let postBody = body; // verify the required parameter 'groupId' is set if (groupId === undefined || groupId === null) { throw new Error("Missing the required parameter 'groupId' when calling write"); } // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling write"); } let pathParams = { 'groupId': groupId }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = ['application/json']; let accepts = ['*/*']; let returnType = 'String'; return this.apiClient.callApi( '/vrspace/api/groups/{groupId}/write', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Write something to a group. * Write something to a group. Online users are notified right away over the web socket, offline users may get web push notification, if these are configured. * @param {String} groupId The group * @param {String} body The message * @return {Promise< String >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link String} */ write(groupId, body) { return this.writeWithHttpInfo(groupId, body) .then(function(response_and_data) { return response_and_data.data; }); } }