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/*}
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
مولفه های |
---|
name | string ضروری. باید در قالب providers/{provider}/vehicles/{vehicle} باشد. {provider} باید شناسه پروژه (به عنوان مثال، sample-cloud-project ) پروژه Google Cloud باشد که حساب سرویسی که این تماس را برقرار می کند، عضو آن است. |
پارامترهای پرس و جو
مولفه های |
---|
header | object ( RequestHeader ) هدر درخواست استاندارد Fleet Engine. |
updateMask | string ( FieldMask format) ضروری. یک ماسک فیلد که نشان میدهد کدام قسمتهای Vehicle باید بهروزرسانی شود. حداقل یک نام فیلد باید ارائه شود. این فهرستی از نامهای فیلدهای کاملاً واجد شرایط با کاما است. مثال: "user.displayName,photo" . |
درخواست بدن
بدنه درخواست شامل نمونه ای از Vehicle
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از Vehicle
است.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eUpdates vehicle data in Fleet Engine, replacing existing data with the provided information.\u003c/p\u003e\n"],["\u003cp\u003eCertain fields like \u003ccode\u003ecurrentTrips\u003c/code\u003e, \u003ccode\u003eavailableCapacity\u003c/code\u003e, and \u003ccode\u003ename\u003c/code\u003e cannot be updated using this method.\u003c/p\u003e\n"],["\u003cp\u003eWhen updating \u003ccode\u003eattributes\u003c/code\u003e or \u003ccode\u003ewaypoints\u003c/code\u003e, the entire field is replaced; use \u003ccode\u003evehicles.updateAttributes\u003c/code\u003e for partial attribute updates.\u003c/p\u003e\n"],["\u003cp\u003eThe request must specify the vehicle's provider and ID, along with a field mask indicating the fields to be updated.\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns the updated \u003ccode\u003eVehicle\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Method: providers.vehicles.update\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n\nWrites updated vehicle data to the Fleet Engine.\n\nWhen updating a `Vehicle`, the following fields cannot be updated since they are managed by the server:\n\n- `currentTrips`\n- `availableCapacity`\n- `currentRouteSegmentVersion`\n- `waypointsVersion`\n\nThe vehicle `name` also cannot be updated.\n\nIf the `attributes` field is updated, **all** the vehicle's attributes are replaced with the attributes provided in the request. If you want to update only some attributes, see the `vehicles.updateAttributes` method. Likewise, the `waypoints` field can be updated, but must contain all the waypoints currently on the vehicle, and no other waypoints.\n\n### HTTP request\n\n`PUT https://fleetengine.googleapis.com/v1/{name=providers/*/vehicles/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`. The {provider} must be the Project ID (for example, `sample-cloud-project`) of the Google Cloud Project of which the service account making this call is a member. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `header` | `object (`[RequestHeader](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/RequestHeader)`)` The standard Fleet Engine request header. |\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. A field mask indicating which fields of the `Vehicle` to update. At least one field name must be provided. This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n\n### Request body\n\nThe request body contains an instance of [Vehicle](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle).\n\n### Response body\n\nIf successful, the response body contains an instance of [Vehicle](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle)."]]