import type { Client } from 'openapi-fetch';
import type { RequestOptions } from './common.js';
import type { EntitlementCreateInputs, EntitlementGrantCreateInput, operations, paths, ResetEntitlementUsageInput } from './schemas.js';
/**
 * Entitlements
 * @description With Entitlements, you can define and enforce usage limits, implement quota-based pricing, and manage access to features in your application.
 */
export declare class Entitlements {
    private client;
    grants: Grants;
    constructor(client: Client<paths, `${string}/${string}`>);
    /**
     * Create an entitlement
     *
     *     - Boolean entitlements define static feature access, e.g. "Can use SSO authentication".
     *     - Static entitlements let you pass along a configuration while granting access, e.g. "Using this feature with X Y settings" (passed in the config).
     *     - Metered entitlements have many use cases, from setting up usage-based access to implementing complex credit systems.  Example: The customer can use 10000 AI tokens during the usage period of the entitlement.
     *
     *     A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error.
     *
     *     Once an entitlement is created you cannot modify it, only delete it.
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlement - The entitlement to create
     * @param signal - An optional abort signal
     * @returns The created entitlement
     */
    create(subjectIdOrKey: operations['createEntitlement']['parameters']['path']['subjectIdOrKey'], entitlement: EntitlementCreateInputs, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
        201: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/json": import("./schemas.js").components["schemas"]["Entitlement"];
            };
        };
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
            };
        };
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
            };
        };
        403: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
            };
        };
        409: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ConflictProblemResponse"];
            };
        };
        412: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
            };
        };
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
            };
        };
        503: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
            };
        };
        default: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
            };
        };
    }, `${string}/${string}`> | undefined>;
    /**
     * Get an entitlement by ID
     *
     * @param id - The ID of the entitlement
     * @param signal - An optional abort signal
     * @returns The entitlement
     */
    get(id: operations['getEntitlement']['parameters']['path']['entitlementId'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
        200: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/json": import("./schemas.js").components["schemas"]["Entitlement"];
            };
        };
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
            };
        };
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
            };
        };
        403: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
            };
        };
        404: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
            };
        };
        412: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
            };
        };
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
            };
        };
        503: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
            };
        };
        default: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
            };
        };
    }, `${string}/${string}`> | undefined>;
    /**
     * List entitlements
     *
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The entitlements
     */
    list(query?: Omit<operations['listEntitlements']['parameters']['query'], 'page' | 'pageSize'>, options?: RequestOptions): Promise<({
        type: "metered";
        isSoftLimit?: boolean;
        isUnlimited?: boolean;
        issueAfterReset?: number;
        issueAfterResetPriority?: number;
        preserveOverageAtReset?: boolean;
        readonly createdAt: Date;
        readonly updatedAt: Date;
        readonly deletedAt?: Date;
        metadata?: import("./schemas.js").components["schemas"]["Metadata"];
        activeFrom: Date;
        activeTo?: Date;
        readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
        readonly id: string;
        subjectKey: string;
        featureKey: string;
        featureId: string;
        readonly lastReset: Date;
        readonly currentUsagePeriod: import("./schemas.js").components["schemas"]["Period"];
        readonly measureUsageFrom: Date;
        readonly usagePeriod: import("./schemas.js").components["schemas"]["RecurringPeriod"];
    } | {
        type: "static";
        config: string;
        readonly createdAt: Date;
        readonly updatedAt: Date;
        readonly deletedAt?: Date;
        metadata?: import("./schemas.js").components["schemas"]["Metadata"];
        activeFrom: Date;
        activeTo?: Date;
        readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
        readonly id: string;
        subjectKey: string;
        featureKey: string;
        featureId: string;
        currentUsagePeriod?: import("./schemas.js").components["schemas"]["Period"];
        usagePeriod?: import("./schemas.js").components["schemas"]["RecurringPeriod"];
    } | {
        type: "boolean";
        readonly createdAt: Date;
        readonly updatedAt: Date;
        readonly deletedAt?: Date;
        metadata?: import("./schemas.js").components["schemas"]["Metadata"];
        activeFrom: Date;
        activeTo?: Date;
        readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
        readonly id: string;
        subjectKey: string;
        featureKey: string;
        featureId: string;
        currentUsagePeriod?: import("./schemas.js").components["schemas"]["Period"];
        usagePeriod?: import("./schemas.js").components["schemas"]["RecurringPeriod"];
    })[]>;
    /**
     * Delete an entitlement
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementId - The ID of the entitlement
     * @param signal - An optional abort signal
     * @returns The deleted entitlement
     */
    delete(subjectIdOrKey: operations['deleteEntitlement']['parameters']['path']['subjectIdOrKey'], entitlementId: operations['deleteEntitlement']['parameters']['path']['entitlementId'], options?: RequestOptions): Promise<undefined>;
    /**
     * Get the value of an entitlement to check access
     * All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The entitlement value
     */
    value(subjectIdOrKey: operations['getEntitlementValue']['parameters']['path']['subjectIdOrKey'], entitlementIdOrFeatureKey: operations['getEntitlementValue']['parameters']['path']['entitlementIdOrFeatureKey'], query?: operations['getEntitlementValue']['parameters']['query'], options?: RequestOptions): Promise<{
        readonly hasAccess: boolean;
        readonly balance?: number;
        readonly usage?: number;
        readonly overage?: number;
        readonly totalAvailableGrantAmount?: number;
        readonly config?: string;
    } | undefined>;
    /**
     * Get the history of an entitlement
     * Returns historical balance and usage data for the entitlement. The queried history can span accross multiple reset events.
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementId - The ID of the entitlement
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The history of the entitlement
     */
    history(subjectIdOrKey: operations['getEntitlementHistory']['parameters']['path']['subjectIdOrKey'], entitlementId: operations['getEntitlementHistory']['parameters']['path']['entitlementId'], query: operations['getEntitlementHistory']['parameters']['query'], options?: RequestOptions): Promise<{
        windowedHistory: import("./schemas.js").components["schemas"]["BalanceHistoryWindow"][];
        burndownHistory: import("./schemas.js").components["schemas"]["GrantBurnDownHistorySegment"][];
    } | undefined>;
    /**
     * Override an entitlement
     * This is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime.
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
     * @param override - The override to create
     * @param signal - An optional abort signal
     * @returns The overridden entitlement
     */
    override(subjectIdOrKey: operations['overrideEntitlement']['parameters']['path']['subjectIdOrKey'], entitlementIdOrFeatureKey: operations['overrideEntitlement']['parameters']['path']['entitlementIdOrFeatureKey'], override: EntitlementCreateInputs, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
        201: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/json": import("./schemas.js").components["schemas"]["Entitlement"];
            };
        };
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
            };
        };
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
            };
        };
        403: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
            };
        };
        404: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
            };
        };
        409: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ConflictProblemResponse"];
            };
        };
        412: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
            };
        };
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
            };
        };
        503: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
            };
        };
        default: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
            };
        };
    }, `${string}/${string}`> | undefined>;
    /**
     * Reset entitlement usage
     * - Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription.
     * - Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed.
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementId - The ID of the entitlement
     * @param body - The body of the request
     * @param signal - An optional abort signal
     * @returns The reset entitlement
     */
    reset(subjectIdOrKey: operations['resetEntitlementUsage']['parameters']['path']['subjectIdOrKey'], entitlementId: operations['resetEntitlementUsage']['parameters']['path']['entitlementId'], body: ResetEntitlementUsageInput, options?: RequestOptions): Promise<undefined>;
}
export declare class Grants {
    private client;
    constructor(client: Client<paths, `${string}/${string}`>);
    /**
     * Grant usage to a subject for an entitlement
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
     * @param grant - The grant to create
     * @param signal - An optional abort signal
     * @returns The created grant
     */
    create(subjectIdOrKey: operations['createGrant']['parameters']['path']['subjectIdOrKey'], entitlementIdOrFeatureKey: operations['createGrant']['parameters']['path']['entitlementIdOrFeatureKey'], grant: EntitlementGrantCreateInput, options?: RequestOptions): Promise<{
        readonly createdAt: Date;
        readonly updatedAt: Date;
        readonly deletedAt?: Date;
        amount: number;
        priority?: number;
        effectiveAt: Date;
        expiration: import("./schemas.js").components["schemas"]["ExpirationPeriod"];
        maxRolloverAmount?: number;
        minRolloverAmount?: number;
        metadata?: import("./schemas.js").components["schemas"]["Metadata"];
        readonly id: string;
        readonly entitlementId: string;
        nextRecurrence?: Date;
        readonly expiresAt?: Date;
        voidedAt?: Date;
        recurrence?: import("./schemas.js").components["schemas"]["RecurringPeriod"];
        annotations?: import("./schemas.js").components["schemas"]["Annotations"];
    } | undefined>;
    /**
     * List grants for an entitlement
     *
     * @param subjectIdOrKey - The ID or key of the subject
     * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
     * @param signal - An optional abort signal
     * @returns The grants
     */
    list(subjectIdOrKey: operations['listEntitlementGrants']['parameters']['path']['subjectIdOrKey'], entitlementIdOrFeatureKey: operations['listEntitlementGrants']['parameters']['path']['entitlementIdOrFeatureKey'], query?: operations['listEntitlementGrants']['parameters']['query'], options?: RequestOptions): Promise<{
        readonly createdAt: Date;
        readonly updatedAt: Date;
        readonly deletedAt?: Date;
        amount: number;
        priority?: number;
        effectiveAt: Date;
        expiration: import("./schemas.js").components["schemas"]["ExpirationPeriod"];
        maxRolloverAmount?: number;
        minRolloverAmount?: number;
        metadata?: import("./schemas.js").components["schemas"]["Metadata"];
        readonly id: string;
        readonly entitlementId: string;
        nextRecurrence?: Date;
        readonly expiresAt?: Date;
        voidedAt?: Date;
        recurrence?: import("./schemas.js").components["schemas"]["RecurringPeriod"];
        annotations?: import("./schemas.js").components["schemas"]["Annotations"];
    }[] | undefined>;
    /**
     * List all grants
     * List all grants for all the subjects and entitlements.
     *
     * @param query - The query parameters
     * @param options - The request options
     * @returns The grants
     */
    listAll(query?: operations['listGrants']['parameters']['query'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
        200: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/json": import("./schemas.js").components["schemas"]["EntitlementGrant"][] | import("./schemas.js").components["schemas"]["GrantPaginatedResponse"];
            };
        };
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
            };
        };
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
            };
        };
        403: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
            };
        };
        412: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
            };
        };
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
            };
        };
        503: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
            };
        };
        default: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
            };
        };
    }, `${string}/${string}`> | undefined>;
    /**
     * Void a grant
     * Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations.
     * Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed
     * to the grant will remain, but future usage cannot be burnt down from the grant.
     *
     * @param grantId - The ID of the grant
     * @param options - The request options
     * @returns The voided grant
     */
    void(grantId: operations['voidGrant']['parameters']['path']['grantId'], options?: RequestOptions): Promise<undefined>;
}
/**
 * Entitlements V2
 * @description With Entitlements, you can define and enforce usage limits, implement quota-based pricing, and manage access to features in your application.
 */
