"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.SelfServeSettingsApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class SelfServeSettingsApi extends runtime.BaseAPI {
    /**
     * Get the customization settings for the vendor\'s customer portal.
     * Get Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationGetRaw(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: `/self_serve_settings/customization`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeCustomizationFromJSON)(jsonValue));
    }
    /**
     * Get the customization settings for the vendor\'s customer portal.
     * Get Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationGet(initOverrides) {
        const response = await this.selfServeSettingsCustomizationGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Create the customization settings for the vendor\'s customer portal.
     * Create Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationPostRaw(requestParameters, initOverrides) {
        if (requestParameters.selfServeCustomization === null || requestParameters.selfServeCustomization === undefined) {
            throw new runtime.RequiredError('selfServeCustomization', 'Required parameter requestParameters.selfServeCustomization was null or undefined when calling selfServeSettingsCustomizationPost.');
        }
        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: `/self_serve_settings/customization`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.SelfServeCustomizationToJSON)(requestParameters.selfServeCustomization),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeCustomizationFromJSON)(jsonValue));
    }
    /**
     * Create the customization settings for the vendor\'s customer portal.
     * Create Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationPost(requestParameters, initOverrides) {
        const response = await this.selfServeSettingsCustomizationPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Update the customization settings for the vendor\'s customer portal.
     * Update Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationPutRaw(requestParameters, initOverrides) {
        if (requestParameters.selfServeCustomization === null || requestParameters.selfServeCustomization === undefined) {
            throw new runtime.RequiredError('selfServeCustomization', 'Required parameter requestParameters.selfServeCustomization was null or undefined when calling selfServeSettingsCustomizationPut.');
        }
        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: `/self_serve_settings/customization`,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.SelfServeCustomizationToJSON)(requestParameters.selfServeCustomization),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeCustomizationFromJSON)(jsonValue));
    }
    /**
     * Update the customization settings for the vendor\'s customer portal.
     * Update Vendor Customization for Self Serve
     */
    async selfServeSettingsCustomizationPut(requestParameters, initOverrides) {
        const response = await this.selfServeSettingsCustomizationPutRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get self serve settings for a vendor.
     * Get Vendor Self Serve Settings
     */
    async selfServeSettingsGetRaw(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: `/self_serve_settings/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeSettingsFromJSON)(jsonValue));
    }
    /**
     * Get self serve settings for a vendor.
     * Get Vendor Self Serve Settings
     */
    async selfServeSettingsGet(initOverrides) {
        const response = await this.selfServeSettingsGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Create the self serve settings for a vendor. If partial fields are given, we will fallback on default values.
     * Create Vendor Self Serve Settings
     */
    async selfServeSettingsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.updateSelfServeSettingsArgs === null || requestParameters.updateSelfServeSettingsArgs === undefined) {
            throw new runtime.RequiredError('updateSelfServeSettingsArgs', 'Required parameter requestParameters.updateSelfServeSettingsArgs was null or undefined when calling selfServeSettingsPost.');
        }
        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: `/self_serve_settings/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdateSelfServeSettingsArgsToJSON)(requestParameters.updateSelfServeSettingsArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeSettingsFromJSON)(jsonValue));
    }
    /**
     * Create the self serve settings for a vendor. If partial fields are given, we will fallback on default values.
     * Create Vendor Self Serve Settings
     */
    async selfServeSettingsPost(requestParameters, initOverrides) {
        const response = await this.selfServeSettingsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Update the self serve settings for a vendor. If partial fields are given, we will only update the provided fields.
     * Update Vendor Self Serve Settings.
     */
    async selfServeSettingsPutRaw(requestParameters, initOverrides) {
        if (requestParameters.updateSelfServeSettingsArgs === null || requestParameters.updateSelfServeSettingsArgs === undefined) {
            throw new runtime.RequiredError('updateSelfServeSettingsArgs', 'Required parameter requestParameters.updateSelfServeSettingsArgs was null or undefined when calling selfServeSettingsPut.');
        }
        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: `/self_serve_settings/`,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdateSelfServeSettingsArgsToJSON)(requestParameters.updateSelfServeSettingsArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeSettingsFromJSON)(jsonValue));
    }
    /**
     * Update the self serve settings for a vendor. If partial fields are given, we will only update the provided fields.
     * Update Vendor Self Serve Settings.
     */
    async selfServeSettingsPut(requestParameters, initOverrides) {
        const response = await this.selfServeSettingsPutRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.SelfServeSettingsApi = SelfServeSettingsApi;
//# sourceMappingURL=data:application/json;base64, 