import { transformResponse } from './utils.js';
export class SubscriptionAddons {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a new subscription addon
     * @param subscriptionId - The ID of the subscription
     * @param addon - The subscription addon to create
     * @param options - Optional request options
     * @returns The created subscription addon
     */
    async create(subscriptionId, addon, options) {
        const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/addons', {
            body: addon,
            params: { path: { subscriptionId } },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List all addons of a subscription
     * @param subscriptionId - The ID of the subscription
     * @param options - Optional request options
     * @returns A list of subscription addons
     */
    async list(subscriptionId, options) {
        const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons', {
            params: { path: { subscriptionId } },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Get a subscription addon by id
     * @param subscriptionId - The ID of the subscription
     * @param subscriptionAddonId - The ID of the subscription addon
     * @param options - Optional request options
     * @returns The subscription addon
     */
    async get(subscriptionId, subscriptionAddonId, options) {
        const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
            params: { path: { subscriptionAddonId, subscriptionId } },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Updates a subscription addon
     * @param subscriptionId - The ID of the subscription
     * @param subscriptionAddonId - The ID of the subscription addon to update
     * @param addon - The subscription addon data to update
     * @param options - Optional request options
     * @returns The updated subscription addon
     */
    async update(subscriptionId, subscriptionAddonId, addon, options) {
        const resp = await this.client.PATCH('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
            body: addon,
            params: { path: { subscriptionAddonId, subscriptionId } },
            ...options,
        });
        return transformResponse(resp);
    }
}
//# sourceMappingURL=subscription-addons.js.map