import { APIResource } from "../../core/resource.js";
import * as HyperdriveAPI from "./hyperdrive.js";
import { HyperdrivesSinglePage } from "./hyperdrive.js";
import { APIPromise } from "../../core/api-promise.js";
import { PagePromise } from "../../core/pagination.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class BaseConfigs extends APIResource {
    static readonly _key: readonly ['hyperdrive', 'configs'];
    /**
     * Creates and returns a new Hyperdrive configuration.
     *
     * @example
     * ```ts
     * const hyperdrive = await client.hyperdrive.configs.create({
     *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
     *   name: 'example-hyperdrive',
     *   origin: {
     *     database: 'postgres',
     *     host: 'database.example.com',
     *     password: 'password',
     *     port: 5432,
     *     scheme: 'postgres',
     *     user: 'postgres',
     *   },
     * });
     * ```
     */
    create(params: ConfigCreateParams, options?: RequestOptions): APIPromise<HyperdriveAPI.Hyperdrive>;
    /**
     * Updates and returns the specified Hyperdrive configuration.
     *
     * @example
     * ```ts
     * const hyperdrive = await client.hyperdrive.configs.update(
     *   '023e105f4ecef8ad9ca31a8372d0c353',
     *   {
     *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
     *     name: 'example-hyperdrive',
     *     origin: {
     *       database: 'postgres',
     *       host: 'database.example.com',
     *       password: 'password',
     *       port: 5432,
     *       scheme: 'postgres',
     *       user: 'postgres',
     *     },
     *   },
     * );
     * ```
     */
    update(hyperdriveID: string, params: ConfigUpdateParams, options?: RequestOptions): APIPromise<HyperdriveAPI.Hyperdrive>;
    /**
     * Returns a list of Hyperdrives.
     *
     * @example
     * ```ts
     * // Automatically fetches more pages as needed.
     * for await (const hyperdrive of client.hyperdrive.configs.list(
     *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
     * )) {
     *   // ...
     * }
     * ```
     */
    list(params: ConfigListParams, options?: RequestOptions): PagePromise<HyperdrivesSinglePage, HyperdriveAPI.Hyperdrive>;
    /**
     * Deletes the specified Hyperdrive.
     *
     * @example
     * ```ts
     * const config = await client.hyperdrive.configs.delete(
     *   '023e105f4ecef8ad9ca31a8372d0c353',
     *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
     * );
     * ```
     */
    delete(hyperdriveID: string, params: ConfigDeleteParams, options?: RequestOptions): APIPromise<ConfigDeleteResponse | null>;
    /**
     * Patches and returns the specified Hyperdrive configuration. Custom caching
     * settings are not kept if caching is disabled.
     *
     * @example
     * ```ts
     * const hyperdrive = await client.hyperdrive.configs.edit(
     *   '023e105f4ecef8ad9ca31a8372d0c353',
     *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
     * );
     * ```
     */
    edit(hyperdriveID: string, params: ConfigEditParams, options?: RequestOptions): APIPromise<HyperdriveAPI.Hyperdrive>;
    /**
     * Returns the specified Hyperdrive configuration.
     *
     * @example
     * ```ts
     * const hyperdrive = await client.hyperdrive.configs.get(
     *   '023e105f4ecef8ad9ca31a8372d0c353',
     *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
     * );
     * ```
     */
    get(hyperdriveID: string, params: ConfigGetParams, options?: RequestOptions): APIPromise<HyperdriveAPI.Hyperdrive>;
}
export declare class Configs extends BaseConfigs {
}
export type ConfigDeleteResponse = unknown;
export interface ConfigCreateParams {
    /**
     * Path param: Define configurations using a unique string identifier.
     */
    account_id: string;
    /**
     * Body param: The name of the Hyperdrive configuration. Used to identify the
     * configuration in the Cloudflare dashboard and API.
     */
    name: string;
    /**
     * Body param
     */
    origin: ConfigCreateParams.PublicDatabase | ConfigCreateParams.AccessProtectedDatabaseBehindCloudflareTunnel | ConfigCreateParams.DatabaseReachableThroughAWorkersVPC;
    /**
     * Body param
     */
    caching?: ConfigCreateParams.HyperdriveHyperdriveCachingCommon | ConfigCreateParams.HyperdriveHyperdriveCachingEnabled;
    /**
     * Body param: mTLS configuration for the origin connection. Cannot be used with
     * VPC Service origins; TLS must be managed on the VPC Service.
     */
    mtls?: ConfigCreateParams.MTLS;
    /**
     * Body param: The (soft) maximum number of connections the Hyperdrive is allowed
     * to make to the origin database.
     *
     * Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not
     * specified, defaults to 20 for free tier and 60 for paid tier. Contact Cloudflare
     * if you need a higher limit.
     */
    origin_connection_limit?: number;
}
export declare namespace ConfigCreateParams {
    interface PublicDatabase {
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Defines the port of your origin database. Defaults to 5432 for PostgreSQL or
         * 3306 for MySQL if not specified.
         */
        port: number;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface AccessProtectedDatabaseBehindCloudflareTunnel {
        /**
         * Defines the Client ID of the Access token to use when connecting to the origin
         * database.
         */
        access_client_id: string;
        /**
         * Defines the Client Secret of the Access Token to use when connecting to the
         * origin database. The API never returns this write-only value.
         */
        access_client_secret: string;
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface DatabaseReachableThroughAWorkersVPC {
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * The identifier of the Workers VPC Service to connect through. Hyperdrive will
         * egress through the specified VPC Service to reach the origin database.
         */
        service_id: string;
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface HyperdriveHyperdriveCachingCommon {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
    }
    interface HyperdriveHyperdriveCachingEnabled {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
        /**
         * Specify the maximum duration (in seconds) items should persist in the cache.
         * Defaults to 60 seconds if not specified.
         */
        max_age?: number;
        /**
         * Specify the number of seconds the cache may serve a stale response. Defaults to
         * 15 seconds if not specified.
         */
        stale_while_revalidate?: number;
    }
    /**
     * mTLS configuration for the origin connection. Cannot be used with VPC Service
     * origins; TLS must be managed on the VPC Service.
     */
    interface MTLS {
        /**
         * Define CA certificate ID obtained after uploading CA cert.
         */
        ca_certificate_id?: string;
        /**
         * Define mTLS certificate ID obtained after uploading client cert.
         */
        mtls_certificate_id?: string;
        /**
         * Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.
         */
        sslmode?: string;
    }
}
export interface ConfigUpdateParams {
    /**
     * Path param: Define configurations using a unique string identifier.
     */
    account_id: string;
    /**
     * Body param: The name of the Hyperdrive configuration. Used to identify the
     * configuration in the Cloudflare dashboard and API.
     */
    name: string;
    /**
     * Body param
     */
    origin: ConfigUpdateParams.PublicDatabase | ConfigUpdateParams.AccessProtectedDatabaseBehindCloudflareTunnel | ConfigUpdateParams.DatabaseReachableThroughAWorkersVPC;
    /**
     * Body param
     */
    caching?: ConfigUpdateParams.HyperdriveHyperdriveCachingCommon | ConfigUpdateParams.HyperdriveHyperdriveCachingEnabled;
    /**
     * Body param: mTLS configuration for the origin connection. Cannot be used with
     * VPC Service origins; TLS must be managed on the VPC Service.
     */
    mtls?: ConfigUpdateParams.MTLS;
    /**
     * Body param: The (soft) maximum number of connections the Hyperdrive is allowed
     * to make to the origin database.
     *
     * Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not
     * specified, defaults to 20 for free tier and 60 for paid tier. Contact Cloudflare
     * if you need a higher limit.
     */
    origin_connection_limit?: number;
}
export declare namespace ConfigUpdateParams {
    interface PublicDatabase {
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Defines the port of your origin database. Defaults to 5432 for PostgreSQL or
         * 3306 for MySQL if not specified.
         */
        port: number;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface AccessProtectedDatabaseBehindCloudflareTunnel {
        /**
         * Defines the Client ID of the Access token to use when connecting to the origin
         * database.
         */
        access_client_id: string;
        /**
         * Defines the Client Secret of the Access Token to use when connecting to the
         * origin database. The API never returns this write-only value.
         */
        access_client_secret: string;
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface DatabaseReachableThroughAWorkersVPC {
        /**
         * Set the name of your origin database.
         */
        database: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password: string;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme: 'postgres' | 'postgresql' | 'mysql';
        /**
         * The identifier of the Workers VPC Service to connect through. Hyperdrive will
         * egress through the specified VPC Service to reach the origin database.
         */
        service_id: string;
        /**
         * Set the user of your origin database.
         */
        user: string;
    }
    interface HyperdriveHyperdriveCachingCommon {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
    }
    interface HyperdriveHyperdriveCachingEnabled {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
        /**
         * Specify the maximum duration (in seconds) items should persist in the cache.
         * Defaults to 60 seconds if not specified.
         */
        max_age?: number;
        /**
         * Specify the number of seconds the cache may serve a stale response. Defaults to
         * 15 seconds if not specified.
         */
        stale_while_revalidate?: number;
    }
    /**
     * mTLS configuration for the origin connection. Cannot be used with VPC Service
     * origins; TLS must be managed on the VPC Service.
     */
    interface MTLS {
        /**
         * Define CA certificate ID obtained after uploading CA cert.
         */
        ca_certificate_id?: string;
        /**
         * Define mTLS certificate ID obtained after uploading client cert.
         */
        mtls_certificate_id?: string;
        /**
         * Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.
         */
        sslmode?: string;
    }
}
export interface ConfigListParams {
    /**
     * Define configurations using a unique string identifier.
     */
    account_id: string;
}
export interface ConfigDeleteParams {
    /**
     * Define configurations using a unique string identifier.
     */
    account_id: string;
}
export interface ConfigEditParams {
    /**
     * Path param: Define configurations using a unique string identifier.
     */
    account_id: string;
    /**
     * Body param
     */
    caching?: ConfigEditParams.HyperdriveHyperdriveCachingCommon | ConfigEditParams.HyperdriveHyperdriveCachingEnabled;
    /**
     * Body param: mTLS configuration for the origin connection. Cannot be used with
     * VPC Service origins; TLS must be managed on the VPC Service.
     */
    mtls?: ConfigEditParams.MTLS;
    /**
     * Body param: The name of the Hyperdrive configuration. Used to identify the
     * configuration in the Cloudflare dashboard and API.
     */
    name?: string;
    /**
     * Body param: Connect to a database through a Workers VPC Service. TLS settings
     * (mTLS, sslmode) cannot be configured on the Hyperdrive when using a VPC Service
     * origin; TLS must be managed on the VPC Service itself.
     */
    origin?: ConfigEditParams.HyperdriveHyperdriveDatabase | ConfigEditParams.HyperdriveInternetOrigin | ConfigEditParams.HyperdriveOverAccessOrigin | ConfigEditParams.HyperdriveVPCServiceOrigin;
    /**
     * Body param: The (soft) maximum number of connections the Hyperdrive is allowed
     * to make to the origin database.
     *
     * Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not
     * specified, defaults to 20 for free tier and 60 for paid tier. Contact Cloudflare
     * if you need a higher limit.
     */
    origin_connection_limit?: number;
}
export declare namespace ConfigEditParams {
    interface HyperdriveHyperdriveCachingCommon {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
    }
    interface HyperdriveHyperdriveCachingEnabled {
        /**
         * Set to true to disable caching of SQL responses. Default is false.
         */
        disabled?: boolean;
        /**
         * Specify the maximum duration (in seconds) items should persist in the cache.
         * Defaults to 60 seconds if not specified.
         */
        max_age?: number;
        /**
         * Specify the number of seconds the cache may serve a stale response. Defaults to
         * 15 seconds if not specified.
         */
        stale_while_revalidate?: number;
    }
    /**
     * mTLS configuration for the origin connection. Cannot be used with VPC Service
     * origins; TLS must be managed on the VPC Service.
     */
    interface MTLS {
        /**
         * Define CA certificate ID obtained after uploading CA cert.
         */
        ca_certificate_id?: string;
        /**
         * Define mTLS certificate ID obtained after uploading client cert.
         */
        mtls_certificate_id?: string;
        /**
         * Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.
         */
        sslmode?: string;
    }
    interface HyperdriveHyperdriveDatabase {
        /**
         * Set the name of your origin database.
         */
        database?: string;
        /**
         * Set the password needed to access your origin database. The API never returns
         * this write-only value.
         */
        password?: string;
        /**
         * Specifies the URL scheme used to connect to your origin database.
         */
        scheme?: 'postgres' | 'postgresql' | 'mysql';
        /**
         * Set the user of your origin database.
         */
        user?: string;
    }
    interface HyperdriveInternetOrigin {
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
        /**
         * Defines the port of your origin database. Defaults to 5432 for PostgreSQL or
         * 3306 for MySQL if not specified.
         */
        port: number;
    }
    interface HyperdriveOverAccessOrigin {
        /**
         * Defines the Client ID of the Access token to use when connecting to the origin
         * database.
         */
        access_client_id: string;
        /**
         * Defines the Client Secret of the Access Token to use when connecting to the
         * origin database. The API never returns this write-only value.
         */
        access_client_secret: string;
        /**
         * Defines the host (hostname or IP) of your origin database.
         */
        host: string;
    }
    /**
     * Connect to a database through a Workers VPC Service. TLS settings (mTLS,
     * sslmode) cannot be configured on the Hyperdrive when using a VPC Service origin;
     * TLS must be managed on the VPC Service itself.
     */
    interface HyperdriveVPCServiceOrigin {
        /**
         * The identifier of the Workers VPC Service to connect through. Hyperdrive will
         * egress through the specified VPC Service to reach the origin database.
         */
        service_id: string;
    }
}
export interface ConfigGetParams {
    /**
     * Define configurations using a unique string identifier.
     */
    account_id: string;
}
export declare namespace Configs {
    export { type ConfigDeleteResponse as ConfigDeleteResponse, type ConfigCreateParams as ConfigCreateParams, type ConfigUpdateParams as ConfigUpdateParams, type ConfigListParams as ConfigListParams, type ConfigDeleteParams as ConfigDeleteParams, type ConfigEditParams as ConfigEditParams, type ConfigGetParams as ConfigGetParams, };
}
export { type HyperdrivesSinglePage };
//# sourceMappingURL=configs.d.ts.map