"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Addons = void 0;
const utils_js_1 = require("./utils.cjs");
class Addons {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a addon
     * @param addon - The addon to create
     * @param options - Optional request options
     * @returns The created addon
     */
    async create(addon, options) {
        const resp = await this.client.POST('/api/v1/addons', {
            body: addon,
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * List addons
     * @param params - Optional parameters for listing addons
     * @param options - Optional request options
     * @returns A list of addons
     */
    async list(params, options) {
        const resp = await this.client.GET('/api/v1/addons', {
            params: { query: params },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Get an addon by ID
     * @param addonId - The ID of the addon to retrieve
     * @param options - Optional request options
     * @returns The addon
     */
    async get(addonId, options) {
        const resp = await this.client.GET('/api/v1/addons/{addonId}', {
            params: { path: { addonId } },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Update an addon
     * @param addonId - The ID of the addon to update
     * @param addon - The addon data to update
     * @param options - Optional request options
     * @returns The updated addon
     */
    async update(addonId, addon, options) {
        const resp = await this.client.PUT('/api/v1/addons/{addonId}', {
            body: addon,
            params: { path: { addonId } },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Delete an addon by ID
     * @param addonId - The ID of the addon to delete
     * @param options - Optional request options
     * @returns void or standard error response structure
     */
    async delete(addonId, options) {
        const resp = await this.client.DELETE('/api/v1/addons/{addonId}', {
            params: { path: { addonId } },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Publish an addon
     * @param addonId - The ID of the addon to publish
     * @param options - Optional request options
     * @returns The published addon
     */
    async publish(addonId, options) {
        const resp = await this.client.POST('/api/v1/addons/{addonId}/publish', {
            params: { path: { addonId } },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Archive an addon
     * @param addonId - The ID of the addon to archive
     * @param options - Optional request options
     * @returns The archived addon
     */
    async archive(addonId, options) {
        const resp = await this.client.POST('/api/v1/addons/{addonId}/archive', {
            params: { path: { addonId } },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
}
exports.Addons = Addons;
//# sourceMappingURL=addons.cjs.map