import { transformResponse } from './utils.js';
/**
 * Features
 * @description Features are the building blocks of your application. They represent the capabilities or services that your application offers.
 */
export class Features {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a feature
     * @param feature - The feature to create
     * @param signal - An optional abort signal
     * @returns The created feature
     */
    async create(feature, options) {
        const resp = await this.client.POST('/api/v1/features', {
            body: feature,
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Get a feature by ID
     * @param id - The ID of the feature
     * @param signal - An optional abort signal
     * @returns The feature
     */
    async get(id, options) {
        const resp = await this.client.GET('/api/v1/features/{featureId}', {
            params: {
                path: {
                    featureId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List features
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The features
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/features', {
            params: {
                query,
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Delete a feature by ID
     * @param id - The ID of the feature
     * @param signal - An optional abort signal
     * @returns The deleted feature
     */
    async delete(id, options) {
        const resp = await this.client.DELETE('/api/v1/features/{featureId}', {
            params: {
                path: {
                    featureId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
}
//# sourceMappingURL=features.js.map