rpcmessages.proto 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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/protobuf/field_mask.proto";
  17. import "google/rpc/status.proto";
  18. import "google/streetview/publish/v1/resources.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/streetview/publish/v1;publish";
  20. option java_outer_classname = "StreetViewPublishRpcMessages";
  21. option java_package = "com.google.geo.ugc.streetview.publish.v1";
  22. // Specifies which view of the [Photo][google.streetview.publish.v1.Photo]
  23. // to include in the response.
  24. enum PhotoView {
  25. // Server reponses do not include the download URL for the photo bytes.
  26. // The default value.
  27. BASIC = 0;
  28. // Server responses include the download URL for the photo bytes.
  29. INCLUDE_DOWNLOAD_URL = 1;
  30. }
  31. // Request to create a [Photo][google.streetview.publish.v1.Photo].
  32. message CreatePhotoRequest {
  33. // Required. Photo to create.
  34. Photo photo = 1;
  35. }
  36. // Request to get a [Photo][google.streetview.publish.v1.Photo].
  37. //
  38. // By default
  39. //
  40. // * does not return the download URL for the photo bytes.
  41. //
  42. // Parameters:
  43. //
  44. // * `view` controls if the download URL for the photo bytes is returned.
  45. message GetPhotoRequest {
  46. // Required. ID of the [Photo][google.streetview.publish.v1.Photo].
  47. string photo_id = 1;
  48. // Specifies if a download URL for the photo bytes should be returned in the
  49. // [Photo][google.streetview.publish.v1.Photo] response.
  50. PhotoView view = 2;
  51. // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
  52. // information, see
  53. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  54. // If language_code is unspecified, the user's language preference for Google
  55. // services is used.
  56. string language_code = 3;
  57. }
  58. // Request to get one or more [Photos][google.streetview.publish.v1.Photo].
  59. // By default
  60. //
  61. // * does not return the download URL for the photo bytes.
  62. //
  63. // Parameters:
  64. //
  65. // * `view` controls if the download URL for the photo bytes is returned.
  66. message BatchGetPhotosRequest {
  67. // Required. IDs of the [Photos][google.streetview.publish.v1.Photo]. HTTP GET
  68. // requests require the following syntax for the URL query parameter:
  69. // `photoIds=<id1>&photoIds=<id2>&...`.
  70. repeated string photo_ids = 1;
  71. // Specifies if a download URL for the photo bytes should be returned in the
  72. // Photo response.
  73. PhotoView view = 2;
  74. // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
  75. // information, see
  76. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  77. // If language_code is unspecified, the user's language preference for Google
  78. // services is used.
  79. string language_code = 3;
  80. }
  81. // Response to batch get of [Photos][google.streetview.publish.v1.Photo].
  82. message BatchGetPhotosResponse {
  83. // List of results for each individual
  84. // [Photo][google.streetview.publish.v1.Photo] requested, in the same order as
  85. // the requests in
  86. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos].
  87. repeated PhotoResponse results = 1;
  88. }
  89. // Response payload for a single
  90. // [Photo][google.streetview.publish.v1.Photo]
  91. // in batch operations including
  92. // [BatchGetPhotos][google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos]
  93. // and
  94. // [BatchUpdatePhotos][google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos].
  95. message PhotoResponse {
  96. // The status for the operation to get or update a single photo in the batch
  97. // request.
  98. google.rpc.Status status = 1;
  99. // The [Photo][google.streetview.publish.v1.Photo] resource, if the request
  100. // was successful.
  101. Photo photo = 2;
  102. }
  103. // Request to list all photos that belong to the user sending the request.
  104. //
  105. // By default
  106. //
  107. // * does not return the download URL for the photo bytes.
  108. //
  109. // Parameters:
  110. //
  111. // * `view` controls if the download URL for the photo bytes is returned.
  112. // * `pageSize` determines the maximum number of photos to return.
  113. // * `pageToken` is the next page token value returned from a previous
  114. // [ListPhotos][google.streetview.publish.v1.StreetViewPublishService.ListPhotos]
  115. // request, if any.
  116. // * `filter` allows filtering by a given parameter. 'placeId' is the only
  117. // parameter supported at the moment.
  118. message ListPhotosRequest {
  119. // Specifies if a download URL for the photos bytes should be returned in the
  120. // Photos response.
  121. PhotoView view = 1;
  122. // The maximum number of photos to return.
  123. // `pageSize` must be non-negative. If `pageSize` is zero or is not provided,
  124. // the default page size of 100 is used.
  125. // The number of photos returned in the response may be less than `pageSize`
  126. // if the number of photos that belong to the user is less than `pageSize`.
  127. int32 page_size = 2;
  128. // The
  129. // [nextPageToken][google.streetview.publish.v1.ListPhotosResponse.next_page_token]
  130. // value returned from a previous
  131. // [ListPhotos][google.streetview.publish.v1.StreetViewPublishService.ListPhotos]
  132. // request, if any.
  133. string page_token = 3;
  134. // The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`.
  135. //
  136. // The only filter supported at the moment is `placeId`.
  137. string filter = 4;
  138. // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
  139. // information, see
  140. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  141. // If language_code is unspecified, the user's language preference for Google
  142. // services is used.
  143. string language_code = 5;
  144. }
  145. // Response to list all photos that belong to a user.
  146. message ListPhotosResponse {
  147. // List of photos. The
  148. // [pageSize][google.streetview.publish.v1.ListPhotosRequest.page_size] field
  149. // in the request determines the number of items returned.
  150. repeated Photo photos = 1;
  151. // Token to retrieve the next page of results, or empty if there are no more
  152. // results in the list.
  153. string next_page_token = 2;
  154. }
  155. // Request to update the metadata of a
  156. // [Photo][google.streetview.publish.v1.Photo]. Updating the pixels of a photo
  157. // is not supported.
  158. message UpdatePhotoRequest {
  159. // Required. [Photo][google.streetview.publish.v1.Photo] object containing the
  160. // new metadata.
  161. Photo photo = 1;
  162. // Mask that identifies fields on the photo metadata to update.
  163. // If not present, the old [Photo][google.streetview.publish.v1.Photo]
  164. // metadata is entirely replaced with the
  165. // new [Photo][google.streetview.publish.v1.Photo] metadata in this request.
  166. // The update fails if invalid fields are specified. Multiple fields can be
  167. // specified in a comma-delimited list.
  168. //
  169. // The following fields are valid:
  170. //
  171. // * `pose.heading`
  172. // * `pose.latLngPair`
  173. // * `pose.pitch`
  174. // * `pose.roll`
  175. // * `pose.level`
  176. // * `pose.altitude`
  177. // * `connections`
  178. // * `places`
  179. //
  180. //
  181. // <aside class="note"><b>Note:</b> When
  182. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  183. // contains repeated fields, the entire set of repeated values get replaced
  184. // with the new contents. For example, if
  185. // [updateMask][google.streetview.publish.v1.UpdatePhotoRequest.update_mask]
  186. // contains `connections` and `UpdatePhotoRequest.photo.connections` is empty,
  187. // all connections are removed.</aside>
  188. google.protobuf.FieldMask update_mask = 2;
  189. }
  190. // Request to update the metadata of photos.
  191. // Updating the pixels of photos is not supported.
  192. message BatchUpdatePhotosRequest {
  193. // Required. List of
  194. // [UpdatePhotoRequests][google.streetview.publish.v1.UpdatePhotoRequest].
  195. repeated UpdatePhotoRequest update_photo_requests = 1;
  196. }
  197. // Response to batch update of metadata of one or more
  198. // [Photos][google.streetview.publish.v1.Photo].
  199. message BatchUpdatePhotosResponse {
  200. // List of results for each individual
  201. // [Photo][google.streetview.publish.v1.Photo] updated, in the same order as
  202. // the request.
  203. repeated PhotoResponse results = 1;
  204. }
  205. // Request to delete a [Photo][google.streetview.publish.v1.Photo].
  206. message DeletePhotoRequest {
  207. // Required. ID of the [Photo][google.streetview.publish.v1.Photo].
  208. string photo_id = 1;
  209. }
  210. // Request to delete multiple [Photos][google.streetview.publish.v1.Photo].
  211. message BatchDeletePhotosRequest {
  212. // Required. IDs of the [Photos][google.streetview.publish.v1.Photo]. HTTP
  213. // GET requests require the following syntax for the URL query parameter:
  214. // `photoIds=<id1>&photoIds=<id2>&...`.
  215. repeated string photo_ids = 1;
  216. }
  217. // Response to batch delete of one or more
  218. // [Photos][google.streetview.publish.v1.Photo].
  219. message BatchDeletePhotosResponse {
  220. // The status for the operation to delete a single
  221. // [Photo][google.streetview.publish.v1.Photo] in the batch request.
  222. repeated google.rpc.Status status = 1;
  223. }