import type { Client } from 'openapi-fetch'; import type { RequestOptions } from './common.js'; import type { operations, paths, SubjectUpsert } from './schemas.js'; /** * Subjects * @description Subjects are entities that consume resources you wish to meter. These can range from users, servers, and services to devices. The design of subjects is intentionally generic, enabling flexible application across various metering scenarios. Meters are aggregating events for each subject.. */ export declare class Subjects { private client; constructor(client: Client); /** * Upsert one or multiple subjects * If the subject does not exist, it will be created, otherwise it will be updated. * * @param subjects - The subjects to upsert * @param signal - An optional abort signal * @returns The upserted subjects */ upsert(subjects: SubjectUpsert | SubjectUpsert[], options?: RequestOptions): Promise<{ readonly createdAt: Date; readonly updatedAt: Date; readonly deletedAt?: Date; readonly id: string; key: string; displayName?: string | null; metadata?: { [key: string]: unknown; } | null; currentPeriodStart?: Date; currentPeriodEnd?: Date; stripeCustomerId?: string | null; }[] | undefined>; /** * Get a subject by ID or key * @param idOrKey - The ID or key of the subject * @param signal - An optional abort signal * @returns The subject */ get(idOrKey: operations['getSubject']['parameters']['path']['subjectIdOrKey'], options?: RequestOptions): Promise<{ readonly createdAt: Date; readonly updatedAt: Date; readonly deletedAt?: Date; readonly id: string; key: string; displayName?: string | null; metadata?: { [key: string]: unknown; } | null; currentPeriodStart?: Date; currentPeriodEnd?: Date; stripeCustomerId?: string | null; } | undefined>; /** * List subjects * @param signal - An optional abort signal * @returns The subjects */ list(options?: RequestOptions): Promise<{ readonly createdAt: Date; readonly updatedAt: Date; readonly deletedAt?: Date; readonly id: string; key: string; displayName?: string | null; metadata?: { [key: string]: unknown; } | null; currentPeriodStart?: Date; currentPeriodEnd?: Date; stripeCustomerId?: string | null; }[] | undefined>; /** * Delete a subject by ID or key * @param idOrKey - The ID or key of the subject * @param signal - An optional abort signal * @returns The deleted subject */ delete(idOrKey: operations['deleteSubject']['parameters']['path']['subjectIdOrKey'], options?: RequestOptions): Promise; }