|
30 | 30 | from ..types.connection_create_response import ConnectionCreateResponse |
31 | 31 | from ..types.connection_get_by_id_response import ConnectionGetByIDResponse |
32 | 32 | from ..types.connection_get_by_tags_response import ConnectionGetByTagsResponse |
| 33 | +from ..types.connection_delete_by_id_response import ConnectionDeleteByIDResponse |
33 | 34 | from ..types.connection_list_documents_response import ConnectionListDocumentsResponse |
34 | 35 | from ..types.connection_delete_by_provider_response import ConnectionDeleteByProviderResponse |
35 | 36 |
|
@@ -136,6 +137,39 @@ def list( |
136 | 137 | cast_to=ConnectionListResponse, |
137 | 138 | ) |
138 | 139 |
|
| 140 | + def delete_by_id( |
| 141 | + self, |
| 142 | + connection_id: str, |
| 143 | + *, |
| 144 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 145 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 146 | + extra_headers: Headers | None = None, |
| 147 | + extra_query: Query | None = None, |
| 148 | + extra_body: Body | None = None, |
| 149 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 150 | + ) -> ConnectionDeleteByIDResponse: |
| 151 | + """ |
| 152 | + Delete a specific connection by ID |
| 153 | +
|
| 154 | + Args: |
| 155 | + extra_headers: Send extra headers |
| 156 | +
|
| 157 | + extra_query: Add additional query parameters to the request |
| 158 | +
|
| 159 | + extra_body: Add additional JSON properties to the request |
| 160 | +
|
| 161 | + timeout: Override the client-level default timeout for this request, in seconds |
| 162 | + """ |
| 163 | + if not connection_id: |
| 164 | + raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
| 165 | + return self._delete( |
| 166 | + f"/v3/connections/{connection_id}", |
| 167 | + options=make_request_options( |
| 168 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 169 | + ), |
| 170 | + cast_to=ConnectionDeleteByIDResponse, |
| 171 | + ) |
| 172 | + |
139 | 173 | def delete_by_provider( |
140 | 174 | self, |
141 | 175 | provider: Literal["notion", "google-drive", "onedrive"], |
@@ -428,6 +462,39 @@ async def list( |
428 | 462 | cast_to=ConnectionListResponse, |
429 | 463 | ) |
430 | 464 |
|
| 465 | + async def delete_by_id( |
| 466 | + self, |
| 467 | + connection_id: str, |
| 468 | + *, |
| 469 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 470 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 471 | + extra_headers: Headers | None = None, |
| 472 | + extra_query: Query | None = None, |
| 473 | + extra_body: Body | None = None, |
| 474 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 475 | + ) -> ConnectionDeleteByIDResponse: |
| 476 | + """ |
| 477 | + Delete a specific connection by ID |
| 478 | +
|
| 479 | + Args: |
| 480 | + extra_headers: Send extra headers |
| 481 | +
|
| 482 | + extra_query: Add additional query parameters to the request |
| 483 | +
|
| 484 | + extra_body: Add additional JSON properties to the request |
| 485 | +
|
| 486 | + timeout: Override the client-level default timeout for this request, in seconds |
| 487 | + """ |
| 488 | + if not connection_id: |
| 489 | + raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
| 490 | + return await self._delete( |
| 491 | + f"/v3/connections/{connection_id}", |
| 492 | + options=make_request_options( |
| 493 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 494 | + ), |
| 495 | + cast_to=ConnectionDeleteByIDResponse, |
| 496 | + ) |
| 497 | + |
431 | 498 | async def delete_by_provider( |
432 | 499 | self, |
433 | 500 | provider: Literal["notion", "google-drive", "onedrive"], |
@@ -630,6 +697,9 @@ def __init__(self, connections: ConnectionsResource) -> None: |
630 | 697 | self.list = to_raw_response_wrapper( |
631 | 698 | connections.list, |
632 | 699 | ) |
| 700 | + self.delete_by_id = to_raw_response_wrapper( |
| 701 | + connections.delete_by_id, |
| 702 | + ) |
633 | 703 | self.delete_by_provider = to_raw_response_wrapper( |
634 | 704 | connections.delete_by_provider, |
635 | 705 | ) |
@@ -657,6 +727,9 @@ def __init__(self, connections: AsyncConnectionsResource) -> None: |
657 | 727 | self.list = async_to_raw_response_wrapper( |
658 | 728 | connections.list, |
659 | 729 | ) |
| 730 | + self.delete_by_id = async_to_raw_response_wrapper( |
| 731 | + connections.delete_by_id, |
| 732 | + ) |
660 | 733 | self.delete_by_provider = async_to_raw_response_wrapper( |
661 | 734 | connections.delete_by_provider, |
662 | 735 | ) |
@@ -684,6 +757,9 @@ def __init__(self, connections: ConnectionsResource) -> None: |
684 | 757 | self.list = to_streamed_response_wrapper( |
685 | 758 | connections.list, |
686 | 759 | ) |
| 760 | + self.delete_by_id = to_streamed_response_wrapper( |
| 761 | + connections.delete_by_id, |
| 762 | + ) |
687 | 763 | self.delete_by_provider = to_streamed_response_wrapper( |
688 | 764 | connections.delete_by_provider, |
689 | 765 | ) |
@@ -711,6 +787,9 @@ def __init__(self, connections: AsyncConnectionsResource) -> None: |
711 | 787 | self.list = async_to_streamed_response_wrapper( |
712 | 788 | connections.list, |
713 | 789 | ) |
| 790 | + self.delete_by_id = async_to_streamed_response_wrapper( |
| 791 | + connections.delete_by_id, |
| 792 | + ) |
714 | 793 | self.delete_by_provider = async_to_streamed_response_wrapper( |
715 | 794 | connections.delete_by_provider, |
716 | 795 | ) |
|
0 commit comments