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