import { transformResponse } from './utils.js';
/**
 * Portal
 * Manage portal tokens.
 */
export class Portal {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a consumer portal token
     * @param request - The request body
     * @param options - The request options
     * @returns The portal token
     */
    async create(body, options) {
        const resp = await this.client.POST('/api/v1/portal/tokens', {
            body,
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List consumer portal tokens
     * @param query - The query parameters
     * @param options - The request options
     * @returns The portal tokens
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/portal/tokens', {
            params: { query },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Invalidate consumer portal tokens
     * @param body - The id or subject to invalidate
     * @param options - The request options
     * @returns The portal token
     */
    async invalidate(body, options) {
        const resp = await this.client.POST('/api/v1/portal/tokens/invalidate', {
            body,
            ...options,
        });
        return transformResponse(resp);
    }
}
//# sourceMappingURL=portal.js.map