Method: photo.update
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يعدّل البيانات الوصفية لـ Photo
، مثل الوضع وربط المكان والروابط وما إلى ذلك. ولا يمكن تغيير وحدات البكسل في الصورة.
يتم استخدام الحقول المحددة في الحقل updateMask
فقط. في حال عدم توفّر updateMask
، ينطبق التعديل على جميع الحقول.
تعرض هذه الطريقة رموز الخطأ التالية:
طلب HTTP
PUT https://streetviewpublish.googleapis.com/v1/photo/{photo.photoId.id}
يستخدِم عنوان URL بنية تحويل ترميز gRPC.
مَعلمات المسار
المَعلمات |
photo.photoId.id |
string
معرّف فريد للصورة
|
معلمات طلب البحث
المَعلمات |
updateMask |
string (FieldMask format)
مطلوبة. قناع يحدد الحقول في البيانات الوصفية للصورة المطلوب تعديلها. وفي حال عدم توفّر هذه البيانات، يتم استبدال بيانات Photo الوصفية القديمة بالكامل ببيانات وصفية Photo الجديدة في هذا الطلب. يتعذّر التعديل في حال تحديد حقول غير صالحة. يمكن تحديد حقول متعددة في قائمة مفصولة بفواصل. الحقول التالية صالحة:
pose.heading
pose.lat_lng_pair
pose.pitch
pose.roll
pose.level
pose.altitude
connections
places
ملاحظة: عندما يحتوي updateMask على حقول متكرّرة، يتم استبدال مجموعة القيم المتكرّرة بالمحتوى الجديد. على سبيل المثال، إذا كانت السمة updateMask تحتوي على connections وكان الحقل UpdatePhotoRequest.photo.connections فارغًا، ستتم إزالة جميع عمليات الربط.
|
نص الطلب
يحتوي نص الطلب على مثال Photo
.
نص الاستجابة
إذا كانت الاستجابة ناجحة، يحتوي نص الاستجابة على مثال Photo
.
نطاقات التفويض
يجب توفير نطاق OAuth التالي:
https://www.googleapis.com/auth/streetviewpublish
لمزيد من المعلومات، راجِع نظرة عامة على بروتوكول OAuth 2.0.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eUpdates a Photo's metadata, such as pose, connections, and places, but not the image pixels themselves.\u003c/p\u003e\n"],["\u003cp\u003eUses an \u003ccode\u003eupdateMask\u003c/code\u003e to specify which fields to update; if omitted, all fields are updated.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/streetviewpublish\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eReturns the updated Photo object if successful.\u003c/p\u003e\n"],["\u003cp\u003eMay return errors if permissions are lacking, the request is invalid, the Photo doesn't exist, or is still being indexed.\u003c/p\u003e\n"]]],["This describes how to update a photo's metadata using the Street View Publish API. It uses a `PUT` request to a specific URL with a photo ID in the path. The `updateMask` query parameter specifies which metadata fields to modify. The request body contains the new metadata, and the response body returns the updated photo. Key metadata includes pose, connections, and places. Authorization requires a specific OAuth scope. Possible errors include permission, invalid argument, not found, or unavailability.\n"],null,["# Method: photo.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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates the metadata of a [Photo](/streetview/publish/reference/rest/v1/photo#Photo), such as pose, place association, connections, etc. Changing the pixels of a photo is not supported.\n\nOnly the fields specified in the `updateMask` field are used. If `updateMask` is not present, the update applies to all fields.\n\nThis method returns the following error codes:\n\n- [google.rpc.Code.PERMISSION_DENIED](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.PERMISSION_DENIED) if the requesting user did not create the requested photo.\n- [google.rpc.Code.INVALID_ARGUMENT](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT) if the request is malformed.\n- [google.rpc.Code.NOT_FOUND](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.NOT_FOUND) if the requested photo does not exist.\n- [google.rpc.Code.UNAVAILABLE](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.UNAVAILABLE) if the requested [Photo](/streetview/publish/reference/rest/v1/photo#Photo) is still being indexed.\n\n### HTTP request\n\n`PUT https://streetviewpublish.googleapis.com/v1/photo/{photo.photoId.id}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------------|-------------------------------------------|\n| `photo.photoId.id` | `string` A unique identifier for a photo. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Required. Mask that identifies fields on the photo metadata to update. If not present, the old [Photo](/streetview/publish/reference/rest/v1/photo#Photo) metadata is entirely replaced with the new [Photo](/streetview/publish/reference/rest/v1/photo#Photo) metadata in this request. The update fails if invalid fields are specified. Multiple fields can be specified in a comma-delimited list. The following fields are valid: - `pose.heading` - `pose.lat_lng_pair` - `pose.pitch` - `pose.roll` - `pose.level` - `pose.altitude` - `connections` - `places` \u003e Note: When `updateMask` contains repeated fields, the entire set of repeated values get replaced with the new contents. For example, if `updateMask` contains `connections` and `UpdatePhotoRequest.photo.connections` is empty, all connections are removed. |\n\n### Request body\n\nThe request body contains an instance of [Photo](/streetview/publish/reference/rest/v1/photo#Photo).\n\n### Response body\n\nIf successful, the response body contains an instance of [Photo](/streetview/publish/reference/rest/v1/photo#Photo).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/streetviewpublish`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]