This repository has been archived on 2023-11-06. You can view files and clone it, but cannot push or open issues or pull requests.
lfk-client-node/dist/services/DonorService.js
Nicolai Ort f48e6bcfc3
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v1.0.0 [CI SKIP]
2023-04-18 18:05:50 +00:00

91 lines
2.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DonorService = void 0;
const request_1 = require("../core/request");
class DonorService {
/**
* Get all
* Lists all donor. <br> This includes the donor's current donation amount.
* @param page
* @param pageSize
* @returns ResponseDonor
* @throws ApiError
*/
static async donorControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/donors`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
/**
* Post
* Create a new donor.
* @param requestBody CreateDonor
* @returns ResponseDonor
* @throws ApiError
*/
static async donorControllerPost(requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/donors`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the donor whose id got provided. <br> This includes the donor's current donation amount.
* @param id
* @returns ResponseDonor
* @throws ApiError
*/
static async donorControllerGetOne(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/donors/${id}`,
});
return result.body;
}
/**
* Put
* Update the donor whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateDonor
* @returns ResponseDonor
* @throws ApiError
*/
static async donorControllerPut(id, requestBody) {
const result = await (0, request_1.request)({
method: 'PUT',
path: `/api/donors/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the donor whose id you provided. <br> If no donor with this id exists it will just return 204(no content). <br> If the donor still has donations associated this will fail, please provide the query param ?force=true to delete the donor with all associated donations.
* @param id
* @param force
* @returns ResponseDonor
* @returns ResponseEmpty
* @throws ApiError
*/
static async donorControllerRemove(id, force) {
const result = await (0, request_1.request)({
method: 'DELETE',
path: `/api/donors/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}
exports.DonorService = DonorService;