91 lines
2.7 KiB
JavaScript
91 lines
2.7 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GroupContactService = void 0;
|
|
const request_1 = require("../core/request");
|
|
class GroupContactService {
|
|
/**
|
|
* Get all
|
|
* Lists all contacts. <br> This includes the contact's associated groups.
|
|
* @param page
|
|
* @param pageSize
|
|
* @result ResponseGroupContact
|
|
* @throws ApiError
|
|
*/
|
|
static async groupContactControllerGetAll(page, pageSize) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/contacts`,
|
|
query: {
|
|
'page': page,
|
|
'page_size': pageSize,
|
|
},
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Post
|
|
* Create a new contact.
|
|
* @param requestBody CreateGroupContact
|
|
* @result ResponseGroupContact
|
|
* @throws ApiError
|
|
*/
|
|
static async groupContactControllerPost(requestBody) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'POST',
|
|
path: `/api/contacts`,
|
|
body: requestBody,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Get one
|
|
* Lists all information about the contact whose id got provided. <br> This includes the contact's associated groups.
|
|
* @param id
|
|
* @result ResponseGroupContact
|
|
* @throws ApiError
|
|
*/
|
|
static async groupContactControllerGetOne(id) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/contacts/${id}`,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Put
|
|
* Update the contact whose id you provided. <br> Please remember that ids can't be changed.
|
|
* @param id
|
|
* @param requestBody UpdateGroupContact
|
|
* @result ResponseGroupContact
|
|
* @throws ApiError
|
|
*/
|
|
static async groupContactControllerPut(id, requestBody) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'PUT',
|
|
path: `/api/contacts/${id}`,
|
|
body: requestBody,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Remove
|
|
* Delete the contact whose id you provided. <br> If no contact with this id exists it will just return 204(no content). <br> This won't delete any groups associated with the contact.
|
|
* @param id
|
|
* @param force
|
|
* @result ResponseGroupContact
|
|
* @result ResponseEmpty
|
|
* @throws ApiError
|
|
*/
|
|
static async groupContactControllerRemove(id, force) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'DELETE',
|
|
path: `/api/contacts/${id}`,
|
|
query: {
|
|
'force': force,
|
|
},
|
|
});
|
|
return result.body;
|
|
}
|
|
}
|
|
exports.GroupContactService = GroupContactService;
|