type ApiRequestOptions = {
    readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
    readonly url: string;
    readonly path?: Record<string, any>;
    readonly cookies?: Record<string, any>;
    readonly headers?: Record<string, any>;
    readonly query?: Record<string, any>;
    readonly formData?: Record<string, any>;
    readonly body?: any;
    readonly mediaType?: string;
    readonly responseHeader?: string;
    readonly errors?: Record<number, string>;
};

declare class CancelError extends Error {
    constructor(message: string);
    get isCancelled(): boolean;
}
interface OnCancel {
    readonly isResolved: boolean;
    readonly isRejected: boolean;
    readonly isCancelled: boolean;
    (cancelHandler: () => void): void;
}
declare class CancelablePromise<T> implements Promise<T> {
    #private;
    constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
    get [Symbol.toStringTag](): string;
    then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
    catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
    finally(onFinally?: (() => void) | null): Promise<T>;
    cancel(): void;
    get isCancelled(): boolean;
}

type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
type Headers = Record<string, string>;
type OpenAPIConfig = {
    BASE: string;
    VERSION: string;
    WITH_CREDENTIALS: boolean;
    CREDENTIALS: 'include' | 'omit' | 'same-origin';
    TOKEN?: string | Resolver<string> | undefined;
    USERNAME?: string | Resolver<string> | undefined;
    PASSWORD?: string | Resolver<string> | undefined;
    HEADERS?: Headers | Resolver<Headers> | undefined;
    ENCODE_PATH?: ((path: string) => string) | undefined;
};
declare const OpenAPI: OpenAPIConfig;

declare abstract class BaseHttpRequest {
    readonly config: OpenAPIConfig;
    constructor(config: OpenAPIConfig);
    abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
}

type ApiKeyCreateRequest = {
    /**
     * A user-specified API key name. This value is required when creating an API key.
     */
    key_name: string;
};

type ApiKeyCreateResponse = {
    /**
     * The API key ID
     */
    id: number;
    /**
     * The generated 64-bit token required to access the Neon API
     */
    key: string;
    /**
     * The user-specified API key name
     */
    name: string;
    /**
     * A timestamp indicating when the API key was created
     */
    created_at: string;
    /**
     * ID of the user who created this API key
     */
    created_by: string;
};

type ApiKeyRevokeResponse = {
    /**
     * The API key ID
     */
    id: number;
    /**
     * The user-specified API key name
     */
    name: string;
    /**
     * A timestamp indicating when the API key was created
     */
    created_at: string;
    /**
     * ID of the user who created this API key
     */
    created_by: string;
    /**
     * A timestamp indicating when the API was last used
     */
    last_used_at?: string | null;
    /**
     * The IP address from which the API key was last used
     */
    last_used_from_addr: string;
    /**
     * A `true` or `false` value indicating whether the API key is revoked
     */
    revoked: boolean;
};

/**
 * The user data of the user that created this API key.
 */
type ApiKeyCreatorData = {
    /**
     * ID of the user who created this API key
     */
    id: string;
    /**
     * The name of the user.
     */
    name: string;
    /**
     * The URL to the user's avatar image.
     */
    image: string;
};

type ApiKeysListResponseItem = {
    /**
     * The API key ID
     */
    id: number;
    /**
     * The user-specified API key name
     */
    name: string;
    /**
     * A timestamp indicating when the API key was created
     */
    created_at: string;
    created_by: ApiKeyCreatorData;
    /**
     * A timestamp indicating when the API was last used
     */
    last_used_at?: string | null;
    /**
     * The IP address from which the API key was last used
     */
    last_used_from_addr: string;
};

type ErrorCode = string;

/**
 * General Error
 */
type GeneralError = {
    request_id?: string;
    code: ErrorCode;
    /**
     * Error message
     */
    message: string;
};

declare class ApiKeyService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * List API keys
     * Retrieves the API keys for your Neon account.
     * The response does not include API key tokens. A token is only provided when creating an API key.
     * API keys can also be managed in the Neon Console.
     * For more information, see [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @returns ApiKeysListResponseItem Returned the API keys for the Neon account
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listApiKeys(): CancelablePromise<Array<ApiKeysListResponseItem> | GeneralError>;
    /**
     * Create API key
     * Creates an API key.
     * The `key_name` is a user-specified name for the key.
     * This method returns an `id` and `key`. The `key` is a randomly generated, 64-bit token required to access the Neon API.
     * API keys can also be managed in the Neon Console.
     * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @param requestBody
     * @returns ApiKeyCreateResponse Created an API key
     * @returns GeneralError General Error
     * @throws ApiError
     */
    createApiKey(requestBody: ApiKeyCreateRequest): CancelablePromise<ApiKeyCreateResponse | GeneralError>;
    /**
     * Revoke API key
     * Revokes the specified API key.
     * An API key that is no longer needed can be revoked.
     * This action cannot be reversed.
     * You can obtain `key_id` values by listing the API keys for your Neon account.
     * API keys can also be managed in the Neon Console.
     * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @param keyId The API key ID
     * @returns ApiKeyRevokeResponse Revoked the specified API key
     * @returns GeneralError General Error
     * @throws ApiError
     */
    revokeApiKey(keyId: number): CancelablePromise<ApiKeyRevokeResponse | GeneralError>;
}

type IdentitySupportedAuthProvider = 'mock' | 'stack';

type IdentityCreateAuthProviderSDKKeysRequest = {
    project_id: string;
    auth_provider: IdentitySupportedAuthProvider;
};

type IdentityCreateIntegrationRequest = {
    auth_provider: IdentitySupportedAuthProvider;
    project_id: string;
    branch_id: string;
    database_name: string;
    role_name: string;
};

type IdentityCreateIntegrationResponse = {
    auth_provider: IdentitySupportedAuthProvider;
    auth_provider_project_id: string;
    pub_client_key: string;
    secret_server_key: string;
    jwks_url: string;
    schema_name: string;
    table_name: string;
};

type IdentityTransferAuthProviderProjectRequest = {
    project_id: string;
    auth_provider: IdentitySupportedAuthProvider;
};

type IdentityTransferAuthProviderProjectResponse = {
    /**
     * URL for completing the process of ownership transfer
     */
    url: string;
};

type IdentityAuthProviderProjectOwnedBy = 'user' | 'neon';

type IdentityAuthProviderProjectTransferStatus = 'initiated' | 'finished';

type IdentityIntegration = {
    auth_provider: string;
    auth_provider_project_id: string;
    branch_id: string;
    db_name: string;
    created_at: string;
    owned_by: IdentityAuthProviderProjectOwnedBy;
    transfer_status?: IdentityAuthProviderProjectTransferStatus;
    jwks_url: string;
};

type ListProjectIdentityIntegrationsResponse = {
    data: Array<IdentityIntegration>;
};

declare class AuthService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Create Neon Auth integration
     * Creates a project on a third-party authentication provider's platform for use with Neon Auth.
     * Use this endpoint if the frontend integration flow can't be used.
     *
     * @param requestBody
     * @returns GeneralError General Error
     * @returns IdentityCreateIntegrationResponse Creates Neon Auth integration
     * @throws ApiError
     */
    createProjectIdentityIntegration(requestBody: IdentityCreateIntegrationRequest): CancelablePromise<GeneralError | IdentityCreateIntegrationResponse>;
    /**
     * Create Auth Provider SDK keys
     * Generates SDK or API Keys for the auth provider. These might be called different things depending
     * on the auth provider you're using, but are generally used for setting up the frontend and backend SDKs.
     *
     * @param requestBody
     * @returns GeneralError General Error
     * @returns IdentityCreateIntegrationResponse Creates Auth Provider SDK keys
     * @throws ApiError
     */
    createProjectIdentityAuthProviderSdkKeys(requestBody: IdentityCreateAuthProviderSDKKeysRequest): CancelablePromise<GeneralError | IdentityCreateIntegrationResponse>;
    /**
     * Transfer Neon-managed auth project to your own account
     * Transfer ownership of your Neon-managed auth project to your own auth provider account.
     *
     * @param requestBody
     * @returns IdentityTransferAuthProviderProjectResponse Transfer initiated. Follow the URL to complete the process in your auth provider's UI.
     * @returns GeneralError General Error
     * @throws ApiError
     */
    transferProjectIdentityAuthProviderProject(requestBody: IdentityTransferAuthProviderProjectRequest): CancelablePromise<IdentityTransferAuthProviderProjectResponse | GeneralError>;
    /**
     * Lists active integrations with auth providers
     * @param projectId The Neon project ID
     * @returns ListProjectIdentityIntegrationsResponse Return management API keys metadata
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectIdentityIntegrations(projectId: string): CancelablePromise<ListProjectIdentityIntegrationsResponse | GeneralError>;
    /**
     * Delete integration with auth provider
     * @param projectId The Neon project ID
     * @param authProvider The authentication provider name
     * @returns any Delete the integration with the authentication provider
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectIdentityIntegration(projectId: string, authProvider: IdentitySupportedAuthProvider): CancelablePromise<any | GeneralError>;
}

/**
 * Annotation properties.
 */
type AnnotationValueData = Record<string, string>;

type AnnotationCreateValueRequest = {
    annotation_value?: AnnotationValueData;
};

type AnnotationObjectData = {
    type: string;
    id: string;
};

type AnnotationData = {
    object: AnnotationObjectData;
    value: AnnotationValueData;
    created_at?: string;
    updated_at?: string;
};

type AnnotationResponse = {
    annotation: AnnotationData;
};

type AnnotationsMapResponse = {
    annotations: Record<string, AnnotationData>;
};

type ComputeUnit = number;

/**
 * The compute endpoint type. Either `read_write` or `read_only`.
 *
 */
type EndpointType = 'read_only' | 'read_write';

/**
 * The Neon compute provisioner.
 * Specify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.
 *
 * Provisioner can be one of the following values:
 * * k8s-pod
 * * k8s-neonvm
 *
 * Clients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.
 *
 */
type Provisioner = string;

/**
 * Duration of inactivity in seconds after which the compute endpoint is
 * automatically suspended. The value `0` means use the default value.
 * The value `-1` means never suspend. The default value is `300` seconds (5 minutes).
 * The minimum value is `60` seconds (1 minute).
 * The maximum value is `604800` seconds (1 week). For more information, see
 * [Scale to zero configuration](https://neon.tech/docs/manage/endpoints#scale-to-zero-configuration).
 *
 */
type SuspendTimeoutSeconds = number;

type BranchCreateRequestEndpointOptions = {
    type: EndpointType;
    /**
     * The minimum number of Compute Units. The minimum value is `0.25`.
     * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
     * for more information.
     *
     */
    autoscaling_limit_min_cu?: ComputeUnit;
    /**
     * The maximum number of Compute Units.
     * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
     * for more information.
     *
     */
    autoscaling_limit_max_cu?: ComputeUnit;
    provisioner?: Provisioner;
    suspend_timeout_seconds?: SuspendTimeoutSeconds;
};

type BranchCreateRequest = {
    endpoints?: Array<BranchCreateRequestEndpointOptions>;
    branch?: {
        /**
         * The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's default branch.
         *
         */
        parent_id?: string;
        /**
         * The branch name
         *
         */
        name?: string;
        /**
         * A Log Sequence Number (LSN) on the parent branch. The branch will be created with data from this LSN.
         *
         */
        parent_lsn?: string;
        /**
         * A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time.
         * The timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.
         *
         */
        parent_timestamp?: string;
        /**
         * Whether the branch is protected
         *
         */
        protected?: boolean;
        /**
         * Whether to create the branch as archived
         *
         */
        archived?: boolean;
        /**
         * The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).
         * * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.
         * * `parent-data` - creates the branch with both schema and data from the parent.
         *
         */
        init_source?: string;
    };
};

type BranchesCountResponse = {
    count: number;
};

/**
 * The branch’s state, indicating if it is initializing, ready for use, or archived.
 * * 'init' - the branch is being created but is not available for querying.
 * * 'ready' - the branch is fully operational and ready for querying. Expect normal query response times.
 * * 'archived' - the branch is stored in cost-effective archival storage. Expect slow query response times.
 *
 */
type BranchState = string;

