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
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ต้องระบุ ต้องอยู่ในรูปแบบ providers/{provider}/vehicles/{vehicle} {provider} ต้องเป็นรหัสโปรเจ็กต์ (เช่น sample-cloud-project ) ของโปรเจ็กต์ Google Cloud ที่บัญชีบริการที่เรียกใช้นี้เป็นสมาชิก
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
header |
object (RequestHeader )
ส่วนหัวคำขอ Fleet Engine มาตรฐาน
|
updateMask |
string (FieldMask format)
ต้องระบุ มาสก์ของช่องที่ระบุช่องของ Vehicle ที่ต้องอัปเดต ต้องระบุชื่อช่องอย่างน้อย 1 ชื่อ ซึ่งเป็นรายการชื่อของช่องที่มีคุณสมบัติครบถ้วนและคั่นด้วยคอมมา ตัวอย่าง: "user.displayName,photo"
|
เนื้อหาของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ Vehicle
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ Vehicle
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[[["\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,["- [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\nHTTP 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\nPath 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\nQuery 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\nRequest body\n\nThe request body contains an instance of [Vehicle](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle).\n\nResponse body\n\nIf successful, the response body contains an instance of [Vehicle](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.vehicles#Vehicle)."]]