Skip to content

Commit e412b95

Browse files
committed
Add files to test generated code.
1 parent e6175e0 commit e412b95

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
15+
syntax = "proto3";
16+
17+
package google.duplicate_methods_test.v1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/iam/v1/iam_policy.proto";
22+
import "google/iam/v1/policy.proto";
23+
import "google/cloud/location/locations.proto";
24+
25+
option csharp_namespace = "Google.DuplicateMethodsTest.V1";
26+
option go_package = "google.golang.org/genproto/googleapis/duplicate_methods_test/v1;duplicate_methods_test";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "DuplicateMethodsTestProto";
29+
option java_package = "com.google.duplicate_methods_test.v1";
30+
option php_namespace = "Google\\DuplicateMethodsTest\\V1";
31+
option ruby_package = "Google::DuplicateMethodsTest::V1";
32+
33+
service DuplicateMethodsTestService {
34+
option (google.api.default_host) = "duplicatemethodstest.googleapis.com";
35+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
36+
37+
// Native GetIamPolicy method that conflicts with the IAMPolicy mixin.
38+
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
39+
option (google.api.http) = {
40+
get: "/v1/{resource=projects/*}:getIamPolicy"
41+
};
42+
}
43+
44+
// Native ListLocations method that conflicts with the Locations mixin.
45+
rpc ListLocations(google.cloud.location.ListLocationsRequest) returns (google.cloud.location.ListLocationsResponse) {
46+
option (google.api.http) = {
47+
get: "/v1/{name=projects/*}/locations"
48+
};
49+
}
50+
51+
// Another native method to ensure the service is valid and has other methods.
52+
rpc Echo(EchoRequest) returns (EchoResponse) {
53+
option (google.api.http) = {
54+
post: "/v1/echo"
55+
body: "*"
56+
};
57+
}
58+
}
59+
60+
message EchoRequest {
61+
string content = 1;
62+
}
63+
64+
message EchoResponse {
65+
string content = 1;
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
type: google.api.Service
2+
config_version: 3
3+
name: duplicatemethodstest.googleapis.com
4+
title: Duplicate Methods Test Service API
5+
6+
apis:
7+
- name: google.duplicate_methods_test.v1.DuplicateMethodsTestService
8+
- name: google.iam.v1.IAMPolicy
9+
- name: google.cloud.location.Locations
10+
11+
# We don't need to define HTTP rules for the native methods here if they are in the proto,
12+
# but we can define standard ones if we want to ensure full coverage.
13+
http:
14+
rules:
15+
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
16+
post: '/v1/{resource=projects/*}:setIamPolicy'
17+
body: '*'
18+
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
19+
get: '/v1/{resource=projects/*}:getIamPolicy'
20+
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
21+
post: '/v1/{resource=projects/*}:testIamPermissions'
22+
body: '*'
23+
- selector: google.cloud.location.Locations.GetLocation
24+
get: '/v1/{name=projects/*}/locations'
25+
- selector: google.cloud.location.Locations.ListLocations
26+
get: '/v1/{name=projects/*}/locations'

0 commit comments

Comments
 (0)