type Branch = {
    /**
     * The branch ID. This value is generated when a branch is created. A `branch_id` value has a `br` prefix. For example: `br-small-term-683261`.
     *
     */
    id: string;
    /**
     * The ID of the project to which the branch belongs
     *
     */
    project_id: string;
    /**
     * The `branch_id` of the parent branch
     *
     */
    parent_id?: string;
    /**
     * The Log Sequence Number (LSN) on the parent branch from which this branch was created
     *
     */
    parent_lsn?: string;
    /**
     * The point in time on the parent branch from which this branch was created
     *
     */
    parent_timestamp?: string;
    /**
     * The branch name
     *
     */
    name: string;
    current_state: BranchState;
    pending_state?: BranchState;
    /**
     * A UTC timestamp indicating when the `current_state` began
     *
     */
    state_changed_at: string;
    /**
     * The logical size of the branch, in bytes
     *
     */
    logical_size?: number;
    /**
     * The branch creation source
     *
     */
    creation_source: string;
    /**
     * DEPRECATED. Use `default` field.
     * Whether the branch is the project's primary branch
     *
     * @deprecated
     */
    primary?: boolean;
    /**
     * Whether the branch is the project's default branch
     *
     */
    default: boolean;
    /**
     * Whether the branch is protected
     *
     */
    protected: boolean;
    /**
     * CPU seconds used by all of the branch's compute endpoints, including deleted ones.
     * This value is reset at the beginning of each billing period.
     * Examples:
     * 1. A branch that uses 1 CPU for 1 second is equal to `cpu_used_sec=1`.
     * 2. A branch that uses 2 CPUs simultaneously for 1 second is equal to `cpu_used_sec=2`.
     *
     * @deprecated
     */
    cpu_used_sec: number;
    compute_time_seconds: number;
    active_time_seconds: number;
    written_data_bytes: number;
    data_transfer_bytes: number;
    /**
     * A timestamp indicating when the branch was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the branch was last updated
     *
     */
    updated_at: string;
    /**
     * A timestamp indicating when the branch was last reset
     *
     */
    last_reset_at?: string;
    /**
     * The resolved user model that contains details of the user/org/integration/api_key used for branch creation. This field is filled only in listing/get/create/get/update/delete methods, if it is empty when calling other handlers, it does not mean that it is empty in the system.
     *
     */
    created_by?: {
        /**
         * The name of the user.
         */
        name?: string;
        /**
         * The URL to the user's avatar image.
         */
        image?: string;
    };
    /**
     * The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).
     * * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.
     * * `parent-data` - creates the branch with both schema and data from the parent.
     *
     */
    init_source?: string;
};

type BranchesResponse = {
    branches: Array<Branch>;
};

type BranchResponse = {
    branch: Branch;
};

/**
 * The action performed by the operation
 */
type OperationAction = 'create_compute' | 'create_timeline' | 'start_compute' | 'suspend_compute' | 'apply_config' | 'check_availability' | 'delete_timeline' | 'create_branch' | 'import_data' | 'tenant_ignore' | 'tenant_attach' | 'tenant_detach' | 'tenant_reattach' | 'replace_safekeeper' | 'disable_maintenance' | 'apply_storage_config' | 'prepare_secondary_pageserver' | 'switch_pageserver' | 'detach_parent_branch' | 'timeline_archive' | 'timeline_unarchive' | 'start_reserved_compute' | 'sync_dbs_and_roles_from_compute' | 'apply_schema_from_branch';

/**
 * The status of the operation
 */
type OperationStatus = 'scheduling' | 'running' | 'finished' | 'failed' | 'error' | 'cancelling' | 'cancelled' | 'skipped';

type Operation = {
    /**
     * The operation ID
     */
    id: string;
    /**
     * The Neon project ID
     */
    project_id: string;
    /**
     * The branch ID
     */
    branch_id?: string;
    /**
     * The endpoint ID
     */
    endpoint_id?: string;
    action: OperationAction;
    status: OperationStatus;
    /**
     * The error that occurred
     */
    error?: string;
    /**
     * The number of times the operation failed
     */
    failures_count: number;
    /**
     * A timestamp indicating when the operation was last retried
     */
    retry_at?: string;
    /**
     * A timestamp indicating when the operation was created
     */
    created_at: string;
    /**
     * A timestamp indicating when the operation status was last updated
     */
    updated_at: string;
    /**
     * The total duration of the operation in milliseconds
     */
    total_duration_ms: number;
};

type OperationsResponse = {
    operations: Array<Operation>;
};

type BranchOperations = (BranchResponse & OperationsResponse);

type BranchRestoreRequest = {
    /**
     * The `branch_id` of the restore source branch.
     * If `source_timestamp` and `source_lsn` are omitted, the branch will be restored to head.
     * If `source_branch_id` is equal to the branch's id, `source_timestamp` or `source_lsn` is required.
     *
     */
    source_branch_id: string;
    /**
     * A Log Sequence Number (LSN) on the source branch. The branch will be restored with data from this LSN.
     *
     */
    source_lsn?: string;
    /**
     * A timestamp identifying a point in time on the source branch. The branch will be restored with data starting from this point in time.
     * The timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.
     *
     */
    source_timestamp?: string;
    /**
     * If not empty, the previous state of the branch will be saved to a branch with this name.
     * If the branch has children or the `source_branch_id` is equal to the branch id, this field is required. All existing child branches will be moved to the newly created branch under the name `preserve_under_name`.
     *
     */
    preserve_under_name?: string;
};

type BranchSchemaCompareResponse = {
    diff?: string;
};

type BranchSchemaResponse = {
    sql?: string;
};

type BranchUpdateRequest = {
    branch: {
        name?: string;
        protected?: boolean;
    };
};

type ConnectionParameters = {
    /**
     * Database name
     *
     */
    database: string;
    /**
     * Password for the role
     *
     */
    password: string;
    /**
     * Role name
     *
     */
    role: string;
    /**
     * Hostname
     *
     */
    host: string;
    /**
     * Pooler hostname
     *
     */
    pooler_host: string;
};

type ConnectionDetails = {
    /**
     * The connection URI is defined as specified here: [Connection URIs](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS)
     * The connection URI can be used to connect to a Postgres database with psql or defined in a DATABASE_URL environment variable.
     * When creating a branch from a parent with more than one role or database, the response body does not include a connection URI.
     *
     */
    connection_uri: string;
    connection_parameters: ConnectionParameters;
};

type ConnectionURIsOptionalResponse = {
    connection_uris?: Array<ConnectionDetails>;
};

/**
 * To paginate the response, issue an initial request with `limit` value. Then, add the value returned in the response `.pagination.next` attribute into the request under the `cursor` query parameter to the subsequent request to retrieve next page in pagination. The contents on cursor `next` are opaque, clients are not expected to make any assumptions on the format of the data inside the cursor.
 */
type CursorPagination = {
    next?: string;
    sort_by?: string;
    sort_order?: string;
};

type CursorPaginationResponse = {
    pagination?: CursorPagination;
};

type DatabaseCreateRequest = {
    database: {
        /**
         * The name of the database
         *
         */
        name: string;
        /**
         * The name of the role that owns the database
         *
         */
        owner_name: string;
    };
};

type Database = {
    /**
     * The database ID
     *
     */
    id: number;
    /**
     * The ID of the branch to which the database belongs
     *
     */
    branch_id: string;
    /**
     * The database name
     *
     */
    name: string;
    /**
     * The name of role that owns the database
     *
     */
    owner_name: string;
    /**
     * A timestamp indicating when the database was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the database was last updated
     *
     */
    updated_at: string;
};

type DatabaseResponse = {
    database: Database;
};

type DatabaseOperations = (DatabaseResponse & OperationsResponse);

type DatabasesResponse = {
    databases: Array<Database>;
};

type DatabaseUpdateRequest = {
    database: {
        /**
         * The name of the database
         *
         */
        name?: string;
        /**
         * The name of the role that owns the database
         *
         */
        owner_name?: string;
    };
};

/**
 * The connection pooler mode. Neon supports PgBouncer in `transaction` mode only.
 *
 */
type EndpointPoolerMode = 'transaction';

/**
 * A raw representation of PgBouncer settings
 */
type PgbouncerSettingsData = Record<string, string>;

/**
 * A raw representation of Postgres settings
 */
type PgSettingsData = Record<string, string>;

/**
 * A collection of settings for a compute endpoint
 */
type EndpointSettingsData = {
    pg_settings?: PgSettingsData;
    pgbouncer_settings?: PgbouncerSettingsData;
};

/**
 * The state of the compute endpoint
 *
 */
type EndpointState = 'init' | 'active' | 'idle';

type Endpoint = {
    /**
     * The hostname of the compute endpoint. This is the hostname specified when connecting to a Neon database.
     *
     */
    host: string;
    /**
     * The compute endpoint ID. Compute endpoint IDs have an `ep-` prefix. For example: `ep-little-smoke-851426`
     *
     */
    id: string;
    /**
     * The ID of the project to which the compute endpoint belongs
     *
     */
    project_id: string;
    /**
     * The ID of the branch that the compute endpoint is associated with
     *
     */
    branch_id: string;
    /**
     * The minimum number of Compute Units
     *
     */
    autoscaling_limit_min_cu: ComputeUnit;
    /**
     * The maximum number of Compute Units
     *
     */
    autoscaling_limit_max_cu: ComputeUnit;
    /**
     * The region identifier
     *
     */
    region_id: string;
    type: EndpointType;
    current_state: EndpointState;
    pending_state?: EndpointState;
    settings: EndpointSettingsData;
    /**
     * Whether connection pooling is enabled for the compute endpoint
     *
     */
    pooler_enabled: boolean;
    pooler_mode: EndpointPoolerMode;
    /**
     * Whether to restrict connections to the compute endpoint.
     * Enabling this option schedules a suspend compute operation.
     * A disabled compute endpoint cannot be enabled by a connection or
     * console action. However, the compute endpoint is periodically
     * enabled by check_availability operations.
     *
     */
    disabled: boolean;
    /**
     * Whether to permit passwordless access to the compute endpoint
     *
     */
    passwordless_access: boolean;
    /**
     * A timestamp indicating when the compute endpoint was last active
     *
     */
    last_active?: string;
    /**
     * The compute endpoint creation source
     *
     */
    creation_source: string;
    /**
     * A timestamp indicating when the compute endpoint was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the compute endpoint was last updated
     *
     */
    updated_at: string;
    /**
     * DEPRECATED. Use the "host" property instead.
     *
     */
    proxy_host: string;
    suspend_timeout_seconds: SuspendTimeoutSeconds;
    provisioner: Provisioner;
    /**
     * Attached compute's release version number.
     *
     */
    compute_release_version?: string;
};

type EndpointsResponse = {
    endpoints: Array<Endpoint>;
};

type RoleCreateRequest = {
    role: {
        /**
         * The role name. Cannot exceed 63 bytes in length.
         *
         */
        name: string;
        /**
         * Whether to create a role that cannot login.
         *
         */
        no_login?: boolean;
    };
};

type Role = {
    /**
     * The ID of the branch to which the role belongs
     *
     */
    branch_id: string;
    /**
     * The role name
     *
     */
    name: string;
    /**
     * The role password
     *
     */
    password?: string;
    /**
     * Whether or not the role is system-protected
     *
     */
    protected?: boolean;
    /**
     * A timestamp indicating when the role was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the role was last updated
     *
     */
    updated_at: string;
};

type RoleResponse = {
    role: Role;
};

type RoleOperations = (RoleResponse & OperationsResponse);

type RolePasswordResponse = {
    /**
     * The role password
     *
     */
    password: string;
};

type RolesResponse = {
    roles: Array<Role>;
};

