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
的執行例項。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-12 (世界標準時間)。
[null,null,["上次更新時間: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."]]],[]]