|
7 | 7 |
|
8 | 8 | import httpx |
9 | 9 |
|
10 | | -from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given |
11 | | -from ..._utils import required_args, maybe_transform, async_maybe_transform |
12 | | -from ..._compat import cached_property |
13 | | -from ...types.d1 import ( |
| 10 | +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given |
| 11 | +from ...._utils import required_args, maybe_transform, async_maybe_transform |
| 12 | +from ...._compat import cached_property |
| 13 | +from ....types.d1 import ( |
14 | 14 | database_raw_params, |
15 | 15 | database_edit_params, |
16 | 16 | database_list_params, |
|
20 | 20 | database_import_params, |
21 | 21 | database_update_params, |
22 | 22 | ) |
23 | | -from ..._resource import SyncAPIResource, AsyncAPIResource |
24 | | -from ..._response import ( |
| 23 | +from .time_travel import ( |
| 24 | + TimeTravelResource, |
| 25 | + AsyncTimeTravelResource, |
| 26 | + TimeTravelResourceWithRawResponse, |
| 27 | + AsyncTimeTravelResourceWithRawResponse, |
| 28 | + TimeTravelResourceWithStreamingResponse, |
| 29 | + AsyncTimeTravelResourceWithStreamingResponse, |
| 30 | +) |
| 31 | +from ...._resource import SyncAPIResource, AsyncAPIResource |
| 32 | +from ...._response import ( |
25 | 33 | to_raw_response_wrapper, |
26 | 34 | to_streamed_response_wrapper, |
27 | 35 | async_to_raw_response_wrapper, |
28 | 36 | async_to_streamed_response_wrapper, |
29 | 37 | ) |
30 | | -from ..._wrappers import ResultWrapper |
31 | | -from ...pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray |
32 | | -from ...types.d1.d1 import D1 |
33 | | -from ..._base_client import AsyncPaginator, make_request_options |
34 | | -from ...types.d1.query_result import QueryResult |
35 | | -from ...types.d1.database_raw_response import DatabaseRawResponse |
36 | | -from ...types.d1.database_list_response import DatabaseListResponse |
37 | | -from ...types.d1.database_export_response import DatabaseExportResponse |
38 | | -from ...types.d1.database_import_response import DatabaseImportResponse |
| 38 | +from ...._wrappers import ResultWrapper |
| 39 | +from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray |
| 40 | +from ....types.d1.d1 import D1 |
| 41 | +from ...._base_client import AsyncPaginator, make_request_options |
| 42 | +from ....types.d1.query_result import QueryResult |
| 43 | +from ....types.d1.database_raw_response import DatabaseRawResponse |
| 44 | +from ....types.d1.database_list_response import DatabaseListResponse |
| 45 | +from ....types.d1.database_export_response import DatabaseExportResponse |
| 46 | +from ....types.d1.database_import_response import DatabaseImportResponse |
39 | 47 |
|
40 | 48 | __all__ = ["DatabaseResource", "AsyncDatabaseResource"] |
41 | 49 |
|
42 | 50 |
|
43 | 51 | class DatabaseResource(SyncAPIResource): |
| 52 | + @cached_property |
| 53 | + def time_travel(self) -> TimeTravelResource: |
| 54 | + return TimeTravelResource(self._client) |
| 55 | + |
44 | 56 | @cached_property |
45 | 57 | def with_raw_response(self) -> DatabaseResourceWithRawResponse: |
46 | 58 | """ |
@@ -809,6 +821,10 @@ def raw( |
809 | 821 |
|
810 | 822 |
|
811 | 823 | class AsyncDatabaseResource(AsyncAPIResource): |
| 824 | + @cached_property |
| 825 | + def time_travel(self) -> AsyncTimeTravelResource: |
| 826 | + return AsyncTimeTravelResource(self._client) |
| 827 | + |
812 | 828 | @cached_property |
813 | 829 | def with_raw_response(self) -> AsyncDatabaseResourceWithRawResponse: |
814 | 830 | """ |
@@ -1615,6 +1631,10 @@ def __init__(self, database: DatabaseResource) -> None: |
1615 | 1631 | database.raw, |
1616 | 1632 | ) |
1617 | 1633 |
|
| 1634 | + @cached_property |
| 1635 | + def time_travel(self) -> TimeTravelResourceWithRawResponse: |
| 1636 | + return TimeTravelResourceWithRawResponse(self._database.time_travel) |
| 1637 | + |
1618 | 1638 |
|
1619 | 1639 | class AsyncDatabaseResourceWithRawResponse: |
1620 | 1640 | def __init__(self, database: AsyncDatabaseResource) -> None: |
@@ -1651,6 +1671,10 @@ def __init__(self, database: AsyncDatabaseResource) -> None: |
1651 | 1671 | database.raw, |
1652 | 1672 | ) |
1653 | 1673 |
|
| 1674 | + @cached_property |
| 1675 | + def time_travel(self) -> AsyncTimeTravelResourceWithRawResponse: |
| 1676 | + return AsyncTimeTravelResourceWithRawResponse(self._database.time_travel) |
| 1677 | + |
1654 | 1678 |
|
1655 | 1679 | class DatabaseResourceWithStreamingResponse: |
1656 | 1680 | def __init__(self, database: DatabaseResource) -> None: |
@@ -1687,6 +1711,10 @@ def __init__(self, database: DatabaseResource) -> None: |
1687 | 1711 | database.raw, |
1688 | 1712 | ) |
1689 | 1713 |
|
| 1714 | + @cached_property |
| 1715 | + def time_travel(self) -> TimeTravelResourceWithStreamingResponse: |
| 1716 | + return TimeTravelResourceWithStreamingResponse(self._database.time_travel) |
| 1717 | + |
1690 | 1718 |
|
1691 | 1719 | class AsyncDatabaseResourceWithStreamingResponse: |
1692 | 1720 | def __init__(self, database: AsyncDatabaseResource) -> None: |
@@ -1722,3 +1750,7 @@ def __init__(self, database: AsyncDatabaseResource) -> None: |
1722 | 1750 | self.raw = async_to_streamed_response_wrapper( |
1723 | 1751 | database.raw, |
1724 | 1752 | ) |
| 1753 | + |
| 1754 | + @cached_property |
| 1755 | + def time_travel(self) -> AsyncTimeTravelResourceWithStreamingResponse: |
| 1756 | + return AsyncTimeTravelResourceWithStreamingResponse(self._database.time_travel) |
0 commit comments