declare class BranchService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Create branch
     * Creates a branch in the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     * This method does not require a request body, but you can specify one to create a compute endpoint for the branch or to select a non-default parent branch.
     * The default behavior is to create a branch from the project's default branch with no compute endpoint, and the branch name is auto-generated.
     * There is a maximum of one read-write endpoint per branch.
     * A branch can have multiple read-only endpoints.
     * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * @param projectId The Neon project ID
     * @param requestBody
     * @returns GeneralError General Error
     * @returns any Created a branch. An endpoint is only created if it was specified in the request.
     * @throws ApiError
     */
    createProjectBranch(projectId: string, requestBody?: (BranchCreateRequest & AnnotationCreateValueRequest)): CancelablePromise<GeneralError | (BranchResponse & EndpointsResponse & OperationsResponse & RolesResponse & DatabasesResponse & ConnectionURIsOptionalResponse)>;
    /**
     * List branches
     * Retrieves a list of branches for the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     * Each Neon project has a root branch named `main`.
     * A `branch_id` value has a `br-` prefix.
     * A project may contain child branches that were branched from `main` or from another branch.
     * A parent branch is identified by the `parent_id` value, which is the `id` of the parent branch.
     * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * @param projectId The Neon project ID
     * @param search Search by branch `name` or `id`. You can specify partial `name` or `id` values to filter results.
     * @param sortBy Sort the branches by sort_field. If not provided, branches will be sorted by updated_at descending order
     * @param cursor A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list.
     * @param sortOrder Defines the sorting order of entities.
     * @param limit The maximum number of records to be returned in the response
     * @returns any Returned a list of branches for the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectBranches(projectId: string, search?: string, sortBy?: 'name' | 'created_at' | 'updated_at', cursor?: string, sortOrder?: 'asc' | 'desc', limit?: number): CancelablePromise<(BranchesResponse & AnnotationsMapResponse & CursorPaginationResponse) | GeneralError>;
    /**
     * Retrieve number of branches
     * Retrieves the total number of branches in the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     * @param projectId The Neon project ID
     * @param search Count branches matching the `name` in search query
     * @returns any Returned a count of branches for the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    countProjectBranches(projectId: string, search?: string): CancelablePromise<BranchesCountResponse | GeneralError>;
    /**
     * Retrieve branch details
     * Retrieves information about the specified branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain a `branch_id` by listing the project's branches.
     * A `branch_id` value has a `br-` prefix.
     *
     * Each Neon project is initially created with a root and default branch named `main`.
     * A project can contain one or more branches.
     * A parent branch is identified by a `parent_id` value, which is the `id` of the parent branch.
     * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns any Returned information about the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranch(projectId: string, branchId: string): CancelablePromise<(BranchResponse & AnnotationResponse) | GeneralError>;
    /**
     * Delete branch
     * Deletes the specified branch from a project, and places
     * all compute endpoints into an idle state, breaking existing client connections.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain a `branch_id` by listing the project's branches.
     * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * When a successful response status is received, the compute endpoints are still active,
     * and the branch is not yet deleted from storage.
     * The deletion occurs after all operations finish.
     * You cannot delete a project's root or default branch, and you cannot delete a branch that has a child branch.
     * A project must have at least one branch.
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns BranchOperations Deleted the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectBranch(projectId: string, branchId: string): CancelablePromise<BranchOperations | GeneralError>;
    /**
     * Update branch
     * Updates the specified branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param requestBody
     * @returns BranchOperations Updated the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    updateProjectBranch(projectId: string, branchId: string, requestBody: BranchUpdateRequest): CancelablePromise<BranchOperations | GeneralError>;
    /**
     * Restore branch
     * Restores a branch to an earlier state in its own or another branch's history
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param requestBody
     * @returns BranchOperations Updated the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    restoreProjectBranch(projectId: string, branchId: string, requestBody: BranchRestoreRequest): CancelablePromise<BranchOperations | GeneralError>;
    /**
     * Retrieve database schema
     * Retrieves the schema from the specified database. The `lsn` and `timestamp` values cannot be specified at the same time. If both are omitted, the database schema is retrieved from database's head.
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param dbName Name of the database for which the schema is retrieved
     * @param lsn The Log Sequence Number (LSN) for which the schema is retrieved
     *
     * @param timestamp The point in time for which the schema is retrieved
     *
     * @returns BranchSchemaResponse Schema definition
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranchSchema(projectId: string, branchId: string, dbName: string, lsn?: string, timestamp?: string): CancelablePromise<BranchSchemaResponse | GeneralError>;
    /**
     * Compare database schema
     * Compares the schema from the specified database with another branch's schema.
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param dbName Name of the database for which the schema is retrieved
     * @param baseBranchId The branch ID to compare the schema with
     * @param lsn The Log Sequence Number (LSN) for which the schema is retrieved
     *
     * @param timestamp The point in time for which the schema is retrieved
     *
     * @param baseLsn The Log Sequence Number (LSN) for the base branch schema
     *
     * @param baseTimestamp The point in time for the base branch schema
     *
     * @returns BranchSchemaCompareResponse Difference between the schemas
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranchSchemaComparison(projectId: string, branchId: string, dbName: string, baseBranchId?: string, lsn?: string, timestamp?: string, baseLsn?: string, baseTimestamp?: string): CancelablePromise<BranchSchemaCompareResponse | GeneralError>;
    /**
     * Set branch as default
     * Sets the specified branch as the project's default branch.
     * The default designation is automatically removed from the previous default branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns BranchOperations Updated the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    setDefaultProjectBranch(projectId: string, branchId: string): CancelablePromise<BranchOperations | GeneralError>;
    /**
     * List branch endpoints
     * Retrieves a list of compute endpoints for the specified branch.
     * Neon permits only one read-write compute endpoint per branch.
     * A branch can have multiple read-only compute endpoints.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns EndpointsResponse Returned a list of endpoints for the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectBranchEndpoints(projectId: string, branchId: string): CancelablePromise<EndpointsResponse | GeneralError>;
    /**
     * List databases
     * Retrieves a list of databases for the specified branch.
     * A branch can have multiple databases.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns DatabasesResponse Returned a list of databases of the specified branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectBranchDatabases(projectId: string, branchId: string): CancelablePromise<DatabasesResponse | GeneralError>;
    /**
     * Create database
     * Creates a database in the specified branch.
     * A branch can have multiple databases.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param requestBody
     * @returns GeneralError General Error
     * @returns DatabaseOperations Created a database in the specified branch
     * @throws ApiError
     */
    createProjectBranchDatabase(projectId: string, branchId: string, requestBody: DatabaseCreateRequest): CancelablePromise<GeneralError | DatabaseOperations>;
    /**
     * Retrieve database details
     * Retrieves information about the specified database.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
     * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param databaseName The database name
     * @returns DatabaseResponse Returned the database details
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranchDatabase(projectId: string, branchId: string, databaseName: string): CancelablePromise<DatabaseResponse | GeneralError>;
    /**
     * Update database
     * Updates the specified database in the branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
     * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param databaseName The database name
     * @param requestBody
     * @returns DatabaseOperations Updated the database
     * @returns GeneralError General Error
     * @throws ApiError
     */
    updateProjectBranchDatabase(projectId: string, branchId: string, databaseName: string, requestBody: DatabaseUpdateRequest): CancelablePromise<DatabaseOperations | GeneralError>;
    /**
     * Delete database
     * Deletes the specified database from the branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
     * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param databaseName The database name
     * @returns DatabaseOperations Deleted the specified database
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectBranchDatabase(projectId: string, branchId: string, databaseName: string): CancelablePromise<DatabaseOperations | GeneralError>;
    /**
     * List roles
     * Retrieves a list of Postgres roles from the specified branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @returns RolesResponse Returned a list of roles from the specified branch.
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectBranchRoles(projectId: string, branchId: string): CancelablePromise<RolesResponse | GeneralError>;
    /**
     * Create role
     * Creates a Postgres role in the specified branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * Connections established to the active compute endpoint will be dropped.
     * If the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param requestBody
     * @returns GeneralError General Error
     * @returns RoleOperations Created a role in the specified branch
     * @throws ApiError
     */
    createProjectBranchRole(projectId: string, branchId: string, requestBody: RoleCreateRequest): CancelablePromise<GeneralError | RoleOperations>;
    /**
     * Retrieve role details
     * Retrieves details about the specified role.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * You can obtain the `role_name` by listing the roles for a branch.
     * In Neon, the terms "role" and "user" are synonymous.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param roleName The role name
     * @returns RoleResponse Returned details for the specified role
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranchRole(projectId: string, branchId: string, roleName: string): CancelablePromise<RoleResponse | GeneralError>;
    /**
     * Delete role
     * Deletes the specified Postgres role from the branch.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * You can obtain the `role_name` by listing the roles for a branch.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param roleName The role name
     * @returns RoleOperations Deleted the specified role from the branch
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectBranchRole(projectId: string, branchId: string, roleName: string): CancelablePromise<RoleOperations | GeneralError>;
    /**
     * Retrieve role password
     * Retrieves the password for the specified Postgres role, if possible.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * You can obtain the `role_name` by listing the roles for a branch.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param roleName The role name
     * @returns RolePasswordResponse Returned password for the specified role
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectBranchRolePassword(projectId: string, branchId: string, roleName: string): CancelablePromise<RolePasswordResponse | GeneralError>;
    /**
     * Reset role password
     * Resets the password for the specified Postgres role.
     * Returns a new password and operations. The new password is ready to use when the last operation finishes.
     * The old password remains valid until last operation finishes.
     * Connections to the compute endpoint are dropped. If idle,
     * the compute endpoint becomes active for a short period of time.
     *
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `branch_id` by listing the project's branches.
     * You can obtain the `role_name` by listing the roles for a branch.
     * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
     *
     * @param projectId The Neon project ID
     * @param branchId The branch ID
     * @param roleName The role nam
     * @returns RoleOperations Reset the password for the specified role
     * @returns GeneralError General Error
     * @throws ApiError
     */
    resetProjectBranchRolePassword(projectId: string, branchId: string, roleName: string): CancelablePromise<RoleOperations | GeneralError>;
}

type ConsumptionHistoryGranularity = 'hourly' | 'daily' | 'monthly';

type ConsumptionHistoryPerTimeframe = {
    /**
     * The specified start date-time for the reported consumption.
     *
     */
    timeframe_start: string;
    /**
     * The specified end date-time for the reported consumption.
     *
     */
    timeframe_end: string;
    /**
     * Seconds. The amount of time the compute endpoints have been active.
     *
     */
    active_time_seconds: number;
    /**
     * Seconds. The number of CPU seconds used by compute endpoints, including compute endpoints that have been deleted.
     *
     */
    compute_time_seconds: number;
    /**
     * Bytes. The amount of written data for all branches.
     *
     */
    written_data_bytes: number;
    /**
     * Bytes. The space occupied in storage. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches.
     *
     */
    synthetic_storage_size_bytes: number;
    /**
     * Bytes-Hour. The amount of storage consumed hourly.
     *
     */
    data_storage_bytes_hour?: number;
};

type ConsumptionHistoryPerPeriod = {
    /**
     * The ID assigned to the specified billing period.
     */
    period_id: string;
    /**
     * The billing plan applicable during the billing period.
     */
    period_plan: string;
    /**
     * The start date-time of the billing period.
     *
     */
    period_start: string;
    /**
     * The end date-time of the billing period, available for the past periods only.
     *
     */
    period_end?: string;
    consumption: Array<ConsumptionHistoryPerTimeframe>;
};

type ConsumptionHistoryPerAccountResponse = {
    periods: Array<ConsumptionHistoryPerPeriod>;
};

type ConsumptionHistoryPerProject = {
    /**
     * The project ID
     */
    project_id: string;
    periods: Array<ConsumptionHistoryPerPeriod>;
};

type ConsumptionHistoryPerProjectResponse = {
    projects: Array<ConsumptionHistoryPerProject>;
};

/**
 * Cursor based pagination is used. The user must pass the cursor as is to the backend.
 * For more information about cursor based pagination, see
 * https://learn.microsoft.com/en-us/ef/core/querying/pagination#keyset-pagination
 *
 */
type Pagination = {
    cursor: string;
};

type PaginationResponse = {
    pagination?: Pagination;
};

