Copies the asset from sourceId into destinationId. Args: sourceId: The ID of the asset to copy. destinationId: The ID of the new asset created by copying. allowOverwrite: If True, allows overwriting an existing asset.
(
sourceId: str,
destinationId: str,
allowOverwrite: bool = False
)
| 1532 | |
| 1533 | |
| 1534 | def copyAsset( |
| 1535 | sourceId: str, |
| 1536 | destinationId: str, |
| 1537 | allowOverwrite: bool = False |
| 1538 | ) -> None: |
| 1539 | """Copies the asset from sourceId into destinationId. |
| 1540 | |
| 1541 | Args: |
| 1542 | sourceId: The ID of the asset to copy. |
| 1543 | destinationId: The ID of the new asset created by copying. |
| 1544 | allowOverwrite: If True, allows overwriting an existing asset. |
| 1545 | """ |
| 1546 | request = { |
| 1547 | 'destinationName': |
| 1548 | _cloud_api_utils.convert_asset_id_to_asset_name(destinationId), |
| 1549 | 'overwrite': |
| 1550 | allowOverwrite |
| 1551 | } |
| 1552 | name = _cloud_api_utils.convert_asset_id_to_asset_name(sourceId) |
| 1553 | _execute_cloud_call( |
| 1554 | _get_cloud_projects().assets().copy(sourceName=name, body=request) |
| 1555 | ) |
| 1556 | |
| 1557 | |
| 1558 | def renameAsset(sourceId: str, destinationId: str) -> None: |
nothing calls this directly
no test coverage detected