33from __future__ import annotations
44
55from typing import Any , List , Type , cast
6+ from typing_extensions import Literal
67
78import httpx
89
@@ -47,6 +48,7 @@ def create(
4748 * ,
4849 account_id : str ,
4950 name : str ,
51+ primary_location_hint : Literal ["wnam" , "enam" , "weur" , "eeur" , "apac" , "oc" ] | NotGiven = NOT_GIVEN ,
5052 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5153 # The extra values given here take precedence over values defined on the client or passed to this method.
5254 extra_headers : Headers | None = None ,
@@ -60,6 +62,9 @@ def create(
6062 Args:
6163 account_id: Account identifier tag.
6264
65+ primary_location_hint: Specify the region to create the D1 primary, if available. If this option is
66+ omitted, the D1 will be created as close as possible to the current user.
67+
6368 extra_headers: Send extra headers
6469
6570 extra_query: Add additional query parameters to the request
@@ -72,7 +77,13 @@ def create(
7277 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
7378 return self ._post (
7479 f"/accounts/{ account_id } /d1/database" ,
75- body = maybe_transform ({"name" : name }, database_create_params .DatabaseCreateParams ),
80+ body = maybe_transform (
81+ {
82+ "name" : name ,
83+ "primary_location_hint" : primary_location_hint ,
84+ },
85+ database_create_params .DatabaseCreateParams ,
86+ ),
7687 options = make_request_options (
7788 extra_headers = extra_headers ,
7889 extra_query = extra_query ,
@@ -248,6 +259,9 @@ def query(
248259 Args:
249260 account_id: Account identifier tag.
250261
262+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
263+ be executed as a batch.
264+
251265 extra_headers: Send extra headers
252266
253267 extra_query: Add additional query parameters to the request
@@ -301,6 +315,9 @@ def raw(
301315 Args:
302316 account_id: Account identifier tag.
303317
318+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
319+ be executed as a batch.
320+
304321 extra_headers: Send extra headers
305322
306323 extra_query: Add additional query parameters to the request
@@ -347,6 +364,7 @@ async def create(
347364 * ,
348365 account_id : str ,
349366 name : str ,
367+ primary_location_hint : Literal ["wnam" , "enam" , "weur" , "eeur" , "apac" , "oc" ] | NotGiven = NOT_GIVEN ,
350368 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
351369 # The extra values given here take precedence over values defined on the client or passed to this method.
352370 extra_headers : Headers | None = None ,
@@ -360,6 +378,9 @@ async def create(
360378 Args:
361379 account_id: Account identifier tag.
362380
381+ primary_location_hint: Specify the region to create the D1 primary, if available. If this option is
382+ omitted, the D1 will be created as close as possible to the current user.
383+
363384 extra_headers: Send extra headers
364385
365386 extra_query: Add additional query parameters to the request
@@ -372,7 +393,13 @@ async def create(
372393 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
373394 return await self ._post (
374395 f"/accounts/{ account_id } /d1/database" ,
375- body = await async_maybe_transform ({"name" : name }, database_create_params .DatabaseCreateParams ),
396+ body = await async_maybe_transform (
397+ {
398+ "name" : name ,
399+ "primary_location_hint" : primary_location_hint ,
400+ },
401+ database_create_params .DatabaseCreateParams ,
402+ ),
376403 options = make_request_options (
377404 extra_headers = extra_headers ,
378405 extra_query = extra_query ,
@@ -548,6 +575,9 @@ async def query(
548575 Args:
549576 account_id: Account identifier tag.
550577
578+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
579+ be executed as a batch.
580+
551581 extra_headers: Send extra headers
552582
553583 extra_query: Add additional query parameters to the request
@@ -601,6 +631,9 @@ async def raw(
601631 Args:
602632 account_id: Account identifier tag.
603633
634+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
635+ be executed as a batch.
636+
604637 extra_headers: Send extra headers
605638
606639 extra_query: Add additional query parameters to the request
0 commit comments