declare class ConsumptionService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Retrieve account consumption metrics
     * Retrieves consumption metrics for Scale, Business, and Enterprise plan accounts. History begins at the time of upgrade.
     *
     * @param from Specify the start `date-time` for the consumption period.
     * The `date-time` value is rounded according to the specified `granularity`.
     * For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`.
     * The specified `date-time` value must respect the specified granularity:
     * - For `hourly`, consumption metrics are limited to the last 168 hours.
     * - For `daily`, consumption metrics are limited to the last 60 days.
     * - For `monthly`, consumption metrics are limited to the past year.
     *
     * The consumption history is available starting from `March 1, 2024, at 00:00:00 UTC`.
     *
     * @param to Specify the end `date-time` for the consumption period.
     * The `date-time` value is rounded according to the specified granularity.
     * For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`.
     * The specified `date-time` value must respect the specified granularity:
     * - For `hourly`, consumption metrics are limited to the last 168 hours.
     * - For `daily`, consumption metrics are limited to the last 60 days.
     * - For `monthly`, consumption metrics are limited to the past year.
     *
     * @param granularity Specify the granularity of consumption metrics.
     * Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days,
     * and 1 year, respectively.
     *
     * @param orgId Specify the organization for which the consumption metrics should be returned.
     * If this parameter is not provided, the endpoint will return the metrics for the
     * authenticated user's account.
     *
     * @param includeV1Metrics Include metrics utilized in previous pricing models.
     * - **data_storage_bytes_hour**: The sum of the maximum observed storage values for each hour
     * for each project, which never decreases.
     *
     * @returns ConsumptionHistoryPerAccountResponse Returned consumption metrics for the Neon account
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getConsumptionHistoryPerAccount(from: string, to: string, granularity: ConsumptionHistoryGranularity, orgId?: string, includeV1Metrics?: boolean): CancelablePromise<ConsumptionHistoryPerAccountResponse | GeneralError>;
    /**
     * Retrieve project consumption metrics
     * Retrieves consumption metrics for Scale, Business, and Enterprise plan projects. History begins at the time of upgrade.
     * Issuing a call to this API does not wake a project's compute endpoint.
     *
     * @param from Specify the start `date-time` for the consumption period.
     * The `date-time` value is rounded according to the specified `granularity`.
     * For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`.
     * The specified `date-time` value must respect the specified `granularity`:
     * - For `hourly`, consumption metrics are limited to the last 168 hours.
     * - For `daily`, consumption metrics are limited to the last 60 days.
     * - For `monthly`, consumption metrics are limited to the last year.
     *
     * The consumption history is available starting from `March 1, 2024, at 00:00:00 UTC`.
     *
     * @param to Specify the end `date-time` for the consumption period.
     * The `date-time` value is rounded according to the specified granularity.
     * For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`.
     * The specified `date-time` value must respect the specified `granularity`:
     * - For `hourly`, consumption metrics are limited to the last 168 hours.
     * - For `daily`, consumption metrics are limited to the last 60 days.
     * - For `monthly`, consumption metrics are limited to the last year.
     *
     * @param granularity Specify the granularity of consumption metrics.
     * Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days,
     * and 1 year, respectively.
     *
     * @param cursor Specify the cursor value from the previous response to get the next batch of projects.
     * @param limit Specify a value from 1 to 100 to limit number of projects in the response.
     * @param projectIds Specify a list of project IDs to filter the response.
     * If omitted, the response will contain all projects.
     * A list of project IDs can be specified as an array of parameter values or as a comma-separated list in a single parameter value.
     * - As an array of parameter values: `project_ids=cold-poetry-09157238%20&project_ids=quiet-snow-71788278`
     * - As a comma-separated list in a single parameter value: `project_ids=cold-poetry-09157238,quiet-snow-71788278`
     *
     * @param orgId Specify the organization for which the project consumption metrics should be returned.
     * If this parameter is not provided, the endpoint will return the metrics for the
     * authenticated user's projects.
     *
     * @param includeV1Metrics Include metrics utilized in previous pricing models.
     * - **data_storage_bytes_hour**: The sum of the maximum observed storage values for each hour,
     * which never decreases.
     *
     * @returns any Returned project consumption metrics for the Neon account
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getConsumptionHistoryPerProject(from: string, to: string, granularity: ConsumptionHistoryGranularity, cursor?: string, limit?: number, projectIds?: Array<string>, orgId?: string, includeV1Metrics?: boolean): CancelablePromise<(ConsumptionHistoryPerProjectResponse & PaginationResponse) | GeneralError>;
}

type EndpointCreateRequest = {
    endpoint: {
        /**
         * The ID of the branch the compute endpoint will be associated with
         *
         */
        branch_id: string;
        /**
         * The region where the compute endpoint will be created. Only the project's `region_id` is permitted.
         *
         */
        region_id?: string;
        type: EndpointType;
        settings?: EndpointSettingsData;
        /**
         * The minimum number of Compute Units. The minimum value is `0.25`.
         * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         */
        autoscaling_limit_min_cu?: ComputeUnit;
        /**
         * The maximum number of Compute Units.
         * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         */
        autoscaling_limit_max_cu?: ComputeUnit;
        provisioner?: Provisioner;
        /**
         * Whether to enable connection pooling for the compute endpoint
         *
         * @deprecated
         */
        pooler_enabled?: boolean;
        pooler_mode?: EndpointPoolerMode;
        /**
         * Whether to restrict connections to the compute endpoint.
         * Enabling this option schedules a suspend compute operation.
         * A disabled compute endpoint cannot be enabled by a connection or
         * console action. However, the compute endpoint is periodically
         * enabled by check_availability operations.
         *
         */
        disabled?: boolean;
        /**
         * NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.
         *
         */
        passwordless_access?: boolean;
        suspend_timeout_seconds?: SuspendTimeoutSeconds;
    };
};

type EndpointResponse = {
    endpoint: Endpoint;
};

type EndpointOperations = (EndpointResponse & OperationsResponse);

type EndpointUpdateRequest = {
    endpoint: {
        /**
         * DEPRECATED: This field will be removed in a future release.
         * The destination branch ID. The destination branch must not have an existing read-write endpoint.
         *
         * @deprecated
         */
        branch_id?: string;
        /**
         * The minimum number of Compute Units. The minimum value is `0.25`.
         * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         */
        autoscaling_limit_min_cu?: ComputeUnit;
        /**
         * The maximum number of Compute Units.
         * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         */
        autoscaling_limit_max_cu?: ComputeUnit;
        provisioner?: Provisioner;
        settings?: EndpointSettingsData;
        /**
         * Whether to enable connection pooling for the compute endpoint
         *
         * @deprecated
         */
        pooler_enabled?: boolean;
        pooler_mode?: EndpointPoolerMode;
        /**
         * Whether to restrict connections to the compute endpoint.
         * Enabling this option schedules a suspend compute operation.
         * A disabled compute endpoint cannot be enabled by a connection or
         * console action. However, the compute endpoint is periodically
         * enabled by check_availability operations.
         *
         */
        disabled?: boolean;
        /**
         * NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.
         *
         */
        passwordless_access?: boolean;
        suspend_timeout_seconds?: SuspendTimeoutSeconds;
    };
};

declare class EndpointService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Create compute endpoint
     * Creates a compute endpoint for the specified branch.
     * An endpoint is a Neon compute instance.
     * There is a maximum of one read-write compute endpoint per branch.
     * If the specified branch already has a read-write compute endpoint, the operation fails.
     * A branch can have multiple read-only compute endpoints.
     *
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain `branch_id` by listing the project's branches.
     * A `branch_id` has a `br-` prefix.
     * For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
     * For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param requestBody
     * @returns GeneralError General Error
     * @returns EndpointOperations Created a compute endpoint
     * @throws ApiError
     */
    createProjectEndpoint(projectId: string, requestBody: EndpointCreateRequest): CancelablePromise<GeneralError | EndpointOperations>;
    /**
     * List compute endpoints
     * Retrieves a list of compute endpoints for the specified project.
     * A compute endpoint is a Neon compute instance.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @returns EndpointsResponse Returned a list of endpoints for the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectEndpoints(projectId: string): CancelablePromise<EndpointsResponse | GeneralError>;
    /**
     * Retrieve compute endpoint details
     * Retrieves information about the specified compute endpoint.
     * A compute endpoint is a Neon compute instance.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @returns EndpointResponse Returned information about the specified endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectEndpoint(projectId: string, endpointId: string): CancelablePromise<EndpointResponse | GeneralError>;
    /**
     * Delete compute endpoint
     * Delete the specified compute endpoint.
     * A compute endpoint is a Neon compute instance.
     * Deleting a compute endpoint drops existing network connections to the compute endpoint.
     * The deletion is completed when last operation in the chain finishes successfully.
     *
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @returns EndpointOperations Deleted the specified compute endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectEndpoint(projectId: string, endpointId: string): CancelablePromise<EndpointOperations | GeneralError>;
    /**
     * Update compute endpoint
     * Updates the specified compute endpoint.
     *
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` and `branch_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix.
     * For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * If the returned list of operations is not empty, the compute endpoint is not ready to use.
     * The client must wait for the last operation to finish before using the compute endpoint.
     * If the compute endpoint was idle before the update, it becomes active for a short period of time,
     * and the control plane suspends it again after the update.
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @param requestBody
     * @returns EndpointOperations Updated the specified compute endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    updateProjectEndpoint(projectId: string, endpointId: string, requestBody: EndpointUpdateRequest): CancelablePromise<EndpointOperations | GeneralError>;
    /**
     * Start compute endpoint
     * Starts a compute endpoint. The compute endpoint is ready to use
     * after the last operation in chain finishes successfully.
     *
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @returns EndpointOperations Started the specified compute endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    startProjectEndpoint(projectId: string, endpointId: string): CancelablePromise<EndpointOperations | GeneralError>;
    /**
     * Suspend compute endpoint
     * Suspend the specified compute endpoint
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @returns EndpointOperations Suspended the specified endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    suspendProjectEndpoint(projectId: string, endpointId: string): CancelablePromise<EndpointOperations | GeneralError>;
    /**
     * Restart compute endpoint
     * Restart the specified compute endpoint: suspend immediately followed by start operations.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain an `endpoint_id` by listing your project's compute endpoints.
     * An `endpoint_id` has an `ep-` prefix.
     * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
     *
     * @param projectId The Neon project ID
     * @param endpointId The endpoint ID
     * @returns EndpointOperations Restarted endpoint
     * @returns GeneralError General Error
     * @throws ApiError
     */
    restartProjectEndpoint(projectId: string, endpointId: string): CancelablePromise<EndpointOperations | GeneralError>;
}

type OperationResponse = {
    operation: Operation;
};

declare class OperationService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Retrieve operation details
     * Retrieves details for the specified operation.
     * An operation is an action performed on a Neon project resource.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain a `operation_id` by listing operations for the project.
     *
     * @param projectId The Neon project ID
     * @param operationId The operation ID
     * @returns OperationResponse Returned details for the specified operation
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectOperation(projectId: string, operationId: string): CancelablePromise<OperationResponse | GeneralError>;
    /**
     * List operations
     * Retrieves a list of operations for the specified Neon project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * The number of operations returned can be large.
     * To paginate the response, issue an initial request with a `limit` value.
     * Then, add the `cursor` value that was returned in the response to the next request.
     *
     * @param projectId The Neon project ID
     * @param cursor Specify the cursor value from the previous response to get the next batch of operations
     * @param limit Specify a value from 1 to 1000 to limit number of operations in the response
     * @returns any Returned a list of operations
     *
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectOperations(projectId: string, cursor?: string, limit?: number): CancelablePromise<(OperationsResponse & PaginationResponse) | GeneralError>;
}

/**
 * Empty response.
 */
type EmptyResponse = {};

/**
 * The role of the organization member
 */
type MemberRole = 'admin' | 'member';

type Member = {
    id: string;
    user_id: string;
    org_id: string;
    role: MemberRole;
    joined_at?: string;
};

type Organization = {
    id: string;
    name: string;
    handle: string;
    plan: string;
    /**
     * A timestamp indicting when the organization was created
     *
     */
    created_at: string;
    /**
     * Organizations created via the Console or the API are managed by `console`.
     * Organizations created by other methods can't be deleted via the Console or the API.
     *
     */
    managed_by: string;
    /**
     * A timestamp indicating when the organization was updated
     *
     */
    updated_at: string;
};

type Invitation = {
    id: string;
    /**
     * Email of the invited user
     */
    email: string;
    /**
     * Organization id as it is stored in Neon
     */
    org_id: string;
    /**
     * UUID for the user_id who extended the invitation
     */
    invited_by: string;
    /**
     * Timestamp when the invitation was created
     */
    invited_at: string;
    role: MemberRole;
};

type OrganizationInvitationsResponse = {
    invitations: Array<Invitation>;
};

type OrganizationInviteCreateRequest = {
    email: string;
    role: MemberRole;
};

type OrganizationInvitesCreateRequest = {
    invitations: Array<OrganizationInviteCreateRequest>;
};

type MemberUserInfo = {
    email: string;
};

