"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Octane API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RefundApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class RefundApi extends runtime.BaseAPI {
    /**
     * Create a refund for a paid invoice.
     * Create Refund
     */
    async refundPostRaw(requestParameters, initOverrides) {
        if (requestParameters.createRefundArgs === null || requestParameters.createRefundArgs === undefined) {
            throw new runtime.RequiredError('createRefundArgs', 'Required parameter requestParameters.createRefundArgs was null or undefined when calling refundPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/refund/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CreateRefundArgsToJSON)(requestParameters.createRefundArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.RefundFromJSON)(jsonValue));
    }
    /**
     * Create a refund for a paid invoice.
     * Create Refund
     */
    async refundPost(requestParameters, initOverrides) {
        const response = await this.refundPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.RefundApi = RefundApi;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVmdW5kQXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvZGVnZW4vYXBpcy9SZWZ1bmRBcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9CQUFvQjtBQUNwQixvQkFBb0I7QUFDcEI7Ozs7Ozs7Ozs7R0FVRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUdILG9EQUFzQztBQUN0QyxzQ0FPbUI7QUFNbkI7O0dBRUc7QUFDSCxNQUFhLFNBQVUsU0FBUSxPQUFPLENBQUMsT0FBTztJQUUxQzs7O09BR0c7SUFDSCxLQUFLLENBQUMsYUFBYSxDQUFDLGlCQUFvQyxFQUFFLGFBQTJCO1FBQ2pGLElBQUksaUJBQWlCLENBQUMsZ0JBQWdCLEtBQUssSUFBSSxJQUFJLGlCQUFpQixDQUFDLGdCQUFnQixLQUFLLFNBQVMsRUFBRTtZQUNqRyxNQUFNLElBQUksT0FBTyxDQUFDLGFBQWEsQ0FBQyxrQkFBa0IsRUFBQyxzR0FBc0csQ0FBQyxDQUFDO1NBQzlKO1FBRUQsTUFBTSxlQUFlLEdBQVEsRUFBRSxDQUFDO1FBRWhDLE1BQU0sZ0JBQWdCLEdBQXdCLEVBQUUsQ0FBQztRQUVqRCxnQkFBZ0IsQ0FBQyxjQUFjLENBQUMsR0FBRyxrQkFBa0IsQ0FBQztRQUV0RCxJQUFJLElBQUksQ0FBQyxhQUFhLElBQUksSUFBSSxDQU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