"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.PaymentGatewayCredentialApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class PaymentGatewayCredentialApi extends runtime.BaseAPI {
    /**
     * Returns the payment gateway information for your account (the Paddle or Stripe credentials used to issue and pay invoices)
     * Get PaymentGatewayCredential
     */
    async paymentGatewayCredentialsGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        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: `/payment_gateway_credentials/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PaymentGatewayCredentialFromJSON)(jsonValue));
    }
    /**
     * Returns the payment gateway information for your account (the Paddle or Stripe credentials used to issue and pay invoices)
     * Get PaymentGatewayCredential
     */
    async paymentGatewayCredentialsGet(initOverrides) {
        const response = await this.paymentGatewayCredentialsGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Adds the credentials for a payment gateway, to be used to issue and pay invoices to your account.
     * Add PaymentGatewayCredential
     */
    async paymentGatewayCredentialsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.paymentGatewayCredentialInputArgs === null || requestParameters.paymentGatewayCredentialInputArgs === undefined) {
            throw new runtime.RequiredError('paymentGatewayCredentialInputArgs', 'Required parameter requestParameters.paymentGatewayCredentialInputArgs was null or undefined when calling paymentGatewayCredentialsPost.');
        }
        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: `/payment_gateway_credentials/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.PaymentGatewayCredentialInputArgsToJSON)(requestParameters.paymentGatewayCredentialInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PaymentGatewayCredentialFromJSON)(jsonValue));
    }
    /**
     * Adds the credentials for a payment gateway, to be used to issue and pay invoices to your account.
     * Add PaymentGatewayCredential
     */
    async paymentGatewayCredentialsPost(requestParameters, initOverrides) {
        const response = await this.paymentGatewayCredentialsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.PaymentGatewayCredentialApi = PaymentGatewayCredentialApi;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGF5bWVudEdhdGV3YXlDcmVkZW50aWFsQXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvZGVnZW4vYXB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