type MemberWithUser = {
    member: Member;
    user: MemberUserInfo;
};

type OrganizationMembersResponse = {
    members: Array<MemberWithUser>;
};

type OrganizationMemberUpdateRequest = {
    role: MemberRole;
};

type OrganizationsResponse = {
    organizations: Array<Organization>;
};

type OrgApiKeyCreateRequest = (ApiKeyCreateRequest & {
    /**
     * If set, the API key can access only this project
     */
    project_id?: string;
});

type OrgApiKeyCreateResponse = (ApiKeyCreateResponse & {
    /**
     * If set, the API key can access only this project
     */
    project_id?: string;
});

type OrgApiKeyRevokeResponse = (ApiKeyRevokeResponse & {
    /**
     * If set, the API key can access only this project
     */
    project_id?: string;
});

type OrgApiKeysListResponseItem = (ApiKeysListResponseItem & {
    /**
     * If set, the API key can access only this project
     */
    project_id?: string;
});

type TransferProjectsToOrganizationRequest = {
    /**
     * The destination organization identifier
     */
    destination_org_id: string;
    /**
     * The list of projects ids to transfer. Maximum of 400 project ids
     */
    project_ids: Array<string>;
};

type VPCEndpointAssignment = {
    label: string;
};

type VPCEndpointDetails = {
    /**
     * The VPC endpoint ID
     */
    vpc_endpoint_id: string;
    /**
     * A descriptive label for the VPC endpoint
     */
    label: string;
    /**
     * The current state of the VPC endpoint. Possible values are
     * `new` (just configured, pending acceptance) or `accepted`
     * (VPC connection was accepted by Neon).
     *
     */
    state: string;
    /**
     * The number of projects that are restricted to use this VPC endpoint.
     *
     */
    num_restricted_projects: number;
    /**
     * A list of example projects that are restricted to use this VPC endpoint.
     * There are at most 3 projects in the list, even if more projects are restricted.
     *
     */
    example_restricted_projects: Array<string>;
};

type VPCEndpoint = {
    /**
     * The VPC endpoint ID
     */
    vpc_endpoint_id: string;
    /**
     * A descriptive label for the VPC endpoint
     */
    label: string;
};

type VPCEndpointsResponse = {
    endpoints: Array<VPCEndpoint>;
};

declare class OrganizationsService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Retrieve organization details
     * Retrieves information about the specified organization.
     *
     * @param orgId The Neon organization ID
     * @returns Organization Returned information about the organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getOrganization(orgId: string): CancelablePromise<Organization | GeneralError>;
    /**
     * List organization API keys
     * Retrieves the API keys for the specified organization.
     * The response does not include API key tokens. A token is only provided when creating an API key.
     * API keys can also be managed in the Neon Console.
     * For more information, see [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @param orgId The Neon organization ID
     * @returns OrgApiKeysListResponseItem Returned the API keys for the specified organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listOrgApiKeys(orgId: string): CancelablePromise<Array<OrgApiKeysListResponseItem> | GeneralError>;
    /**
     * Create organization API key
     * Creates an API key for the specified organization.
     * The `key_name` is a user-specified name for the key.
     * This method returns an `id` and `key`. The `key` is a randomly generated, 64-bit token required to access the Neon API.
     * API keys can also be managed in the Neon Console.
     * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @param orgId The Neon organization ID
     * @param requestBody
     * @returns OrgApiKeyCreateResponse Created an organization API key
     * @returns GeneralError General Error
     * @throws ApiError
     */
    createOrgApiKey(orgId: string, requestBody: OrgApiKeyCreateRequest): CancelablePromise<OrgApiKeyCreateResponse | GeneralError>;
    /**
     * Revoke organization API key
     * Revokes the specified organization API key.
     * An API key that is no longer needed can be revoked.
     * This action cannot be reversed.
     * You can obtain `key_id` values by listing the API keys for an organization.
     * API keys can also be managed in the Neon Console.
     * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
     *
     * @param orgId The Neon organization ID
     * @param keyId The API key ID
     * @returns OrgApiKeyRevokeResponse Revoked the specified organization API key
     * @returns GeneralError General Error
     * @throws ApiError
     */
    revokeOrgApiKey(orgId: string, keyId: number): CancelablePromise<OrgApiKeyRevokeResponse | GeneralError>;
    /**
     * Retrieve organization members details
     * Retrieves information about the specified organization members.
     *
     * @param orgId The Neon organization ID
     * @returns OrganizationMembersResponse Returned information about organization members
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getOrganizationMembers(orgId: string): CancelablePromise<OrganizationMembersResponse | GeneralError>;
    /**
     * Retrieve organization member details
     * Retrieves information about the specified organization member.
     *
     * @param orgId The Neon organization ID
     * @param memberId The Neon organization member ID
     * @returns Member Returned information about the organization member
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getOrganizationMember(orgId: string, memberId: string): CancelablePromise<Member | GeneralError>;
    /**
     * Update role for organization member
     * Only an admin can perform this action.
     *
     * @param orgId The Neon organization ID
     * @param memberId The Neon organization member ID
     * @param requestBody
     * @returns Member The updated organization member
     * @returns GeneralError General Error
     * @throws ApiError
     */
    updateOrganizationMember(orgId: string, memberId: string, requestBody: OrganizationMemberUpdateRequest): CancelablePromise<Member | GeneralError>;
    /**
     * Remove member from the organization
     * Remove member from the organization.
     * Only an admin of the organization can perform this action.
     * If another admin is being removed, it will not be allows in case it is the only admin left in the organization.
     *
     * @param orgId The Neon organization ID
     * @param memberId The Neon organization member ID
     * @returns EmptyResponse Removed organization member
     * @returns GeneralError General Error
     * @throws ApiError
     */
    removeOrganizationMember(orgId: string, memberId: string): CancelablePromise<EmptyResponse | GeneralError>;
    /**
     * Retrieve organization invitation details
     * Retrieves information about extended invitations for the specified organization
     *
     * @param orgId The Neon organization ID
     * @returns OrganizationInvitationsResponse Returned information about the organization invitations
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getOrganizationInvitations(orgId: string): CancelablePromise<OrganizationInvitationsResponse | GeneralError>;
    /**
     * Create organization invitations
     * Creates invitations for a specific organization.
     * If the invited user has an existing account, they automatically join as a member.
     * If they don't yet have an account, they are invited to create one, after which they become a member.
     * Each invited user receives an email notification.
     *
     * @param orgId The Neon organization ID
     * @param requestBody
     * @returns OrganizationInvitationsResponse The created organization invitation
     * @returns GeneralError General Error
     * @throws ApiError
     */
    createOrganizationInvitations(orgId: string, requestBody: OrganizationInvitesCreateRequest): CancelablePromise<OrganizationInvitationsResponse | GeneralError>;
    /**
     * Transfer projects between organizations
     * Transfers selected projects, identified by their IDs, from your organization to another specified organization.
     *
     * @param sourceOrgId The Neon organization ID (source org, which currently owns the project)
     * @param requestBody
     * @returns EmptyResponse Projects successfully transferred from organization to organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    transferProjectsFromOrgToOrg(sourceOrgId: string, requestBody: TransferProjectsToOrganizationRequest): CancelablePromise<EmptyResponse | GeneralError>;
    /**
     * List VPC endpoints
     * Retrieves the list of VPC endpoints for the specified Neon organization.
     *
     * @param orgId The Neon organization ID
     * @param regionId The Neon region ID
     * @returns VPCEndpointsResponse The list of configured VPC endpoint IDs for the specified organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listOrganizationVpcEndpoints(orgId: string, regionId: string): CancelablePromise<VPCEndpointsResponse | GeneralError>;
    /**
     * Retrieve VPC endpoint details
     * Retrieves the current state and configuration details of a specified VPC endpoint.
     *
     * @param orgId The Neon organization ID
     * @param regionId The Neon region ID.
     * Azure regions are currently not supported.
     *
     * @param vpcEndpointId The VPC endpoint ID
     * @returns VPCEndpointDetails Returned the current status and configuration details of the specified VPC endpoint.
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getOrganizationVpcEndpointDetails(orgId: string, regionId: string, vpcEndpointId: string): CancelablePromise<VPCEndpointDetails | GeneralError>;
    /**
     * Assign or update VPC endpoint
     * Assigns a VPC endpoint to a Neon organization or updates its existing assignment.
     *
     * @param orgId The Neon organization ID
     * @param regionId The Neon region ID.
     * Azure regions are currently not supported.
     *
     * @param vpcEndpointId The VPC endpoint ID
     * @param requestBody
     * @returns any Assigned the VPC endpoint to the specified Neon organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    assignOrganizationVpcEndpoint(orgId: string, regionId: string, vpcEndpointId: string, requestBody: VPCEndpointAssignment): CancelablePromise<any | GeneralError>;
    /**
     * Delete VPC endpoint
     * Deletes the VPC endpoint from the specified Neon organization.
     *
     * @param orgId The Neon organization ID
     * @param regionId The Neon region ID.
     * Azure regions are currently not supported.
     *
     * @param vpcEndpointId The VPC endpoint ID
     * @returns any Deleted the VPC endpoint from the specified Neon organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteOrganizationVpcEndpoint(orgId: string, regionId: string, vpcEndpointId: string): CancelablePromise<any | GeneralError>;
    /**
     * Retrieve current user organizations list
     * Retrieves information about the current Neon user's organizations
     *
     * @returns OrganizationsResponse Returned information about the current user organizations
     *
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getCurrentUserOrganizations(): CancelablePromise<OrganizationsResponse | GeneralError>;
}

/**
 * Add a new JWKS to a specific endpoint of a project
 */
type AddProjectJWKSRequest = {
    /**
     * The URL that lists the JWKS
     */
    jwks_url: string;
    /**
     * The name of the authentication provider (e.g., Clerk, Stytch, Auth0)
     */
    provider_name: string;
    /**
     * Branch ID
     */
    branch_id?: string;
    /**
     * The name of the required JWT Audience to be used
     */
    jwt_audience?: string;
    /**
     * The roles the JWKS should be mapped to
     */
    role_names: Array<string>;
};

type ConnectionURIResponse = {
    /**
     * The connection URI.
     *
     */
    uri: string;
};

type ConnectionURIsResponse = {
    connection_uris: Array<ConnectionDetails>;
};

type GrantPermissionToProjectRequest = {
    email: string;
};

type JWKS = {
    /**
     * JWKS ID
     */
    id: string;
    /**
     * Project ID
     */
    project_id: string;
    /**
     * Branch ID
     */
    branch_id?: string;
    /**
     * The URL that lists the JWKS
     */
    jwks_url: string;
    /**
     * The name of the authentication provider (e.g., Clerk, Stytch, Auth0)
     */
    provider_name: string;
    /**
     * The date and time when the JWKS was created
     */
    created_at: string;
    /**
     * The date and time when the JWKS was last modified
     */
    updated_at: string;
    /**
     * The name of the required JWT Audience to be used
     */
    jwt_audience?: string;
};

type JWKSResponse = {
    jwks: JWKS;
};

type JWKSCreationOperation = (JWKSResponse & OperationsResponse);

/**
 * A collection of settings for a Neon endpoint
 */
type DefaultEndpointSettings = Record<string, string>;

/**
 * The major Postgres version number. Currently supported versions are `14`, `15`, `16`, and `17`.
 */
type PgVersion = number;

/**
 * A list of IP addresses that are allowed to connect to the compute endpoint.
 * If the list is empty or not set, all IP addresses are allowed.
 * If protected_branches_only is true, the list will be applied only to protected branches.
 *
 */
type AllowedIps = {
    /**
     * A list of IP addresses that are allowed to connect to the endpoint.
     */
    ips?: Array<string>;
    /**
     * If true, the list will be applied only to protected branches.
     */
    protected_branches_only?: boolean;
};

/**
 * A maintenance window is a time period during which Neon may perform maintenance on the project's infrastructure.
 * During this time, the project's compute endpoints may be unavailable and existing connections can be
 * interrupted.
 *
 */
type MaintenanceWindow = {
    /**
     * A list of weekdays when the maintenance window is active.
     * Encoded as ints, where 1 - Monday, and 7 - Sunday.
     *
     */
    weekdays: Array<number>;
    /**
     * Start time of the maintenance window, in the format of "HH:MM". Uses UTC.
     *
     */
    start_time: string;
    /**
     * End time of the maintenance window, in the format of "HH:MM". Uses UTC.
     *
     */
    end_time: string;
};

