diff --git a/getstream/common/rest_client.py b/getstream/common/rest_client.py index 39bbd1e..f081636 100644 --- a/getstream/common/rest_client.py +++ b/getstream/common/rest_client.py @@ -240,6 +240,88 @@ def export_users(self, user_ids: List[str]) -> StreamResponse[ExportUsersRespons return self.post("/api/v2/export/users", ExportUsersResponse, json=json) + def list_external_storage(self) -> StreamResponse[ListExternalStorageResponse]: + return self.get("/api/v2/external_storage", ListExternalStorageResponse) + + def create_external_storage( + self, + bucket: str, + name: str, + storage_type: str, + gcs_credentials: Optional[str] = None, + path: Optional[str] = None, + aws_s3: Optional[S3Request] = None, + azure_blob: Optional[AzureRequest] = None, + ) -> StreamResponse[CreateExternalStorageResponse]: + json = build_body_dict( + bucket=bucket, + name=name, + storage_type=storage_type, + gcs_credentials=gcs_credentials, + path=path, + aws_s3=aws_s3, + azure_blob=azure_blob, + ) + + return self.post( + "/api/v2/external_storage", CreateExternalStorageResponse, json=json + ) + + def delete_external_storage( + self, name: str + ) -> StreamResponse[DeleteExternalStorageResponse]: + path_params = { + "name": name, + } + + return self.delete( + "/api/v2/external_storage/{name}", + DeleteExternalStorageResponse, + path_params=path_params, + ) + + def update_external_storage( + self, + name: str, + bucket: str, + storage_type: str, + gcs_credentials: Optional[str] = None, + path: Optional[str] = None, + aws_s3: Optional[S3Request] = None, + azure_blob: Optional[AzureRequest] = None, + ) -> StreamResponse[UpdateExternalStorageResponse]: + path_params = { + "name": name, + } + json = build_body_dict( + bucket=bucket, + storage_type=storage_type, + gcs_credentials=gcs_credentials, + path=path, + aws_s3=aws_s3, + azure_blob=azure_blob, + ) + + return self.put( + "/api/v2/external_storage/{name}", + UpdateExternalStorageResponse, + path_params=path_params, + json=json, + ) + + def check_external_storage( + self, name: str + ) -> StreamResponse[CheckExternalStorageResponse]: + path_params = { + "name": name, + } + + return self.get( + "/api/v2/external_storage/{name}/check", + CheckExternalStorageResponse, + path_params=path_params, + ) + def create_guest(self, user: UserRequest) -> StreamResponse[CreateGuestResponse]: json = build_body_dict(user=user) diff --git a/getstream/video/rest_client.py b/getstream/video/rest_client.py index 7838eb7..a9046f6 100644 --- a/getstream/video/rest_client.py +++ b/getstream/video/rest_client.py @@ -615,85 +615,3 @@ def update_call_type( def get_edges(self) -> StreamResponse[GetEdgesResponse]: return self.get("/api/v2/video/edges", GetEdgesResponse) - - def list_external_storage(self) -> StreamResponse[ListExternalStorageResponse]: - return self.get("/api/v2/video/external_storage", ListExternalStorageResponse) - - def create_external_storage( - self, - bucket: str, - name: str, - storage_type: str, - gcs_credentials: Optional[str] = None, - path: Optional[str] = None, - aws_s3: Optional[S3Request] = None, - azure_blob: Optional[AzureRequest] = None, - ) -> StreamResponse[CreateExternalStorageResponse]: - json = build_body_dict( - bucket=bucket, - name=name, - storage_type=storage_type, - gcs_credentials=gcs_credentials, - path=path, - aws_s3=aws_s3, - azure_blob=azure_blob, - ) - - return self.post( - "/api/v2/video/external_storage", CreateExternalStorageResponse, json=json - ) - - def delete_external_storage( - self, name: str - ) -> StreamResponse[DeleteExternalStorageResponse]: - path_params = { - "name": name, - } - - return self.delete( - "/api/v2/video/external_storage/{name}", - DeleteExternalStorageResponse, - path_params=path_params, - ) - - def update_external_storage( - self, - name: str, - bucket: str, - storage_type: str, - gcs_credentials: Optional[str] = None, - path: Optional[str] = None, - aws_s3: Optional[S3Request] = None, - azure_blob: Optional[AzureRequest] = None, - ) -> StreamResponse[UpdateExternalStorageResponse]: - path_params = { - "name": name, - } - json = build_body_dict( - bucket=bucket, - storage_type=storage_type, - gcs_credentials=gcs_credentials, - path=path, - aws_s3=aws_s3, - azure_blob=azure_blob, - ) - - return self.put( - "/api/v2/video/external_storage/{name}", - UpdateExternalStorageResponse, - path_params=path_params, - json=json, - ) - - def check_external_storage( - self, name: str - ) -> StreamResponse[CheckExternalStorageResponse]: - path_params = { - "name": name, - } - - return self.get( - "/api/v2/video/external_storage/{name}/check", - CheckExternalStorageResponse, - path_params=path_params, - )