Method: providers.vehicles.update
将更新后的车辆数据写入 Fleet Engine。
更新 Vehicle
时,以下字段无法更新,因为它们由服务器管理:
currentTrips
availableCapacity
currentRouteSegmentVersion
waypointsVersion
车辆 name
也无法更新。
如果更新 attributes
字段,则车辆的所有属性都会替换为请求中提供的属性。如果您只想更新部分属性,请参阅 vehicles.updateAttributes
方法。同样,waypoints
字段可以更新,但必须包含车辆当前的所有航点,且不包含任何其他航点。
HTTP 请求
PUT https://fleetengine.googleapis.com/v1/{name=providers/*/vehicles/*}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。必须采用 providers/{provider}/vehicles/{vehicle} 格式。{provider} 必须是发出此调用的服务账号所属的 Google Cloud 项目的项目 ID(例如 sample-cloud-project )。
|
查询参数
参数 |
header |
object (RequestHeader )
标准的 Fleet Engine 请求标头。
|
updateMask |
string (FieldMask format)
必需。一个字段掩码,指示要更新的 Vehicle 的哪些字段。必须提供至少一个字段名称。 这是完全限定字段名称的逗号分隔列表。示例:"user.displayName,photo" 。
|
请求正文
请求正文包含一个 Vehicle
实例。
响应正文
如果成功,则响应正文包含一个 Vehicle
实例。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-12。
[null,null,["最后更新时间 (UTC):2024-11-12。"],[[["Updates vehicle data in Fleet Engine, replacing existing data with the provided information."],["Certain fields like `currentTrips`, `availableCapacity`, and `name` cannot be updated using this method."],["When updating `attributes` or `waypoints`, the entire field is replaced; use `vehicles.updateAttributes` for partial attribute updates."],["The request must specify the vehicle's provider and ID, along with a field mask indicating the fields to be updated."],["A successful response returns the updated `Vehicle` object."]]],[]]