|
30 | 30 | import httpx |
31 | 31 |
|
32 | 32 | from sap_cloud_sdk.adms._auth import IasTokenFetcher |
33 | | -from sap_cloud_sdk.adms._http import AdmsHttp, AsyncAdmsHttp |
| 33 | +from sap_cloud_sdk.adms._http import AdmsHttp, AsyncAdmsHttp, quote_odata_string_key |
34 | 34 | from sap_cloud_sdk.adms._models import ( |
35 | 35 | AllowedDomain, |
36 | 36 | BusinessObjectNodeType, |
@@ -201,7 +201,7 @@ def get_download_url( |
201 | 201 |
|
202 | 202 | fn_key = ( |
203 | 203 | f"{rel_key}/DownloadDocument(" |
204 | | - f"DocContentVersionID='{doc_content_version_id}')" |
| 204 | + f"DocContentVersionID={quote_odata_string_key(doc_content_version_id)})" |
205 | 205 | ) |
206 | 206 | resp = self._http.get(fn_key, service_base=_SERVICE_PATH) |
207 | 207 | return resp.json().get("value", "") |
@@ -674,7 +674,7 @@ def create_document_type(self, payload: CreateDocumentTypeInput) -> DocumentType |
674 | 674 | def delete_document_type(self, document_type_id: str) -> None: |
675 | 675 | """Delete a document type classification.""" |
676 | 676 | self._http.delete( |
677 | | - f"DocumentType(DocumentTypeID='{document_type_id}')", |
| 677 | + f"DocumentType(DocumentTypeID={quote_odata_string_key(document_type_id)})", |
678 | 678 | service_base=_CONFIG_SERVICE_PATH, |
679 | 679 | ) |
680 | 680 |
|
@@ -720,7 +720,7 @@ def delete_business_object_type( |
720 | 720 | ) -> None: |
721 | 721 | """Delete a business object node type registration.""" |
722 | 722 | self._http.delete( |
723 | | - f"BusinessObjectNodeType(BusinessObjectNodeTypeUniqueID='{business_object_node_type_unique_id}')", |
| 723 | + f"BusinessObjectNodeType(BusinessObjectNodeTypeUniqueID={quote_odata_string_key(business_object_node_type_unique_id)})", |
724 | 724 | service_base=_CONFIG_SERVICE_PATH, |
725 | 725 | ) |
726 | 726 |
|
@@ -839,7 +839,7 @@ def get_status( |
839 | 839 | Current :class:`~sap_cloud_sdk.adms._models.JobOutput`. |
840 | 840 | """ |
841 | 841 | service = _ADMIN_SERVICE_PATH if use_admin_service else _SERVICE_PATH |
842 | | - path = f"JobStatus(JobID='{job_id}')" |
| 842 | + path = f"JobStatus(JobID={quote_odata_string_key(job_id)})" |
843 | 843 | resp = self._http.get(path, service_base=service) |
844 | 844 | return JobOutput.from_dict(resp.json()) |
845 | 845 |
|
@@ -941,7 +941,7 @@ async def get_download_url( |
941 | 941 |
|
942 | 942 | fn_key = ( |
943 | 943 | f"{rel_key}/DownloadDocument(" |
944 | | - f"DocContentVersionID='{doc_content_version_id}')" |
| 944 | + f"DocContentVersionID={quote_odata_string_key(doc_content_version_id)})" |
945 | 945 | ) |
946 | 946 | resp = await self._http.get(fn_key, service_base=_SERVICE_PATH) |
947 | 947 | return resp.json().get("value", "") |
@@ -1316,7 +1316,7 @@ async def create_document_type( |
1316 | 1316 | async def delete_document_type(self, document_type_id: str) -> None: |
1317 | 1317 | """Async variant of :meth:`_ConfigurationApi.delete_document_type` — same semantics.""" |
1318 | 1318 | await self._http.delete( |
1319 | | - f"DocumentType(DocumentTypeID='{document_type_id}')", |
| 1319 | + f"DocumentType(DocumentTypeID={quote_odata_string_key(document_type_id)})", |
1320 | 1320 | service_base=_CONFIG_SERVICE_PATH, |
1321 | 1321 | ) |
1322 | 1322 |
|
@@ -1362,7 +1362,7 @@ async def delete_business_object_type( |
1362 | 1362 | ) -> None: |
1363 | 1363 | """Async variant of :meth:`_ConfigurationApi.delete_business_object_type` — same semantics.""" |
1364 | 1364 | await self._http.delete( |
1365 | | - f"BusinessObjectNodeType(BusinessObjectNodeTypeUniqueID='{business_object_node_type_unique_id}')", |
| 1365 | + f"BusinessObjectNodeType(BusinessObjectNodeTypeUniqueID={quote_odata_string_key(business_object_node_type_unique_id)})", |
1366 | 1366 | service_base=_CONFIG_SERVICE_PATH, |
1367 | 1367 | ) |
1368 | 1368 |
|
@@ -1471,7 +1471,7 @@ async def get_status( |
1471 | 1471 | Current :class:`~sap_cloud_sdk.adms._models.JobOutput`. |
1472 | 1472 | """ |
1473 | 1473 | service = _ADMIN_SERVICE_PATH if use_admin_service else _SERVICE_PATH |
1474 | | - path = f"JobStatus(JobID='{job_id}')" |
| 1474 | + path = f"JobStatus(JobID={quote_odata_string_key(job_id)})" |
1475 | 1475 | resp = await self._http.get(path, service_base=service) |
1476 | 1476 | return JobOutput.from_dict(resp.json()) |
1477 | 1477 |
|
|
0 commit comments