Skip to content

Commit 24fcaa9

Browse files
feat(api): api update (#2645)
1 parent 1278a59 commit 24fcaa9

File tree

5 files changed

+130
-6
lines changed

5 files changed

+130
-6
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1707
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be6e76cbd3107968355eb2201def84211f0db684c96538904a871f8da9d0f992.yml
3-
openapi_spec_hash: b96b6fb0e5b4dcfeacff17e803b1088d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3e03f71406670e2384aa5c3bf2bea707a896e4957b4ec5f9427182fbaa0f85b4.yml
3+
openapi_spec_hash: 40d67d20dcbb7925f96d686d41ad2916
44
config_hash: e30b863eac83985d5919f958f3cd8993

src/cloudflare/types/d1/d1.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22

33
from typing import Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from ..._models import BaseModel
78

8-
__all__ = ["D1"]
9+
__all__ = ["D1", "ReadReplication"]
10+
11+
12+
class ReadReplication(BaseModel):
13+
mode: Literal["auto", "disabled"]
14+
"""The read replication mode for the database.
15+
16+
Use 'auto' to create replicas and allow D1 automatically place them around the
17+
world, or 'disabled' to not use any database replicas (it can take a few hours
18+
for all replicas to be deleted).
19+
"""
920

1021

1122
class D1(BaseModel):
@@ -20,6 +31,9 @@ class D1(BaseModel):
2031

2132
num_tables: Optional[float] = None
2233

34+
read_replication: Optional[ReadReplication] = None
35+
"""Configuration for D1 read replication."""
36+
2337
uuid: Optional[str] = None
2438
"""D1 database identifier (UUID)."""
2539

src/cloudflare/types/d1/database_import_response.py

+37-1
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,59 @@
55

66
from ..._models import BaseModel
77

8-
__all__ = ["DatabaseImportResponse", "Result", "ResultMeta"]
8+
__all__ = ["DatabaseImportResponse", "Result", "ResultMeta", "ResultMetaTimings"]
9+
10+
11+
class ResultMetaTimings(BaseModel):
12+
sql_duration_ms: Optional[float] = None
13+
"""The duration of the SQL query execution inside the database.
14+
15+
Does not include any network communication.
16+
"""
917

1018

1119
class ResultMeta(BaseModel):
1220
changed_db: Optional[bool] = None
21+
"""Denotes if the database has been altered in some way, like deleting rows."""
1322

1423
changes: Optional[float] = None
24+
"""
25+
Rough indication of how many rows were modified by the query, as provided by
26+
SQLite's `sqlite3_total_changes()`.
27+
"""
1528

1629
duration: Optional[float] = None
30+
"""The duration of the SQL query execution inside the database.
31+
32+
Does not include any network communication.
33+
"""
1734

1835
last_row_id: Optional[float] = None
36+
"""
37+
The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
38+
provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
39+
"""
1940

2041
rows_read: Optional[float] = None
42+
"""
43+
Number of rows read during the SQL query execution, including indices (not all
44+
rows are necessarily returned).
45+
"""
2146

2247
rows_written: Optional[float] = None
48+
"""Number of rows written during the SQL query execution, including indices."""
49+
50+
served_by_primary: Optional[bool] = None
51+
"""Denotes if the query has been handled by the database primary instance."""
52+
53+
served_by_region: Optional[Literal["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]] = None
54+
"""Region location hint of the database instance that handled the query."""
2355

2456
size_after: Optional[float] = None
57+
"""Size of the database after the query committed, in bytes."""
58+
59+
timings: Optional[ResultMetaTimings] = None
60+
"""Various durations for the query."""
2561

2662

2763
class Result(BaseModel):

src/cloudflare/types/d1/database_raw_response.py

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,63 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Union, Optional
4+
from typing_extensions import Literal
45

56
from ..._models import BaseModel
67

7-
__all__ = ["DatabaseRawResponse", "Meta", "Results"]
8+
__all__ = ["DatabaseRawResponse", "Meta", "MetaTimings", "Results"]
9+
10+
11+
class MetaTimings(BaseModel):
12+
sql_duration_ms: Optional[float] = None
13+
"""The duration of the SQL query execution inside the database.
14+
15+
Does not include any network communication.
16+
"""
817

918

1019
class Meta(BaseModel):
1120
changed_db: Optional[bool] = None
21+
"""Denotes if the database has been altered in some way, like deleting rows."""
1222

1323
changes: Optional[float] = None
24+
"""
25+
Rough indication of how many rows were modified by the query, as provided by
26+
SQLite's `sqlite3_total_changes()`.
27+
"""
1428

1529
duration: Optional[float] = None
30+
"""The duration of the SQL query execution inside the database.
31+
32+
Does not include any network communication.
33+
"""
1634

1735
last_row_id: Optional[float] = None
36+
"""
37+
The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
38+
provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
39+
"""
1840

1941
rows_read: Optional[float] = None
42+
"""
43+
Number of rows read during the SQL query execution, including indices (not all
44+
rows are necessarily returned).
45+
"""
2046

2147
rows_written: Optional[float] = None
48+
"""Number of rows written during the SQL query execution, including indices."""
49+
50+
served_by_primary: Optional[bool] = None
51+
"""Denotes if the query has been handled by the database primary instance."""
52+
53+
served_by_region: Optional[Literal["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]] = None
54+
"""Region location hint of the database instance that handled the query."""
2255

2356
size_after: Optional[float] = None
57+
"""Size of the database after the query committed, in bytes."""
58+
59+
timings: Optional[MetaTimings] = None
60+
"""Various durations for the query."""
2461

2562

2663
class Results(BaseModel):

src/cloudflare/types/d1/query_result.py

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,63 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Optional
4+
from typing_extensions import Literal
45

56
from ..._models import BaseModel
67

7-
__all__ = ["QueryResult", "Meta"]
8+
__all__ = ["QueryResult", "Meta", "MetaTimings"]
9+
10+
11+
class MetaTimings(BaseModel):
12+
sql_duration_ms: Optional[float] = None
13+
"""The duration of the SQL query execution inside the database.
14+
15+
Does not include any network communication.
16+
"""
817

918

1019
class Meta(BaseModel):
1120
changed_db: Optional[bool] = None
21+
"""Denotes if the database has been altered in some way, like deleting rows."""
1222

1323
changes: Optional[float] = None
24+
"""
25+
Rough indication of how many rows were modified by the query, as provided by
26+
SQLite's `sqlite3_total_changes()`.
27+
"""
1428

1529
duration: Optional[float] = None
30+
"""The duration of the SQL query execution inside the database.
31+
32+
Does not include any network communication.
33+
"""
1634

1735
last_row_id: Optional[float] = None
36+
"""
37+
The row ID of the last inserted row in a table with an `INTEGER PRIMARY KEY` as
38+
provided by SQLite. Tables created with `WITHOUT ROWID` do not populate this.
39+
"""
1840

1941
rows_read: Optional[float] = None
42+
"""
43+
Number of rows read during the SQL query execution, including indices (not all
44+
rows are necessarily returned).
45+
"""
2046

2147
rows_written: Optional[float] = None
48+
"""Number of rows written during the SQL query execution, including indices."""
49+
50+
served_by_primary: Optional[bool] = None
51+
"""Denotes if the query has been handled by the database primary instance."""
52+
53+
served_by_region: Optional[Literal["WNAM", "ENAM", "WEUR", "EEUR", "APAC", "OC"]] = None
54+
"""Region location hint of the database instance that handled the query."""
2255

2356
size_after: Optional[float] = None
57+
"""Size of the database after the query committed, in bytes."""
58+
59+
timings: Optional[MetaTimings] = None
60+
"""Various durations for the query."""
2461

2562

2663
class QueryResult(BaseModel):

0 commit comments

Comments
 (0)