type ProjectAuditLogLevel = 'hipaa';

/**
 * Per-project consumption quota. If the quota is exceeded, all active computes
 * are automatically suspended and it will not be possible to start them with
 * an API method call or incoming proxy connections. The only exception is
 * `logical_size_bytes`, which is applied on per-branch basis, i.e., only the
 * compute on the branch that exceeds the `logical_size` quota will be suspended.
 *
 * Quotas are enforced based on per-project consumption metrics with the same names,
 * which are reset at the end of each billing period (the first day of the month).
 * Logical size is also an exception in this case, as it represents the total size
 * of data stored in a branch, so it is not reset.
 *
 * A zero or empty quota value means 'unlimited'.
 *
 */
type ProjectQuota = {
    /**
     * The total amount of wall-clock time allowed to be spent by the project's compute endpoints.
     *
     */
    active_time_seconds?: number;
    /**
     * The total amount of CPU seconds allowed to be spent by the project's compute endpoints.
     *
     */
    compute_time_seconds?: number;
    /**
     * Total amount of data written to all of a project's branches.
     *
     */
    written_data_bytes?: number;
    /**
     * Total amount of data transferred from all of a project's branches using the proxy.
     *
     */
    data_transfer_bytes?: number;
    /**
     * Limit on the logical size of every project's branch.
     *
     */
    logical_size_bytes?: number;
};

type ProjectSettingsData = {
    quota?: ProjectQuota;
    allowed_ips?: AllowedIps;
    /**
     * Sets wal_level=logical for all compute endpoints in this project.
     * All active endpoints will be suspended.
     * Once enabled, logical replication cannot be disabled.
     *
     */
    enable_logical_replication?: boolean;
    maintenance_window?: MaintenanceWindow;
    /**
     * When set, connections from the public internet
     * are disallowed. This supersedes the AllowedIPs list.
     * This parameter is under active development and its semantics may change in the future.
     *
     */
    block_public_connections?: boolean;
    /**
     * When set, connections using VPC endpoints are disallowed.
     * This parameter is under active development and its semantics may change in the future.
     *
     */
    block_vpc_connections?: boolean;
    audit_log_level?: ProjectAuditLogLevel;
};

type ProjectCreateRequest = {
    project: {
        settings?: ProjectSettingsData;
        /**
         * The project name. If not specified, the name will be identical to the generated project ID
         */
        name?: string;
        branch?: {
            /**
             * The default branch name. If not specified, the default branch name, `main`, will be used.
             *
             */
            name?: string;
            /**
             * The role name. If not specified, the default role name, `{database_name}_owner`, will be used.
             *
             */
            role_name?: string;
            /**
             * The database name. If not specified, the default database name, `neondb`, will be used.
             *
             */
            database_name?: string;
        };
        /**
         * DEPRECATED, use default_endpoint_settings.autoscaling_limit_min_cu instead.
         *
         * The minimum number of Compute Units. The minimum value is `0.25`.
         * See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         * @deprecated
         */
        autoscaling_limit_min_cu?: ComputeUnit;
        /**
         * DEPRECATED, use default_endpoint_settings.autoscaling_limit_max_cu instead.
         *
         * The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)
         * for more information.
         *
         * @deprecated
         */
        autoscaling_limit_max_cu?: ComputeUnit;
        provisioner?: Provisioner;
        /**
         * The region identifier. Refer to our [Regions](https://neon.tech/docs/introduction/regions) documentation for supported regions. Values are specified in this format: `aws-us-east-1`
         *
         */
        region_id?: string;
        default_endpoint_settings?: DefaultEndpointSettings;
        pg_version?: PgVersion;
        /**
         * Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.
         *
         */
        store_passwords?: boolean;
        /**
         * The number of seconds to retain the shared history for all branches in this project.
         * The default is 1 day (86400 seconds).
         *
         */
        history_retention_seconds?: number;
        /**
         * Organization id in case the project created belongs to an organization.
         * If not present, project is owned by a user and not by org.
         *
         */
        org_id?: string;
    };
};

/**
 * The list of configured JWKS definitions for a project
 */
type ProjectJWKSResponse = {
    jwks: Array<JWKS>;
};

type ProjectPermission = {
    id: string;
    granted_to_email: string;
    granted_at: string;
    revoked_at?: string;
};

type ProjectPermissions = {
    project_permissions: Array<ProjectPermission>;
};

/**
 * Type of subscription to Neon Cloud.
 * Notice that for users without billing account this will be "UNKNOWN"
 *
 */
type BillingSubscriptionType = 'UNKNOWN' | 'direct_sales' | 'aws_marketplace' | 'free_v2' | 'launch' | 'scale' | 'business' | 'vercel_pg_legacy';

type ProjectOwnerData = {
    email: string;
    name: string;
    branches_limit: number;
    subscription_type: BillingSubscriptionType;
};

type Project = {
    /**
     * Bytes-Hour. Project consumed that much storage hourly during the billing period. The value has some lag.
     * The value is reset at the beginning of each billing period.
     *
     */
    data_storage_bytes_hour: number;
    /**
     * Bytes. Egress traffic from the Neon cloud to the client for given project over the billing period.
     * Includes deleted endpoints. The value has some lag. The value is reset at the beginning of each billing period.
     *
     */
    data_transfer_bytes: number;
    /**
     * Bytes. Amount of WAL that travelled through storage for given project across all branches.
     * The value has some lag. The value is reset at the beginning of each billing period.
     *
     */
    written_data_bytes: number;
    /**
     * Seconds. The number of CPU seconds used by the project's compute endpoints, including compute endpoints that have been deleted.
     * The value has some lag. The value is reset at the beginning of each billing period.
     * Examples:
     * 1. An endpoint that uses 1 CPU for 1 second is equal to `compute_time=1`.
     * 2. An endpoint that uses 2 CPUs simultaneously for 1 second is equal to `compute_time=2`.
     *
     */
    compute_time_seconds: number;
    /**
     * Seconds. Control plane observed endpoints of this project being active this amount of wall-clock time.
     * The value has some lag.
     * The value is reset at the beginning of each billing period.
     *
     */
    active_time_seconds: number;
    /**
     * DEPRECATED, use compute_time instead.
     *
     * @deprecated
     */
    cpu_used_sec: number;
    /**
     * The project ID
     */
    id: string;
    /**
     * The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`.
     *
     */
    platform_id: string;
    /**
     * The region identifier
     *
     */
    region_id: string;
    /**
     * The project name
     *
     */
    name: string;
    provisioner: Provisioner;
    default_endpoint_settings?: DefaultEndpointSettings;
    settings?: ProjectSettingsData;
    pg_version: PgVersion;
    /**
     * The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`).
     *
     */
    proxy_host: string;
    /**
     * The logical size limit for a branch. The value is in MiB.
     *
     */
    branch_logical_size_limit: number;
    /**
     * The logical size limit for a branch. The value is in B.
     *
     */
    branch_logical_size_limit_bytes: number;
    /**
     * Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.
     *
     */
    store_passwords: boolean;
    /**
     * A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time.
     *
     */
    maintenance_starts_at?: string;
    /**
     * The project creation source
     *
     */
    creation_source: string;
    /**
     * The number of seconds to retain the shared history for all branches in this project. The default for all plans is 1 day (86400 seconds).
     *
     */
    history_retention_seconds: number;
    /**
     * A timestamp indicating when the project was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the project was last updated
     *
     */
    updated_at: string;
    /**
     * The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.
     *
     */
    synthetic_storage_size?: number;
    /**
     * A date-time indicating when Neon Cloud started measuring consumption for current consumption period.
     *
     */
    consumption_period_start: string;
    /**
     * A date-time indicating when Neon Cloud plans to stop measuring consumption for current consumption period.
     *
     */
    consumption_period_end: string;
    /**
     * DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.
     * A timestamp indicating when the project quota resets.
     *
     * @deprecated
     */
    quota_reset_at?: string;
    owner_id: string;
    owner?: ProjectOwnerData;
    /**
     * The most recent time when any endpoint of this project was active.
     *
     * Omitted when observed no activity for endpoints of this project.
     *
     */
    compute_last_active_at?: string;
    org_id?: string;
    /**
     * A timestamp indicating when project update begins. If set, computes might experience a brief restart around this time.
     *
     */
    maintenance_scheduled_for?: string;
};

type ProjectResponse = {
    project: Project;
};

/**
 * A map where key is a project ID and a value is a list of installed applications.
 *
 */
type ProjectsApplicationsMapResponse = {
    applications: Record<string, Array<'vercel' | 'github' | 'datadog'>>;
};

/**
 * A map where key is a project ID and a value is a list of installed integrations.
 *
 */
type ProjectsIntegrationsMapResponse = {
    integrations: Record<string, Array<'vercel' | 'github' | 'datadog'>>;
};

/**
 * Essential data about the project. Full data is available at the getProject endpoint.
 *
 */
type ProjectListItem = {
    /**
     * The project ID
     */
    id: string;
    /**
     * The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`.
     *
     */
    platform_id: string;
    /**
     * The region identifier
     *
     */
    region_id: string;
    /**
     * The project name
     *
     */
    name: string;
    provisioner: Provisioner;
    default_endpoint_settings?: DefaultEndpointSettings;
    settings?: ProjectSettingsData;
    pg_version: PgVersion;
    /**
     * The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`).
     *
     */
    proxy_host: string;
    /**
     * The logical size limit for a branch. The value is in MiB.
     *
     */
    branch_logical_size_limit: number;
    /**
     * The logical size limit for a branch. The value is in B.
     *
     */
    branch_logical_size_limit_bytes: number;
    /**
     * Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.
     *
     */
    store_passwords: boolean;
    /**
     * Control plane observed endpoints of this project being active this amount of wall-clock time.
     *
     */
    active_time: number;
    /**
     * DEPRECATED. Use data from the getProject endpoint instead.
     *
     * @deprecated
     */
    cpu_used_sec: number;
    /**
     * A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time.
     *
     */
    maintenance_starts_at?: string;
    /**
     * The project creation source
     *
     */
    creation_source: string;
    /**
     * A timestamp indicating when the project was created
     *
     */
    created_at: string;
    /**
     * A timestamp indicating when the project was last updated
     *
     */
    updated_at: string;
    /**
     * The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.
     *
     */
    synthetic_storage_size?: number;
    /**
     * DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.
     * A timestamp indicating when the project quota resets
     *
     * @deprecated
     */
    quota_reset_at?: string;
    owner_id: string;
    /**
     * The most recent time when any endpoint of this project was active.
     *
     * Omitted when observed no activity for endpoints of this project.
     *
     */
    compute_last_active_at?: string;
    /**
     * Organization id if a project belongs to organization.
     * Permissions for the project will be given to organization members as defined by the organization admins.
     * The permissions of the project do not depend on the user that created the project if a project belongs to an organization.
     *
     */
    org_id?: string;
};

type ProjectsResponse = {
    projects: Array<ProjectListItem>;
    /**
     * A list of project IDs indicating which projects are known to exist, but whose details could not
     * be fetched within the requested (or implicit) time limit
     *
     */
    unavailable_project_ids?: Array<string>;
};

type ProjectUpdateRequest = {
    project: {
        settings?: ProjectSettingsData;
        /**
         * The project name
         */
        name?: string;
        default_endpoint_settings?: DefaultEndpointSettings;
        /**
         * The number of seconds to retain the shared history for all branches in this project.
         * The default is 1 day (604800 seconds).
         *
         */
        history_retention_seconds?: number;
    };
};

