Method: providers.vehicles.list
返回与请求选项匹配且与提供商相关联的车辆的分页列表。
HTTP 请求
GET https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。必须采用 providers/{provider} 格式。提供程序必须是发出此调用的服务账号所属的 Google Cloud 项目的项目 ID(例如 sample-cloud-project )。
|
查询参数
参数 |
header |
object (RequestHeader )
标准的 Fleet Engine 请求标头。
|
pageSize |
integer
要返回的车辆数量上限。默认值:100。
|
pageToken |
string
上次调用 vehicles.list 提供的 nextPageToken 的值,以便您按页浏览车辆组。如果请求的过滤条件与上次调用 vehicles.list 的过滤条件不同,则此值为未定义。
|
minimumCapacity |
integer
指定车辆所需的最小载客量。返回的所有车辆的 maximumCapacity 都将大于或等于此值。如果设置,必须大于或等于 0。
|
tripTypes[] |
enum (TripType )
将响应限制为至少支持一种指定行程类型的车辆。
|
maximumStaleness |
string (Duration format)
将响应限制为在指定时长内向 Fleet Engine 发送位置信息更新的车辆。仍在传输位置信息的静态车辆不会被视为已过时。如果存在,必须为有效的正时长。 该时长以秒为单位,最多包含九个小数位,以“s ”结尾。示例:"3.5s" 。
|
vehicleTypeCategories[] |
enum (Category )
必需。将响应限制为与指定类型类别之一相符的车辆。不允许UNKNOWN 。
|
requiredAttributes[] |
string
调用方可以使用 requiredAttributes 、requiredOneOfAttributes 和 requiredOneOfAttributeSets 字段的任意组合来构成复杂的逻辑运算。 requiredAttributes 是一个列表;requiredOneOfAttributes 使用允许列出列表的消息。结合使用这两个字段可组合此表达式:
(requiredAttributes[0] AND requiredAttributes[1] AND ...)
AND
(requiredOneOfAttributes[0][0] OR requiredOneOfAttributes[0][1] OR
...)
AND
(requiredOneOfAttributes[1][0] OR requiredOneOfAttributes[1][1] OR
...)
将响应限制为具有指定属性的车辆。此字段是结合/AND 运算。最多允许 50 个 requiredAttributes。这与车辆允许的属性数量上限一致。每个重复的字符串都应采用“key:value”格式。
|
requiredOneOfAttributes[] |
string
将响应限制为包含每个 VehicleAttributeList 中至少一个指定属性的车辆。在每个列表中,车辆必须至少与其中一个属性匹配。此字段是每个 VehicleAttributeList 中的包含性析取/或运算,也是 VehicleAttributeList 集合中的联接/与运算。每个重复字符串应采用“key1:value1|key2:value2|key3:value3”格式。
|
requiredOneOfAttributeSets[] |
string
requiredOneOfAttributeSets 提供其他功能。
与 requiredOneOfAttributes 类似,requiredOneOfAttributeSets 使用允许列表列表的消息,允许使用如下表达式:
(requiredAttributes[0] AND requiredAttributes[1] AND ...)
AND
(
(requiredOneOfAttributeSets[0][0] AND
requiredOneOfAttributeSets[0][1] AND
...)
OR
(requiredOneOfAttributeSets[1][0] AND
requiredOneOfAttributeSets[1][1] AND
...)
)
将响应限制为与 VehicleAttributeList 中的所有属性都匹配的车辆。在每个列表中,车辆必须与所有属性匹配。此字段是每个 VehicleAttributeList 中的合取/AND 运算,也是 VehicleAttributeList 集合中的包含析取/或运算。每个重复的字符串都应采用以下格式:"key1:value1|key2:value2|key3:value3"。
|
vehicleState |
enum (VehicleState )
将响应限制为具有此车辆状态的车辆。
|
onTripOnly |
boolean
仅归还当前行程的车辆。
|
filter |
string
可选。列出车辆时要应用的过滤查询。如需查看过滤器语法示例,请访问 http://aip.dev/160。 此字段旨在替换 requiredAttributes 、requiredOneOfAttributes 和 required_one_of_attributes_sets 字段。如果在此处指定了非空值,则以下字段必须为空:requiredAttributes 、requiredOneOfAttributes 和 required_one_of_attributes_sets 。 此过滤条件充当具有其他约束条件(例如 vehicleState 或 onTripOnly )的 AND 子句。 请注意,仅支持针对车辆属性(例如 attributes.<key> = <value> 或 attributes.<key1> = <value1> AND
attributes.<key2> = <value2> )的查询。过滤条件查询中允许的限制数量上限为 50 个。 此外,所有属性均存储为字符串,因此唯一支持的属性比较是字符串比较。若要与数字或布尔值进行比较,必须明确用英文引号将这些值括起来,才能被视为字符串(例如 attributes.<key> = "10" 或 attributes.<key> = "true" )。
|
viewport |
object (Viewport )
可选。一个过滤条件,用于将返回的车辆限制为最近一次已知位置位于视口定义的矩形区域内的车辆。
|
响应正文
vehicles.list
响应消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"vehicles": [
{
object (Vehicle )
}
],
"nextPageToken": string,
"totalSize": string
} |
字段 |
vehicles[] |
object (Vehicle )
与请求中条件匹配的车辆。返回的最大车辆数由请求中的 pageSize 字段确定。
|
nextPageToken |
string
用于检索下一页车辆的令牌。如果不再有符合请求条件的车辆,则为空。
|
totalSize |
string (int64 format)
必需。所有网页中与请求条件匹配的车辆的总数。
|
视口
纬度-经度视口,表示为两个对角的 low
和 high
点。视口被视为封闭区域,即包含其边界。纬度边界必须介于 -90 度和 90 度(包括这两个数值)之间,经度边界必须介于 -180 度和 180 度(包括这两个数值)之间。各种情况包括:
如果 low
= high
,则视口由该单个点组成。
如果 low.longitude
> high.longitude
,则反转经度范围(视口与 180 度经度线相交)。
如果 low.longitude
= -180 度且 high.longitude
= 180 度,则视口包含所有经度。
如果 low.longitude
= 180 度且 high.longitude
= -180 度,则经度范围为空。
如果 low.latitude
> high.latitude
,则纬度范围为空。
必须填充 low
和 high
,并且表示的框不能为空(如上文定义所述)。视口为空会导致错误。
例如,以下视口将纽约市完全包围:
{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }
JSON 表示法 |
{
"low": {
object (LatLng )
},
"high": {
object (LatLng )
}
} |
字段 |
low |
object (LatLng )
必需。视口的低点。
|
high |
object (LatLng )
必需。视口的高点。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-06。
[null,null,["最后更新时间 (UTC):2024-11-06。"],[[["Retrieves a paginated list of vehicles associated with a provider, filtered by various criteria such as capacity, trip types, vehicle state, and attributes."],["Allows filtering by a specified geographic viewport, ensuring vehicles are within a defined rectangular area."],["Supports complex logical operations for filtering based on vehicle attributes, allowing for flexible and specific vehicle selection."],["Returns vehicle details including current state, supported trip types, and attributes, along with pagination information for accessing subsequent result pages."],["Requires specifying the provider (Project ID) in the request path and accepts an optional request header for standard Fleet Engine requests."]]],["This document details how to retrieve a paginated list of vehicles via a `GET` HTTP request to `https://fleetengine.googleapis.com/v1/{parent=providers/*}/vehicles`. The `parent` path parameter is required, defining the provider. Query parameters can filter results by: header, page size/token, minimum capacity, trip types, maximum staleness, vehicle type categories, attributes, state, current trips, and a filter. Optionally, a viewport parameter limits results to vehicles within a geographic area. The empty request body will return a response body that includes a list of vehicles, a next page token, and the total size of vehicles.\n"]]