cloudflare
Version:
The official TypeScript library for the Cloudflare API
90 lines • 2.97 kB
TypeScript
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class BaseConfig extends APIResource {
static readonly _key: readonly ['aiGateway', 'billing', 'topup', 'config'];
/**
* Configure auto top-up with a balance threshold and top-up amount. Dashboard
* sessions only: API token, OAuth, and service credentials are rejected with 403.
*
* @example
* ```ts
* const config =
* await client.aiGateway.billing.topup.config.create({
* account_id: 'account_id',
* amount: 5000,
* threshold: 500,
* });
* ```
*/
create(params: ConfigCreateParams, options?: RequestOptions): APIPromise<ConfigCreateResponse>;
/**
* Remove the auto top-up configuration for the account. Dashboard sessions only:
* API token, OAuth, and service credentials are rejected with 403.
*
* @example
* ```ts
* const config =
* await client.aiGateway.billing.topup.config.delete({
* account_id: 'account_id',
* });
* ```
*/
delete(params: ConfigDeleteParams, options?: RequestOptions): APIPromise<ConfigDeleteResponse>;
/**
* Retrieve the current auto top-up threshold, amount, and any error state.
*
* @example
* ```ts
* const config =
* await client.aiGateway.billing.topup.config.get({
* account_id: 'account_id',
* });
* ```
*/
get(params: ConfigGetParams, options?: RequestOptions): APIPromise<ConfigGetResponse>;
}
export declare class Config extends BaseConfig {
}
export interface ConfigCreateResponse {
amount: number;
threshold: number;
}
export type ConfigDeleteResponse = unknown;
export interface ConfigGetResponse {
amount: number | null;
threshold: number | null;
disabledReason?: string | null;
error?: string | null;
lastFailedAt?: number | null;
}
export interface ConfigCreateParams {
/**
* Path param: Cloudflare account ID.
*/
account_id: string;
/**
* Body param: Auto top-up amount in cents (min 1000).
*/
amount: number;
/**
* Body param: Balance threshold in cents that triggers auto top-up (min 500).
*/
threshold: number;
}
export interface ConfigDeleteParams {
/**
* Cloudflare account ID.
*/
account_id: string;
}
export interface ConfigGetParams {
/**
* Cloudflare account ID.
*/
account_id: string;
}
export declare namespace Config {
export { type ConfigCreateResponse as ConfigCreateResponse, type ConfigDeleteResponse as ConfigDeleteResponse, type ConfigGetResponse as ConfigGetResponse, type ConfigCreateParams as ConfigCreateParams, type ConfigDeleteParams as ConfigDeleteParams, type ConfigGetParams as ConfigGetParams, };
}
//# sourceMappingURL=config.d.ts.map