|
20 | 20 | CreateDocumentTypeInput, |
21 | 21 | DocumentType, |
22 | 22 | DocumentTypeBusinessObjectTypeMap, |
| 23 | + UpdateAllowedDomainInput, |
| 24 | + UpdateBusinessObjectNodeTypeInput, |
| 25 | + UpdateDocumentTypeInput, |
23 | 26 | ) |
24 | 27 | from sap_cloud_sdk.adms._query_options import ConfigQueryOptions |
25 | 28 | from sap_cloud_sdk.adms.config import _CONFIG_SERVICE_PATH |
@@ -57,6 +60,27 @@ def create_allowed_domain(self, payload: CreateAllowedDomainInput) -> AllowedDom |
57 | 60 | ) |
58 | 61 | return AllowedDomain.from_dict(resp.json()) |
59 | 62 |
|
| 63 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_ALLOWED_DOMAIN) |
| 64 | + def get_allowed_domain(self, allowed_domain_id: str) -> AllowedDomain: |
| 65 | + """Fetch a single AllowedDomain by its UUID.""" |
| 66 | + resp = self._http.get( |
| 67 | + build_allowed_domain_key_path(allowed_domain_id), |
| 68 | + service_base=_CONFIG_SERVICE_PATH, |
| 69 | + ) |
| 70 | + return AllowedDomain.from_dict(resp.json()) |
| 71 | + |
| 72 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_ALLOWED_DOMAIN) |
| 73 | + def update_allowed_domain( |
| 74 | + self, allowed_domain_id: str, payload: UpdateAllowedDomainInput |
| 75 | + ) -> AllowedDomain: |
| 76 | + """Update an existing AllowedDomain entry (PATCH — only sent fields change).""" |
| 77 | + resp = self._http.patch( |
| 78 | + build_allowed_domain_key_path(allowed_domain_id), |
| 79 | + json=payload.to_odata_dict(), |
| 80 | + service_base=_CONFIG_SERVICE_PATH, |
| 81 | + ) |
| 82 | + return AllowedDomain.from_dict(resp.json()) |
| 83 | + |
60 | 84 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_ALLOWED_DOMAIN) |
61 | 85 | def delete_allowed_domain(self, allowed_domain_id: str) -> None: |
62 | 86 | """Remove an entry from the domain allow-list.""" |
@@ -87,6 +111,27 @@ def create_document_type(self, payload: CreateDocumentTypeInput) -> DocumentType |
87 | 111 | ) |
88 | 112 | return DocumentType.from_dict(resp.json()) |
89 | 113 |
|
| 114 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_DOCUMENT_TYPE) |
| 115 | + def get_document_type(self, document_type_id: str) -> DocumentType: |
| 116 | + """Fetch a single DocumentType by its ID.""" |
| 117 | + resp = self._http.get( |
| 118 | + build_document_type_key_path(document_type_id), |
| 119 | + service_base=_CONFIG_SERVICE_PATH, |
| 120 | + ) |
| 121 | + return DocumentType.from_dict(resp.json()) |
| 122 | + |
| 123 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_DOCUMENT_TYPE) |
| 124 | + def update_document_type( |
| 125 | + self, document_type_id: str, payload: UpdateDocumentTypeInput |
| 126 | + ) -> DocumentType: |
| 127 | + """Update an existing DocumentType (PATCH — only sent fields change).""" |
| 128 | + resp = self._http.patch( |
| 129 | + build_document_type_key_path(document_type_id), |
| 130 | + json=payload.to_odata_dict(), |
| 131 | + service_base=_CONFIG_SERVICE_PATH, |
| 132 | + ) |
| 133 | + return DocumentType.from_dict(resp.json()) |
| 134 | + |
90 | 135 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_DOCUMENT_TYPE) |
91 | 136 | def delete_document_type(self, document_type_id: str) -> None: |
92 | 137 | """Delete a document type classification.""" |
@@ -122,6 +167,35 @@ def create_business_object_type( |
122 | 167 | ) |
123 | 168 | return BusinessObjectNodeType.from_dict(resp.json()) |
124 | 169 |
|
| 170 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_BUSINESS_OBJECT_TYPE) |
| 171 | + def get_business_object_type( |
| 172 | + self, business_object_node_type_unique_id: str |
| 173 | + ) -> BusinessObjectNodeType: |
| 174 | + """Fetch a single BusinessObjectNodeType by its unique ID.""" |
| 175 | + resp = self._http.get( |
| 176 | + build_business_object_node_type_key_path( |
| 177 | + business_object_node_type_unique_id |
| 178 | + ), |
| 179 | + service_base=_CONFIG_SERVICE_PATH, |
| 180 | + ) |
| 181 | + return BusinessObjectNodeType.from_dict(resp.json()) |
| 182 | + |
| 183 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_BUSINESS_OBJECT_TYPE) |
| 184 | + def update_business_object_type( |
| 185 | + self, |
| 186 | + business_object_node_type_unique_id: str, |
| 187 | + payload: UpdateBusinessObjectNodeTypeInput, |
| 188 | + ) -> BusinessObjectNodeType: |
| 189 | + """Update an existing BusinessObjectNodeType (PATCH).""" |
| 190 | + resp = self._http.patch( |
| 191 | + build_business_object_node_type_key_path( |
| 192 | + business_object_node_type_unique_id |
| 193 | + ), |
| 194 | + json=payload.to_odata_dict(), |
| 195 | + service_base=_CONFIG_SERVICE_PATH, |
| 196 | + ) |
| 197 | + return BusinessObjectNodeType.from_dict(resp.json()) |
| 198 | + |
125 | 199 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_BUSINESS_OBJECT_TYPE) |
126 | 200 | def delete_business_object_type( |
127 | 201 | self, business_object_node_type_unique_id: str |
@@ -163,6 +237,17 @@ def create_type_mapping( |
163 | 237 | ) |
164 | 238 | return DocumentTypeBusinessObjectTypeMap.from_dict(resp.json()) |
165 | 239 |
|
| 240 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_DOCTYPE_BOTYPE_MAP) |
| 241 | + def get_type_mapping( |
| 242 | + self, document_type_bo_type_map_id: str |
| 243 | + ) -> DocumentTypeBusinessObjectTypeMap: |
| 244 | + """Fetch a single DocumentType ↔ BusinessObjectNodeType mapping by its UUID.""" |
| 245 | + resp = self._http.get( |
| 246 | + build_doctype_botype_map_key_path(document_type_bo_type_map_id), |
| 247 | + service_base=_CONFIG_SERVICE_PATH, |
| 248 | + ) |
| 249 | + return DocumentTypeBusinessObjectTypeMap.from_dict(resp.json()) |
| 250 | + |
166 | 251 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_DOCTYPE_BOTYPE_MAP) |
167 | 252 | def delete_type_mapping(self, document_type_bo_type_map_id: str) -> None: |
168 | 253 | """Delete a DocumentType ↔ BusinessObjectNodeType mapping.""" |
@@ -205,6 +290,27 @@ async def create_allowed_domain( |
205 | 290 | ) |
206 | 291 | return AllowedDomain.from_dict(resp.json()) |
207 | 292 |
|
| 293 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_ALLOWED_DOMAIN) |
| 294 | + async def get_allowed_domain(self, allowed_domain_id: str) -> AllowedDomain: |
| 295 | + """Async variant of :meth:`_ConfigurationApi.get_allowed_domain` — same semantics.""" |
| 296 | + resp = await self._http.get( |
| 297 | + build_allowed_domain_key_path(allowed_domain_id), |
| 298 | + service_base=_CONFIG_SERVICE_PATH, |
| 299 | + ) |
| 300 | + return AllowedDomain.from_dict(resp.json()) |
| 301 | + |
| 302 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_ALLOWED_DOMAIN) |
| 303 | + async def update_allowed_domain( |
| 304 | + self, allowed_domain_id: str, payload: UpdateAllowedDomainInput |
| 305 | + ) -> AllowedDomain: |
| 306 | + """Async variant of :meth:`_ConfigurationApi.update_allowed_domain` — same semantics.""" |
| 307 | + resp = await self._http.patch( |
| 308 | + build_allowed_domain_key_path(allowed_domain_id), |
| 309 | + json=payload.to_odata_dict(), |
| 310 | + service_base=_CONFIG_SERVICE_PATH, |
| 311 | + ) |
| 312 | + return AllowedDomain.from_dict(resp.json()) |
| 313 | + |
208 | 314 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_ALLOWED_DOMAIN) |
209 | 315 | async def delete_allowed_domain(self, allowed_domain_id: str) -> None: |
210 | 316 | """Async variant of :meth:`_ConfigurationApi.delete_allowed_domain` — same semantics.""" |
@@ -237,6 +343,27 @@ async def create_document_type( |
237 | 343 | ) |
238 | 344 | return DocumentType.from_dict(resp.json()) |
239 | 345 |
|
| 346 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_DOCUMENT_TYPE) |
| 347 | + async def get_document_type(self, document_type_id: str) -> DocumentType: |
| 348 | + """Async variant of :meth:`_ConfigurationApi.get_document_type` — same semantics.""" |
| 349 | + resp = await self._http.get( |
| 350 | + build_document_type_key_path(document_type_id), |
| 351 | + service_base=_CONFIG_SERVICE_PATH, |
| 352 | + ) |
| 353 | + return DocumentType.from_dict(resp.json()) |
| 354 | + |
| 355 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_DOCUMENT_TYPE) |
| 356 | + async def update_document_type( |
| 357 | + self, document_type_id: str, payload: UpdateDocumentTypeInput |
| 358 | + ) -> DocumentType: |
| 359 | + """Async variant of :meth:`_ConfigurationApi.update_document_type` — same semantics.""" |
| 360 | + resp = await self._http.patch( |
| 361 | + build_document_type_key_path(document_type_id), |
| 362 | + json=payload.to_odata_dict(), |
| 363 | + service_base=_CONFIG_SERVICE_PATH, |
| 364 | + ) |
| 365 | + return DocumentType.from_dict(resp.json()) |
| 366 | + |
240 | 367 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_DOCUMENT_TYPE) |
241 | 368 | async def delete_document_type(self, document_type_id: str) -> None: |
242 | 369 | """Async variant of :meth:`_ConfigurationApi.delete_document_type` — same semantics.""" |
@@ -272,6 +399,35 @@ async def create_business_object_type( |
272 | 399 | ) |
273 | 400 | return BusinessObjectNodeType.from_dict(resp.json()) |
274 | 401 |
|
| 402 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_BUSINESS_OBJECT_TYPE) |
| 403 | + async def get_business_object_type( |
| 404 | + self, business_object_node_type_unique_id: str |
| 405 | + ) -> BusinessObjectNodeType: |
| 406 | + """Async variant of :meth:`_ConfigurationApi.get_business_object_type` — same semantics.""" |
| 407 | + resp = await self._http.get( |
| 408 | + build_business_object_node_type_key_path( |
| 409 | + business_object_node_type_unique_id |
| 410 | + ), |
| 411 | + service_base=_CONFIG_SERVICE_PATH, |
| 412 | + ) |
| 413 | + return BusinessObjectNodeType.from_dict(resp.json()) |
| 414 | + |
| 415 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_UPDATE_BUSINESS_OBJECT_TYPE) |
| 416 | + async def update_business_object_type( |
| 417 | + self, |
| 418 | + business_object_node_type_unique_id: str, |
| 419 | + payload: UpdateBusinessObjectNodeTypeInput, |
| 420 | + ) -> BusinessObjectNodeType: |
| 421 | + """Async variant of :meth:`_ConfigurationApi.update_business_object_type` — same semantics.""" |
| 422 | + resp = await self._http.patch( |
| 423 | + build_business_object_node_type_key_path( |
| 424 | + business_object_node_type_unique_id |
| 425 | + ), |
| 426 | + json=payload.to_odata_dict(), |
| 427 | + service_base=_CONFIG_SERVICE_PATH, |
| 428 | + ) |
| 429 | + return BusinessObjectNodeType.from_dict(resp.json()) |
| 430 | + |
275 | 431 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_BUSINESS_OBJECT_TYPE) |
276 | 432 | async def delete_business_object_type( |
277 | 433 | self, business_object_node_type_unique_id: str |
@@ -313,6 +469,17 @@ async def create_type_mapping( |
313 | 469 | ) |
314 | 470 | return DocumentTypeBusinessObjectTypeMap.from_dict(resp.json()) |
315 | 471 |
|
| 472 | + @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_GET_DOCTYPE_BOTYPE_MAP) |
| 473 | + async def get_type_mapping( |
| 474 | + self, document_type_bo_type_map_id: str |
| 475 | + ) -> DocumentTypeBusinessObjectTypeMap: |
| 476 | + """Async variant of :meth:`_ConfigurationApi.get_type_mapping` — same semantics.""" |
| 477 | + resp = await self._http.get( |
| 478 | + build_doctype_botype_map_key_path(document_type_bo_type_map_id), |
| 479 | + service_base=_CONFIG_SERVICE_PATH, |
| 480 | + ) |
| 481 | + return DocumentTypeBusinessObjectTypeMap.from_dict(resp.json()) |
| 482 | + |
316 | 483 | @record_metrics(Module.ADMS, Operation.ADMS_CONFIG_DELETE_DOCTYPE_BOTYPE_MAP) |
317 | 484 | async def delete_type_mapping(self, document_type_bo_type_map_id: str) -> None: |
318 | 485 | """Async variant of :meth:`_ConfigurationApi.delete_type_mapping` — same semantics.""" |
|
0 commit comments