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。必須遵守下列限制:
- 必須是有效的萬國碼 (Unicode) 字串。
- 長度上限為 64 個半形字元。
- 根據 Unicode 正規化表單 C 進行正規化。
- 不可包含下列 ASCII 字元:/、「:」、「?」、「,」或「#」。
|
回應主體
如果成功,回應主體會包含新建立的 Vehicle
例項。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[[["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."]]],[]]