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 ),进行此调用的服务账号所属的 Google Cloud 项目所属的项目。
|
查询参数
参数 |
header |
object (RequestHeader )
标准 Fleet Engine 请求标头。
|
vehicleId |
string
必需。唯一车辆 ID。需遵循以下限制:
- 必须是有效的 Unicode 字符串。
- 长度上限为 64 个字符。
- 根据 Unicode 标准化形式 C 进行标准化。
- 不得包含以下任何 ASCII 字符:“/”“:”“?”“,”或“#”。
|
请求正文
请求正文包含一个 Vehicle
实例。
响应正文
如果成功,响应正文将包含一个新创建的 Vehicle
实例。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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."]]],[]]