export declare class EntitlementsV2 {
    private client;
    grants: GrantsV2;
    constructor(client: Client<paths, `${string}/${string}`>);
    /**
     * List all entitlements for all customers and features
     * @description This endpoint is intended for administrative purposes only.
     * To fetch entitlements of a specific customer, use the customer entitlements endpoint.
     * @param options - Request options including query parameters
     * @returns List of entitlements
     */
    list(options?: RequestOptions & {
        query?: operations['listEntitlementsV2']['parameters']['query'];
    }): Promise<{
        totalCount: number;
        page: number;
        pageSize: number;
        items: import("./schemas.js").components["schemas"]["EntitlementV2"][];
    } | undefined>;
    /**
     * Get entitlement by ID
     * @param entitlementId - The ID of the entitlement
     * @param options - Request options
     * @returns The entitlement
     */
    get(entitlementId: operations['getEntitlementByIdV2']['parameters']['path']['entitlementId'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
        200: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/json": import("./schemas.js").components["schemas"]["EntitlementV2"];
            };
        };
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
            };
        };
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
            };
        };
        403: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
            };
        };
        404: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
            };
        };
        412: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
            };
        };
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
            };
        };
        503: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
            };
        };
        default: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
            };
        };
    }, `${string}/${string}`> | undefined>;
}
/**
 * Grants
 */
export declare class GrantsV2 {
    private client;
    constructor(client: Client<paths, `${string}/${string}`>);
    /**
     * List all grants for all customers and entitlements
     * @description This endpoint is intended for administrative purposes only.
     * To fetch grants of a specific entitlement, use the customer entitlements grants endpoint.
     * @param options - Request options including query parameters
     * @returns List of grants
     */
    list(options?: RequestOptions & {
        query?: operations['listGrantsV2']['parameters']['query'];
    }): Promise<{
        totalCount: number;
        page: number;
        pageSize: number;
        items: import("./schemas.js").components["schemas"]["EntitlementGrantV2"][];
    } | undefined>;
    /**
     * Void a grant (legacy method using V1 endpoint)
     * @description Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations.
     * Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed
     * to the grant will remain, but future usage cannot be burnt down from the grant.
     * @param grantId - The ID of the grant
     * @param options - Request options
     * @returns The voided grant
     * @deprecated This method uses the legacy V1 endpoint. Consider using customer-specific grant operations instead.
     */
    void(grantId: operations['voidGrant']['parameters']['path']['grantId'], options?: RequestOptions): Promise<undefined>;
}
