1ffe3c632Sopenharmony_ci// Protocol Buffers - Google's data interchange format
2ffe3c632Sopenharmony_ci// Copyright 2008 Google Inc.  All rights reserved.
3ffe3c632Sopenharmony_ci// https://developers.google.com/protocol-buffers/
4ffe3c632Sopenharmony_ci//
5ffe3c632Sopenharmony_ci// Redistribution and use in source and binary forms, with or without
6ffe3c632Sopenharmony_ci// modification, are permitted provided that the following conditions are
7ffe3c632Sopenharmony_ci// met:
8ffe3c632Sopenharmony_ci//
9ffe3c632Sopenharmony_ci//     * Redistributions of source code must retain the above copyright
10ffe3c632Sopenharmony_ci// notice, this list of conditions and the following disclaimer.
11ffe3c632Sopenharmony_ci//     * Redistributions in binary form must reproduce the above
12ffe3c632Sopenharmony_ci// copyright notice, this list of conditions and the following disclaimer
13ffe3c632Sopenharmony_ci// in the documentation and/or other materials provided with the
14ffe3c632Sopenharmony_ci// distribution.
15ffe3c632Sopenharmony_ci//     * Neither the name of Google Inc. nor the names of its
16ffe3c632Sopenharmony_ci// contributors may be used to endorse or promote products derived from
17ffe3c632Sopenharmony_ci// this software without specific prior written permission.
18ffe3c632Sopenharmony_ci//
19ffe3c632Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20ffe3c632Sopenharmony_ci// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21ffe3c632Sopenharmony_ci// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22ffe3c632Sopenharmony_ci// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23ffe3c632Sopenharmony_ci// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24ffe3c632Sopenharmony_ci// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25ffe3c632Sopenharmony_ci// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26ffe3c632Sopenharmony_ci// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27ffe3c632Sopenharmony_ci// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28ffe3c632Sopenharmony_ci// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29ffe3c632Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30ffe3c632Sopenharmony_ci
31ffe3c632Sopenharmony_ci// Author: benjy@google.com (Benjy Weinberger)
32ffe3c632Sopenharmony_ci//  Based on original Protocol Buffers design by
33ffe3c632Sopenharmony_ci//  Sanjay Ghemawat, Jeff Dean, and others.
34ffe3c632Sopenharmony_ci//
35ffe3c632Sopenharmony_ci// A proto file used to test the "custom options" feature of google.protobuf.
36ffe3c632Sopenharmony_ci
37ffe3c632Sopenharmony_ci// This file is based on unittest_custom_options.proto in
38ffe3c632Sopenharmony_ci// src/google/protobuf, but is modified for proto3. It could
39ffe3c632Sopenharmony_ci// potentially be moved into src/google/protobuf, but currently C#
40ffe3c632Sopenharmony_ci// is the only language that really needs it, as we don't support
41ffe3c632Sopenharmony_ci// proto2 syntax. It's cut down significantly as proto3 only supports
42ffe3c632Sopenharmony_ci// extensions for options.
43ffe3c632Sopenharmony_ci
44ffe3c632Sopenharmony_ci
45ffe3c632Sopenharmony_cisyntax = "proto3";
46ffe3c632Sopenharmony_ci
47ffe3c632Sopenharmony_ci// A custom file option (defined below).
48ffe3c632Sopenharmony_cioption (file_opt1) = 9876543210;
49ffe3c632Sopenharmony_ci
50ffe3c632Sopenharmony_ciimport "google/protobuf/descriptor.proto";
51ffe3c632Sopenharmony_ci
52ffe3c632Sopenharmony_ci// We don't put this in a package within proto2 because we need to make sure
53ffe3c632Sopenharmony_ci// that the generated code doesn't depend on being in the proto2 namespace.
54ffe3c632Sopenharmony_cipackage protobuf_unittest;
55ffe3c632Sopenharmony_cioption csharp_namespace = "UnitTest.Issues.TestProtos";
56ffe3c632Sopenharmony_ci
57ffe3c632Sopenharmony_ci// Some simple test custom options of various types.
58ffe3c632Sopenharmony_ci
59ffe3c632Sopenharmony_ciextend google.protobuf.FileOptions {
60ffe3c632Sopenharmony_ci  uint64 file_opt1 = 7736974;
61ffe3c632Sopenharmony_ci}
62ffe3c632Sopenharmony_ci
63ffe3c632Sopenharmony_ciextend google.protobuf.MessageOptions {
64ffe3c632Sopenharmony_ci  int32 message_opt1 = 7739036;
65ffe3c632Sopenharmony_ci}
66ffe3c632Sopenharmony_ci
67ffe3c632Sopenharmony_ciextend google.protobuf.FieldOptions {
68ffe3c632Sopenharmony_ci  fixed64 field_opt1 = 7740936;
69ffe3c632Sopenharmony_ci}
70ffe3c632Sopenharmony_ci
71ffe3c632Sopenharmony_ciextend google.protobuf.OneofOptions {
72ffe3c632Sopenharmony_ci  int32 oneof_opt1 = 7740111;
73ffe3c632Sopenharmony_ci}
74ffe3c632Sopenharmony_ci
75ffe3c632Sopenharmony_ciextend google.protobuf.EnumOptions {
76ffe3c632Sopenharmony_ci  sfixed32 enum_opt1 = 7753576;
77ffe3c632Sopenharmony_ci}
78ffe3c632Sopenharmony_ci
79ffe3c632Sopenharmony_ciextend google.protobuf.EnumValueOptions {
80ffe3c632Sopenharmony_ci  int32 enum_value_opt1 = 1560678;
81ffe3c632Sopenharmony_ci}
82ffe3c632Sopenharmony_ci
83ffe3c632Sopenharmony_ciextend google.protobuf.ServiceOptions {
84ffe3c632Sopenharmony_ci  sint64 service_opt1 = 7887650;
85ffe3c632Sopenharmony_ci}
86ffe3c632Sopenharmony_ci
87ffe3c632Sopenharmony_cienum MethodOpt1 {
88ffe3c632Sopenharmony_ci  METHODOPT1_UNSPECIFIED = 0;
89ffe3c632Sopenharmony_ci  METHODOPT1_VAL1 = 1;
90ffe3c632Sopenharmony_ci  METHODOPT1_VAL2 = 2;
91ffe3c632Sopenharmony_ci}
92ffe3c632Sopenharmony_ci
93ffe3c632Sopenharmony_ciextend google.protobuf.MethodOptions {
94ffe3c632Sopenharmony_ci  MethodOpt1 method_opt1 = 7890860;
95ffe3c632Sopenharmony_ci}
96ffe3c632Sopenharmony_ci
97ffe3c632Sopenharmony_ci// A test message with custom options at all possible locations (and also some
98ffe3c632Sopenharmony_ci// regular options, to make sure they interact nicely).
99ffe3c632Sopenharmony_cimessage TestMessageWithCustomOptions {
100ffe3c632Sopenharmony_ci  option message_set_wire_format = false;
101ffe3c632Sopenharmony_ci
102ffe3c632Sopenharmony_ci  option (message_opt1) = -56;
103ffe3c632Sopenharmony_ci
104ffe3c632Sopenharmony_ci  string field1 = 1 [ctype=CORD,
105ffe3c632Sopenharmony_ci                              (field_opt1)=8765432109];
106ffe3c632Sopenharmony_ci
107ffe3c632Sopenharmony_ci  oneof AnOneof {
108ffe3c632Sopenharmony_ci    option (oneof_opt1) = -99;
109ffe3c632Sopenharmony_ci    int32 oneof_field = 2;
110ffe3c632Sopenharmony_ci  }
111ffe3c632Sopenharmony_ci
112ffe3c632Sopenharmony_ci  enum AnEnum {
113ffe3c632Sopenharmony_ci    option (enum_opt1) = -789;
114ffe3c632Sopenharmony_ci    ANENUM_UNSPECIFIED = 0;
115ffe3c632Sopenharmony_ci    ANENUM_VAL1 = 1;
116ffe3c632Sopenharmony_ci    ANENUM_VAL2 = 2 [(enum_value_opt1) = 123];
117ffe3c632Sopenharmony_ci  }
118ffe3c632Sopenharmony_ci}
119ffe3c632Sopenharmony_ci
120ffe3c632Sopenharmony_ci
121ffe3c632Sopenharmony_ci// A test RPC service with custom options at all possible locations (and also
122ffe3c632Sopenharmony_ci// some regular options, to make sure they interact nicely).
123ffe3c632Sopenharmony_cimessage CustomOptionFooRequest {
124ffe3c632Sopenharmony_ci}
125ffe3c632Sopenharmony_ci
126ffe3c632Sopenharmony_cimessage CustomOptionFooResponse {
127ffe3c632Sopenharmony_ci}
128ffe3c632Sopenharmony_ci
129ffe3c632Sopenharmony_cimessage CustomOptionFooClientMessage {
130ffe3c632Sopenharmony_ci}
131ffe3c632Sopenharmony_ci
132ffe3c632Sopenharmony_cimessage CustomOptionFooServerMessage {
133ffe3c632Sopenharmony_ci}
134ffe3c632Sopenharmony_ci
135ffe3c632Sopenharmony_ciservice TestServiceWithCustomOptions {
136ffe3c632Sopenharmony_ci  option (service_opt1) = -9876543210;
137ffe3c632Sopenharmony_ci
138ffe3c632Sopenharmony_ci  rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) {
139ffe3c632Sopenharmony_ci    option (method_opt1) = METHODOPT1_VAL2;
140ffe3c632Sopenharmony_ci  }
141ffe3c632Sopenharmony_ci}
142ffe3c632Sopenharmony_ci
143ffe3c632Sopenharmony_ci
144ffe3c632Sopenharmony_ci
145ffe3c632Sopenharmony_ci// Options of every possible field type, so we can test them all exhaustively.
146ffe3c632Sopenharmony_ci
147ffe3c632Sopenharmony_cimessage DummyMessageContainingEnum {
148ffe3c632Sopenharmony_ci  enum TestEnumType {
149ffe3c632Sopenharmony_ci    TEST_OPTION_ENUM_UNSPECIFIED = 0;
150ffe3c632Sopenharmony_ci    TEST_OPTION_ENUM_TYPE1 = 22;
151ffe3c632Sopenharmony_ci    TEST_OPTION_ENUM_TYPE2 = -23;
152ffe3c632Sopenharmony_ci  }
153ffe3c632Sopenharmony_ci}
154ffe3c632Sopenharmony_ci
155ffe3c632Sopenharmony_cimessage DummyMessageInvalidAsOptionType {
156ffe3c632Sopenharmony_ci}
157ffe3c632Sopenharmony_ci
158ffe3c632Sopenharmony_ciextend google.protobuf.MessageOptions {
159ffe3c632Sopenharmony_ci          bool     bool_opt = 7706090;
160ffe3c632Sopenharmony_ci         int32    int32_opt = 7705709;
161ffe3c632Sopenharmony_ci         int64    int64_opt = 7705542;
162ffe3c632Sopenharmony_ci        uint32   uint32_opt = 7704880;
163ffe3c632Sopenharmony_ci        uint64   uint64_opt = 7702367;
164ffe3c632Sopenharmony_ci        sint32   sint32_opt = 7701568;
165ffe3c632Sopenharmony_ci        sint64   sint64_opt = 7700863;
166ffe3c632Sopenharmony_ci       fixed32  fixed32_opt = 7700307;
167ffe3c632Sopenharmony_ci       fixed64  fixed64_opt = 7700194;
168ffe3c632Sopenharmony_ci      sfixed32 sfixed32_opt = 7698645;
169ffe3c632Sopenharmony_ci      sfixed64 sfixed64_opt = 7685475;
170ffe3c632Sopenharmony_ci         float    float_opt = 7675390;
171ffe3c632Sopenharmony_ci        double   double_opt = 7673293;
172ffe3c632Sopenharmony_ci        string   string_opt = 7673285;
173ffe3c632Sopenharmony_ci         bytes    bytes_opt = 7673238;
174ffe3c632Sopenharmony_ci  DummyMessageContainingEnum.TestEnumType enum_opt = 7673233;
175ffe3c632Sopenharmony_ci  DummyMessageInvalidAsOptionType message_type_opt = 7665967;
176ffe3c632Sopenharmony_ci}
177ffe3c632Sopenharmony_ci
178ffe3c632Sopenharmony_cimessage CustomOptionMinIntegerValues {
179ffe3c632Sopenharmony_ci  option     (bool_opt) = false;
180ffe3c632Sopenharmony_ci  option    (int32_opt) = -0x80000000;
181ffe3c632Sopenharmony_ci  option    (int64_opt) = -0x8000000000000000;
182ffe3c632Sopenharmony_ci  option   (uint32_opt) = 0;
183ffe3c632Sopenharmony_ci  option   (uint64_opt) = 0;
184ffe3c632Sopenharmony_ci  option   (sint32_opt) = -0x80000000;
185ffe3c632Sopenharmony_ci  option   (sint64_opt) = -0x8000000000000000;
186ffe3c632Sopenharmony_ci  option  (fixed32_opt) = 0;
187ffe3c632Sopenharmony_ci  option  (fixed64_opt) = 0;
188ffe3c632Sopenharmony_ci  option (sfixed32_opt) = -0x80000000;
189ffe3c632Sopenharmony_ci  option (sfixed64_opt) = -0x8000000000000000;
190ffe3c632Sopenharmony_ci}
191ffe3c632Sopenharmony_ci
192ffe3c632Sopenharmony_cimessage CustomOptionMaxIntegerValues {
193ffe3c632Sopenharmony_ci  option     (bool_opt) = true;
194ffe3c632Sopenharmony_ci  option    (int32_opt) = 0x7FFFFFFF;
195ffe3c632Sopenharmony_ci  option    (int64_opt) = 0x7FFFFFFFFFFFFFFF;
196ffe3c632Sopenharmony_ci  option   (uint32_opt) = 0xFFFFFFFF;
197ffe3c632Sopenharmony_ci  option   (uint64_opt) = 0xFFFFFFFFFFFFFFFF;
198ffe3c632Sopenharmony_ci  option   (sint32_opt) = 0x7FFFFFFF;
199ffe3c632Sopenharmony_ci  option   (sint64_opt) = 0x7FFFFFFFFFFFFFFF;
200ffe3c632Sopenharmony_ci  option  (fixed32_opt) = 0xFFFFFFFF;
201ffe3c632Sopenharmony_ci  option  (fixed64_opt) = 0xFFFFFFFFFFFFFFFF;
202ffe3c632Sopenharmony_ci  option (sfixed32_opt) = 0x7FFFFFFF;
203ffe3c632Sopenharmony_ci  option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF;
204ffe3c632Sopenharmony_ci}
205ffe3c632Sopenharmony_ci
206ffe3c632Sopenharmony_cimessage CustomOptionOtherValues {
207ffe3c632Sopenharmony_ci  option  (int32_opt) = -100;  // To test sign-extension.
208ffe3c632Sopenharmony_ci  option  (float_opt) = 12.3456789;
209ffe3c632Sopenharmony_ci  option (double_opt) = 1.234567890123456789;
210ffe3c632Sopenharmony_ci  option (string_opt) = "Hello, \"World\"";
211ffe3c632Sopenharmony_ci  option  (bytes_opt) = "Hello\0World";
212ffe3c632Sopenharmony_ci  option   (enum_opt) = TEST_OPTION_ENUM_TYPE2;
213ffe3c632Sopenharmony_ci}
214ffe3c632Sopenharmony_ci
215ffe3c632Sopenharmony_cimessage SettingRealsFromPositiveInts {
216ffe3c632Sopenharmony_ci  option  (float_opt) = 12;
217ffe3c632Sopenharmony_ci  option (double_opt) = 154;
218ffe3c632Sopenharmony_ci}
219ffe3c632Sopenharmony_ci
220ffe3c632Sopenharmony_cimessage SettingRealsFromNegativeInts {
221ffe3c632Sopenharmony_ci  option  (float_opt) = -12;
222ffe3c632Sopenharmony_ci  option  (double_opt) = -154;
223ffe3c632Sopenharmony_ci}
224ffe3c632Sopenharmony_ci
225ffe3c632Sopenharmony_ci// Options of complex message types, themselves combined and extended in
226ffe3c632Sopenharmony_ci// various ways.
227ffe3c632Sopenharmony_ci
228ffe3c632Sopenharmony_cimessage ComplexOptionType1 {
229ffe3c632Sopenharmony_ci  int32 foo = 1;
230ffe3c632Sopenharmony_ci  int32 foo2 = 2;
231ffe3c632Sopenharmony_ci  int32 foo3 = 3;
232ffe3c632Sopenharmony_ci  repeated int32 foo4 = 4;
233ffe3c632Sopenharmony_ci}
234ffe3c632Sopenharmony_ci
235ffe3c632Sopenharmony_cimessage ComplexOptionType2 {
236ffe3c632Sopenharmony_ci  ComplexOptionType1 bar = 1;
237ffe3c632Sopenharmony_ci  int32 baz = 2;
238ffe3c632Sopenharmony_ci
239ffe3c632Sopenharmony_ci  message ComplexOptionType4 {
240ffe3c632Sopenharmony_ci    int32 waldo = 1;
241ffe3c632Sopenharmony_ci
242ffe3c632Sopenharmony_ci    extend google.protobuf.MessageOptions {
243ffe3c632Sopenharmony_ci      ComplexOptionType4 complex_opt4 = 7633546;
244ffe3c632Sopenharmony_ci    }
245ffe3c632Sopenharmony_ci  }
246ffe3c632Sopenharmony_ci
247ffe3c632Sopenharmony_ci  ComplexOptionType4 fred = 3;
248ffe3c632Sopenharmony_ci  repeated ComplexOptionType4 barney = 4;
249ffe3c632Sopenharmony_ci}
250ffe3c632Sopenharmony_ci
251ffe3c632Sopenharmony_cimessage ComplexOptionType3 {
252ffe3c632Sopenharmony_ci  int32 qux = 1;
253ffe3c632Sopenharmony_ci}
254ffe3c632Sopenharmony_ci
255ffe3c632Sopenharmony_ciextend google.protobuf.MessageOptions {
256ffe3c632Sopenharmony_ci  protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756;
257ffe3c632Sopenharmony_ci  ComplexOptionType2 complex_opt2 = 7636949;
258ffe3c632Sopenharmony_ci  ComplexOptionType3 complex_opt3 = 7636463;
259ffe3c632Sopenharmony_ci}
260ffe3c632Sopenharmony_ci
261ffe3c632Sopenharmony_ci// Note that we try various different ways of naming the same extension.
262ffe3c632Sopenharmony_cimessage VariousComplexOptions {
263ffe3c632Sopenharmony_ci  option (.protobuf_unittest.complex_opt1).foo = 42;
264ffe3c632Sopenharmony_ci  option (protobuf_unittest.complex_opt1).foo4 = 99;
265ffe3c632Sopenharmony_ci  option (protobuf_unittest.complex_opt1).foo4 = 88;
266ffe3c632Sopenharmony_ci  option (complex_opt2).baz = 987;
267ffe3c632Sopenharmony_ci  option (complex_opt2).bar.foo = 743;
268ffe3c632Sopenharmony_ci  option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971;
269ffe3c632Sopenharmony_ci  option (complex_opt2).fred.waldo = 321;
270ffe3c632Sopenharmony_ci  option (complex_opt2).barney = { waldo: 101 };
271ffe3c632Sopenharmony_ci  option (complex_opt2).barney = { waldo: 212 };
272ffe3c632Sopenharmony_ci  option (protobuf_unittest.complex_opt3).qux = 9;
273ffe3c632Sopenharmony_ci}
274ffe3c632Sopenharmony_ci
275ffe3c632Sopenharmony_ci// ------------------------------------------------------
276ffe3c632Sopenharmony_ci// Definitions for testing aggregate option parsing.
277ffe3c632Sopenharmony_ci// See descriptor_unittest.cc.
278ffe3c632Sopenharmony_ci
279ffe3c632Sopenharmony_ci// A helper type used to test aggregate option parsing
280ffe3c632Sopenharmony_cimessage Aggregate {
281ffe3c632Sopenharmony_ci  int32 i = 1;
282ffe3c632Sopenharmony_ci  string s = 2;
283ffe3c632Sopenharmony_ci
284ffe3c632Sopenharmony_ci  // A nested object
285ffe3c632Sopenharmony_ci  Aggregate sub = 3;
286ffe3c632Sopenharmony_ci}
287ffe3c632Sopenharmony_ci
288ffe3c632Sopenharmony_ci// Allow Aggregate to be used as an option at all possible locations
289ffe3c632Sopenharmony_ci// in the .proto grammar.
290ffe3c632Sopenharmony_ciextend google.protobuf.FileOptions      { Aggregate fileopt    = 15478479; }
291ffe3c632Sopenharmony_ciextend google.protobuf.MessageOptions   { Aggregate msgopt     = 15480088; }
292ffe3c632Sopenharmony_ciextend google.protobuf.FieldOptions     { Aggregate fieldopt   = 15481374; }
293ffe3c632Sopenharmony_ciextend google.protobuf.EnumOptions      { Aggregate enumopt    = 15483218; }
294ffe3c632Sopenharmony_ciextend google.protobuf.EnumValueOptions { Aggregate enumvalopt = 15486921; }
295ffe3c632Sopenharmony_ciextend google.protobuf.ServiceOptions   { Aggregate serviceopt = 15497145; }
296ffe3c632Sopenharmony_ciextend google.protobuf.MethodOptions    { Aggregate methodopt  = 15512713; }
297ffe3c632Sopenharmony_ci
298ffe3c632Sopenharmony_ci// Try using AggregateOption at different points in the proto grammar
299ffe3c632Sopenharmony_cioption (fileopt) = {
300ffe3c632Sopenharmony_ci  s: 'FileAnnotation'
301ffe3c632Sopenharmony_ci  // Also test the handling of comments
302ffe3c632Sopenharmony_ci  /* of both types */ i: 100
303ffe3c632Sopenharmony_ci
304ffe3c632Sopenharmony_ci  sub { s: 'NestedFileAnnotation' }
305ffe3c632Sopenharmony_ci};
306ffe3c632Sopenharmony_ci
307ffe3c632Sopenharmony_cimessage AggregateMessage {
308ffe3c632Sopenharmony_ci  option (msgopt) = { i:101 s:'MessageAnnotation' };
309ffe3c632Sopenharmony_ci  int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }];
310ffe3c632Sopenharmony_ci}
311ffe3c632Sopenharmony_ci
312ffe3c632Sopenharmony_ciservice AggregateService {
313ffe3c632Sopenharmony_ci  option (serviceopt) = { s:'ServiceAnnotation' };
314ffe3c632Sopenharmony_ci  rpc Method (AggregateMessage) returns (AggregateMessage) {
315ffe3c632Sopenharmony_ci    option (methodopt) = { s:'MethodAnnotation' };
316ffe3c632Sopenharmony_ci  }
317ffe3c632Sopenharmony_ci}
318ffe3c632Sopenharmony_ci
319ffe3c632Sopenharmony_cienum AggregateEnum {
320ffe3c632Sopenharmony_ci  option (enumopt) = { s:'EnumAnnotation' };
321ffe3c632Sopenharmony_ci  UNSPECIFIED = 0;
322ffe3c632Sopenharmony_ci  VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }];
323ffe3c632Sopenharmony_ci}
324ffe3c632Sopenharmony_ci
325ffe3c632Sopenharmony_ci// Test custom options for nested type.
326ffe3c632Sopenharmony_cimessage NestedOptionType {
327ffe3c632Sopenharmony_ci  message NestedMessage {
328ffe3c632Sopenharmony_ci    option (message_opt1) = 1001;
329ffe3c632Sopenharmony_ci    int32 nested_field = 1 [(field_opt1) = 1002];
330ffe3c632Sopenharmony_ci  }
331ffe3c632Sopenharmony_ci  enum NestedEnum {
332ffe3c632Sopenharmony_ci    UNSPECIFIED = 0;
333ffe3c632Sopenharmony_ci    option (enum_opt1) = 1003;
334ffe3c632Sopenharmony_ci    NESTED_ENUM_VALUE = 1 [(enum_value_opt1) = 1004];
335ffe3c632Sopenharmony_ci  }
336ffe3c632Sopenharmony_ci}
337