diff --git a/protoc_plugin/lib/src/gen/dart_options.pb.dart b/protoc_plugin/lib/src/gen/dart_options.pb.dart index b92dcb350..064358474 100644 --- a/protoc_plugin/lib/src/gen/dart_options.pb.dart +++ b/protoc_plugin/lib/src/gen/dart_options.pb.dart @@ -125,7 +125,7 @@ class Imports extends $pb.GeneratedMessage { _omitMessageNames ? '' : 'Imports', package: const $pb.PackageName(_omitMessageNames ? '' : 'dart_options'), createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'mixins', $pb.PbFieldType.PM, + ..pPM(1, _omitFieldNames ? '' : 'mixins', subBuilder: DartMixin.create) ..hasRequiredFields = false; diff --git a/protoc_plugin/lib/src/gen/google/api/client.pb.dart b/protoc_plugin/lib/src/gen/google/api/client.pb.dart index fdf9cbe7b..3cc4ee4bb 100644 --- a/protoc_plugin/lib/src/gen/google/api/client.pb.dart +++ b/protoc_plugin/lib/src/gen/google/api/client.pb.dart @@ -162,10 +162,7 @@ class ClientLibrarySettings extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'version') - ..e<$1.LaunchStage>( - 2, _omitFieldNames ? '' : 'launchStage', $pb.PbFieldType.OE, - defaultOrMaker: $1.LaunchStage.LAUNCH_STAGE_UNSPECIFIED, - valueOf: $1.LaunchStage.valueOf, + ..aE<$1.LaunchStage>(2, _omitFieldNames ? '' : 'launchStage', enumValues: $1.LaunchStage.values) ..aOB(3, _omitFieldNames ? '' : 'restNumericEnums') ..aOM(21, _omitFieldNames ? '' : 'javaSettings', @@ -386,8 +383,7 @@ class Publishing extends $pb.GeneratedMessage { _omitMessageNames ? '' : 'Publishing', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'), createEmptyInstance: create) - ..pc( - 2, _omitFieldNames ? '' : 'methodSettings', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'methodSettings', subBuilder: MethodSettings.create) ..aOS(101, _omitFieldNames ? '' : 'newIssueUri') ..aOS(102, _omitFieldNames ? '' : 'documentationUri') @@ -395,14 +391,9 @@ class Publishing extends $pb.GeneratedMessage { ..aOS(104, _omitFieldNames ? '' : 'githubLabel') ..pPS(105, _omitFieldNames ? '' : 'codeownerGithubTeams') ..aOS(106, _omitFieldNames ? '' : 'docTagPrefix') - ..e( - 107, _omitFieldNames ? '' : 'organization', $pb.PbFieldType.OE, - defaultOrMaker: - ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED, - valueOf: ClientLibraryOrganization.valueOf, + ..aE(107, _omitFieldNames ? '' : 'organization', enumValues: ClientLibraryOrganization.values) - ..pc( - 109, _omitFieldNames ? '' : 'librarySettings', $pb.PbFieldType.PM, + ..pPM(109, _omitFieldNames ? '' : 'librarySettings', subBuilder: ClientLibrarySettings.create) ..aOS(110, _omitFieldNames ? '' : 'protoReferenceDocumentationUri') ..aOS(111, _omitFieldNames ? '' : 'restReferenceDocumentationUri') @@ -1310,8 +1301,8 @@ class MethodSettings_LongRunning extends $pb.GeneratedMessage { createEmptyInstance: create) ..aOM<$0.Duration>(1, _omitFieldNames ? '' : 'initialPollDelay', subBuilder: $0.Duration.create) - ..a<$core.double>( - 2, _omitFieldNames ? '' : 'pollDelayMultiplier', $pb.PbFieldType.OF) + ..aD(2, _omitFieldNames ? '' : 'pollDelayMultiplier', + fieldType: $pb.PbFieldType.OF) ..aOM<$0.Duration>(3, _omitFieldNames ? '' : 'maxPollDelay', subBuilder: $0.Duration.create) ..aOM<$0.Duration>(4, _omitFieldNames ? '' : 'totalPollTimeout', diff --git a/protoc_plugin/lib/src/gen/google/api/http.pb.dart b/protoc_plugin/lib/src/gen/google/api/http.pb.dart index 018fa1a0b..a49640412 100644 --- a/protoc_plugin/lib/src/gen/google/api/http.pb.dart +++ b/protoc_plugin/lib/src/gen/google/api/http.pb.dart @@ -44,7 +44,7 @@ class Http extends $pb.GeneratedMessage { _omitMessageNames ? '' : 'Http', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'), createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'rules', $pb.PbFieldType.PM, + ..pPM(1, _omitFieldNames ? '' : 'rules', subBuilder: HttpRule.create) ..aOB(2, _omitFieldNames ? '' : 'fullyDecodeReservedExpansion') ..hasRequiredFields = false; @@ -416,8 +416,7 @@ class HttpRule extends $pb.GeneratedMessage { ..aOS(7, _omitFieldNames ? '' : 'body') ..aOM(8, _omitFieldNames ? '' : 'custom', subBuilder: CustomHttpPattern.create) - ..pc( - 11, _omitFieldNames ? '' : 'additionalBindings', $pb.PbFieldType.PM, + ..pPM(11, _omitFieldNames ? '' : 'additionalBindings', subBuilder: HttpRule.create) ..aOS(12, _omitFieldNames ? '' : 'responseBody') ..hasRequiredFields = false; @@ -441,7 +440,19 @@ class HttpRule extends $pb.GeneratedMessage { _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static HttpRule? _defaultInstance; + @$pb.TagNumber(2) + @$pb.TagNumber(3) + @$pb.TagNumber(4) + @$pb.TagNumber(5) + @$pb.TagNumber(6) + @$pb.TagNumber(8) HttpRule_Pattern whichPattern() => _HttpRule_PatternByTag[$_whichOneof(0)]!; + @$pb.TagNumber(2) + @$pb.TagNumber(3) + @$pb.TagNumber(4) + @$pb.TagNumber(5) + @$pb.TagNumber(6) + @$pb.TagNumber(8) void clearPattern() => $_clearField($_whichOneof(0)); /// Selects a method to which this rule applies. diff --git a/protoc_plugin/lib/src/gen/google/api/routing.pb.dart b/protoc_plugin/lib/src/gen/google/api/routing.pb.dart index 528ac0076..28bb74212 100644 --- a/protoc_plugin/lib/src/gen/google/api/routing.pb.dart +++ b/protoc_plugin/lib/src/gen/google/api/routing.pb.dart @@ -398,8 +398,7 @@ class RoutingRule extends $pb.GeneratedMessage { _omitMessageNames ? '' : 'RoutingRule', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'), createEmptyInstance: create) - ..pc( - 2, _omitFieldNames ? '' : 'routingParameters', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'routingParameters', subBuilder: RoutingParameter.create) ..hasRequiredFields = false; diff --git a/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pb.dart b/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pb.dart index bbdcac1cc..3bee3157a 100644 --- a/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pb.dart +++ b/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pb.dart @@ -51,9 +51,9 @@ class Version extends $pb.GeneratedMessage { package: const $pb.PackageName( _omitMessageNames ? '' : 'google.protobuf.compiler'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'major', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'minor', $pb.PbFieldType.O3) - ..a<$core.int>(3, _omitFieldNames ? '' : 'patch', $pb.PbFieldType.O3) + ..aI(1, _omitFieldNames ? '' : 'major') + ..aI(2, _omitFieldNames ? '' : 'minor') + ..aI(3, _omitFieldNames ? '' : 'patch') ..aOS(4, _omitFieldNames ? '' : 'suffix') ..hasRequiredFields = false; @@ -152,11 +152,10 @@ class CodeGeneratorRequest extends $pb.GeneratedMessage { ..aOS(2, _omitFieldNames ? '' : 'parameter') ..aOM(3, _omitFieldNames ? '' : 'compilerVersion', subBuilder: Version.create) - ..pc<$0.FileDescriptorProto>( - 15, _omitFieldNames ? '' : 'protoFile', $pb.PbFieldType.PM, + ..pPM<$0.FileDescriptorProto>(15, _omitFieldNames ? '' : 'protoFile', subBuilder: $0.FileDescriptorProto.create) - ..pc<$0.FileDescriptorProto>( - 17, _omitFieldNames ? '' : 'sourceFileDescriptors', $pb.PbFieldType.PM, + ..pPM<$0.FileDescriptorProto>( + 17, _omitFieldNames ? '' : 'sourceFileDescriptors', subBuilder: $0.FileDescriptorProto.create); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -424,12 +423,9 @@ class CodeGeneratorResponse extends $pb.GeneratedMessage { ..a<$fixnum.Int64>( 2, _omitFieldNames ? '' : 'supportedFeatures', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.int>( - 3, _omitFieldNames ? '' : 'minimumEdition', $pb.PbFieldType.O3) - ..a<$core.int>( - 4, _omitFieldNames ? '' : 'maximumEdition', $pb.PbFieldType.O3) - ..pc( - 15, _omitFieldNames ? '' : 'file', $pb.PbFieldType.PM, + ..aI(3, _omitFieldNames ? '' : 'minimumEdition') + ..aI(4, _omitFieldNames ? '' : 'maximumEdition') + ..pPM(15, _omitFieldNames ? '' : 'file', subBuilder: CodeGeneratorResponse_File.create) ..hasRequiredFields = false; diff --git a/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart b/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart index 4e0519341..a49594737 100644 --- a/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart +++ b/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart @@ -46,8 +46,7 @@ class FileDescriptorSet extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 1, _omitFieldNames ? '' : 'file', $pb.PbFieldType.PM, + ..pPM(1, _omitFieldNames ? '' : 'file', subBuilder: FileDescriptorProto.create) ..hasExtensions = true; @@ -131,17 +130,13 @@ class FileDescriptorProto extends $pb.GeneratedMessage { ..aOS(1, _omitFieldNames ? '' : 'name') ..aOS(2, _omitFieldNames ? '' : 'package') ..pPS(3, _omitFieldNames ? '' : 'dependency') - ..pc( - 4, _omitFieldNames ? '' : 'messageType', $pb.PbFieldType.PM, + ..pPM(4, _omitFieldNames ? '' : 'messageType', subBuilder: DescriptorProto.create) - ..pc( - 5, _omitFieldNames ? '' : 'enumType', $pb.PbFieldType.PM, + ..pPM(5, _omitFieldNames ? '' : 'enumType', subBuilder: EnumDescriptorProto.create) - ..pc( - 6, _omitFieldNames ? '' : 'service', $pb.PbFieldType.PM, + ..pPM(6, _omitFieldNames ? '' : 'service', subBuilder: ServiceDescriptorProto.create) - ..pc( - 7, _omitFieldNames ? '' : 'extension', $pb.PbFieldType.PM, + ..pPM(7, _omitFieldNames ? '' : 'extension', subBuilder: FieldDescriptorProto.create) ..aOM(8, _omitFieldNames ? '' : 'options', subBuilder: FileOptions.create) @@ -152,9 +147,7 @@ class FileDescriptorProto extends $pb.GeneratedMessage { ..p<$core.int>( 11, _omitFieldNames ? '' : 'weakDependency', $pb.PbFieldType.P3) ..aOS(12, _omitFieldNames ? '' : 'syntax') - ..e(14, _omitFieldNames ? '' : 'edition', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(14, _omitFieldNames ? '' : 'edition', enumValues: Edition.values) ..pPS(15, _omitFieldNames ? '' : 'optionDependency'); @@ -311,8 +304,8 @@ class DescriptorProto_ExtensionRange extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'start', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'end', $pb.PbFieldType.O3) + ..aI(1, _omitFieldNames ? '' : 'start') + ..aI(2, _omitFieldNames ? '' : 'end') ..aOM(3, _omitFieldNames ? '' : 'options', subBuilder: ExtensionRangeOptions.create); @@ -398,8 +391,8 @@ class DescriptorProto_ReservedRange extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'start', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'end', $pb.PbFieldType.O3) + ..aI(1, _omitFieldNames ? '' : 'start') + ..aI(2, _omitFieldNames ? '' : 'end') ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -490,34 +483,26 @@ class DescriptorProto extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') - ..pc( - 2, _omitFieldNames ? '' : 'field', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'field', subBuilder: FieldDescriptorProto.create) - ..pc( - 3, _omitFieldNames ? '' : 'nestedType', $pb.PbFieldType.PM, + ..pPM(3, _omitFieldNames ? '' : 'nestedType', subBuilder: DescriptorProto.create) - ..pc( - 4, _omitFieldNames ? '' : 'enumType', $pb.PbFieldType.PM, + ..pPM(4, _omitFieldNames ? '' : 'enumType', subBuilder: EnumDescriptorProto.create) - ..pc( - 5, _omitFieldNames ? '' : 'extensionRange', $pb.PbFieldType.PM, + ..pPM( + 5, _omitFieldNames ? '' : 'extensionRange', subBuilder: DescriptorProto_ExtensionRange.create) - ..pc( - 6, _omitFieldNames ? '' : 'extension', $pb.PbFieldType.PM, + ..pPM(6, _omitFieldNames ? '' : 'extension', subBuilder: FieldDescriptorProto.create) ..aOM(7, _omitFieldNames ? '' : 'options', subBuilder: MessageOptions.create) - ..pc( - 8, _omitFieldNames ? '' : 'oneofDecl', $pb.PbFieldType.PM, + ..pPM(8, _omitFieldNames ? '' : 'oneofDecl', subBuilder: OneofDescriptorProto.create) - ..pc( - 9, _omitFieldNames ? '' : 'reservedRange', $pb.PbFieldType.PM, + ..pPM( + 9, _omitFieldNames ? '' : 'reservedRange', subBuilder: DescriptorProto_ReservedRange.create) ..pPS(10, _omitFieldNames ? '' : 'reservedName') - ..e( - 11, _omitFieldNames ? '' : 'visibility', $pb.PbFieldType.OE, - defaultOrMaker: SymbolVisibility.VISIBILITY_UNSET, - valueOf: SymbolVisibility.valueOf, + ..aE(11, _omitFieldNames ? '' : 'visibility', enumValues: SymbolVisibility.values); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -630,7 +615,7 @@ class ExtensionRangeOptions_Declaration extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'number', $pb.PbFieldType.O3) + ..aI(1, _omitFieldNames ? '' : 'number') ..aOS(2, _omitFieldNames ? '' : 'fullName') ..aOS(3, _omitFieldNames ? '' : 'type') ..aOB(5, _omitFieldNames ? '' : 'reserved') @@ -749,18 +734,17 @@ class ExtensionRangeOptions extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 2, _omitFieldNames ? '' : 'declaration', $pb.PbFieldType.PM, + ..pPM( + 2, _omitFieldNames ? '' : 'declaration', subBuilder: ExtensionRangeOptions_Declaration.create) - ..e( - 3, _omitFieldNames ? '' : 'verification', $pb.PbFieldType.OE, + ..aE( + 3, _omitFieldNames ? '' : 'verification', defaultOrMaker: ExtensionRangeOptions_VerificationState.UNVERIFIED, - valueOf: ExtensionRangeOptions_VerificationState.valueOf, enumValues: ExtensionRangeOptions_VerificationState.values) ..aOM(50, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -868,22 +852,16 @@ class FieldDescriptorProto extends $pb.GeneratedMessage { createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') ..aOS(2, _omitFieldNames ? '' : 'extendee') - ..a<$core.int>(3, _omitFieldNames ? '' : 'number', $pb.PbFieldType.O3) - ..e( - 4, _omitFieldNames ? '' : 'label', $pb.PbFieldType.OE, - defaultOrMaker: FieldDescriptorProto_Label.LABEL_OPTIONAL, - valueOf: FieldDescriptorProto_Label.valueOf, + ..aI(3, _omitFieldNames ? '' : 'number') + ..aE(4, _omitFieldNames ? '' : 'label', enumValues: FieldDescriptorProto_Label.values) - ..e( - 5, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, - defaultOrMaker: FieldDescriptorProto_Type.TYPE_DOUBLE, - valueOf: FieldDescriptorProto_Type.valueOf, + ..aE(5, _omitFieldNames ? '' : 'type', enumValues: FieldDescriptorProto_Type.values) ..aOS(6, _omitFieldNames ? '' : 'typeName') ..aOS(7, _omitFieldNames ? '' : 'defaultValue') ..aOM(8, _omitFieldNames ? '' : 'options', subBuilder: FieldOptions.create) - ..a<$core.int>(9, _omitFieldNames ? '' : 'oneofIndex', $pb.PbFieldType.O3) + ..aI(9, _omitFieldNames ? '' : 'oneofIndex') ..aOS(10, _omitFieldNames ? '' : 'jsonName') ..aOB(17, _omitFieldNames ? '' : 'proto3Optional'); @@ -1154,8 +1132,8 @@ class EnumDescriptorProto_EnumReservedRange extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'start', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'end', $pb.PbFieldType.O3) + ..aI(1, _omitFieldNames ? '' : 'start') + ..aI(2, _omitFieldNames ? '' : 'end') ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -1237,19 +1215,15 @@ class EnumDescriptorProto extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') - ..pc( - 2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'value', subBuilder: EnumValueDescriptorProto.create) ..aOM(3, _omitFieldNames ? '' : 'options', subBuilder: EnumOptions.create) - ..pc( - 4, _omitFieldNames ? '' : 'reservedRange', $pb.PbFieldType.PM, + ..pPM( + 4, _omitFieldNames ? '' : 'reservedRange', subBuilder: EnumDescriptorProto_EnumReservedRange.create) ..pPS(5, _omitFieldNames ? '' : 'reservedName') - ..e( - 6, _omitFieldNames ? '' : 'visibility', $pb.PbFieldType.OE, - defaultOrMaker: SymbolVisibility.VISIBILITY_UNSET, - valueOf: SymbolVisibility.valueOf, + ..aE(6, _omitFieldNames ? '' : 'visibility', enumValues: SymbolVisibility.values); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -1348,7 +1322,7 @@ class EnumValueDescriptorProto extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') - ..a<$core.int>(2, _omitFieldNames ? '' : 'number', $pb.PbFieldType.O3) + ..aI(2, _omitFieldNames ? '' : 'number') ..aOM(3, _omitFieldNames ? '' : 'options', subBuilder: EnumValueOptions.create); @@ -1433,8 +1407,7 @@ class ServiceDescriptorProto extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') - ..pc( - 2, _omitFieldNames ? '' : 'method', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'method', subBuilder: MethodDescriptorProto.create) ..aOM(3, _omitFieldNames ? '' : 'options', subBuilder: ServiceOptions.create); @@ -1682,10 +1655,8 @@ class FileOptions extends $pb.GeneratedMessage { createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'javaPackage') ..aOS(8, _omitFieldNames ? '' : 'javaOuterClassname') - ..e( - 9, _omitFieldNames ? '' : 'optimizeFor', $pb.PbFieldType.OE, + ..aE(9, _omitFieldNames ? '' : 'optimizeFor', defaultOrMaker: FileOptions_OptimizeMode.SPEED, - valueOf: FileOptions_OptimizeMode.valueOf, enumValues: FileOptions_OptimizeMode.values) ..aOB(10, _omitFieldNames ? '' : 'javaMultipleFiles') ..aOS(11, _omitFieldNames ? '' : 'goPackage') @@ -1707,8 +1678,8 @@ class FileOptions extends $pb.GeneratedMessage { ..aOS(45, _omitFieldNames ? '' : 'rubyPackage') ..aOM(50, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -2041,8 +2012,8 @@ class MessageOptions extends $pb.GeneratedMessage { ..aOB(11, _omitFieldNames ? '' : 'deprecatedLegacyJsonFieldConflicts') ..aOM(12, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -2219,9 +2190,7 @@ class FieldOptions_EditionDefault extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOS(2, _omitFieldNames ? '' : 'value') - ..e(3, _omitFieldNames ? '' : 'edition', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(3, _omitFieldNames ? '' : 'edition', enumValues: Edition.values) ..hasRequiredFields = false; @@ -2299,20 +2268,12 @@ class FieldOptions_FeatureSupport extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..e( - 1, _omitFieldNames ? '' : 'editionIntroduced', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(1, _omitFieldNames ? '' : 'editionIntroduced', enumValues: Edition.values) - ..e( - 2, _omitFieldNames ? '' : 'editionDeprecated', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(2, _omitFieldNames ? '' : 'editionDeprecated', enumValues: Edition.values) ..aOS(3, _omitFieldNames ? '' : 'deprecationWarning') - ..e(4, _omitFieldNames ? '' : 'editionRemoved', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(4, _omitFieldNames ? '' : 'editionRemoved', enumValues: Edition.values) ..hasRequiredFields = false; @@ -2394,7 +2355,7 @@ class FieldOptions extends $pb.GeneratedMessage { $core.bool? deprecated, $core.bool? lazy, FieldOptions_JSType? jstype, - $core.bool? weak, + @$core.Deprecated('This field is deprecated.') $core.bool? weak, $core.bool? unverifiedLazy, $core.bool? debugRedact, FieldOptions_OptionRetention? retention, @@ -2437,42 +2398,32 @@ class FieldOptions extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..e( - 1, _omitFieldNames ? '' : 'ctype', $pb.PbFieldType.OE, + ..aE(1, _omitFieldNames ? '' : 'ctype', defaultOrMaker: FieldOptions_CType.STRING, - valueOf: FieldOptions_CType.valueOf, enumValues: FieldOptions_CType.values) ..aOB(2, _omitFieldNames ? '' : 'packed') ..aOB(3, _omitFieldNames ? '' : 'deprecated') ..aOB(5, _omitFieldNames ? '' : 'lazy') - ..e( - 6, _omitFieldNames ? '' : 'jstype', $pb.PbFieldType.OE, + ..aE(6, _omitFieldNames ? '' : 'jstype', defaultOrMaker: FieldOptions_JSType.JS_NORMAL, - valueOf: FieldOptions_JSType.valueOf, enumValues: FieldOptions_JSType.values) ..aOB(10, _omitFieldNames ? '' : 'weak') ..aOB(15, _omitFieldNames ? '' : 'unverifiedLazy') ..aOB(16, _omitFieldNames ? '' : 'debugRedact') - ..e( - 17, _omitFieldNames ? '' : 'retention', $pb.PbFieldType.OE, - defaultOrMaker: FieldOptions_OptionRetention.RETENTION_UNKNOWN, - valueOf: FieldOptions_OptionRetention.valueOf, + ..aE(17, _omitFieldNames ? '' : 'retention', enumValues: FieldOptions_OptionRetention.values) - ..pc( - 19, _omitFieldNames ? '' : 'targets', $pb.PbFieldType.PE, - valueOf: FieldOptions_OptionTargetType.valueOf, - enumValues: FieldOptions_OptionTargetType.values, - defaultEnumValue: FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN) - ..pc( - 20, _omitFieldNames ? '' : 'editionDefaults', $pb.PbFieldType.PM, + ..pPE(19, _omitFieldNames ? '' : 'targets', + enumValues: FieldOptions_OptionTargetType.values) + ..pPM( + 20, _omitFieldNames ? '' : 'editionDefaults', subBuilder: FieldOptions_EditionDefault.create) ..aOM(21, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) ..aOM( 22, _omitFieldNames ? '' : 'featureSupport', subBuilder: FieldOptions_FeatureSupport.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -2593,13 +2544,18 @@ class FieldOptions extends $pb.GeneratedMessage { @$pb.TagNumber(6) void clearJstype() => $_clearField(6); + /// DEPRECATED. DO NOT USE! /// For Google-internal migration only. Do not use. + @$core.Deprecated('This field is deprecated.') @$pb.TagNumber(10) $core.bool get weak => $_getBF(5); + @$core.Deprecated('This field is deprecated.') @$pb.TagNumber(10) set weak($core.bool value) => $_setBool(5, value); + @$core.Deprecated('This field is deprecated.') @$pb.TagNumber(10) $core.bool hasWeak() => $_has(5); + @$core.Deprecated('This field is deprecated.') @$pb.TagNumber(10) void clearWeak() => $_clearField(10); @@ -2701,8 +2657,8 @@ class OneofOptions extends $pb.GeneratedMessage { createEmptyInstance: create) ..aOM(1, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -2787,8 +2743,8 @@ class EnumOptions extends $pb.GeneratedMessage { ..aOB(6, _omitFieldNames ? '' : 'deprecatedLegacyJsonFieldConflicts') ..aOM(7, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -2915,8 +2871,8 @@ class EnumValueOptions extends $pb.GeneratedMessage { ..aOM( 4, _omitFieldNames ? '' : 'featureSupport', subBuilder: FieldOptions_FeatureSupport.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -3029,8 +2985,8 @@ class ServiceOptions extends $pb.GeneratedMessage { ..aOB(33, _omitFieldNames ? '' : 'deprecated') ..aOM(34, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -3119,15 +3075,14 @@ class MethodOptions extends $pb.GeneratedMessage { const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) ..aOB(33, _omitFieldNames ? '' : 'deprecated') - ..e( - 34, _omitFieldNames ? '' : 'idempotencyLevel', $pb.PbFieldType.OE, + ..aE( + 34, _omitFieldNames ? '' : 'idempotencyLevel', defaultOrMaker: MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN, - valueOf: MethodOptions_IdempotencyLevel.valueOf, enumValues: MethodOptions_IdempotencyLevel.values) ..aOM(35, _omitFieldNames ? '' : 'features', subBuilder: FeatureSet.create) - ..pc( - 999, _omitFieldNames ? '' : 'uninterpretedOption', $pb.PbFieldType.PM, + ..pPM( + 999, _omitFieldNames ? '' : 'uninterpretedOption', subBuilder: UninterpretedOption.create) ..hasExtensions = true; @@ -3313,16 +3268,14 @@ class UninterpretedOption extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 2, _omitFieldNames ? '' : 'name', $pb.PbFieldType.PM, + ..pPM(2, _omitFieldNames ? '' : 'name', subBuilder: UninterpretedOption_NamePart.create) ..aOS(3, _omitFieldNames ? '' : 'identifierValue') ..a<$fixnum.Int64>( 4, _omitFieldNames ? '' : 'positiveIntValue', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) ..aInt64(5, _omitFieldNames ? '' : 'negativeIntValue') - ..a<$core.double>( - 6, _omitFieldNames ? '' : 'doubleValue', $pb.PbFieldType.OD) + ..aD(6, _omitFieldNames ? '' : 'doubleValue') ..a<$core.List<$core.int>>( 7, _omitFieldNames ? '' : 'stringValue', $pb.PbFieldType.OY) ..aOS(8, _omitFieldNames ? '' : 'aggregateValue'); @@ -3499,48 +3452,25 @@ class FeatureSet extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..e( - 1, _omitFieldNames ? '' : 'fieldPresence', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN, - valueOf: FeatureSet_FieldPresence.valueOf, + ..aE(1, _omitFieldNames ? '' : 'fieldPresence', enumValues: FeatureSet_FieldPresence.values) - ..e( - 2, _omitFieldNames ? '' : 'enumType', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_EnumType.ENUM_TYPE_UNKNOWN, - valueOf: FeatureSet_EnumType.valueOf, + ..aE(2, _omitFieldNames ? '' : 'enumType', enumValues: FeatureSet_EnumType.values) - ..e( - 3, _omitFieldNames ? '' : 'repeatedFieldEncoding', $pb.PbFieldType.OE, - defaultOrMaker: - FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN, - valueOf: FeatureSet_RepeatedFieldEncoding.valueOf, + ..aE( + 3, _omitFieldNames ? '' : 'repeatedFieldEncoding', enumValues: FeatureSet_RepeatedFieldEncoding.values) - ..e( - 4, _omitFieldNames ? '' : 'utf8Validation', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN, - valueOf: FeatureSet_Utf8Validation.valueOf, + ..aE(4, _omitFieldNames ? '' : 'utf8Validation', enumValues: FeatureSet_Utf8Validation.values) - ..e( - 5, _omitFieldNames ? '' : 'messageEncoding', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN, - valueOf: FeatureSet_MessageEncoding.valueOf, + ..aE( + 5, _omitFieldNames ? '' : 'messageEncoding', enumValues: FeatureSet_MessageEncoding.values) - ..e( - 6, _omitFieldNames ? '' : 'jsonFormat', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN, - valueOf: FeatureSet_JsonFormat.valueOf, + ..aE(6, _omitFieldNames ? '' : 'jsonFormat', enumValues: FeatureSet_JsonFormat.values) - ..e( - 7, _omitFieldNames ? '' : 'enforceNamingStyle', $pb.PbFieldType.OE, - defaultOrMaker: - FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN, - valueOf: FeatureSet_EnforceNamingStyle.valueOf, + ..aE( + 7, _omitFieldNames ? '' : 'enforceNamingStyle', enumValues: FeatureSet_EnforceNamingStyle.values) - ..e( - 8, _omitFieldNames ? '' : 'defaultSymbolVisibility', $pb.PbFieldType.OE, - defaultOrMaker: FeatureSet_VisibilityFeature_DefaultSymbolVisibility - .DEFAULT_SYMBOL_VISIBILITY_UNKNOWN, - valueOf: FeatureSet_VisibilityFeature_DefaultSymbolVisibility.valueOf, + ..aE( + 8, _omitFieldNames ? '' : 'defaultSymbolVisibility', enumValues: FeatureSet_VisibilityFeature_DefaultSymbolVisibility.values) ..hasExtensions = true; @@ -3675,9 +3605,7 @@ class FeatureSetDefaults_FeatureSetEditionDefault extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..e(3, _omitFieldNames ? '' : 'edition', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(3, _omitFieldNames ? '' : 'edition', enumValues: Edition.values) ..aOM(4, _omitFieldNames ? '' : 'overridableFeatures', subBuilder: FeatureSet.create) @@ -3775,16 +3703,12 @@ class FeatureSetDefaults extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 1, _omitFieldNames ? '' : 'defaults', $pb.PbFieldType.PM, + ..pPM( + 1, _omitFieldNames ? '' : 'defaults', subBuilder: FeatureSetDefaults_FeatureSetEditionDefault.create) - ..e(4, _omitFieldNames ? '' : 'minimumEdition', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(4, _omitFieldNames ? '' : 'minimumEdition', enumValues: Edition.values) - ..e(5, _omitFieldNames ? '' : 'maximumEdition', $pb.PbFieldType.OE, - defaultOrMaker: Edition.EDITION_UNKNOWN, - valueOf: Edition.valueOf, + ..aE(5, _omitFieldNames ? '' : 'maximumEdition', enumValues: Edition.values); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -4024,8 +3948,7 @@ class SourceCodeInfo extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 1, _omitFieldNames ? '' : 'location', $pb.PbFieldType.PM, + ..pPM(1, _omitFieldNames ? '' : 'location', subBuilder: SourceCodeInfo_Location.create) ..hasExtensions = true; @@ -4130,12 +4053,10 @@ class GeneratedCodeInfo_Annotation extends $pb.GeneratedMessage { createEmptyInstance: create) ..p<$core.int>(1, _omitFieldNames ? '' : 'path', $pb.PbFieldType.K3) ..aOS(2, _omitFieldNames ? '' : 'sourceFile') - ..a<$core.int>(3, _omitFieldNames ? '' : 'begin', $pb.PbFieldType.O3) - ..a<$core.int>(4, _omitFieldNames ? '' : 'end', $pb.PbFieldType.O3) - ..e( - 5, _omitFieldNames ? '' : 'semantic', $pb.PbFieldType.OE, - defaultOrMaker: GeneratedCodeInfo_Annotation_Semantic.NONE, - valueOf: GeneratedCodeInfo_Annotation_Semantic.valueOf, + ..aI(3, _omitFieldNames ? '' : 'begin') + ..aI(4, _omitFieldNames ? '' : 'end') + ..aE( + 5, _omitFieldNames ? '' : 'semantic', enumValues: GeneratedCodeInfo_Annotation_Semantic.values) ..hasRequiredFields = false; @@ -4238,8 +4159,7 @@ class GeneratedCodeInfo extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) - ..pc( - 1, _omitFieldNames ? '' : 'annotation', $pb.PbFieldType.PM, + ..pPM(1, _omitFieldNames ? '' : 'annotation', subBuilder: GeneratedCodeInfo_Annotation.create) ..hasRequiredFields = false; diff --git a/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart b/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart index 343ec9dd7..fafadb503 100644 --- a/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart +++ b/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart @@ -104,7 +104,7 @@ class Duration extends $pb.GeneratedMessage with $mixin.DurationMixin { createEmptyInstance: create, wellKnownType: $mixin.WellKnownType.duration) ..aInt64(1, _omitFieldNames ? '' : 'seconds') - ..a<$core.int>(2, _omitFieldNames ? '' : 'nanos', $pb.PbFieldType.O3) + ..aI(2, _omitFieldNames ? '' : 'nanos') ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') diff --git a/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pb.dart b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pb.dart new file mode 100644 index 000000000..014f4b8fc --- /dev/null +++ b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pb.dart @@ -0,0 +1,399 @@ +// This is a generated file - do not edit. +// +// Generated from google/protobuf/unittest_features.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'unittest_features.pbenum.dart'; + +export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions; + +export 'unittest_features.pbenum.dart'; + +class TestMessage_Nested extends $pb.GeneratedMessage { + factory TestMessage_Nested() => create(); + + TestMessage_Nested._(); + + factory TestMessage_Nested.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory TestMessage_Nested.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'TestMessage.Nested', + package: const $pb.PackageName(_omitMessageNames ? '' : 'pb'), + createEmptyInstance: create) + ..hasRequiredFields = false; + static final testNested = $pb.Extension( + _omitMessageNames ? '' : 'google.protobuf.FeatureSet', + _omitFieldNames ? '' : 'testNested', + 9997, + $pb.PbFieldType.OM, + defaultOrMaker: TestFeatures.getDefault, + subBuilder: TestFeatures.create); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestMessage_Nested clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestMessage_Nested copyWith(void Function(TestMessage_Nested) updates) => + super.copyWith((message) => updates(message as TestMessage_Nested)) + as TestMessage_Nested; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static TestMessage_Nested create() => TestMessage_Nested._(); + @$core.override + TestMessage_Nested createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static TestMessage_Nested getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static TestMessage_Nested? _defaultInstance; +} + +class TestMessage extends $pb.GeneratedMessage { + factory TestMessage() => create(); + + TestMessage._(); + + factory TestMessage.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory TestMessage.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'TestMessage', + package: const $pb.PackageName(_omitMessageNames ? '' : 'pb'), + createEmptyInstance: create) + ..hasRequiredFields = false; + static final testMessage = $pb.Extension( + _omitMessageNames ? '' : 'google.protobuf.FeatureSet', + _omitFieldNames ? '' : 'testMessage', + 9998, + $pb.PbFieldType.OM, + defaultOrMaker: TestFeatures.getDefault, + subBuilder: TestFeatures.create); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestMessage clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestMessage copyWith(void Function(TestMessage) updates) => + super.copyWith((message) => updates(message as TestMessage)) + as TestMessage; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static TestMessage create() => TestMessage._(); + @$core.override + TestMessage createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static TestMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static TestMessage? _defaultInstance; +} + +class TestFeatures extends $pb.GeneratedMessage { + factory TestFeatures({ + EnumFeature? fileFeature, + EnumFeature? extensionRangeFeature, + EnumFeature? messageFeature, + EnumFeature? fieldFeature, + EnumFeature? oneofFeature, + EnumFeature? enumFeature, + EnumFeature? enumEntryFeature, + EnumFeature? serviceFeature, + EnumFeature? methodFeature, + EnumFeature? multipleFeature, + $core.bool? boolFieldFeature, + EnumFeature? sourceFeature, + EnumFeature? sourceFeature2, + EnumFeature? removedFeature, + EnumFeature? futureFeature, + EnumFeature? legacyFeature, + ValueLifetimeFeature? valueLifetimeFeature, + }) { + final result = create(); + if (fileFeature != null) result.fileFeature = fileFeature; + if (extensionRangeFeature != null) + result.extensionRangeFeature = extensionRangeFeature; + if (messageFeature != null) result.messageFeature = messageFeature; + if (fieldFeature != null) result.fieldFeature = fieldFeature; + if (oneofFeature != null) result.oneofFeature = oneofFeature; + if (enumFeature != null) result.enumFeature = enumFeature; + if (enumEntryFeature != null) result.enumEntryFeature = enumEntryFeature; + if (serviceFeature != null) result.serviceFeature = serviceFeature; + if (methodFeature != null) result.methodFeature = methodFeature; + if (multipleFeature != null) result.multipleFeature = multipleFeature; + if (boolFieldFeature != null) result.boolFieldFeature = boolFieldFeature; + if (sourceFeature != null) result.sourceFeature = sourceFeature; + if (sourceFeature2 != null) result.sourceFeature2 = sourceFeature2; + if (removedFeature != null) result.removedFeature = removedFeature; + if (futureFeature != null) result.futureFeature = futureFeature; + if (legacyFeature != null) result.legacyFeature = legacyFeature; + if (valueLifetimeFeature != null) + result.valueLifetimeFeature = valueLifetimeFeature; + return result; + } + + TestFeatures._(); + + factory TestFeatures.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory TestFeatures.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'TestFeatures', + package: const $pb.PackageName(_omitMessageNames ? '' : 'pb'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'fileFeature', + enumValues: EnumFeature.values) + ..aE(2, _omitFieldNames ? '' : 'extensionRangeFeature', + enumValues: EnumFeature.values) + ..aE(3, _omitFieldNames ? '' : 'messageFeature', + enumValues: EnumFeature.values) + ..aE(4, _omitFieldNames ? '' : 'fieldFeature', + enumValues: EnumFeature.values) + ..aE(5, _omitFieldNames ? '' : 'oneofFeature', + enumValues: EnumFeature.values) + ..aE(6, _omitFieldNames ? '' : 'enumFeature', + enumValues: EnumFeature.values) + ..aE(7, _omitFieldNames ? '' : 'enumEntryFeature', + enumValues: EnumFeature.values) + ..aE(8, _omitFieldNames ? '' : 'serviceFeature', + enumValues: EnumFeature.values) + ..aE(9, _omitFieldNames ? '' : 'methodFeature', + enumValues: EnumFeature.values) + ..aE(10, _omitFieldNames ? '' : 'multipleFeature', + enumValues: EnumFeature.values) + ..aOB(11, _omitFieldNames ? '' : 'boolFieldFeature') + ..aE(15, _omitFieldNames ? '' : 'sourceFeature', + enumValues: EnumFeature.values) + ..aE(16, _omitFieldNames ? '' : 'sourceFeature2', + enumValues: EnumFeature.values) + ..aE(17, _omitFieldNames ? '' : 'removedFeature', + enumValues: EnumFeature.values) + ..aE(18, _omitFieldNames ? '' : 'futureFeature', + enumValues: EnumFeature.values) + ..aE(19, _omitFieldNames ? '' : 'legacyFeature', + enumValues: EnumFeature.values) + ..aE( + 20, _omitFieldNames ? '' : 'valueLifetimeFeature', + enumValues: ValueLifetimeFeature.values) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestFeatures clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + TestFeatures copyWith(void Function(TestFeatures) updates) => + super.copyWith((message) => updates(message as TestFeatures)) + as TestFeatures; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static TestFeatures create() => TestFeatures._(); + @$core.override + TestFeatures createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static TestFeatures getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static TestFeatures? _defaultInstance; + + @$pb.TagNumber(1) + EnumFeature get fileFeature => $_getN(0); + @$pb.TagNumber(1) + set fileFeature(EnumFeature value) => $_setField(1, value); + @$pb.TagNumber(1) + $core.bool hasFileFeature() => $_has(0); + @$pb.TagNumber(1) + void clearFileFeature() => $_clearField(1); + + @$pb.TagNumber(2) + EnumFeature get extensionRangeFeature => $_getN(1); + @$pb.TagNumber(2) + set extensionRangeFeature(EnumFeature value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasExtensionRangeFeature() => $_has(1); + @$pb.TagNumber(2) + void clearExtensionRangeFeature() => $_clearField(2); + + @$pb.TagNumber(3) + EnumFeature get messageFeature => $_getN(2); + @$pb.TagNumber(3) + set messageFeature(EnumFeature value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasMessageFeature() => $_has(2); + @$pb.TagNumber(3) + void clearMessageFeature() => $_clearField(3); + + @$pb.TagNumber(4) + EnumFeature get fieldFeature => $_getN(3); + @$pb.TagNumber(4) + set fieldFeature(EnumFeature value) => $_setField(4, value); + @$pb.TagNumber(4) + $core.bool hasFieldFeature() => $_has(3); + @$pb.TagNumber(4) + void clearFieldFeature() => $_clearField(4); + + @$pb.TagNumber(5) + EnumFeature get oneofFeature => $_getN(4); + @$pb.TagNumber(5) + set oneofFeature(EnumFeature value) => $_setField(5, value); + @$pb.TagNumber(5) + $core.bool hasOneofFeature() => $_has(4); + @$pb.TagNumber(5) + void clearOneofFeature() => $_clearField(5); + + @$pb.TagNumber(6) + EnumFeature get enumFeature => $_getN(5); + @$pb.TagNumber(6) + set enumFeature(EnumFeature value) => $_setField(6, value); + @$pb.TagNumber(6) + $core.bool hasEnumFeature() => $_has(5); + @$pb.TagNumber(6) + void clearEnumFeature() => $_clearField(6); + + @$pb.TagNumber(7) + EnumFeature get enumEntryFeature => $_getN(6); + @$pb.TagNumber(7) + set enumEntryFeature(EnumFeature value) => $_setField(7, value); + @$pb.TagNumber(7) + $core.bool hasEnumEntryFeature() => $_has(6); + @$pb.TagNumber(7) + void clearEnumEntryFeature() => $_clearField(7); + + @$pb.TagNumber(8) + EnumFeature get serviceFeature => $_getN(7); + @$pb.TagNumber(8) + set serviceFeature(EnumFeature value) => $_setField(8, value); + @$pb.TagNumber(8) + $core.bool hasServiceFeature() => $_has(7); + @$pb.TagNumber(8) + void clearServiceFeature() => $_clearField(8); + + @$pb.TagNumber(9) + EnumFeature get methodFeature => $_getN(8); + @$pb.TagNumber(9) + set methodFeature(EnumFeature value) => $_setField(9, value); + @$pb.TagNumber(9) + $core.bool hasMethodFeature() => $_has(8); + @$pb.TagNumber(9) + void clearMethodFeature() => $_clearField(9); + + @$pb.TagNumber(10) + EnumFeature get multipleFeature => $_getN(9); + @$pb.TagNumber(10) + set multipleFeature(EnumFeature value) => $_setField(10, value); + @$pb.TagNumber(10) + $core.bool hasMultipleFeature() => $_has(9); + @$pb.TagNumber(10) + void clearMultipleFeature() => $_clearField(10); + + @$pb.TagNumber(11) + $core.bool get boolFieldFeature => $_getBF(10); + @$pb.TagNumber(11) + set boolFieldFeature($core.bool value) => $_setBool(10, value); + @$pb.TagNumber(11) + $core.bool hasBoolFieldFeature() => $_has(10); + @$pb.TagNumber(11) + void clearBoolFieldFeature() => $_clearField(11); + + @$pb.TagNumber(15) + EnumFeature get sourceFeature => $_getN(11); + @$pb.TagNumber(15) + set sourceFeature(EnumFeature value) => $_setField(15, value); + @$pb.TagNumber(15) + $core.bool hasSourceFeature() => $_has(11); + @$pb.TagNumber(15) + void clearSourceFeature() => $_clearField(15); + + @$pb.TagNumber(16) + EnumFeature get sourceFeature2 => $_getN(12); + @$pb.TagNumber(16) + set sourceFeature2(EnumFeature value) => $_setField(16, value); + @$pb.TagNumber(16) + $core.bool hasSourceFeature2() => $_has(12); + @$pb.TagNumber(16) + void clearSourceFeature2() => $_clearField(16); + + @$pb.TagNumber(17) + EnumFeature get removedFeature => $_getN(13); + @$pb.TagNumber(17) + set removedFeature(EnumFeature value) => $_setField(17, value); + @$pb.TagNumber(17) + $core.bool hasRemovedFeature() => $_has(13); + @$pb.TagNumber(17) + void clearRemovedFeature() => $_clearField(17); + + @$pb.TagNumber(18) + EnumFeature get futureFeature => $_getN(14); + @$pb.TagNumber(18) + set futureFeature(EnumFeature value) => $_setField(18, value); + @$pb.TagNumber(18) + $core.bool hasFutureFeature() => $_has(14); + @$pb.TagNumber(18) + void clearFutureFeature() => $_clearField(18); + + @$pb.TagNumber(19) + EnumFeature get legacyFeature => $_getN(15); + @$pb.TagNumber(19) + set legacyFeature(EnumFeature value) => $_setField(19, value); + @$pb.TagNumber(19) + $core.bool hasLegacyFeature() => $_has(15); + @$pb.TagNumber(19) + void clearLegacyFeature() => $_clearField(19); + + @$pb.TagNumber(20) + ValueLifetimeFeature get valueLifetimeFeature => $_getN(16); + @$pb.TagNumber(20) + set valueLifetimeFeature(ValueLifetimeFeature value) => $_setField(20, value); + @$pb.TagNumber(20) + $core.bool hasValueLifetimeFeature() => $_has(16); + @$pb.TagNumber(20) + void clearValueLifetimeFeature() => $_clearField(20); +} + +class Unittest_features { + static final test = $pb.Extension( + _omitMessageNames ? '' : 'google.protobuf.FeatureSet', + _omitFieldNames ? '' : 'test', + 9999, + $pb.PbFieldType.OM, + defaultOrMaker: TestFeatures.getDefault, + subBuilder: TestFeatures.create); + static void registerAllExtensions($pb.ExtensionRegistry registry) { + registry.add(test); + } +} + +const $core.bool _omitFieldNames = + $core.bool.fromEnvironment('protobuf.omit_field_names'); +const $core.bool _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pbenum.dart b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pbenum.dart new file mode 100644 index 000000000..2aea267d5 --- /dev/null +++ b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pbenum.dart @@ -0,0 +1,117 @@ +// This is a generated file - do not edit. +// +// Generated from google/protobuf/unittest_features.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class EnumFeature extends $pb.ProtobufEnum { + static const EnumFeature TEST_ENUM_FEATURE_UNKNOWN = + EnumFeature._(0, _omitEnumNames ? '' : 'TEST_ENUM_FEATURE_UNKNOWN'); + static const EnumFeature VALUE1 = + EnumFeature._(1, _omitEnumNames ? '' : 'VALUE1'); + static const EnumFeature VALUE2 = + EnumFeature._(2, _omitEnumNames ? '' : 'VALUE2'); + static const EnumFeature VALUE3 = + EnumFeature._(3, _omitEnumNames ? '' : 'VALUE3'); + static const EnumFeature VALUE4 = + EnumFeature._(4, _omitEnumNames ? '' : 'VALUE4'); + static const EnumFeature VALUE5 = + EnumFeature._(5, _omitEnumNames ? '' : 'VALUE5'); + static const EnumFeature VALUE6 = + EnumFeature._(6, _omitEnumNames ? '' : 'VALUE6'); + static const EnumFeature VALUE7 = + EnumFeature._(7, _omitEnumNames ? '' : 'VALUE7'); + static const EnumFeature VALUE8 = + EnumFeature._(8, _omitEnumNames ? '' : 'VALUE8'); + static const EnumFeature VALUE9 = + EnumFeature._(9, _omitEnumNames ? '' : 'VALUE9'); + static const EnumFeature VALUE10 = + EnumFeature._(10, _omitEnumNames ? '' : 'VALUE10'); + static const EnumFeature VALUE11 = + EnumFeature._(11, _omitEnumNames ? '' : 'VALUE11'); + static const EnumFeature VALUE12 = + EnumFeature._(12, _omitEnumNames ? '' : 'VALUE12'); + static const EnumFeature VALUE13 = + EnumFeature._(13, _omitEnumNames ? '' : 'VALUE13'); + static const EnumFeature VALUE14 = + EnumFeature._(14, _omitEnumNames ? '' : 'VALUE14'); + static const EnumFeature VALUE15 = + EnumFeature._(15, _omitEnumNames ? '' : 'VALUE15'); + + static const $core.List values = [ + TEST_ENUM_FEATURE_UNKNOWN, + VALUE1, + VALUE2, + VALUE3, + VALUE4, + VALUE5, + VALUE6, + VALUE7, + VALUE8, + VALUE9, + VALUE10, + VALUE11, + VALUE12, + VALUE13, + VALUE14, + VALUE15, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 15); + static EnumFeature? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const EnumFeature._(super.value, super.name); +} + +class ValueLifetimeFeature extends $pb.ProtobufEnum { + static const ValueLifetimeFeature TEST_VALUE_LIFETIME_UNKNOWN = + ValueLifetimeFeature._( + 0, _omitEnumNames ? '' : 'TEST_VALUE_LIFETIME_UNKNOWN'); + static const ValueLifetimeFeature VALUE_LIFETIME_INHERITED = + ValueLifetimeFeature._( + 1, _omitEnumNames ? '' : 'VALUE_LIFETIME_INHERITED'); + static const ValueLifetimeFeature VALUE_LIFETIME_SUPPORT = + ValueLifetimeFeature._(2, _omitEnumNames ? '' : 'VALUE_LIFETIME_SUPPORT'); + static const ValueLifetimeFeature VALUE_LIFETIME_EMPTY_SUPPORT = + ValueLifetimeFeature._( + 3, _omitEnumNames ? '' : 'VALUE_LIFETIME_EMPTY_SUPPORT'); + static const ValueLifetimeFeature VALUE_LIFETIME_FUTURE = + ValueLifetimeFeature._(4, _omitEnumNames ? '' : 'VALUE_LIFETIME_FUTURE'); + static const ValueLifetimeFeature VALUE_LIFETIME_DEPRECATED = + ValueLifetimeFeature._( + 5, _omitEnumNames ? '' : 'VALUE_LIFETIME_DEPRECATED'); + static const ValueLifetimeFeature VALUE_LIFETIME_REMOVED = + ValueLifetimeFeature._(6, _omitEnumNames ? '' : 'VALUE_LIFETIME_REMOVED'); + + static const $core.List values = [ + TEST_VALUE_LIFETIME_UNKNOWN, + VALUE_LIFETIME_INHERITED, + VALUE_LIFETIME_SUPPORT, + VALUE_LIFETIME_EMPTY_SUPPORT, + VALUE_LIFETIME_FUTURE, + VALUE_LIFETIME_DEPRECATED, + VALUE_LIFETIME_REMOVED, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 6); + static ValueLifetimeFeature? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const ValueLifetimeFeature._(super.value, super.name); +} + +const $core.bool _omitEnumNames = + $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/protoc_plugin/protos/google/protobuf/compiler/plugin.proto b/protoc_plugin/protos/google/protobuf/compiler/plugin.proto index 033fab23c..10d285f8a 100644 --- a/protoc_plugin/protos/google/protobuf/compiler/plugin.proto +++ b/protoc_plugin/protos/google/protobuf/compiler/plugin.proto @@ -24,11 +24,11 @@ package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; +import "google/protobuf/descriptor.proto"; + option csharp_namespace = "Google.Protobuf.Compiler"; option go_package = "google.golang.org/protobuf/types/pluginpb"; -import "google/protobuf/descriptor.proto"; - // The version number of protocol compiler. message Version { optional int32 major = 1; diff --git a/protoc_plugin/protos/google/protobuf/descriptor.proto b/protoc_plugin/protos/google/protobuf/descriptor.proto index cb9bea190..333b7e998 100644 --- a/protoc_plugin/protos/google/protobuf/descriptor.proto +++ b/protoc_plugin/protos/google/protobuf/descriptor.proto @@ -398,6 +398,9 @@ message ServiceDescriptorProto { repeated MethodDescriptorProto method = 2; optional ServiceOptions options = 3; + + reserved 4; + reserved "stream"; } // Describes a method of a service. @@ -753,8 +756,9 @@ message FieldOptions { // is a formalization for deprecating fields. optional bool deprecated = 3 [default = false]; + // DEPRECATED. DO NOT USE! // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; + optional bool weak = 10 [default = false, deprecated = true]; // Indicate that the field value should not be printed out when using debug // formats, e.g. when the field contains sensitive credentials. diff --git a/protoc_plugin/protos/google/protobuf/unittest_features.proto b/protoc_plugin/protos/google/protobuf/unittest_features.proto new file mode 100644 index 000000000..dd0d4141e --- /dev/null +++ b/protoc_plugin/protos/google/protobuf/unittest_features.proto @@ -0,0 +1,244 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +edition = "2024"; + +package pb; + +import "google/protobuf/descriptor.proto"; + +option java_outer_classname = "UnittestFeatures"; + +extend google.protobuf.FeatureSet { + TestFeatures test = 9999; +} + +message TestMessage { + extend google.protobuf.FeatureSet { + TestFeatures test_message = 9998; + } + message Nested { + extend google.protobuf.FeatureSet { + TestFeatures test_nested = 9997; + } + } +} + +enum EnumFeature { + TEST_ENUM_FEATURE_UNKNOWN = 0; + VALUE1 = 1; + VALUE2 = 2; + VALUE3 = 3; + VALUE4 = 4; + VALUE5 = 5; + VALUE6 = 6; + VALUE7 = 7; + VALUE8 = 8; + VALUE9 = 9; + VALUE10 = 10; + VALUE11 = 11; + VALUE12 = 12; + VALUE13 = 13; + VALUE14 = 14; + VALUE15 = 15; +} + +enum ValueLifetimeFeature { + TEST_VALUE_LIFETIME_UNKNOWN = 0; + VALUE_LIFETIME_INHERITED = 1; + VALUE_LIFETIME_SUPPORT = 2 [feature_support = { + edition_introduced: EDITION_99997_TEST_ONLY + edition_deprecated: EDITION_99998_TEST_ONLY + deprecation_warning: "Custom feature deprecation warning" + edition_removed: EDITION_99999_TEST_ONLY + }]; + VALUE_LIFETIME_EMPTY_SUPPORT = 3 [feature_support = {}]; + VALUE_LIFETIME_FUTURE = 4 + [feature_support.edition_introduced = EDITION_99997_TEST_ONLY]; + VALUE_LIFETIME_DEPRECATED = 5 [feature_support = { + edition_deprecated: EDITION_99997_TEST_ONLY + deprecation_warning: "Custom feature deprecation warning" + }]; + VALUE_LIFETIME_REMOVED = 6 [feature_support = { + edition_deprecated: EDITION_2023 + edition_removed: EDITION_99997_TEST_ONLY + }]; +} + +message TestFeatures { + EnumFeature file_feature = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VALUE2" }, + edition_defaults = { edition: EDITION_2023, value: "VALUE3" }, + edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "VALUE4" }, + edition_defaults = { edition: EDITION_99998_TEST_ONLY, value: "VALUE5" } + ]; + EnumFeature extension_range_feature = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_EXTENSION_RANGE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature message_feature = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature field_feature = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature oneof_feature = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ONEOF, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature enum_feature = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature enum_entry_feature = 7 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM_ENTRY, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature service_feature = 8 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_SERVICE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature method_feature = 9 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_METHOD, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + EnumFeature multiple_feature = 10 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_ENUM_ENTRY, + targets = TARGET_TYPE_SERVICE, + targets = TARGET_TYPE_METHOD, + targets = TARGET_TYPE_ONEOF, + targets = TARGET_TYPE_EXTENSION_RANGE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + + bool bool_field_feature = 11 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "false" }, + edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "true" } + ]; + + EnumFeature source_feature = 15 [ + retention = RETENTION_SOURCE, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_ENUM_ENTRY, + targets = TARGET_TYPE_SERVICE, + targets = TARGET_TYPE_METHOD, + targets = TARGET_TYPE_ONEOF, + targets = TARGET_TYPE_EXTENSION_RANGE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + + EnumFeature source_feature2 = 16 [ + retention = RETENTION_SOURCE, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_ENUM_ENTRY, + targets = TARGET_TYPE_SERVICE, + targets = TARGET_TYPE_METHOD, + targets = TARGET_TYPE_ONEOF, + targets = TARGET_TYPE_EXTENSION_RANGE, + feature_support.edition_introduced = EDITION_2023, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" } + ]; + + EnumFeature removed_feature = 17 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + feature_support = { + edition_introduced: EDITION_2023 + edition_deprecated: EDITION_2023 + deprecation_warning: "Custom feature deprecation warning" + edition_removed: EDITION_2024 + }, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" }, + edition_defaults = { edition: EDITION_2023, value: "VALUE2" }, + edition_defaults = { edition: EDITION_2024, value: "VALUE3" } + ]; + + EnumFeature future_feature = 18 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + feature_support = { edition_introduced: EDITION_2024 }, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" }, + edition_defaults = { edition: EDITION_2024, value: "VALUE2" } + ]; + + EnumFeature legacy_feature = 19 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + feature_support = { + edition_introduced: EDITION_PROTO3 + edition_removed: EDITION_2023 + }, + edition_defaults = { edition: EDITION_LEGACY, value: "VALUE1" }, + edition_defaults = { edition: EDITION_2023, value: "VALUE2" } + ]; + + ValueLifetimeFeature value_lifetime_feature = 20 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023 + edition_deprecated: EDITION_99998_TEST_ONLY + deprecation_warning: "Custom feature deprecation warning" + edition_removed: EDITION_99999_TEST_ONLY + }, + edition_defaults = { + edition: EDITION_LEGACY, + value: "VALUE_LIFETIME_INHERITED" + }, + // Verify edition defaults can use future values. + edition_defaults = { + edition: EDITION_2023, + value: "VALUE_LIFETIME_FUTURE" + }, + // Verify edition defaults can use removed values. + edition_defaults = { + edition: EDITION_99999_TEST_ONLY, + value: "VALUE_LIFETIME_FUTURE" + } + ]; +} diff --git a/protoc_plugin/tool/update_protos.dart b/protoc_plugin/tool/update_protos.dart index cd3f22145..c0ff6e254 100644 --- a/protoc_plugin/tool/update_protos.dart +++ b/protoc_plugin/tool/update_protos.dart @@ -31,6 +31,7 @@ void main(List args) async { 'google/protobuf/compiler/plugin.proto', 'google/protobuf/descriptor.proto', 'google/protobuf/duration.proto', + 'google/protobuf/unittest_features.proto', ]); // Update from googleapis/googleapis.