"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.
This includes the donor's current donation amount.
* @returns ResponseDonor
* @throws ApiError
*/
static async donorControllerGetAll() {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/donors`,
});
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.
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.
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.
If no donor with this id exists it will just return 204(no content).
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;