xref: /aosp_15_r20/external/sdk-platform-java/gapic-generator-java/src/test/proto/basic.proto (revision 882aa7c72c3cd3b66e72a261bdd69b93f7de7670)
1// Copyright 2018 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//     https://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.testdata;
18
19option java_package = "com.google.google.testdata";
20
21// This is a service description.
22// It takes up multiple lines, like so.
23service FooService {
24  // FooMethod does something.
25  // This comment also takes up multiple lines.
26  rpc FooMethod(FooMessage) returns (FooMessage.BarMessage);
27}
28
29// This is another service description.
30service BarService {
31  // BarMethod does another thing.
32  rpc BarMethod(FooMessage) returns (FooMessage.BarMessage);
33}
34
35// This is a message descxription.
36// Lorum ipsum dolor sit amet consectetur adipiscing elit.
37message FooMessage {
38  // This is a field description for field_one.
39  // And here is the second line of that description.
40  string field_one = 1;  // A field trailing comment.
41
42  // This is another field description.
43  string field_two = 2;
44  // Another field trailing comment.
45
46  // This is an inner message description for BarMessage.
47  message BarMessage {
48    // A third leading comment for field_three.
49    string field_three = 1;
50
51    /*
52     * This is a block comment for field_two.
53     */
54    string field_two = 2;
55  }
56
57  // An inner enum.
58  enum FoodEnum {
59    // Unspecified value.
60    FOOD_UNSPECIFIED = 0;
61
62    // �� ��.
63    RICE = 1;
64
65    // �� ��.
66    CHOCOLATE = 2;
67  }
68
69  // An inner oneof.
70  oneof InnerOneof {
71    // An InnerOneof comment for its field.
72    string field_four = 6;
73  }
74}
75
76// This is an outer enum.
77enum OuterEnum {
78  // Another unspecified value.
79  VALUE_UNSPECIFIED = 0;
80}
81