streetview_publish.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. // Copyright 2022 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/longrunning/operations.proto";
  19. import "google/protobuf/empty.proto";
  20. import "google/streetview/publish/v1/resources.proto";
  21. import "google/streetview/publish/v1/rpcmessages.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/streetview/publish/v1;publish";
  23. option java_outer_classname = "StreetViewPublish";
  24. option java_package = "com.google.geo.ugc.streetview.publish.v1";
  25. // Definition of the service that backs the Street View Publish API.
  26. // Publishes and connects user-contributed photos on Street View.
  27. service StreetViewPublishService {
  28. option (google.api.default_host) = "streetviewpublish.googleapis.com";
  29. option (google.api.oauth_scopes) = "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?ref_topic=6275604,
  37. // the photo must meet the following requirements:
  38. //
  39. // * Photo Sphere XMP metadata must be included in the photo metadata. 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?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 the request is malformed or if
  71. // the uploaded photo is not a 360 photo.
  72. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the upload reference does not exist.
  73. // * [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] if the account has reached the
  74. // storage limit.
  75. rpc CreatePhoto(CreatePhotoRequest) returns (Photo) {
  76. option (google.api.http) = {
  77. post: "/v1/photo"
  78. body: "photo"
  79. };
  80. option (google.api.method_signature) = "photo";
  81. }
  82. // Gets the metadata of the specified
  83. // [Photo][google.streetview.publish.v1.Photo].
  84. //
  85. // This method returns the following error codes:
  86. //
  87. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if the requesting user did not
  88. // create the requested [Photo][google.streetview.publish.v1.Photo].
  89. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
  90. // [Photo][google.streetview.publish.v1.Photo] does not exist.
  91. // * [google.rpc.Code.UNAVAILABLE][google.rpc.Code.UNAVAILABLE] if the requested
  92. // [Photo][google.streetview.publish.v1.Photo] is still being indexed.
  93. rpc GetPhoto(GetPhotoRequest) returns (Photo) {
  94. option (google.api.http) = {
  95. get: "/v1/photo/{photo_id}"
  96. };
  97. option (google.api.method_signature) = "photo_id,view";
  98. }
  99. // Gets the metadata of the specified
  100. // [Photo][google.streetview.publish.v1.Photo] batch.
  101. //
  102. // Note that if
  103. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos]
  104. // fails, either critical fields are missing or there is an authentication
  105. // error. Even if
  106. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos]
  107. // succeeds, individual photos in the batch may have failures.
  108. // These failures are specified in each
  109. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  110. // in
  111. // [BatchGetPhotosResponse.results][google.streetview.publish.v1.BatchGetPhotosResponse.results].
  112. // See
  113. // [GetPhoto][google.streetview.publish.v1.StreetViewPublishService.GetPhoto]
  114. // for specific failures that can occur per photo.
  115. rpc BatchGetPhotos(BatchGetPhotosRequest) returns (BatchGetPhotosResponse) {
  116. option (google.api.http) = {
  117. get: "/v1/photos:batchGet"
  118. };
  119. option (google.api.method_signature) = "view,photo_ids";
  120. }
  121. // Lists all the [Photos][google.streetview.publish.v1.Photo] that belong to
  122. // the user.
  123. //
  124. // > Note: Recently created photos that are still
  125. // being indexed are not returned in the response.
  126. rpc ListPhotos(ListPhotosRequest) returns (ListPhotosResponse) {
  127. option (google.api.http) = {
  128. get: "/v1/photos"
  129. };
  130. option (google.api.method_signature) = "view,filter";
  131. }
  132. // Updates the metadata of a [Photo][google.streetview.publish.v1.Photo], such
  133. // as pose, place association, connections, etc. Changing the pixels of a
  134. // photo is not supported.
  135. //
  136. // Only the fields specified in the
  137. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  138. // field are used. If `updateMask` is not present, the update applies to all
  139. // fields.
  140. //
  141. // This method returns the following error codes:
  142. //
  143. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if the requesting user did not
  144. // create the requested photo.
  145. // * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] if the request is malformed.
  146. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested photo does not exist.
  147. // * [google.rpc.Code.UNAVAILABLE][google.rpc.Code.UNAVAILABLE] if the requested
  148. // [Photo][google.streetview.publish.v1.Photo] is still being indexed.
  149. rpc UpdatePhoto(UpdatePhotoRequest) returns (Photo) {
  150. option (google.api.http) = {
  151. put: "/v1/photo/{photo.photo_id.id}"
  152. body: "photo"
  153. };
  154. option (google.api.method_signature) = "photo,update_mask";
  155. }
  156. // Updates the metadata of [Photos][google.streetview.publish.v1.Photo], such
  157. // as pose, place association, connections, etc. Changing the pixels of photos
  158. // is not supported.
  159. //
  160. // Note that if
  161. // [BatchUpdatePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos]
  162. // fails, either critical fields are missing or there is an authentication
  163. // error. Even if
  164. // [BatchUpdatePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos]
  165. // succeeds, individual photos in the batch may have failures.
  166. // These failures are specified in each
  167. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  168. // in
  169. // [BatchUpdatePhotosResponse.results][google.streetview.publish.v1.BatchUpdatePhotosResponse.results].
  170. // See
  171. // [UpdatePhoto][google.streetview.publish.v1.StreetViewPublishService.UpdatePhoto]
  172. // for specific failures that can occur per photo.
  173. //
  174. // Only the fields specified in
  175. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  176. // field are used. If `updateMask` is not present, the update applies to all
  177. // fields.
  178. //
  179. // The number of
  180. // [UpdatePhotoRequest][google.streetview.publish.v1.UpdatePhotoRequest]
  181. // messages in a
  182. // [BatchUpdatePhotosRequest][google.streetview.publish.v1.BatchUpdatePhotosRequest]
  183. // must not exceed 20.
  184. //
  185. // > Note: To update
  186. // [Pose.altitude][google.streetview.publish.v1.Pose.altitude],
  187. // [Pose.latLngPair][google.streetview.publish.v1.Pose.lat_lng_pair] has to be
  188. // filled as well. Otherwise, the request will fail.
  189. rpc BatchUpdatePhotos(BatchUpdatePhotosRequest) returns (BatchUpdatePhotosResponse) {
  190. option (google.api.http) = {
  191. post: "/v1/photos:batchUpdate"
  192. body: "*"
  193. };
  194. option (google.api.method_signature) = "update_photo_requests";
  195. }
  196. // Deletes a [Photo][google.streetview.publish.v1.Photo] and its metadata.
  197. //
  198. // This method returns the following error codes:
  199. //
  200. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if the requesting user did not
  201. // create the requested photo.
  202. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the photo ID does not exist.
  203. rpc DeletePhoto(DeletePhotoRequest) returns (google.protobuf.Empty) {
  204. option (google.api.http) = {
  205. delete: "/v1/photo/{photo_id}"
  206. };
  207. option (google.api.method_signature) = "photo_id";
  208. }
  209. // Deletes a list of [Photos][google.streetview.publish.v1.Photo] and their
  210. // metadata.
  211. //
  212. // Note that if
  213. // [BatchDeletePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchDeletePhotos]
  214. // fails, either critical fields are missing or there is an authentication
  215. // error. Even if
  216. // [BatchDeletePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchDeletePhotos]
  217. // succeeds, individual photos in the batch may have failures.
  218. // These failures are specified in each
  219. // [PhotoResponse.status][google.streetview.publish.v1.PhotoResponse.status]
  220. // in
  221. // [BatchDeletePhotosResponse.results][google.streetview.publish.v1.BatchDeletePhotosResponse.status].
  222. // See
  223. // [DeletePhoto][google.streetview.publish.v1.StreetViewPublishService.DeletePhoto]
  224. // for specific failures that can occur per photo.
  225. rpc BatchDeletePhotos(BatchDeletePhotosRequest) returns (BatchDeletePhotosResponse) {
  226. option (google.api.http) = {
  227. post: "/v1/photos:batchDelete"
  228. body: "*"
  229. };
  230. option (google.api.method_signature) = "photo_ids";
  231. }
  232. // Creates an upload session to start uploading photo sequence data.
  233. // The upload URL of the returned
  234. // [UploadRef][google.streetview.publish.v1.UploadRef] is used to upload the
  235. // data for the `photoSequence`.
  236. //
  237. // After the upload is complete, the
  238. // [UploadRef][google.streetview.publish.v1.UploadRef] is used with
  239. // [CreatePhotoSequence][google.streetview.publish.v1.StreetViewPublishService.CreatePhotoSequence]
  240. // to create the [PhotoSequence][google.streetview.publish.v1.PhotoSequence]
  241. // object entry.
  242. rpc StartPhotoSequenceUpload(google.protobuf.Empty) returns (UploadRef) {
  243. option (google.api.http) = {
  244. post: "/v1/photoSequence:startUpload"
  245. body: "*"
  246. };
  247. }
  248. // After the client finishes uploading the
  249. // [PhotoSequence][google.streetview.publish.v1.PhotoSequence] with the
  250. // returned [UploadRef][google.streetview.publish.v1.UploadRef],
  251. // [CreatePhotoSequence][google.streetview.publish.v1.StreetViewPublishService.CreatePhotoSequence]
  252. // extracts a sequence of 360 photos from a video or Extensible Device
  253. // Metadata (XDM, http://www.xdm.org/) to be published to Street View on
  254. // Google Maps.
  255. //
  256. // `CreatePhotoSequence` returns an [Operation][google.longrunning.Operation],
  257. // with the [PhotoSequence][google.streetview.publish.v1.PhotoSequence] Id set
  258. // in the `Operation.name` field.
  259. //
  260. // This method returns the following error codes:
  261. //
  262. // * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] if the request is malformed.
  263. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the upload reference does not exist.
  264. rpc CreatePhotoSequence(CreatePhotoSequenceRequest) returns (google.longrunning.Operation) {
  265. option (google.api.http) = {
  266. post: "/v1/photoSequence"
  267. body: "photo_sequence"
  268. };
  269. option (google.api.method_signature) = "photo_sequence,input_type";
  270. option (google.longrunning.operation_info) = {
  271. response_type: "PhotoSequence"
  272. metadata_type: "google.protobuf.Empty"
  273. };
  274. }
  275. // Gets the metadata of the specified
  276. // [PhotoSequence][google.streetview.publish.v1.PhotoSequence] via the
  277. // [Operation][google.longrunning.Operation] interface.
  278. //
  279. // This method returns the following three types of responses:
  280. //
  281. // * `Operation.done` = false, if the processing of
  282. // [PhotoSequence][google.streetview.publish.v1.PhotoSequence] is not
  283. // finished yet.
  284. // * `Operation.done` = true and `Operation.error` is populated, if there was
  285. // an error in processing.
  286. // * `Operation.done` = true and `Operation.response` is poulated, which
  287. // contains a [PhotoSequence][google.streetview.publish.v1.PhotoSequence]
  288. // message.
  289. //
  290. // This method returns the following error codes:
  291. //
  292. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if the requesting user did not
  293. // create the requested
  294. // [PhotoSequence][google.streetview.publish.v1.PhotoSequence].
  295. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
  296. // [PhotoSequence][google.streetview.publish.v1.PhotoSequence] does not exist.
  297. rpc GetPhotoSequence(GetPhotoSequenceRequest) returns (google.longrunning.Operation) {
  298. option (google.api.http) = {
  299. get: "/v1/photoSequence/{sequence_id}"
  300. };
  301. option (google.longrunning.operation_info) = {
  302. response_type: "PhotoSequence"
  303. metadata_type: "google.protobuf.Empty"
  304. };
  305. }
  306. // Lists all the [PhotoSequences][google.streetview.publish.v1.PhotoSequence]
  307. // that belong to the user, in descending CreatePhotoSequence timestamp order.
  308. rpc ListPhotoSequences(ListPhotoSequencesRequest) returns (ListPhotoSequencesResponse) {
  309. option (google.api.http) = {
  310. get: "/v1/photoSequences"
  311. };
  312. }
  313. // Deletes a [PhotoSequence][google.streetview.publish.v1.PhotoSequence] and
  314. // its metadata.
  315. //
  316. // This method returns the following error codes:
  317. //
  318. // * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED] if the requesting user did not
  319. // create the requested photo sequence.
  320. // * [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND] if the photo sequence ID does not exist.
  321. // * [google.rpc.Code.FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION] if the photo sequence ID is not
  322. // yet finished processing.
  323. rpc DeletePhotoSequence(DeletePhotoSequenceRequest) returns (google.protobuf.Empty) {
  324. option (google.api.http) = {
  325. delete: "/v1/photoSequence/{sequence_id}"
  326. };
  327. option (google.api.method_signature) = "sequence_id";
  328. }
  329. }