Method: providers.vehicles.create
將與隨選共乘或外送服務供應商相關的新車輛例項化。每個 Vehicle
都必須有專屬的車輛 ID。
建立 Vehicle
時,必須填入下列 Vehicle
欄位:
vehicleState
supportedTripTypes
maximumCapacity
vehicleType
建立 Vehicle
時,系統會忽略下列 Vehicle
欄位:
name
currentTrips
availableCapacity
currentRouteSegment
currentRouteSegmentEndPoint
currentRouteSegmentVersion
currentRouteSegmentTraffic
route
waypoints
waypointsVersion
remainingDistanceMeters
remainingTimeSeconds
eta_to_next_waypoint
navigationStatus
所有其他欄位均為選填欄位,如果提供,系統就會使用。
HTTP 要求
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
必要欄位。格式須為 providers/{provider} 。提供者必須是服務帳戶 (發出此呼叫的服務帳戶) 所屬的 Google Cloud 專案專案 ID (例如 sample-cloud-project )。
|
查詢參數
參數 |
header |
object (RequestHeader )
標準 Fleet Engine 要求標頭。
|
vehicleId |
string
必要欄位。不重複的車輛 ID。但須遵守下列限制:
|
回應主體
如果成功,回應主體會包含新建立的 Vehicle
例項。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-08 (世界標準時間)。
[null,null,["上次更新時間:2024-11-08 (世界標準時間)。"],[[["Instantiates a new vehicle associated with an on-demand rideshare or deliveries provider, requiring a unique vehicle ID for each vehicle."],["When creating a `Vehicle`, `vehicleState`, `supportedTripTypes`, `maximumCapacity`, and `vehicleType` fields are required; while fields like `name`, `currentTrips`, `availableCapacity`, and route-related fields are ignored."],["Sends a POST request to `https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles` to create a vehicle, with the provider specified in the path parameter."],["Requires a `header` for the Fleet Engine request and a unique `vehicleId` in the query parameters, adhering to specified restrictions for the `vehicleId` format."],["Includes the `Vehicle` object details in the request body and returns the newly created `Vehicle` object in the response body upon successful creation."]]],[]]