@coveo/platform-client
Version:
The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.
57 lines • 1.91 kB
JavaScript
import API from '../../../APICore.js';
import Resource from '../../Resource.js';
export default class Members extends Resource {
static baseUrl = `/rest/organizations/${API.orgPlaceholder}/members`;
/**
* Lists the members of an organization.
*/
getAll() {
return this.api.get(Members.baseUrl);
}
/**
* deletes the member from all groups of an organization.
* Note: Deleted users can still be included by domain.
* @param username The username of the member to delete.
*/
delete(username) {
return this.api.delete(`${Members.baseUrl}/${username}`);
}
/**
* Shows a member of an organization.
* @param username The username of the member to show.
*/
get(username) {
return this.api.get(`${Members.baseUrl}/${username}`);
}
/**
* Lists the privileges for the current user on an organization.
*/
getPrivileges() {
return this.api.get(`${Members.baseUrl}/privileges`);
}
/**
* Updates the members of an organization.
* @param sendEmailToInvitedUsers Whether to send an invitation email alongside the invite(s). Default to true.
* @param model
* @param options
*/
updateOrganizationMembers(model, options) {
return this.api.put(this.buildPath(Members.baseUrl, options), model);
}
/**
* Updates a member of an organization.
* @param username The username of the member to update.
* @param model
*/
updateMember(username, model) {
return this.api.put(`${Members.baseUrl}/${username}`, model);
}
/**
* Lists the groups to which an organization member belongs.
* @param username The username of the user for which to list groups.
*/
getGroups(username) {
return this.api.get(`${Members.baseUrl}/${username}/groups`);
}
}
//# sourceMappingURL=Members.js.map