Skip to content

Commit

Permalink
chore: migrate maps/playablelocations to the PHP microgenerator
Browse files Browse the repository at this point in the history
Committer: @miraleung
PiperOrigin-RevId: 373589757
  • Loading branch information
Google APIs authored and copybara-github committed May 13, 2021
1 parent b29fb6b commit 7467f29
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 58 deletions.
14 changes: 6 additions & 8 deletions google/maps/playablelocations/v3/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ go_gapic_assembly_pkg(

##############################################################################
# PHP
# DO NOT OVERRIDE this PHP microgenerator section with autogenerated rules.
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
php_gapic_assembly_pkg = "php_gapic_assembly_pkg2",
php_gapic_library = "php_gapic_library2",
php_grpc_library = "php_grpc_library2",
php_proto_library = "php_proto_library2",
)

php_proto_library(
Expand All @@ -170,10 +171,7 @@ php_grpc_library(

php_gapic_library(
name = "playablelocations_php_gapic",
src = ":playablelocations_proto_with_info",
gapic_yaml = "playablelocations_gapic.yaml",
package = "google.maps.playablelocations.v3",
service_yaml = "playablelocations_v3.yaml",
srcs = [":playablelocations_proto_with_info"],
deps = [
":playablelocations_php_grpc",
":playablelocations_php_proto",
Expand Down
78 changes: 43 additions & 35 deletions google/maps/playablelocations/v3/playablelocations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option go_package = "google.golang.org/genproto/googleapis/maps/playablelocation
option java_multiple_files = true;
option java_outer_classname = "PlayableLocationsProto";
option java_package = "com.google.maps.playablelocations.v3";
option php_namespace = "Google\\Maps\\PlayableLocations\\V3";
option objc_class_prefix = "GMPL";

// The Playable Locations API for v3.
Expand All @@ -40,7 +41,8 @@ service PlayableLocations {
//
// Note: Identical `SamplePlayableLocations` requests can return different
// results as the state of the world changes over time.
rpc SamplePlayableLocations(SamplePlayableLocationsRequest) returns (SamplePlayableLocationsResponse) {
rpc SamplePlayableLocations(SamplePlayableLocationsRequest)
returns (SamplePlayableLocationsResponse) {
option (google.api.http) = {
post: "/v3:samplePlayableLocations"
body: "*"
Expand All @@ -51,7 +53,8 @@ service PlayableLocations {
//
// Reports are not partially saved; either all reports are saved and this
// request succeeds, or no reports are saved, and this request fails.
rpc LogPlayerReports(LogPlayerReportsRequest) returns (LogPlayerReportsResponse) {
rpc LogPlayerReports(LogPlayerReportsRequest)
returns (LogPlayerReportsResponse) {
option (google.api.http) = {
post: "/v3:logPlayerReports"
body: "*"
Expand Down Expand Up @@ -97,11 +100,13 @@ service PlayableLocations {
// again to get a fresh view of the real world.
message SamplePlayableLocationsRequest {
// Required. Specifies the area to search within for playable locations.
google.maps.playablelocations.v3.sample.AreaFilter area_filter = 1 [(google.api.field_behavior) = REQUIRED];
google.maps.playablelocations.v3.sample.AreaFilter area_filter = 1
[(google.api.field_behavior) = REQUIRED];

// Required. Specifies one or more (up to 5) criteria for filtering the
// returned playable locations.
repeated google.maps.playablelocations.v3.sample.Criterion criteria = 2 [(google.api.field_behavior) = REQUIRED];
repeated google.maps.playablelocations.v3.sample.Criterion criteria = 2
[(google.api.field_behavior) = REQUIRED];
}

//
Expand All @@ -111,11 +116,13 @@ message SamplePlayableLocationsRequest {
message SamplePlayableLocationsResponse {
// Each PlayableLocation object corresponds to a game_object_type specified
// in the request.
map<int32, google.maps.playablelocations.v3.sample.PlayableLocationList> locations_per_game_object_type = 1;
map<int32, google.maps.playablelocations.v3.sample.PlayableLocationList>
locations_per_game_object_type = 1;

// Required. Specifies the "time-to-live" for the set of playable locations. You can use
// this value to determine how long to cache the set of playable locations.
// After this length of time, your back-end game server should issue a new
// Required. Specifies the "time-to-live" for the set of playable locations.
// You can use this value to determine how long to cache the set of playable
// locations. After this length of time, your back-end game server should
// issue a new
// [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations]
// request to get a fresh set of playable locations (because for example, they
// might have been removed, a park might have closed for the day, a
Expand All @@ -125,54 +132,55 @@ message SamplePlayableLocationsResponse {

// A request for logging your player's bad location reports.
message LogPlayerReportsRequest {
// Required. Player reports. The maximum number of player reports that you can log at
// once is 50.
repeated PlayerReport player_reports = 1 [(google.api.field_behavior) = REQUIRED];

// Required. A string that uniquely identifies the log player reports request. This
// allows you to detect duplicate requests. We recommend that you use UUIDs
// for this value. The value must not exceed 50 characters.
// Required. Player reports. The maximum number of player reports that you can
// log at once is 50.
repeated PlayerReport player_reports = 1
[(google.api.field_behavior) = REQUIRED];

// Required. A string that uniquely identifies the log player reports request.
// This allows you to detect duplicate requests. We recommend that you use
// UUIDs for this value. The value must not exceed 50 characters.
//
// You should reuse the `request_id` only when retrying a request in the case
// of a failure. In that case, the request must be identical to the one that
// failed.
string request_id = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Information about the client device (for example, device model and
// operating system).
google.maps.unity.ClientInfo client_info = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Information about the client device (for example, device model
// and operating system).
google.maps.unity.ClientInfo client_info = 3
[(google.api.field_behavior) = REQUIRED];
}

// A response for the [LogPlayerReports][google.maps.playablelocations.v3.PlayableLocations.LogPlayerReports]
// A response for the
// [LogPlayerReports][google.maps.playablelocations.v3.PlayableLocations.LogPlayerReports]
// method.
//
// This method returns no data upon success.
message LogPlayerReportsResponse {

}
message LogPlayerReportsResponse {}

// A request for logging impressions.
message LogImpressionsRequest {
// Required. Impression event details. The maximum number of impression reports that you
// can log at once is 50.
// Required. Impression event details. The maximum number of impression
// reports that you can log at once is 50.
repeated Impression impressions = 1 [(google.api.field_behavior) = REQUIRED];

// Required. A string that uniquely identifies the log impressions request. This allows
// you to detect duplicate requests. We recommend that you use UUIDs for this
// value. The value must not exceed 50 characters.
// Required. A string that uniquely identifies the log impressions request.
// This allows you to detect duplicate requests. We recommend that you use
// UUIDs for this value. The value must not exceed 50 characters.
//
// You should reuse the `request_id` only when retrying a request in case of
// failure. In this case, the request must be identical to the one that
// failed.
string request_id = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Information about the client device. For example, device model and
// operating system.
google.maps.unity.ClientInfo client_info = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Information about the client device. For example, device model
// and operating system.
google.maps.unity.ClientInfo client_info = 3
[(google.api.field_behavior) = REQUIRED];
}

// A response for the [LogImpressions][google.maps.playablelocations.v3.PlayableLocations.LogImpressions] method.
// This method returns no data upon success.
message LogImpressionsResponse {

}
// A response for the
// [LogImpressions][google.maps.playablelocations.v3.PlayableLocations.LogImpressions]
// method. This method returns no data upon success.
message LogImpressionsResponse {}
12 changes: 0 additions & 12 deletions google/maps/playablelocations/v3/playablelocations_gapic.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
type: com.google.api.codegen.ConfigProto
config_schema_version: 2.0.0
language_settings:
go:
package_name: developers.google.com/maps/go/playablelocations/v3
csharp:
package_name: Google.Maps.PlayableLocations.V3
ruby:
package_name: Google::Maps::PlayableLocations::V3
php:
package_name: Google\Maps\PlayableLocations\V3
nodejs:
package_name: playablelocations.v3
domain_layer_location: googlemaps
4 changes: 3 additions & 1 deletion google/maps/playablelocations/v3/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option go_package = "google.golang.org/genproto/googleapis/maps/playablelocation
option java_multiple_files = true;
option java_outer_classname = "ResourcesProto";
option java_package = "com.google.maps.playablelocations.v3";
option php_namespace = "Google\\Maps\\PlayableLocations\\V3";
option objc_class_prefix = "GMPL";

// A report submitted by a player about a playable location that is considered
Expand Down Expand Up @@ -59,7 +60,8 @@ message PlayerReport {
string location_name = 1 [(google.api.field_behavior) = REQUIRED];

// Required. One or more reasons why this playable location is considered bad.
repeated BadLocationReason reasons = 2 [(google.api.field_behavior) = REQUIRED];
repeated BadLocationReason reasons = 2
[(google.api.field_behavior) = REQUIRED];

// Required. A free-form description detailing why the playable location is
// considered bad.
Expand Down
5 changes: 3 additions & 2 deletions google/maps/playablelocations/v3/sample/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ go_proto_library(

##############################################################################
# PHP
# DO NOT OVERRIDE this PHP microgenerator section with autogenerated rules.
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_grpc_library",
"php_proto_library",
php_grpc_library = "php_grpc_library2",
php_proto_library = "php_proto_library2",
)

php_proto_library(
Expand Down

0 comments on commit 7467f29

Please sign in to comment.