| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- // Protos/pluginlib_descriptor_test.proto - test proto
- //
- // This source file is part of the Swift.org open source project
- //
- // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
- // Licensed under Apache License v2.0 with Runtime Library Exception
- //
- // See http://swift.org/LICENSE.txt for license information
- // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
- //
- // -----------------------------------------------------------------------------
- ///
- /// Test proto for Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift
- ///
- // -----------------------------------------------------------------------------
- syntax = "proto2";
- package swift_descriptor_test;
- // Use the option to test swift name generation.
- option swift_prefix = "SDT";
- import "pluginlib_descriptor_test_import.proto";
- enum TopLevelEnum {
- VALUE_ZERO = 0;
- VALUE_ONE = 1;
- VALUE_TWO = 2;
- }
- message TopLevelMessage {
- enum SubEnum {
- SUB_VALUE_0 = 0;
- SUB_VALUE_1 = 1;
- SUB_VALUE_2 = 2;
- }
- message SubMessage {
- optional int32 field1 = 1;
- optional string field2 = 2;
- optional SubMessage field3 = 3;
- }
- optional string field1 = 1;
- optional int32 field2 = 2;
- oneof o {
- TopLevelEnum field3 = 3;
- SubEnum field4 = 4;
- SubMessage field5 = 5;
- TopLevelMessage2 field6 = 6;
- }
- }
- message TopLevelMessage2 {
- optional TopLevelMessage left = 1;
- optional TopLevelMessage2 right = 2;
- }
- message ExternalRefs {
- optional swift_descriptor_test.import.ExtendableOne one = 1;
- optional swift_descriptor_test.import.Version ver = 2;
- }
- extend swift_descriptor_test.import.ExtendableOne {
- optional string ext_str = 90000;
- }
- message ScoperForExt {
- extend swift_descriptor_test.import.ExtendableOne.ExtendableTwo {
- optional TopLevelEnum ext_enum = 99001;
- optional TopLevelMessage2 ext_msg = 99002;
- }
- }
- service SomeService {
- rpc Foo(swift_descriptor_test.import.ExtendableOne) returns (swift_descriptor_test.import.Version);
- rpc Bar(TopLevelMessage) returns (TopLevelMessage2);
- }
- message Proto2MessageForPresence {
- required string req_str_field = 1;
- required int32 req_int32_field = 2;
- required TopLevelEnum req_enum_field = 3;
- required TopLevelMessage req_message_field = 4;
- optional string opt_str_field = 11;
- optional int32 opt_int32_field = 12;
- optional TopLevelEnum opt_enum_field = 13;
- optional TopLevelMessage opt_message_field = 14;
- repeated string repeat_str_field = 21;
- repeated int32 repeat_int32_field = 22;
- repeated TopLevelEnum repeat_enum_field = 23;
- repeated TopLevelMessage repeat_message_field = 24;
- oneof o {
- string oneof_str_field = 31;
- int32 oneof_int32_field = 32;
- TopLevelEnum oneof_enum_field = 33;
- TopLevelMessage oneof_message_field = 34;
- }
- }
|