streetview_publish.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. // Copyright 2019 Google LLC.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.streetview.publish.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/protobuf/empty.proto";
  19. import "google/streetview/publish/v1/resources.proto";
  20. import "google/streetview/publish/v1/rpcmessages.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/streetview/publish/v1;publish";
  22. option java_outer_classname = "StreetViewPublish";
  23. option java_package = "com.google.geo.ugc.streetview.publish.v1";
  24. // Definition of the service that backs the Street View Publish API.
  25. // Publishes and connects user-contributed photos on Street View.
  26. service StreetViewPublishService {
  27. option (google.api.default_host) = "streetviewpublish.googleapis.com";
  28. option (google.api.oauth_scopes) =
  29. "https://www.googleapis.com/auth/streetviewpublish";
  30. // Creates an upload session to start uploading photo bytes. The method uses
  31. // the upload URL of the returned
  32. // [UploadRef][google.streetview.publish.v1.UploadRef] to upload the bytes for
  33. // the [Photo][google.streetview.publish.v1.Photo].
  34. //
  35. // In addition to the photo requirements shown in
  36. // https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604,
  37. // the photo must meet the following requirements:
  38. //
  39. // * Photo Sphere XMP metadata must be included in the photo medadata. See
  40. // https://developers.google.com/streetview/spherical-metadata for the
  41. // required fields.
  42. // * The pixel size of the photo must meet the size requirements listed in
  43. // https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and
  44. // the photo must be a full 360 horizontally.
  45. //
  46. // After the upload completes, the method uses
  47. // [UploadRef][google.streetview.publish.v1.UploadRef] with
  48. // [CreatePhoto][google.streetview.publish.v1.StreetViewPublishService.CreatePhoto]
  49. // to create the [Photo][google.streetview.publish.v1.Photo] object entry.
  50. rpc StartUpload(google.protobuf.Empty) returns (UploadRef) {
  51. option (google.api.http) = {
  52. post: "/v1/photo:startUpload"
  53. body: "*"
  54. };
  55. }
  56. // After the client finishes uploading the photo with the returned
  57. // [UploadRef][google.streetview.publish.v1.UploadRef],
  58. // [CreatePhoto][google.streetview.publish.v1.StreetViewPublishService.CreatePhoto]
  59. // publishes the uploaded [Photo][google.streetview.publish.v1.Photo] to
  60. // Street View on Google Maps.
  61. //
  62. // Currently, the only way to set heading, pitch, and roll in CreatePhoto is
  63. // through the [Photo Sphere XMP
  64. // metadata](https://developers.google.com/streetview/spherical-metadata) in
  65. // the photo bytes. CreatePhoto ignores the `pose.heading`, `pose.pitch`,
  66. // `pose.roll`, `pose.altitude`, and `pose.level` fields in Pose.
  67. //
  68. // This method returns the following error codes:
  69. //
  70. // * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] if
  71. // the request is malformed or if the uploaded photo is not a 360 photo.
  72. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the upload
  73. // reference does not exist.
  74. // * [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]
  75. // if the account has reached the storage limit.
  76. rpc CreatePhoto(CreatePhotoRequest) returns (Photo) {
  77. option (google.api.http) = {
  78. post: "/v1/photo"
  79. body: "photo"
  80. };
  81. option (google.api.method_signature) = "photo";
  82. }
  83. // Gets the metadata of the specified
  84. // [Photo][google.streetview.publish.v1.Photo].
  85. //
  86. // This method returns the following error codes:
  87. //
  88. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if
  89. // the requesting user did not create the requested
  90. // [Photo][google.streetview.publish.v1.Photo].
  91. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
  92. // [Photo][google.streetview.publish.v1.Photo] does not exist.
  93. // * [google.rpc.Code.UNAVAILABLE][google.rpc.Code.UNAVAILABLE] if the
  94. // requested [Photo][google.streetview.publish.v1.Photo] is still being
  95. // indexed.
  96. rpc GetPhoto(GetPhotoRequest) returns (Photo) {
  97. option (google.api.http) = {
  98. get: "/v1/photo/{photo_id}"
  99. };
  100. option (google.api.method_signature) = "photo_id,view";
  101. }
  102. // Gets the metadata of the specified
  103. // [Photo][google.streetview.publish.v1.Photo] batch.
  104. //
  105. // Note that if
  106. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos]
  107. // fails, either critical fields are missing or there is an authentication
  108. // error. Even if
  109. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos]
  110. // succeeds, individual photos in the batch may have failures.
  111. // These failures are specified in each
  112. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  113. // in
  114. // [BatchGetPhotosResponse.results][google.streetview.publish.v1.BatchGetPhotosResponse.results].
  115. // See
  116. // [GetPhoto][google.streetview.publish.v1.StreetViewPublishService.GetPhoto]
  117. // for specific failures that can occur per photo.
  118. rpc BatchGetPhotos(BatchGetPhotosRequest) returns (BatchGetPhotosResponse) {
  119. option (google.api.http) = {
  120. get: "/v1/photos:batchGet"
  121. };
  122. option (google.api.method_signature) = "photo_ids,view";
  123. }
  124. // Lists all the [Photos][google.streetview.publish.v1.Photo] that belong to
  125. // the user.
  126. //
  127. // <aside class="note"><b>Note:</b> Recently created photos that are still
  128. // being indexed are not returned in the response.</aside>
  129. rpc ListPhotos(ListPhotosRequest) returns (ListPhotosResponse) {
  130. option (google.api.http) = {
  131. get: "/v1/photos"
  132. };
  133. option (google.api.method_signature) = "view,filter";
  134. }
  135. // Updates the metadata of a [Photo][google.streetview.publish.v1.Photo], such
  136. // as pose, place association, connections, etc. Changing the pixels of a
  137. // photo is not supported.
  138. //
  139. // Only the fields specified in the
  140. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  141. // field are used. If `updateMask` is not present, the update applies to all
  142. // fields.
  143. //
  144. // This method returns the following error codes:
  145. //
  146. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if
  147. // the requesting user did not create the requested photo.
  148. // * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] if
  149. // the request is malformed.
  150. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
  151. // photo does not exist.
  152. // * [google.rpc.Code.UNAVAILABLE][google.rpc.Code.UNAVAILABLE] if the
  153. // requested [Photo][google.streetview.publish.v1.Photo] is still being
  154. // indexed.
  155. rpc UpdatePhoto(UpdatePhotoRequest) returns (Photo) {
  156. option (google.api.http) = {
  157. put: "/v1/photo/{photo.photo_id.id}"
  158. body: "photo"
  159. };
  160. option (google.api.method_signature) = "photo,update_mask";
  161. }
  162. // Updates the metadata of [Photos][google.streetview.publish.v1.Photo], such
  163. // as pose, place association, connections, etc. Changing the pixels of photos
  164. // is not supported.
  165. //
  166. // Note that if
  167. // [BatchUpdatePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos]
  168. // fails, either critical fields are missing or there is an authentication
  169. // error. Even if
  170. // [BatchUpdatePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos]
  171. // succeeds, individual photos in the batch may have failures.
  172. // These failures are specified in each
  173. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  174. // in
  175. // [BatchUpdatePhotosResponse.results][google.streetview.publish.v1.BatchUpdatePhotosResponse.results].
  176. // See
  177. // [UpdatePhoto][google.streetview.publish.v1.StreetViewPublishService.UpdatePhoto]
  178. // for specific failures that can occur per photo.
  179. //
  180. // Only the fields specified in
  181. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  182. // field are used. If `updateMask` is not present, the update applies to all
  183. // fields.
  184. //
  185. // The number of
  186. // [UpdatePhotoRequest][google.streetview.publish.v1.UpdatePhotoRequest]
  187. // messages in a
  188. // [BatchUpdatePhotosRequest][google.streetview.publish.v1.BatchUpdatePhotosRequest]
  189. // must not exceed 20.
  190. //
  191. // <aside class="note"><b>Note:</b> To update
  192. // [Pose.altitude][google.streetview.publish.v1.Pose.altitude],
  193. // [Pose.latLngPair][google.streetview.publish.v1.Pose.lat_lng_pair] has to be
  194. // filled as well. Otherwise, the request will fail.</aside>
  195. rpc BatchUpdatePhotos(BatchUpdatePhotosRequest)
  196. returns (BatchUpdatePhotosResponse) {
  197. option (google.api.http) = {
  198. post: "/v1/photos:batchUpdate"
  199. body: "*"
  200. };
  201. option (google.api.method_signature) = "update_photo_requests";
  202. }
  203. // Deletes a [Photo][google.streetview.publish.v1.Photo] and its metadata.
  204. //
  205. // This method returns the following error codes:
  206. //
  207. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if
  208. // the requesting user did not create the requested photo.
  209. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the photo ID
  210. // does not exist.
  211. rpc DeletePhoto(DeletePhotoRequest) returns (google.protobuf.Empty) {
  212. option (google.api.http) = {
  213. delete: "/v1/photo/{photo_id}"
  214. };
  215. option (google.api.method_signature) = "photo_id";
  216. }
  217. // Deletes a list of [Photos][google.streetview.publish.v1.Photo] and their
  218. // metadata.
  219. //
  220. // Note that if
  221. // [BatchDeletePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchDeletePhotos]
  222. // fails, either critical fields are missing or there was an authentication
  223. // error. Even if
  224. // [BatchDeletePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchDeletePhotos]
  225. // succeeds, individual photos in the batch may have failures.
  226. // These failures are specified in each
  227. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  228. // in
  229. // [BatchDeletePhotosResponse.results][google.streetview.publish.v1.BatchDeletePhotosResponse.status].
  230. // See
  231. // [DeletePhoto][google.streetview.publish.v1.StreetViewPublishService.DeletePhoto]
  232. // for specific failures that can occur per photo.
  233. rpc BatchDeletePhotos(BatchDeletePhotosRequest)
  234. returns (BatchDeletePhotosResponse) {
  235. option (google.api.http) = {
  236. post: "/v1/photos:batchDelete"
  237. body: "*"
  238. };
  239. option (google.api.method_signature) = "photo_ids";
  240. }
  241. }