Skip to content

Commit b8d1c66

Browse files
chore(api): update composite API spec
1 parent 93e3971 commit b8d1c66

5 files changed

Lines changed: 29 additions & 497 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1875
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bf7dfc2bf9acbcb238f92962ced2695cfd0b801920e211150c0cfdf843fa0e2d.yml
3-
openapi_spec_hash: 0ebeed6e8af5033fea11925351e681aa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a1e1993bc5d83b6cd7ac1033f0f90e5996f2a8cb71b474786d61f99624a1c9c0.yml
3+
openapi_spec_hash: 23c376aefced9ed2d7c6b652b4912d1c
44
config_hash: 4b8075dcc6a5884435b2e16c80fc020f

src/cloudflare/resources/d1/database.py

Lines changed: 1 addition & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Iterable, Optional, cast
5+
from typing import Type, Optional, cast
66
from typing_extensions import Literal, overload
77

88
import httpx
@@ -586,7 +586,6 @@ def import_(
586586
cast_to=cast(Type[DatabaseImportResponse], ResultWrapper[DatabaseImportResponse]),
587587
)
588588

589-
@overload
590589
def query(
591590
self,
592591
database_id: str,
@@ -620,56 +619,6 @@ def query(
620619
621620
timeout: Override the client-level default timeout for this request, in seconds
622621
"""
623-
...
624-
625-
@overload
626-
def query(
627-
self,
628-
database_id: str,
629-
*,
630-
account_id: str,
631-
body: Iterable[database_query_params.MultipleQueriesBody],
632-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
633-
# The extra values given here take precedence over values defined on the client or passed to this method.
634-
extra_headers: Headers | None = None,
635-
extra_query: Query | None = None,
636-
extra_body: Body | None = None,
637-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
638-
) -> SyncSinglePage[QueryResult]:
639-
"""
640-
Returns the query result as an object.
641-
642-
Args:
643-
account_id: Account identifier tag.
644-
645-
database_id: D1 database identifier (UUID).
646-
647-
extra_headers: Send extra headers
648-
649-
extra_query: Add additional query parameters to the request
650-
651-
extra_body: Add additional JSON properties to the request
652-
653-
timeout: Override the client-level default timeout for this request, in seconds
654-
"""
655-
...
656-
657-
@required_args(["account_id", "sql"], ["account_id", "body"])
658-
def query(
659-
self,
660-
database_id: str,
661-
*,
662-
account_id: str,
663-
sql: str | Omit = omit,
664-
params: SequenceNotStr[str] | Omit = omit,
665-
body: Iterable[database_query_params.MultipleQueriesBody] | Omit = omit,
666-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
667-
# The extra values given here take precedence over values defined on the client or passed to this method.
668-
extra_headers: Headers | None = None,
669-
extra_query: Query | None = None,
670-
extra_body: Body | None = None,
671-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
672-
) -> SyncSinglePage[QueryResult]:
673622
if not account_id:
674623
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
675624
if not database_id:
@@ -681,7 +630,6 @@ def query(
681630
{
682631
"sql": sql,
683632
"params": params,
684-
"body": body,
685633
},
686634
database_query_params.DatabaseQueryParams,
687635
),
@@ -692,7 +640,6 @@ def query(
692640
method="post",
693641
)
694642

695-
@overload
696643
def raw(
697644
self,
698645
database_id: str,
@@ -728,58 +675,6 @@ def raw(
728675
729676
timeout: Override the client-level default timeout for this request, in seconds
730677
"""
731-
...
732-
733-
@overload
734-
def raw(
735-
self,
736-
database_id: str,
737-
*,
738-
account_id: str,
739-
body: Iterable[database_raw_params.MultipleQueriesBody],
740-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
741-
# The extra values given here take precedence over values defined on the client or passed to this method.
742-
extra_headers: Headers | None = None,
743-
extra_query: Query | None = None,
744-
extra_body: Body | None = None,
745-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
746-
) -> SyncSinglePage[DatabaseRawResponse]:
747-
"""Returns the query result rows as arrays rather than objects.
748-
749-
This is a
750-
performance-optimized version of the /query endpoint.
751-
752-
Args:
753-
account_id: Account identifier tag.
754-
755-
database_id: D1 database identifier (UUID).
756-
757-
extra_headers: Send extra headers
758-
759-
extra_query: Add additional query parameters to the request
760-
761-
extra_body: Add additional JSON properties to the request
762-
763-
timeout: Override the client-level default timeout for this request, in seconds
764-
"""
765-
...
766-
767-
@required_args(["account_id", "sql"], ["account_id", "body"])
768-
def raw(
769-
self,
770-
database_id: str,
771-
*,
772-
account_id: str,
773-
sql: str | Omit = omit,
774-
params: SequenceNotStr[str] | Omit = omit,
775-
body: Iterable[database_raw_params.MultipleQueriesBody] | Omit = omit,
776-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
777-
# The extra values given here take precedence over values defined on the client or passed to this method.
778-
extra_headers: Headers | None = None,
779-
extra_query: Query | None = None,
780-
extra_body: Body | None = None,
781-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
782-
) -> SyncSinglePage[DatabaseRawResponse]:
783678
if not account_id:
784679
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
785680
if not database_id:
@@ -791,7 +686,6 @@ def raw(
791686
{
792687
"sql": sql,
793688
"params": params,
794-
"body": body,
795689
},
796690
database_raw_params.DatabaseRawParams,
797691
),
@@ -1353,7 +1247,6 @@ async def import_(
13531247
cast_to=cast(Type[DatabaseImportResponse], ResultWrapper[DatabaseImportResponse]),
13541248
)
13551249

1356-
@overload
13571250
def query(
13581251
self,
13591252
database_id: str,
@@ -1387,56 +1280,6 @@ def query(
13871280
13881281
timeout: Override the client-level default timeout for this request, in seconds
13891282
"""
1390-
...
1391-
1392-
@overload
1393-
def query(
1394-
self,
1395-
database_id: str,
1396-
*,
1397-
account_id: str,
1398-
body: Iterable[database_query_params.MultipleQueriesBody],
1399-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1400-
# The extra values given here take precedence over values defined on the client or passed to this method.
1401-
extra_headers: Headers | None = None,
1402-
extra_query: Query | None = None,
1403-
extra_body: Body | None = None,
1404-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1405-
) -> AsyncPaginator[QueryResult, AsyncSinglePage[QueryResult]]:
1406-
"""
1407-
Returns the query result as an object.
1408-
1409-
Args:
1410-
account_id: Account identifier tag.
1411-
1412-
database_id: D1 database identifier (UUID).
1413-
1414-
extra_headers: Send extra headers
1415-
1416-
extra_query: Add additional query parameters to the request
1417-
1418-
extra_body: Add additional JSON properties to the request
1419-
1420-
timeout: Override the client-level default timeout for this request, in seconds
1421-
"""
1422-
...
1423-
1424-
@required_args(["account_id", "sql"], ["account_id", "body"])
1425-
def query(
1426-
self,
1427-
database_id: str,
1428-
*,
1429-
account_id: str,
1430-
sql: str | Omit = omit,
1431-
params: SequenceNotStr[str] | Omit = omit,
1432-
body: Iterable[database_query_params.MultipleQueriesBody] | Omit = omit,
1433-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1434-
# The extra values given here take precedence over values defined on the client or passed to this method.
1435-
extra_headers: Headers | None = None,
1436-
extra_query: Query | None = None,
1437-
extra_body: Body | None = None,
1438-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1439-
) -> AsyncPaginator[QueryResult, AsyncSinglePage[QueryResult]]:
14401283
if not account_id:
14411284
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
14421285
if not database_id:
@@ -1448,7 +1291,6 @@ def query(
14481291
{
14491292
"sql": sql,
14501293
"params": params,
1451-
"body": body,
14521294
},
14531295
database_query_params.DatabaseQueryParams,
14541296
),
@@ -1459,7 +1301,6 @@ def query(
14591301
method="post",
14601302
)
14611303

1462-
@overload
14631304
def raw(
14641305
self,
14651306
database_id: str,
@@ -1495,58 +1336,6 @@ def raw(
14951336
14961337
timeout: Override the client-level default timeout for this request, in seconds
14971338
"""
1498-
...
1499-
1500-
@overload
1501-
def raw(
1502-
self,
1503-
database_id: str,
1504-
*,
1505-
account_id: str,
1506-
body: Iterable[database_raw_params.MultipleQueriesBody],
1507-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1508-
# The extra values given here take precedence over values defined on the client or passed to this method.
1509-
extra_headers: Headers | None = None,
1510-
extra_query: Query | None = None,
1511-
extra_body: Body | None = None,
1512-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1513-
) -> AsyncPaginator[DatabaseRawResponse, AsyncSinglePage[DatabaseRawResponse]]:
1514-
"""Returns the query result rows as arrays rather than objects.
1515-
1516-
This is a
1517-
performance-optimized version of the /query endpoint.
1518-
1519-
Args:
1520-
account_id: Account identifier tag.
1521-
1522-
database_id: D1 database identifier (UUID).
1523-
1524-
extra_headers: Send extra headers
1525-
1526-
extra_query: Add additional query parameters to the request
1527-
1528-
extra_body: Add additional JSON properties to the request
1529-
1530-
timeout: Override the client-level default timeout for this request, in seconds
1531-
"""
1532-
...
1533-
1534-
@required_args(["account_id", "sql"], ["account_id", "body"])
1535-
def raw(
1536-
self,
1537-
database_id: str,
1538-
*,
1539-
account_id: str,
1540-
sql: str | Omit = omit,
1541-
params: SequenceNotStr[str] | Omit = omit,
1542-
body: Iterable[database_raw_params.MultipleQueriesBody] | Omit = omit,
1543-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1544-
# The extra values given here take precedence over values defined on the client or passed to this method.
1545-
extra_headers: Headers | None = None,
1546-
extra_query: Query | None = None,
1547-
extra_body: Body | None = None,
1548-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1549-
) -> AsyncPaginator[DatabaseRawResponse, AsyncSinglePage[DatabaseRawResponse]]:
15501339
if not account_id:
15511340
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
15521341
if not database_id:
@@ -1558,7 +1347,6 @@ def raw(
15581347
{
15591348
"sql": sql,
15601349
"params": params,
1561-
"body": body,
15621350
},
15631351
database_raw_params.DatabaseRawParams,
15641352
),

src/cloudflare/types/d1/database_query_params.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
6-
from typing_extensions import Required, TypeAlias, TypedDict
5+
from typing_extensions import Required, TypedDict
76

87
from ..._types import SequenceNotStr
98

10-
__all__ = ["DatabaseQueryParams", "D1Query", "MultipleQueries", "MultipleQueriesBody"]
9+
__all__ = ["DatabaseQueryParams"]
1110

1211

13-
class D1Query(TypedDict, total=False):
12+
class DatabaseQueryParams(TypedDict, total=False):
1413
account_id: Required[str]
1514
"""Account identifier tag."""
1615

@@ -22,24 +21,3 @@ class D1Query(TypedDict, total=False):
2221
"""
2322

2423
params: SequenceNotStr[str]
25-
26-
27-
class MultipleQueries(TypedDict, total=False):
28-
account_id: Required[str]
29-
"""Account identifier tag."""
30-
31-
body: Required[Iterable[MultipleQueriesBody]]
32-
33-
34-
class MultipleQueriesBody(TypedDict, total=False):
35-
sql: Required[str]
36-
"""Your SQL query.
37-
38-
Supports multiple statements, joined by semicolons, which will be executed as a
39-
batch.
40-
"""
41-
42-
params: SequenceNotStr[str]
43-
44-
45-
DatabaseQueryParams: TypeAlias = Union[D1Query, MultipleQueries]

src/cloudflare/types/d1/database_raw_params.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
6-
from typing_extensions import Required, TypeAlias, TypedDict
5+
from typing_extensions import Required, TypedDict
76

87
from ..._types import SequenceNotStr
98

10-
__all__ = ["DatabaseRawParams", "D1Query", "MultipleQueries", "MultipleQueriesBody"]
9+
__all__ = ["DatabaseRawParams"]
1110

1211

13-
class D1Query(TypedDict, total=False):
12+
class DatabaseRawParams(TypedDict, total=False):
1413
account_id: Required[str]
1514
"""Account identifier tag."""
1615

@@ -22,24 +21,3 @@ class D1Query(TypedDict, total=False):
2221
"""
2322

2423
params: SequenceNotStr[str]
25-
26-
27-
class MultipleQueries(TypedDict, total=False):
28-
account_id: Required[str]
29-
"""Account identifier tag."""
30-
31-
body: Required[Iterable[MultipleQueriesBody]]
32-
33-
34-
class MultipleQueriesBody(TypedDict, total=False):
35-
sql: Required[str]
36-
"""Your SQL query.
37-
38-
Supports multiple statements, joined by semicolons, which will be executed as a
39-
batch.
40-
"""
41-
42-
params: SequenceNotStr[str]
43-
44-
45-
DatabaseRawParams: TypeAlias = Union[D1Query, MultipleQueries]

0 commit comments

Comments
 (0)