MCPcopy
hub / github.com/google/earthengine-api / updateAsset

Function updateAsset

python/ee/data.py:2202–2225  ·  view source on GitHub ↗

Updates an asset. Args: asset_id: The ID of the asset to update. asset: The updated version of the asset, containing only the new values of the fields to be updated. Only the "start_time", "end_time", and "properties" fields can be updated. If a value is named in "update_mask"

(asset_id: str, asset: Any, update_mask: Sequence[str])

Source from the content-addressed store, hash-verified

2200
2201
2202def updateAsset(asset_id: str, asset: Any, update_mask: Sequence[str]) -> None:
2203 """Updates an asset.
2204
2205 Args:
2206 asset_id: The ID of the asset to update.
2207 asset: The updated version of the asset, containing only the new values of
2208 the fields to be updated. Only the "start_time", "end_time", and
2209 "properties" fields can be updated. If a value is named in "update_mask",
2210 but is unset in "asset", then that value will be deleted from the asset.
2211 update_mask: A list of the values to update. This should contain the strings
2212 "start_time" or "end_time" to update the corresponding timestamp. If
2213 a property is to be updated or deleted, it should be named here as
2214 "properties.THAT_PROPERTY_NAME". If the entire property set is to be
2215 replaced, this should contain the string "properties". If this list is
2216 empty, all properties and both timestamps will be updated.
2217 """
2218 name = _cloud_api_utils.convert_asset_id_to_asset_name(asset_id)
2219 _execute_cloud_call(
2220 _get_cloud_projects()
2221 .assets()
2222 .patch(
2223 name=name, body={'updateMask': {'paths': update_mask}, 'asset': asset}
2224 )
2225 )
2226
2227
2228def createAssetHome(requestedId: str) -> None:

Callers 1

setAssetPropertiesFunction · 0.85

Calls 3

_execute_cloud_callFunction · 0.85
_get_cloud_projectsFunction · 0.85
assetsMethod · 0.80

Tested by

no test coverage detected