declare class ProjectService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * List projects
     * Retrieves a list of projects for the Neon account.
     * A project is the top-level object in the Neon object hierarchy.
     * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
     *
     * @param cursor Specify the cursor value from the previous response to retrieve the next batch of projects.
     * @param limit Specify a value from 1 to 400 to limit number of projects in the response.
     * @param search Search by project `name` or `id`. You can specify partial `name` or `id` values to filter results.
     * @param orgId Search for projects by `org_id`.
     * @param timeout Specify an explicit timeout in milliseconds to limit response delay.
     * After timing out, the incomplete list of project data fetched so far will be returned.
     * Projects still being fetched when the timeout occurred are listed in the "unavailable" attribute of the response.
     * If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above
     *
     * @returns any Returned a list of projects for the Neon account
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjects(cursor?: string, limit?: number, search?: string, orgId?: string, timeout?: number): CancelablePromise<(ProjectsResponse & PaginationResponse & ProjectsApplicationsMapResponse & ProjectsIntegrationsMapResponse) | GeneralError>;
    /**
     * Create project
     * Creates a Neon project.
     * A project is the top-level object in the Neon object hierarchy.
     * Plan limits define how many projects you can create.
     * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
     *
     * You can specify a region and Postgres version in the request body.
     * Neon currently supports PostgreSQL 14, 15, 16, and 17.
     * For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
     *
     * @param requestBody
     * @returns GeneralError General Error
     * @returns any Created a project.
     * The project includes a connection URI with a database, password, and role.
     * At least one non-protected role is created with a password.
     * Wait until the operations are finished before attempting to connect to a project database.
     *
     * @throws ApiError
     */
    createProject(requestBody: ProjectCreateRequest): CancelablePromise<GeneralError | (ProjectResponse & ConnectionURIsResponse & RolesResponse & DatabasesResponse & OperationsResponse & BranchResponse & EndpointsResponse)>;
    /**
     * List shared projects
     * Retrieves a list of shared projects for the Neon account.
     * A project is the top-level object in the Neon object hierarchy.
     * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
     *
     * @param cursor Specify the cursor value from the previous response to get the next batch of projects.
     * @param limit Specify a value from 1 to 400 to limit number of projects in the response.
     * @param search Search query by name or id.
     * @param timeout Specify an explicit timeout in milliseconds to limit response delay.
     * After timing out, the incomplete list of project data fetched so far will be returned.
     * Projects still being fetched when the timeout occurred are listed in the "unavailable" attribute of the response.
     * If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above
     *
     * @returns any Returned a list of shared projects for the Neon account
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listSharedProjects(cursor?: string, limit?: number, search?: string, timeout?: number): CancelablePromise<(ProjectsResponse & PaginationResponse) | GeneralError>;
    /**
     * Retrieve project details
     * Retrieves information about the specified project.
     * A project is the top-level object in the Neon object hierarchy.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     * @param projectId The Neon project ID
     * @returns ProjectResponse Returned information about the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProject(projectId: string): CancelablePromise<ProjectResponse | GeneralError>;
    /**
     * Update project
     * Updates the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     * @param projectId The Neon project ID
     * @param requestBody
     * @returns any Updated the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    updateProject(projectId: string, requestBody: ProjectUpdateRequest): CancelablePromise<(ProjectResponse & OperationsResponse) | GeneralError>;
    /**
     * Delete project
     * Deletes the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * Deleting a project is a permanent action.
     * Deleting a project also deletes endpoints, branches, databases, and users that belong to the project.
     *
     * @param projectId The Neon project ID
     * @returns ProjectResponse Deleted the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProject(projectId: string): CancelablePromise<ProjectResponse | GeneralError>;
    /**
     * List project access
     * Retrieves details about users who have access to the project, including the permission `id`, the granted-to email address, and the date project access was granted.
     * @param projectId
     * @returns ProjectPermissions Returned project access details
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectPermissions(projectId: string): CancelablePromise<ProjectPermissions | GeneralError>;
    /**
     * Grant project access
     * Grants project access to the account associated with the specified email address
     * @param projectId
     * @param requestBody
     * @returns ProjectPermission Granted project access
     * @returns GeneralError General Error
     * @throws ApiError
     */
    grantPermissionToProject(projectId: string, requestBody: GrantPermissionToProjectRequest): CancelablePromise<ProjectPermission | GeneralError>;
    /**
     * Revoke project access
     * Revokes project access from the user associated with the specified permission `id`. You can retrieve a user's permission `id` by listing project access.
     * @param projectId
     * @param permissionId
     * @returns ProjectPermission Revoked project access
     * @returns GeneralError General Error
     * @throws ApiError
     */
    revokePermissionFromProject(projectId: string, permissionId: string): CancelablePromise<ProjectPermission | GeneralError>;
    /**
     * List JWKS URLs
     * Returns the JWKS URLs available for verifying JWTs used as the authentication mechanism for the specified project.
     *
     * @param projectId The Neon project ID
     * @returns ProjectJWKSResponse The JWKS URLs available for the project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getProjectJwks(projectId: string): CancelablePromise<ProjectJWKSResponse | GeneralError>;
    /**
     * Add JWKS URL
     * Add a new JWKS URL to a project, such that it can be used for verifying JWTs used as the authentication mechanism for the specified project.
     *
     * The URL must be a valid HTTPS URL that returns a JSON Web Key Set.
     *
     * The `provider_name` field allows you to specify which authentication provider you're using (e.g., Clerk, Auth0, AWS Cognito, etc.).
     *
     * The `branch_id` can be used to specify on which branches the JWKS URL will be accepted. If not specified, then it will work on any branch.
     *
     * The `role_names` can be used to specify for which roles the JWKS URL will be accepted.
     *
     * The `jwt_audience` can be used to specify which "aud" values should be accepted by Neon in the JWTs that are used for authentication.
     *
     * @param projectId The Neon project ID
     * @param requestBody
     * @returns GeneralError General Error
     * @returns JWKSCreationOperation The JWKS URL was added to the project's authentication connections
     * @throws ApiError
     */
    addProjectJwks(projectId: string, requestBody: AddProjectJWKSRequest): CancelablePromise<GeneralError | JWKSCreationOperation>;
    /**
     * Delete JWKS URL
     * Deletes a JWKS URL from the specified project
     * @param projectId The Neon project ID
     * @param jwksId The JWKS ID
     * @returns JWKS Deleted a JWKS URL from the project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectJwks(projectId: string, jwksId: string): CancelablePromise<JWKS | GeneralError>;
    /**
     * Retrieve connection URI
     * Retrieves a connection URI for the specified database.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     * You can obtain the `database_name` by listing the databases for a branch.
     * You can obtain a `role_name` by listing the roles for a branch.
     *
     * @param projectId The Neon project ID
     * @param databaseName The database name
     * @param roleName The role name
     * @param branchId The branch ID. Defaults to your project's default `branch_id` if not specified.
     * @param endpointId The endpoint ID. Defaults to the read-write `endpoint_id` associated with the `branch_id` if not specified.
     * @param pooled Adds the `-pooler` option to the connection URI when set to `true`, creating a pooled connection URI.
     * @returns ConnectionURIResponse Returned the connection URI
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getConnectionUri(projectId: string, databaseName: string, roleName: string, branchId?: string, endpointId?: string, pooled?: boolean): CancelablePromise<ConnectionURIResponse | GeneralError>;
    /**
     * List VPC endpoint restrictions
     * Lists VPC endpoint restrictions for the specified Neon project.
     *
     * @param projectId The Neon project ID
     * @returns VPCEndpointsResponse Returned VPC endpoint restrictions for the specified project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    listProjectVpcEndpoints(projectId: string): CancelablePromise<VPCEndpointsResponse | GeneralError>;
    /**
     * Set VPC endpoint restriction
     * Sets or updates a VPC endpoint restriction for a Neon project.
     * When a VPC endpoint restriction is set, the project only accepts connections
     * from the specified VPC.
     * A VPC endpoint can be set as a restriction only after it is assigned to the
     * parent organization of the Neon project.
     *
     * @param projectId The Neon project ID
     * @param vpcEndpointId The VPC endpoint ID
     * @param requestBody
     * @returns any Configured the specified VPC endpoint as a restriction for the specified project.
     * @returns GeneralError General Error
     * @throws ApiError
     */
    assignProjectVpcEndpoint(projectId: string, vpcEndpointId: string, requestBody: VPCEndpointAssignment): CancelablePromise<any | GeneralError>;
    /**
     * Delete VPC endpoint restriction
     * Removes the specified VPC endpoint restriction from a Neon project.
     *
     * @param projectId The Neon project ID
     * @param vpcEndpointId The VPC endpoint ID
     * @returns any Removed the VPC endpoint restriction from the specified Neon project
     * @returns GeneralError General Error
     * @throws ApiError
     */
    deleteProjectVpcEndpoint(projectId: string, vpcEndpointId: string): CancelablePromise<any | GeneralError>;
}

type RegionResponse = {
    /**
     * The region ID as used in other API endpoints
     */
    region_id: string;
    /**
     * A short description of the region.
     */
    name: string;
    /**
     * Whether this region is used by default in new projects.
     */
    default: boolean;
    /**
     * The geographical latitude (approximate) for the region. Empty if unknown.
     */
    geo_lat: string;
    /**
     * The geographical longitude (approximate) for the region. Empty if unknown.
     */
    geo_long: string;
};

type ActiveRegionsResponse = {
    /**
     * The list of active regions
     */
    regions: Array<RegionResponse>;
};

declare class RegionService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * List supported regions
     * Lists supported Neon regions
     *
     * @returns ActiveRegionsResponse The list of active regions
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getActiveRegions(): CancelablePromise<ActiveRegionsResponse | GeneralError>;
}

/**
 * State of the billing account.
 *
 */
type BillingAccountState = 'UNKNOWN' | 'active' | 'suspended' | 'deactivated' | 'deleted';

/**
 * Indicates whether and how an account makes payments.
 *
 */
type BillingPaymentMethod = 'UNKNOWN' | 'none' | 'stripe' | 'direct_payment' | 'aws_mp' | 'azure_mp' | 'vercel_mp' | 'staff' | 'trial' | 'sponsorship';

type PaymentSourceBankCard = {
    /**
     * Last 4 digits of the card.
     *
     */
    last4: string;
    /**
     * Brand of credit card.
     *
     */
    brand?: 'amex' | 'diners' | 'discover' | 'jcb' | 'mastercard' | 'unionpay' | 'unknown' | 'visa';
    /**
     * Credit card expiration month
     *
     */
    exp_month?: number;
    /**
     * Credit card expiration year
     *
     */
    exp_year?: number;
};

type PaymentSource = {
    /**
     * Type of payment source. E.g. "card".
     *
     */
    type: string;
    card?: PaymentSourceBankCard;
};

type BillingAccount = {
    state: BillingAccountState;
    payment_source: PaymentSource;
    subscription_type: BillingSubscriptionType;
    payment_method: BillingPaymentMethod;
    /**
     * The last time the quota was reset. Defaults to the date-time the account is created.
     *
     */
    quota_reset_at_last: string;
    /**
     * The full name of the individual or entity that owns the billing account. This name appears on invoices.
     */
    name: string;
    /**
     * Billing email, to receive emails related to invoices and subscriptions.
     *
     */
    email: string;
    /**
     * Billing address city.
     *
     */
    address_city: string;
    /**
     * Billing address country code defined by ISO 3166-1 alpha-2.
     *
     */
    address_country: string;
    /**
     * Billing address country name.
     *
     */
    address_country_name?: string;
    /**
     * Billing address line 1.
     *
     */
    address_line1: string;
    /**
     * Billing address line 2.
     *
     */
    address_line2: string;
    /**
     * Billing address postal code.
     *
     */
    address_postal_code: string;
    /**
     * Billing address state or region.
     *
     */
    address_state: string;
    /**
     * Orb user portal url
     *
     */
    orb_portal_url?: string;
    /**
     * The tax identification number for the billing account, displayed on invoices.
     *
     */
    tax_id?: string;
    /**
     * The type of the tax identification number based on the country.
     *
     */
    tax_id_type?: string;
};

/**
 * Identity provider id from keycloak
 */
type IdentityProviderId = 'github' | 'google' | 'hasura' | 'microsoft' | 'microsoftv2' | 'vercelmp' | 'keycloak' | 'test';

type CurrentUserAuthAccount = {
    email: string;
    image: string;
    /**
     * DEPRECATED. Use `email` field.
     *
     * @deprecated
     */
    login: string;
    name: string;
    provider: IdentityProviderId;
};

type CurrentUserInfoResponse = {
    /**
     * Control plane observes active endpoints of a user this amount of wall-clock time.
     *
     */
    active_seconds_limit: number;
    billing_account: BillingAccount;
    auth_accounts: Array<CurrentUserAuthAccount>;
    email: string;
    id: string;
    image: string;
    /**
     * DEPRECATED. Use `email` field.
     *
     * @deprecated
     */
    login: string;
    name: string;
    last_name: string;
    projects_limit: number;
    branches_limit: number;
    max_autoscaling_limit: ComputeUnit;
    compute_seconds_limit?: number;
    plan: string;
};

