# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, Required, TypedDict

__all__ = ["DatabaseCreateParams", "ReadReplication"]


class DatabaseCreateParams(TypedDict, total=False):
    account_id: Required[str]
    """Account identifier tag."""

    name: Required[str]
    """D1 database name."""

    jurisdiction: Literal["eu", "fedramp"]
    """Specify the location to restrict the D1 database to run and store data.

    If this option is present, the location hint is ignored.
    """

    primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"]
    """Specify the region to create the D1 primary, if available.

    If this option is omitted, the D1 will be created as close as possible to the
    current user.
    """

    read_replication: ReadReplication
    """Configuration for D1 read replication."""


class ReadReplication(TypedDict, total=False):
    """Configuration for D1 read replication."""

    mode: Required[Literal["auto", "disabled"]]
    """The read replication mode for the database.

    Use 'auto' to create replicas and allow D1 automatically place them around the
    world, or 'disabled' to not use any database replicas (it can take a few hours
    for all replicas to be deleted).
    """
