playablelocations.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // Copyright 2020 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.maps.playablelocations.v3;
  16. import "google/api/annotations.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/maps/playablelocations/v3/resources.proto";
  19. import "google/maps/playablelocations/v3/sample/resources.proto";
  20. import "google/maps/unity/clientinfo.proto";
  21. import "google/protobuf/duration.proto";
  22. import "google/api/client.proto";
  23. option csharp_namespace = "Google.Maps.PlayableLocations.V3";
  24. option go_package = "google.golang.org/genproto/googleapis/maps/playablelocations/v3;playablelocations";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "PlayableLocationsProto";
  27. option java_package = "com.google.maps.playablelocations.v3";
  28. option php_namespace = "Google\\Maps\\PlayableLocations\\V3";
  29. option objc_class_prefix = "GMPL";
  30. // The Playable Locations API for v3.
  31. service PlayableLocations {
  32. option (google.api.default_host) = "playablelocations.googleapis.com";
  33. // Returns a set of playable locations that lie within a specified area,
  34. // that satisfy optional filter criteria.
  35. //
  36. // Note: Identical `SamplePlayableLocations` requests can return different
  37. // results as the state of the world changes over time.
  38. rpc SamplePlayableLocations(SamplePlayableLocationsRequest)
  39. returns (SamplePlayableLocationsResponse) {
  40. option (google.api.http) = {
  41. post: "/v3:samplePlayableLocations"
  42. body: "*"
  43. };
  44. }
  45. // Logs bad playable location reports submitted by players.
  46. //
  47. // Reports are not partially saved; either all reports are saved and this
  48. // request succeeds, or no reports are saved, and this request fails.
  49. rpc LogPlayerReports(LogPlayerReportsRequest)
  50. returns (LogPlayerReportsResponse) {
  51. option (google.api.http) = {
  52. post: "/v3:logPlayerReports"
  53. body: "*"
  54. };
  55. }
  56. // Logs new events when playable locations are displayed, and when they are
  57. // interacted with.
  58. //
  59. // Impressions are not partially saved; either all impressions are saved and
  60. // this request succeeds, or no impressions are saved, and this request fails.
  61. rpc LogImpressions(LogImpressionsRequest) returns (LogImpressionsResponse) {
  62. option (google.api.http) = {
  63. post: "/v3:logImpressions"
  64. body: "*"
  65. };
  66. }
  67. }
  68. //
  69. // Life of a query:
  70. //
  71. // - When a game starts in a new location, your game server issues a
  72. // [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations]
  73. // request. The request specifies the S2 cell, and contains one or more
  74. // "criteria" for filtering:
  75. //
  76. // - Criterion 0: i locations for long-lived bases, or level 0 monsters, or...
  77. // - Criterion 1: j locations for short-lived bases, or level 1 monsters, ...
  78. // - Criterion 2: k locations for random objects.
  79. // - etc (up to 5 criterion may be specified).
  80. //
  81. // `PlayableLocationList` will then contain mutually
  82. // exclusive lists of `PlayableLocation` objects that satisfy each of
  83. // the criteria. Think of it as a collection of real-world locations that you
  84. // can then associate with your game state.
  85. //
  86. // Note: These points are impermanent in nature. E.g, parks can close, and
  87. // places can be removed.
  88. //
  89. // The response specifies how long you can expect the playable locations to
  90. // last. Once they expire, you should query the `samplePlayableLocations` API
  91. // again to get a fresh view of the real world.
  92. message SamplePlayableLocationsRequest {
  93. // Required. Specifies the area to search within for playable locations.
  94. google.maps.playablelocations.v3.sample.AreaFilter area_filter = 1
  95. [(google.api.field_behavior) = REQUIRED];
  96. // Required. Specifies one or more (up to 5) criteria for filtering the
  97. // returned playable locations.
  98. repeated google.maps.playablelocations.v3.sample.Criterion criteria = 2
  99. [(google.api.field_behavior) = REQUIRED];
  100. }
  101. //
  102. // Response for the
  103. // [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations]
  104. // method.
  105. message SamplePlayableLocationsResponse {
  106. // Each PlayableLocation object corresponds to a game_object_type specified
  107. // in the request.
  108. map<int32, google.maps.playablelocations.v3.sample.PlayableLocationList>
  109. locations_per_game_object_type = 1;
  110. // Required. Specifies the "time-to-live" for the set of playable locations.
  111. // You can use this value to determine how long to cache the set of playable
  112. // locations. After this length of time, your back-end game server should
  113. // issue a new
  114. // [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations]
  115. // request to get a fresh set of playable locations (because for example, they
  116. // might have been removed, a park might have closed for the day, a
  117. // business might have closed permanently).
  118. google.protobuf.Duration ttl = 9;
  119. }
  120. // A request for logging your player's bad location reports.
  121. message LogPlayerReportsRequest {
  122. // Required. Player reports. The maximum number of player reports that you can
  123. // log at once is 50.
  124. repeated PlayerReport player_reports = 1
  125. [(google.api.field_behavior) = REQUIRED];
  126. // Required. A string that uniquely identifies the log player reports request.
  127. // This allows you to detect duplicate requests. We recommend that you use
  128. // UUIDs for this value. The value must not exceed 50 characters.
  129. //
  130. // You should reuse the `request_id` only when retrying a request in the case
  131. // of a failure. In that case, the request must be identical to the one that
  132. // failed.
  133. string request_id = 2 [(google.api.field_behavior) = REQUIRED];
  134. // Required. Information about the client device (for example, device model
  135. // and operating system).
  136. google.maps.unity.ClientInfo client_info = 3
  137. [(google.api.field_behavior) = REQUIRED];
  138. }
  139. // A response for the
  140. // [LogPlayerReports][google.maps.playablelocations.v3.PlayableLocations.LogPlayerReports]
  141. // method.
  142. //
  143. // This method returns no data upon success.
  144. message LogPlayerReportsResponse {}
  145. // A request for logging impressions.
  146. message LogImpressionsRequest {
  147. // Required. Impression event details. The maximum number of impression
  148. // reports that you can log at once is 50.
  149. repeated Impression impressions = 1 [(google.api.field_behavior) = REQUIRED];
  150. // Required. A string that uniquely identifies the log impressions request.
  151. // This allows you to detect duplicate requests. We recommend that you use
  152. // UUIDs for this value. The value must not exceed 50 characters.
  153. //
  154. // You should reuse the `request_id` only when retrying a request in case of
  155. // failure. In this case, the request must be identical to the one that
  156. // failed.
  157. string request_id = 2 [(google.api.field_behavior) = REQUIRED];
  158. // Required. Information about the client device. For example, device model
  159. // and operating system.
  160. google.maps.unity.ClientInfo client_info = 3
  161. [(google.api.field_behavior) = REQUIRED];
  162. }
  163. // A response for the
  164. // [LogImpressions][google.maps.playablelocations.v3.PlayableLocations.LogImpressions]
  165. // method. This method returns no data upon success.
  166. message LogImpressionsResponse {}