declare class UsersService {
    readonly httpRequest: BaseHttpRequest;
    constructor(httpRequest: BaseHttpRequest);
    /**
     * Retrieve current user details
     * Retrieves information about the current Neon user account.
     *
     * @returns CurrentUserInfoResponse Returned information about the current user
     *
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getCurrentUserInfo(): CancelablePromise<CurrentUserInfoResponse | GeneralError>;
    /**
     * Retrieve current user organizations list
     * Retrieves information about the current Neon user's organizations
     *
     * @returns OrganizationsResponse Returned information about the current user organizations
     *
     * @returns GeneralError General Error
     * @throws ApiError
     */
    getCurrentUserOrganizations(): CancelablePromise<OrganizationsResponse | GeneralError>;
    /**
     * Transfer projects from personal account to organization
     * Transfers selected projects, identified by their IDs, from your personal account to a specified organization.
     *
     * @param requestBody
     * @returns EmptyResponse Projects successfully transferred from personal account to organization
     * @returns GeneralError General Error
     * @throws ApiError
     */
    transferProjectsFromUserToOrg(requestBody: TransferProjectsToOrganizationRequest): CancelablePromise<EmptyResponse | GeneralError>;
}

type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
declare class NeonClient {
    readonly apiKey: ApiKeyService;
    readonly auth: AuthService;
    readonly branch: BranchService;
    readonly consumption: ConsumptionService;
    readonly endpoint: EndpointService;
    readonly operation: OperationService;
    readonly organizations: OrganizationsService;
    readonly project: ProjectService;
    readonly region: RegionService;
    readonly users: UsersService;
    readonly request: BaseHttpRequest;
    constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
}

type ApiResult = {
    readonly url: string;
    readonly ok: boolean;
    readonly status: number;
    readonly statusText: string;
    readonly body: any;
};

declare class ApiError extends Error {
    readonly url: string;
    readonly status: number;
    readonly statusText: string;
    readonly body: any;
    readonly request: ApiRequestOptions;
    constructor(request: ApiRequestOptions, response: ApiResult, message: string);
}

type ConvertUserToOrgRequest = {
    name: string;
};

type LinkedAuthAccount = {
    provider: IdentityProviderId;
    provider_display_name: string;
    username: string;
};

type CurrentUserInfoAuthResponse = {
    password_stored: boolean;
    auth_accounts: Array<CurrentUserAuthAccount>;
    linked_accounts: Array<LinkedAuthAccount>;
    provider: string;
};

/**
 * A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list.
 */
type CursorParam = string;

/**
 * A Duration represents the elapsed time between two instants
 * as an int64 nanosecond count. The representation limits the
 * largest representable duration to approximately 290 years.
 */
type Duration = number;

type EndpointPasswordlessSessionAuthRequest = {
    session_id: string;
};

type ExplainData = {
    'QUERY PLAN': string;
};

type FeatureFlags = Record<string, (boolean | string)>;

type Features = Record<string, boolean>;

type HealthCheck = {
    /**
     * Service status
     */
    status: string;
};

type IdentityCreateNewUserRequest = {
    project_id: string;
    auth_provider: IdentitySupportedAuthProvider;
    email: string;
    name?: string;
};

type IdentityCreateNewUserResponse = {
    /**
     * ID of newly created user
     */
    id: string;
};

type InvitationCreateRequest = {
    /**
     * Email to invite
     */
    email: string;
    role: MemberRole;
};

/**
 * The maximum number of records to be returned in the response
 */
type LimitParam = number;

type Limits = {
    active_time: number;
    max_projects: number;
    max_branches: number;
    max_protected_branches: number;
    max_autoscaling_cu: number;
    max_fixed_size_cu: number;
    cpu_seconds: number;
    max_compute_time_non_primary: number;
    max_active_endpoints: number;
    max_read_only_endpoints: number;
    max_allowed_ips: number;
    max_vpc_endpoints_per_region: number;
    max_monitoring_retention_hours: number;
    max_history_retention_seconds: number;
    min_autosuspend_seconds: number;
    max_data_transfer: number;
    min_idle_seconds_to_autoarchive: number;
    min_age_seconds_to_autoarchive: number;
    max_branch_roles: number;
    max_branch_databases: number;
    max_concurrent_scheduled_operation_chains_per_project: number;
    max_concurrent_executing_operation_chains_per_project: number;
    max_root_branches: number;
    max_import_size: number;
};

type LimitsUnsatisfiedResponse = {
    limits: Array<{
        name: string;
        expected: string;
        actual: string;
    }>;
};

type OrganizationCreateRequest = {
    organization: {
        /**
         * The organization name
         */
        name?: string;
        /**
         * Emails with roles to invite to the organization
         */
        invitations?: Array<InvitationCreateRequest>;
    };
    subscription_type: BillingSubscriptionType;
};

/**
 * Details of an organization guest, who is not directly a member of
 * an organization but has been shared one of the projects it owns
 *
 */
type OrganizationGuest = {
    permission_id: string;
    user_email: string;
    project_id: string;
    project_name: string;
};

/**
 * A list of details for guests of an organization
 *
 */
type OrganizationGuestsResponse = Array<OrganizationGuest>;

type OrganizationInviteUpdateRequest = {
    email?: string;
    role?: MemberRole;
    resend?: boolean;
};

type OrganizationLimits = {
    limits: Limits;
    features: Features;
};

type OrganizationsUpdateRequest = {
    name: string;
};

type OrgDeletionConditionName = 'project_count';

type ProjectLimits = {
    limits: Limits;
    features: Features;
};

type ProjectsWithIntegrationResponse = {
    projects: Array<{
        id: string;
        integration: string;
    }>;
};

type Snapshot = {
    id: string;
    name: string;
    lsn?: string;
    timestamp?: string;
    source_branch_id?: string;
    source_schedule_id?: string;
    created_at: string;
    expires_at?: string;
};

/**
 * Defines the sorting order of entities.
 */
type SortOrderParam = 'asc' | 'desc';

type StatementData = {
    fields?: Array<string>;
    rows?: Array<Array<string>>;
    truncated: boolean;
};

type StatementResult = {
    data?: StatementData;
    error?: string;
    explain_data?: Array<ExplainData>;
    query: string;
};

type SupportTicketSeverity = 'low' | 'normal' | 'high' | 'critical';

/**
 * Specify an explicit timeout in milliseconds to limit response delay.
 * After timing out, the incomplete list of project data fetched so far will be returned.
 * Projects still being fetched when the timeout occurred are listed in the "unavailable" attribute of the response.
 * If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above
 *
 */
type TimeoutParam = number;

type UpdateUserInfoRequest = {
    email?: string;
    id: string;
    /**
     * DEPRECATED. This field is ignored.
     *
     * @deprecated
     */
    image?: string;
    first_name?: string;
    last_name?: string;
    password?: string;
    new_password?: string;
};

type UserDeletionConditionName = 'project_count' | 'org_admin_membership_count' | 'subscription_type';

type VerifyUserPasswordRequest = {
    password: string;
};

export { type ActiveRegionsResponse, type AddProjectJWKSRequest, type AllowedIps, type AnnotationCreateValueRequest, type AnnotationData, type AnnotationObjectData, type AnnotationResponse, type AnnotationValueData, type AnnotationsMapResponse, ApiError, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyCreatorData, type ApiKeyRevokeResponse, ApiKeyService, type ApiKeysListResponseItem, AuthService, BaseHttpRequest, type BillingAccount, type BillingAccountState, type BillingPaymentMethod, type BillingSubscriptionType, type Branch, type BranchCreateRequest, type BranchCreateRequestEndpointOptions, type BranchOperations, type BranchResponse, type BranchRestoreRequest, type BranchSchemaCompareResponse, type BranchSchemaResponse, BranchService, type BranchState, type BranchUpdateRequest, type BranchesCountResponse, type BranchesResponse, CancelError, CancelablePromise, type ComputeUnit, type ConnectionDetails, type ConnectionParameters, type ConnectionURIResponse, type ConnectionURIsOptionalResponse, type ConnectionURIsResponse, type ConsumptionHistoryGranularity, type ConsumptionHistoryPerAccountResponse, type ConsumptionHistoryPerPeriod, type ConsumptionHistoryPerProject, type ConsumptionHistoryPerProjectResponse, type ConsumptionHistoryPerTimeframe, ConsumptionService, type ConvertUserToOrgRequest, type CurrentUserAuthAccount, type CurrentUserInfoAuthResponse, type CurrentUserInfoResponse, type CursorPagination, type CursorPaginationResponse, type CursorParam, type Database, type DatabaseCreateRequest, type DatabaseOperations, type DatabaseResponse, type DatabaseUpdateRequest, type DatabasesResponse, type DefaultEndpointSettings, type Duration, type EmptyResponse, type Endpoint, type EndpointCreateRequest, type EndpointOperations, type EndpointPasswordlessSessionAuthRequest, type EndpointPoolerMode, type EndpointResponse, EndpointService, type EndpointSettingsData, type EndpointState, type EndpointType, type EndpointUpdateRequest, type EndpointsResponse, type ErrorCode, type ExplainData, type FeatureFlags, type Features, type GeneralError, type GrantPermissionToProjectRequest, type HealthCheck, type IdentityAuthProviderProjectOwnedBy, type IdentityAuthProviderProjectTransferStatus, type IdentityCreateAuthProviderSDKKeysRequest, type IdentityCreateIntegrationRequest, type IdentityCreateIntegrationResponse, type IdentityCreateNewUserRequest, type IdentityCreateNewUserResponse, type IdentityIntegration, type IdentityProviderId, type IdentitySupportedAuthProvider, type IdentityTransferAuthProviderProjectRequest, type IdentityTransferAuthProviderProjectResponse, type Invitation, type InvitationCreateRequest, type JWKS, type JWKSCreationOperation, type JWKSResponse, type LimitParam, type Limits, type LimitsUnsatisfiedResponse, type LinkedAuthAccount, type ListProjectIdentityIntegrationsResponse, type MaintenanceWindow, type Member, type MemberRole, type MemberUserInfo, type MemberWithUser, NeonClient, OpenAPI, type OpenAPIConfig, type Operation, type OperationAction, type OperationResponse, OperationService, type OperationStatus, type OperationsResponse, type OrgApiKeyCreateRequest, type OrgApiKeyCreateResponse, type OrgApiKeyRevokeResponse, type OrgApiKeysListResponseItem, type OrgDeletionConditionName, type Organization, type OrganizationCreateRequest, type OrganizationGuest, type OrganizationGuestsResponse, type OrganizationInvitationsResponse, type OrganizationInviteCreateRequest, type OrganizationInviteUpdateRequest, type OrganizationInvitesCreateRequest, type OrganizationLimits, type OrganizationMemberUpdateRequest, type OrganizationMembersResponse, type OrganizationsResponse, OrganizationsService, type OrganizationsUpdateRequest, type Pagination, type PaginationResponse, type PaymentSource, type PaymentSourceBankCard, type PgSettingsData, type PgVersion, type PgbouncerSettingsData, type Project, type ProjectAuditLogLevel, type ProjectCreateRequest, type ProjectJWKSResponse, type ProjectLimits, type ProjectListItem, type ProjectOwnerData, type ProjectPermission, type ProjectPermissions, type ProjectQuota, type ProjectResponse, ProjectService, type ProjectSettingsData, type ProjectUpdateRequest, type ProjectsApplicationsMapResponse, type ProjectsIntegrationsMapResponse, type ProjectsResponse, type ProjectsWithIntegrationResponse, type Provisioner, type RegionResponse, RegionService, type Role, type RoleCreateRequest, type RoleOperations, type RolePasswordResponse, type RoleResponse, type RolesResponse, type Snapshot, type SortOrderParam, type StatementData, type StatementResult, type SupportTicketSeverity, type SuspendTimeoutSeconds, type TimeoutParam, type TransferProjectsToOrganizationRequest, type UpdateUserInfoRequest, type UserDeletionConditionName, UsersService, type VPCEndpoint, type VPCEndpointAssignment, type VPCEndpointDetails, type VPCEndpointsResponse, type VerifyUserPasswordRequest };
