|
22 | 22 | ) |
23 | 23 | from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType |
24 | 24 | from .types.blob_storage_integration_response import BlobStorageIntegrationResponse |
| 25 | +from .types.blob_storage_integration_status_response import ( |
| 26 | + BlobStorageIntegrationStatusResponse, |
| 27 | +) |
25 | 28 | from .types.blob_storage_integration_type import BlobStorageIntegrationType |
26 | 29 | from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse |
27 | 30 |
|
@@ -300,6 +303,106 @@ def upsert_blob_storage_integration( |
300 | 303 | body=_response_json, |
301 | 304 | ) |
302 | 305 |
|
| 306 | + def get_blob_storage_integration_status( |
| 307 | + self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 308 | + ) -> HttpResponse[BlobStorageIntegrationStatusResponse]: |
| 309 | + """ |
| 310 | + Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key) |
| 311 | +
|
| 312 | + Parameters |
| 313 | + ---------- |
| 314 | + id : str |
| 315 | +
|
| 316 | + request_options : typing.Optional[RequestOptions] |
| 317 | + Request-specific configuration. |
| 318 | +
|
| 319 | + Returns |
| 320 | + ------- |
| 321 | + HttpResponse[BlobStorageIntegrationStatusResponse] |
| 322 | + """ |
| 323 | + _response = self._client_wrapper.httpx_client.request( |
| 324 | + f"api/public/integrations/blob-storage/{jsonable_encoder(id)}", |
| 325 | + method="GET", |
| 326 | + request_options=request_options, |
| 327 | + ) |
| 328 | + try: |
| 329 | + if 200 <= _response.status_code < 300: |
| 330 | + _data = typing.cast( |
| 331 | + BlobStorageIntegrationStatusResponse, |
| 332 | + parse_obj_as( |
| 333 | + type_=BlobStorageIntegrationStatusResponse, # type: ignore |
| 334 | + object_=_response.json(), |
| 335 | + ), |
| 336 | + ) |
| 337 | + return HttpResponse(response=_response, data=_data) |
| 338 | + if _response.status_code == 400: |
| 339 | + raise Error( |
| 340 | + headers=dict(_response.headers), |
| 341 | + body=typing.cast( |
| 342 | + typing.Any, |
| 343 | + parse_obj_as( |
| 344 | + type_=typing.Any, # type: ignore |
| 345 | + object_=_response.json(), |
| 346 | + ), |
| 347 | + ), |
| 348 | + ) |
| 349 | + if _response.status_code == 401: |
| 350 | + raise UnauthorizedError( |
| 351 | + headers=dict(_response.headers), |
| 352 | + body=typing.cast( |
| 353 | + typing.Any, |
| 354 | + parse_obj_as( |
| 355 | + type_=typing.Any, # type: ignore |
| 356 | + object_=_response.json(), |
| 357 | + ), |
| 358 | + ), |
| 359 | + ) |
| 360 | + if _response.status_code == 403: |
| 361 | + raise AccessDeniedError( |
| 362 | + headers=dict(_response.headers), |
| 363 | + body=typing.cast( |
| 364 | + typing.Any, |
| 365 | + parse_obj_as( |
| 366 | + type_=typing.Any, # type: ignore |
| 367 | + object_=_response.json(), |
| 368 | + ), |
| 369 | + ), |
| 370 | + ) |
| 371 | + if _response.status_code == 405: |
| 372 | + raise MethodNotAllowedError( |
| 373 | + headers=dict(_response.headers), |
| 374 | + body=typing.cast( |
| 375 | + typing.Any, |
| 376 | + parse_obj_as( |
| 377 | + type_=typing.Any, # type: ignore |
| 378 | + object_=_response.json(), |
| 379 | + ), |
| 380 | + ), |
| 381 | + ) |
| 382 | + if _response.status_code == 404: |
| 383 | + raise NotFoundError( |
| 384 | + headers=dict(_response.headers), |
| 385 | + body=typing.cast( |
| 386 | + typing.Any, |
| 387 | + parse_obj_as( |
| 388 | + type_=typing.Any, # type: ignore |
| 389 | + object_=_response.json(), |
| 390 | + ), |
| 391 | + ), |
| 392 | + ) |
| 393 | + _response_json = _response.json() |
| 394 | + except JSONDecodeError: |
| 395 | + raise ApiError( |
| 396 | + status_code=_response.status_code, |
| 397 | + headers=dict(_response.headers), |
| 398 | + body=_response.text, |
| 399 | + ) |
| 400 | + raise ApiError( |
| 401 | + status_code=_response.status_code, |
| 402 | + headers=dict(_response.headers), |
| 403 | + body=_response_json, |
| 404 | + ) |
| 405 | + |
303 | 406 | def delete_blob_storage_integration( |
304 | 407 | self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
305 | 408 | ) -> HttpResponse[BlobStorageIntegrationDeletionResponse]: |
@@ -672,6 +775,106 @@ async def upsert_blob_storage_integration( |
672 | 775 | body=_response_json, |
673 | 776 | ) |
674 | 777 |
|
| 778 | + async def get_blob_storage_integration_status( |
| 779 | + self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 780 | + ) -> AsyncHttpResponse[BlobStorageIntegrationStatusResponse]: |
| 781 | + """ |
| 782 | + Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key) |
| 783 | +
|
| 784 | + Parameters |
| 785 | + ---------- |
| 786 | + id : str |
| 787 | +
|
| 788 | + request_options : typing.Optional[RequestOptions] |
| 789 | + Request-specific configuration. |
| 790 | +
|
| 791 | + Returns |
| 792 | + ------- |
| 793 | + AsyncHttpResponse[BlobStorageIntegrationStatusResponse] |
| 794 | + """ |
| 795 | + _response = await self._client_wrapper.httpx_client.request( |
| 796 | + f"api/public/integrations/blob-storage/{jsonable_encoder(id)}", |
| 797 | + method="GET", |
| 798 | + request_options=request_options, |
| 799 | + ) |
| 800 | + try: |
| 801 | + if 200 <= _response.status_code < 300: |
| 802 | + _data = typing.cast( |
| 803 | + BlobStorageIntegrationStatusResponse, |
| 804 | + parse_obj_as( |
| 805 | + type_=BlobStorageIntegrationStatusResponse, # type: ignore |
| 806 | + object_=_response.json(), |
| 807 | + ), |
| 808 | + ) |
| 809 | + return AsyncHttpResponse(response=_response, data=_data) |
| 810 | + if _response.status_code == 400: |
| 811 | + raise Error( |
| 812 | + headers=dict(_response.headers), |
| 813 | + body=typing.cast( |
| 814 | + typing.Any, |
| 815 | + parse_obj_as( |
| 816 | + type_=typing.Any, # type: ignore |
| 817 | + object_=_response.json(), |
| 818 | + ), |
| 819 | + ), |
| 820 | + ) |
| 821 | + if _response.status_code == 401: |
| 822 | + raise UnauthorizedError( |
| 823 | + headers=dict(_response.headers), |
| 824 | + body=typing.cast( |
| 825 | + typing.Any, |
| 826 | + parse_obj_as( |
| 827 | + type_=typing.Any, # type: ignore |
| 828 | + object_=_response.json(), |
| 829 | + ), |
| 830 | + ), |
| 831 | + ) |
| 832 | + if _response.status_code == 403: |
| 833 | + raise AccessDeniedError( |
| 834 | + headers=dict(_response.headers), |
| 835 | + body=typing.cast( |
| 836 | + typing.Any, |
| 837 | + parse_obj_as( |
| 838 | + type_=typing.Any, # type: ignore |
| 839 | + object_=_response.json(), |
| 840 | + ), |
| 841 | + ), |
| 842 | + ) |
| 843 | + if _response.status_code == 405: |
| 844 | + raise MethodNotAllowedError( |
| 845 | + headers=dict(_response.headers), |
| 846 | + body=typing.cast( |
| 847 | + typing.Any, |
| 848 | + parse_obj_as( |
| 849 | + type_=typing.Any, # type: ignore |
| 850 | + object_=_response.json(), |
| 851 | + ), |
| 852 | + ), |
| 853 | + ) |
| 854 | + if _response.status_code == 404: |
| 855 | + raise NotFoundError( |
| 856 | + headers=dict(_response.headers), |
| 857 | + body=typing.cast( |
| 858 | + typing.Any, |
| 859 | + parse_obj_as( |
| 860 | + type_=typing.Any, # type: ignore |
| 861 | + object_=_response.json(), |
| 862 | + ), |
| 863 | + ), |
| 864 | + ) |
| 865 | + _response_json = _response.json() |
| 866 | + except JSONDecodeError: |
| 867 | + raise ApiError( |
| 868 | + status_code=_response.status_code, |
| 869 | + headers=dict(_response.headers), |
| 870 | + body=_response.text, |
| 871 | + ) |
| 872 | + raise ApiError( |
| 873 | + status_code=_response.status_code, |
| 874 | + headers=dict(_response.headers), |
| 875 | + body=_response_json, |
| 876 | + ) |
| 877 | + |
675 | 878 | async def delete_blob_storage_integration( |
676 | 879 | self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
677 | 880 | ) -> AsyncHttpResponse[BlobStorageIntegrationDeletionResponse]: |
|
0 commit comments