// This file is auto-generated by @hey-api/openapi-ts
import { client } from "./client.gen.js";
class _HeyApiClient {
    _client = client;
    constructor(args) {
        if (args?.client) {
            this._client = args.client;
        }
    }
}
export class NeonClient extends _HeyApiClient {
    /**
     * 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/).
     *
     */
    listApiKeys(options) {
        return (options?.client ?? this._client).get({
            url: "/api_keys",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    createApiKey(options) {
        return (options.client ?? this._client).post({
            url: "/api_keys",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    revokeApiKey(options) {
        return (options.client ?? this._client).delete({
            url: "/api_keys/{key_id}",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    getProjectOperation(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/operations/{operation_id}",
            ...options,
        });
    }
    /**
     * List projects
     * Retrieves a list of projects for an organization.
     * You may need to specify an org_id parameter depending on your API key type.
     * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
     *
     */
    listProjects(options) {
        return (options?.client ?? this._client).get({
            url: "/projects",
            ...options,
        });
    }
    /**
     * Create project
     * Creates a Neon project within an organization.
     * You may need to specify an org_id parameter depending on your API key type.
     * 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/).
     *
     */
    createProject(options) {
        return (options.client ?? this._client).post({
            url: "/projects",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * List shared projects
     * Retrieves a list of projects shared with your Neon account.
     * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
     *
     */
    listSharedProjects(options) {
        return (options?.client ?? this._client).get({
            url: "/projects/shared",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    deleteProject(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}",
            ...options,
        });
    }
    /**
     * Retrieve project details
     * Retrieves information about the specified project.
     * You can obtain a `project_id` by listing the projects for an organization.
     *
     */
    getProject(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}",
            ...options,
        });
    }
    /**
     * Update project
     * Updates the specified project.
     * You can obtain a `project_id` by listing the projects for your Neon account.
     *
     */
    updateProject(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     * Operations older than 6 months may be deleted from our systems.
     * If you need more history than that, you should store your own history.
     *
     */
    listProjectOperations(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/operations",
            ...options,
        });
    }
    /**
     * 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.
     */
    listProjectPermissions(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/permissions",
            ...options,
        });
    }
    /**
     * Grant project access
     * Grants project access to the account associated with the specified email address
     */
    grantPermissionToProject(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/permissions",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     */
    revokePermissionFromProject(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/permissions/{permission_id}",
            ...options,
        });
    }
    /**
     * Return available shared preload libraries
     * Return available shared preload libraries
     */
    getAvailablePreloadLibraries(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/available_preload_libraries",
            ...options,
        });
    }
    /**
     * Create a project transfer request
     * Creates a transfer request for the specified project. A transfer request allows
     * the project to be transferred to another account or organization. The request
     * has an expiration time after which it can no longer be used. To accept/claim
     * the transfer request, the recipient user/organization must call the
     * `/projects/{project_id}/transfer_requests/{request_id}` API endpoint, or visit
     * `https://console.neon.tech/app/claim?p={project_id}&tr={request_id}&ru={redirect_url}`
     * in the Neon Console. The `ru` parameter is optional and can be used to redirect
     * the user after accepting the transfer request. This feature is currently in
     * private preview. Get in touch with us to get access.
     *
     */
    createProjectTransferRequest(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/transfer_requests",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Accept a project transfer request
     * Accepts a transfer request for the specified project, transferring it to the specified organization
     * or user. If org_id is not passed, the project will be transferred to the current user or organization account.
     *
     */
    acceptProjectTransferRequest(options) {
        return (options.client ?? this._client).put({
            url: "/projects/{project_id}/transfer_requests/{request_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * List JWKS URLs
     * Returns the JWKS URLs available for verifying JWTs used as the authentication mechanism for the specified project.
     *
     */
    getProjectJwks(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/jwks",
            ...options,
        });
    }
    /**
     * 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. If not specified, then default roles will be used (authenticator, authenticated and anonymous).
     *
     * The `jwt_audience` can be used to specify which "aud" values should be accepted by Neon in the JWTs that are used for authentication.
     *
     */
    addProjectJwks(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/jwks",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Delete JWKS URL
     * Deletes a JWKS URL from the specified project
     */
    deleteProjectJwks(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/jwks/{jwks_id}",
            ...options,
        });
    }
    /**
     * Delete Neon Data API
     * Deletes the Neon Data API for the specified branch.
     * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
     *
     */
    deleteProjectBranchDataApi(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
            ...options,
        });
    }
    /**
     * Get Neon Data API
     * Retrieves the Neon Data API for the specified branch.
     *
     */
    getProjectBranchDataApi(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
            ...options,
        });
    }
    /**
     * Refresh schema cache
     * Refreshes the schema cache for the Neon Data API in the specified branch.
     * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
     *
     */
    refreshSchemaCacheDataApi(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
            ...options,
        });
    }
    /**
     * Create Neon Data API
     * Creates a new instance of Neon Data API in the specified branch.
     * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
     *
     */
    createProjectBranchDataApi(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     *
     */
    createNeonAuthIntegration(options) {
        return (options.client ?? this._client).post({
            url: "/projects/auth/create",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Delete domain from redirect_uri whitelist
     * Deletes a domain from the redirect_uri whitelist for the specified project.
     *
     */
    deleteNeonAuthDomainFromRedirectUriWhitelist(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/auth/domains",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * List domains in redirect_uri whitelist
     * Lists the domains in the redirect_uri whitelist for the specified project.
     *
     */
    listNeonAuthRedirectUriWhitelistDomains(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/auth/domains",
            ...options,
        });
    }
    /**
     * Add domain to redirect_uri whitelist
     * Adds a domain to the redirect_uri whitelist for the specified project.
     *
     */
    addNeonAuthDomainToRedirectUriWhitelist(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/auth/domains",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     *
     */
    createNeonAuthProviderSdkKeys(options) {
        return (options.client ?? this._client).post({
            url: "/projects/auth/keys",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Create new auth user
     * Creates a new user in Neon Auth.
     * The user will be created in your neon_auth.users_sync table and automatically propagated to your auth project, whether Neon-managed or provider-owned.
     *
     */
    createNeonAuthNewUser(options) {
        return (options.client ?? this._client).post({
            url: "/projects/auth/user",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Delete auth user
     * Deletes the auth user for the specified project.
     *
     */
    deleteNeonAuthUser(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/auth/users/{auth_user_id}",
            ...options,
        });
    }
    /**
     * Transfer Neon-managed auth project to your own account
     * Transfer ownership of your Neon-managed auth project to your own auth provider account.
     *
     */
    transferNeonAuthProviderProject(options) {
        return (options.client ?? this._client).post({
            url: "/projects/auth/transfer_ownership",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Lists active integrations with auth providers
     */
    listNeonAuthIntegrations(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/auth/integrations",
            ...options,
        });
    }
    /**
     * List OAuth providers
     * Lists the OAuth providers for the specified project.
     *
     */
    listNeonAuthOauthProviders(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/auth/oauth_providers",
            ...options,
        });
    }
    /**
     * Add a OAuth provider
     * Adds a OAuth provider to the specified project.
     *
     */
    addNeonAuthOauthProvider(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/auth/oauth_providers",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Delete OAuth provider
     * Deletes a OAuth provider from the specified project.
     *
     */
    deleteNeonAuthOauthProvider(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/auth/oauth_providers/{oauth_provider_id}",
            ...options,
        });
    }
    /**
     * Update OAuth provider
     * Updates a OAuth provider for the specified project.
     *
     */
    updateNeonAuthOauthProvider(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/auth/oauth_providers/{oauth_provider_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Get email server configuration
     * Gets the email server configuration for the specified project.
     *
     */
    getNeonAuthEmailServer(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/auth/email_server",
            ...options,
        });
    }
    /**
     * Update email server configuration
     * Updates the email server configuration for the specified project.
     *
     */
    updateNeonAuthEmailServer(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/auth/email_server",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Delete integration with auth provider
     */
    deleteNeonAuthIntegration(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/auth/integration/{auth_provider}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     *
     */
    getConnectionUri(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/connection_uri",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    listProjectBranches(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches",
            ...options,
        });
    }
    /**
     * 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.
     * By default, the branch is created from the project's default branch with no compute endpoint, and the branch name is auto-generated.
     * To access the branch, you must add an endpoint object. A `read_write` endpoint allows you to perform read and write operations on the branch.
     * Each branch supports one read-write endpoint and multiple read-only endpoints.
     * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
     *
     */
    createProjectBranch(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     *
     */
    countProjectBranches(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/count",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    deleteProjectBranch(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/branches/{branch_id}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    getProjectBranch(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    updateProjectBranch(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/branches/{branch_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Restore branch
     * Restores a branch to an earlier state in its own or another branch's history
     */
    restoreProjectBranch(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/restore",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     */
    getProjectBranchSchema(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/schema",
            ...options,
        });
    }
    /**
     * Compare database schema
     * Compares the schema from the specified database with another branch's schema.
     */
    getProjectBranchSchemaComparison(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/compare_schema",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    setDefaultProjectBranch(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/set_as_default",
            ...options,
        });
    }
    /**
     * Finalize restore
     * Finalize the restore operation for a branch created from a snapshot.
     * This operation updates the branch so it functions as the original branch it replaced.
     * This includes:
     * - Reassigning any computes from the original branch to the restored branch (this will restart the computes)
     * - Renaming the restored branch to the original branch's name
     * - Renaming the original branch so it no longer uses the original name
     *
     * This operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    finalizeRestoreBranch(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/finalize_restore",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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.
     *
     */
    listProjectBranchEndpoints(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/endpoints",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    listProjectBranchDatabases(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/databases",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    createProjectBranchDatabase(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/databases",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    deleteProjectBranchDatabase(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    getProjectBranchDatabase(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    updateProjectBranchDatabase(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    listProjectBranchRoles(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/roles",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    createProjectBranchRole(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/roles",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    deleteProjectBranchRole(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    getProjectBranchRole(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    getProjectBranchRolePassword(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    resetProjectBranchRolePassword(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password",
            ...options,
        });
    }
    /**
     * List VPC endpoint restrictions
     * Lists VPC endpoint restrictions for the specified Neon project.
     *
     */
    listProjectVpcEndpoints(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/vpc_endpoints",
            ...options,
        });
    }
    /**
     * Delete VPC endpoint restriction
     * Removes the specified VPC endpoint restriction from a Neon project.
     *
     */
    deleteProjectVpcEndpoint(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    assignProjectVpcEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    listProjectEndpoints(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/endpoints",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    createProjectEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/endpoints",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    deleteProjectEndpoint(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/endpoints/{endpoint_id}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    getProjectEndpoint(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/endpoints/{endpoint_id}",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    updateProjectEndpoint(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/endpoints/{endpoint_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    startProjectEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/endpoints/{endpoint_id}/start",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    suspendProjectEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/endpoints/{endpoint_id}/suspend",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    restartProjectEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/endpoints/{endpoint_id}/restart",
            ...options,
        });
    }
    /**
     * Retrieve account consumption metrics
     * Retrieves consumption metrics for Scale, Business, and Enterprise plan accounts. History begins at the time of upgrade.
     *
     */
    getConsumptionHistoryPerAccount(options) {
        return (options.client ?? this._client).get({
            url: "/consumption_history/account",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    getConsumptionHistoryPerProject(options) {
        return (options.client ?? this._client).get({
            url: "/consumption_history/projects",
            ...options,
        });
    }
    /**
     * Retrieve organization details
     * Retrieves information about the specified organization.
     *
     */
    getOrganization(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    listOrgApiKeys(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/api_keys",
            ...options,
        });
    }
    /**
     * 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/).
     *
     */
    createOrgApiKey(options) {
        return (options.client ?? this._client).post({
            url: "/organizations/{org_id}/api_keys",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * 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/).
     *
     */
    revokeOrgApiKey(options) {
        return (options.client ?? this._client).delete({
            url: "/organizations/{org_id}/api_keys/{key_id}",
            ...options,
        });
    }
    /**
     * Retrieve organization members details
     * Retrieves information about the specified organization members.
     *
     */
    getOrganizationMembers(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/members",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    removeOrganizationMember(options) {
        return (options.client ?? this._client).delete({
            url: "/organizations/{org_id}/members/{member_id}",
            ...options,
        });
    }
    /**
     * Retrieve organization member details
     * Retrieves information about the specified organization member.
     *
     */
    getOrganizationMember(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/members/{member_id}",
            ...options,
        });
    }
    /**
     * Update role for organization member
     * Only an admin can perform this action.
     *
     */
    updateOrganizationMember(options) {
        return (options.client ?? this._client).patch({
            url: "/organizations/{org_id}/members/{member_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Retrieve organization invitation details
     * Retrieves information about extended invitations for the specified organization
     *
     */
    getOrganizationInvitations(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/invitations",
            ...options,
        });
    }
    /**
     * 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.
     *
     */
    createOrganizationInvitations(options) {
        return (options.client ?? this._client).post({
            url: "/organizations/{org_id}/invitations",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Transfer projects between organizations
     * Transfers selected projects, identified by their IDs, from your organization to another specified organization.
     *
     */
    transferProjectsFromOrgToOrg(options) {
        return (options.client ?? this._client).post({
            url: "/organizations/{source_org_id}/projects/transfer",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * List VPC endpoints across all regions
     * Retrieves the list of VPC endpoints for the specified Neon organization across all regions.
     *
     */
    listOrganizationVpcEndpointsAllRegions(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/vpc/vpc_endpoints",
            ...options,
        });
    }
    /**
     * List VPC endpoints
     * Retrieves the list of VPC endpoints for the specified Neon organization.
     *
     */
    listOrganizationVpcEndpoints(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints",
            ...options,
        });
    }
    /**
     * Delete VPC endpoint
     * Deletes the VPC endpoint from the specified Neon organization.
     * If you delete a VPC endpoint from a Neon organization, that VPC endpoint cannot
     * be added back to the Neon organization.
     *
     */
    deleteOrganizationVpcEndpoint(options) {
        return (options.client ?? this._client).delete({
            url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
            ...options,
        });
    }
    /**
     * Retrieve VPC endpoint details
     * Retrieves the current state and configuration details of a specified VPC endpoint.
     *
     */
    getOrganizationVpcEndpointDetails(options) {
        return (options.client ?? this._client).get({
            url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
            ...options,
        });
    }
    /**
     * Assign or update VPC endpoint
     * Assigns a VPC endpoint to a Neon organization or updates its existing assignment.
     *
     */
    assignOrganizationVpcEndpoint(options) {
        return (options.client ?? this._client).post({
            url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * List supported regions
     * Lists supported Neon regions
     *
     */
    getActiveRegions(options) {
        return (options?.client ?? this._client).get({
            url: "/regions",
            ...options,
        });
    }
    /**
     * Retrieve current user details
     * Retrieves information about the current Neon user account.
     *
     */
    getCurrentUserInfo(options) {
        return (options?.client ?? this._client).get({
            url: "/users/me",
            ...options,
        });
    }
    /**
     * Retrieve current user organizations list
     * Retrieves information about the current Neon user's organizations
     *
     */
    getCurrentUserOrganizations(options) {
        return (options?.client ?? this._client).get({
            url: "/users/me/organizations",
            ...options,
        });
    }
    /**
     * Transfer projects from personal account to organization
     * Transfers selected projects, identified by their IDs, from your personal account to a specified organization.
     *
     */
    transferProjectsFromUserToOrg(options) {
        return (options.client ?? this._client).post({
            url: "/users/me/projects/transfer",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Get request authentication details
     * Returns auth information about the passed credentials. It can refer to an API key, Bearer token or OAuth session.
     *
     */
    getAuthDetails(options) {
        return (options?.client ?? this._client).get({
            url: "/auth",
            ...options,
        });
    }
    /**
     * Create snapshot
     * Create a snapshot from the specified branch using the provided parameters.
     * This endpoint may initiate an asynchronous operation.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    createSnapshot(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/branches/{branch_id}/snapshot",
            ...options,
        });
    }
    /**
     * List project snapshots
     * List the snapshots for the specified project.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    listSnapshots(options) {
        return (options.client ?? this._client).get({
            url: "/projects/{project_id}/snapshots",
            ...options,
        });
    }
    /**
     * Delete snapshot
     * Delete the specified snapshot.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    deleteSnapshot(options) {
        return (options.client ?? this._client).delete({
            url: "/projects/{project_id}/snapshots/{snapshot_id}",
            ...options,
        });
    }
    /**
     * Update snapshot
     * Update the specified snapshot.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    updateSnapshot(options) {
        return (options.client ?? this._client).patch({
            url: "/projects/{project_id}/snapshots/{snapshot_id}",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
    /**
     * Restore snapshot
     * Restore the specified snapshot to a new branch and optionally finalize the restore operation.
     *
     * **Note**: This endpoint is currently in Beta.
     *
     */
    restoreSnapshot(options) {
        return (options.client ?? this._client).post({
            url: "/projects/{project_id}/snapshots/{snapshot_id}/restore",
            ...options,
            headers: {
                "Content-Type": "application/json",
                ...options.headers,
            },
        });
    }
}
//# sourceMappingURL=sdk.gen.js.map