Skip to content

Commit

Permalink
rebuild paths to match newer pattern for ext providers
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli committed May 10, 2024
1 parent cc6142f commit 8f1341c
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 82 deletions.
82 changes: 82 additions & 0 deletions getstream/common/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
82 changes: 0 additions & 82 deletions getstream/video/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit 8f1341c

Please sign in to comment.