"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DonationService = void 0; const request_1 = require("../core/request"); class DonationService { /** * Get all * Lists all donations (fixed or distance based) from all donors.
This includes the donations's runner's distance ran(if distance donation). * @result any * @throws ApiError */ static async donationControllerGetAll() { const result = await (0, request_1.request)({ method: 'GET', path: `/api/donations`, }); return result.body; } /** * Get one * Lists all information about the donation whose id got provided. This includes the donation's runner's distance ran (if distance donation). * @param id * @result any * @throws ApiError */ static async donationControllerGetOne(id) { const result = await (0, request_1.request)({ method: 'GET', path: `/api/donations/${id}`, }); return result.body; } /** * Remove * Delete the donation whose id you provided.
If no donation with this id exists it will just return 204(no content). * @param id * @param force * @result any * @result ResponseEmpty * @throws ApiError */ static async donationControllerRemove(id, force) { const result = await (0, request_1.request)({ method: 'DELETE', path: `/api/donations/${id}`, query: { 'force': force, }, }); return result.body; } /** * Post fixed * Create a fixed donation (not distance donation - use /donations/distance instead).
Please rmemember to provide the donation's donors's id and amount. * @param requestBody CreateFixedDonation * @result ResponseDonation * @throws ApiError */ static async donationControllerPostFixed(requestBody) { const result = await (0, request_1.request)({ method: 'POST', path: `/api/donations/fixed`, body: requestBody, }); return result.body; } /** * Post distance * Create a distance donation (not fixed donation - use /donations/fixed instead).
Please rmemember to provide the donation's donors's and runners ids and amount per distance (kilometer). * @param requestBody CreateDistanceDonation * @result ResponseDistanceDonation * @throws ApiError */ static async donationControllerPostDistance(requestBody) { const result = await (0, request_1.request)({ method: 'POST', path: `/api/donations/distance`, body: requestBody, }); return result.body; } /** * Put fixed * Update the fixed donation (not distance donation - use /donations/distance instead) whose id you provided.
Please remember that ids can't be changed and amounts must be positive. * @param id * @param requestBody UpdateFixedDonation * @result ResponseDonation * @throws ApiError */ static async donationControllerPutFixed(id, requestBody) { const result = await (0, request_1.request)({ method: 'PUT', path: `/api/donations/fixed/${id}`, body: requestBody, }); return result.body; } /** * Put distance * Update the distance donation (not fixed donation - use /donations/fixed instead) whose id you provided.
Please remember that ids can't be changed and amountPerDistance must be positive. * @param id * @param requestBody UpdateDistanceDonation * @result ResponseDonation * @throws ApiError */ static async donationControllerPutDistance(id, requestBody) { const result = await (0, request_1.request)({ method: 'PUT', path: `/api/donations/distance/${id}`, body: requestBody, }); return result.body; } } exports.DonationService = DonationService;