Skip to content

Commit 0cefb2e

Browse files
authored
Upgrade protobuf to 5.0.0 (#807)
* Upgrade protobuf * Regenerate main * regen example
1 parent b46c486 commit 0cefb2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3246
-3716
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.3.0
2+
3+
- Require `package:protobuf` 5.0.0
4+
15
## 4.2.0
26

37
- Export a protobuf generated symbol (`Any`)
Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/label.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/label.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names
1112

1213
import 'dart:core' as $core;
1314

1415
import 'package:protobuf/protobuf.dart' as $pb;
1516

1617
import 'label.pbenum.dart';
1718

19+
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
20+
1821
export 'label.pbenum.dart';
1922

2023
/// A description of a label.
@@ -25,53 +28,44 @@ class LabelDescriptor extends $pb.GeneratedMessage {
2528
$core.String? description,
2629
}) {
2730
final result = create();
28-
if (key != null) {
29-
result.key = key;
30-
}
31-
if (valueType != null) {
32-
result.valueType = valueType;
33-
}
34-
if (description != null) {
35-
result.description = description;
36-
}
31+
if (key != null) result.key = key;
32+
if (valueType != null) result.valueType = valueType;
33+
if (description != null) result.description = description;
3734
return result;
3835
}
39-
LabelDescriptor._() : super();
40-
factory LabelDescriptor.fromBuffer($core.List<$core.int> i,
41-
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
42-
create()..mergeFromBuffer(i, r);
43-
factory LabelDescriptor.fromJson($core.String i,
44-
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
45-
create()..mergeFromJson(i, r);
36+
37+
LabelDescriptor._();
38+
39+
factory LabelDescriptor.fromBuffer($core.List<$core.int> data,
40+
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
41+
create()..mergeFromBuffer(data, registry);
42+
factory LabelDescriptor.fromJson($core.String json,
43+
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
44+
create()..mergeFromJson(json, registry);
4645

4746
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
4847
_omitMessageNames ? '' : 'LabelDescriptor',
4948
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'),
5049
createEmptyInstance: create)
5150
..aOS(1, _omitFieldNames ? '' : 'key')
52-
..e<LabelDescriptor_ValueType>(
53-
2, _omitFieldNames ? '' : 'valueType', $pb.PbFieldType.OE,
54-
defaultOrMaker: LabelDescriptor_ValueType.STRING,
55-
valueOf: LabelDescriptor_ValueType.valueOf,
51+
..aE<LabelDescriptor_ValueType>(2, _omitFieldNames ? '' : 'valueType',
5652
enumValues: LabelDescriptor_ValueType.values)
5753
..aOS(3, _omitFieldNames ? '' : 'description')
5854
..hasRequiredFields = false;
5955

60-
@$core.Deprecated('Using this can add significant overhead to your binary. '
61-
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
62-
'Will be removed in next major version')
63-
LabelDescriptor clone() => LabelDescriptor()..mergeFromMessage(this);
64-
@$core.Deprecated('Using this can add significant overhead to your binary. '
65-
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
66-
'Will be removed in next major version')
56+
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
57+
LabelDescriptor clone() => deepCopy();
58+
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
6759
LabelDescriptor copyWith(void Function(LabelDescriptor) updates) =>
6860
super.copyWith((message) => updates(message as LabelDescriptor))
6961
as LabelDescriptor;
7062

63+
@$core.override
7164
$pb.BuilderInfo get info_ => _i;
7265

7366
@$core.pragma('dart2js:noInline')
7467
static LabelDescriptor create() => LabelDescriptor._();
68+
@$core.override
7569
LabelDescriptor createEmptyInstance() => create();
7670
static $pb.PbList<LabelDescriptor> createRepeated() =>
7771
$pb.PbList<LabelDescriptor>();
@@ -84,42 +78,34 @@ class LabelDescriptor extends $pb.GeneratedMessage {
8478
@$pb.TagNumber(1)
8579
$core.String get key => $_getSZ(0);
8680
@$pb.TagNumber(1)
87-
set key($core.String v) {
88-
$_setString(0, v);
89-
}
90-
81+
set key($core.String value) => $_setString(0, value);
9182
@$pb.TagNumber(1)
9283
$core.bool hasKey() => $_has(0);
9384
@$pb.TagNumber(1)
94-
void clearKey() => clearField(1);
85+
void clearKey() => $_clearField(1);
9586

9687
/// The type of data that can be assigned to the label.
9788
@$pb.TagNumber(2)
9889
LabelDescriptor_ValueType get valueType => $_getN(1);
9990
@$pb.TagNumber(2)
100-
set valueType(LabelDescriptor_ValueType v) {
101-
setField(2, v);
102-
}
103-
91+
set valueType(LabelDescriptor_ValueType value) => $_setField(2, value);
10492
@$pb.TagNumber(2)
10593
$core.bool hasValueType() => $_has(1);
10694
@$pb.TagNumber(2)
107-
void clearValueType() => clearField(2);
95+
void clearValueType() => $_clearField(2);
10896

10997
/// A human-readable description for the label.
11098
@$pb.TagNumber(3)
11199
$core.String get description => $_getSZ(2);
112100
@$pb.TagNumber(3)
113-
set description($core.String v) {
114-
$_setString(2, v);
115-
}
116-
101+
set description($core.String value) => $_setString(2, value);
117102
@$pb.TagNumber(3)
118103
$core.bool hasDescription() => $_has(2);
119104
@$pb.TagNumber(3)
120-
void clearDescription() => clearField(3);
105+
void clearDescription() => $_clearField(3);
121106
}
122107

123-
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
124-
const _omitMessageNames =
108+
const $core.bool _omitFieldNames =
109+
$core.bool.fromEnvironment('protobuf.omit_field_names');
110+
const $core.bool _omitMessageNames =
125111
$core.bool.fromEnvironment('protobuf.omit_message_names');
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/label.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/label.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names
1112

1213
import 'dart:core' as $core;
1314

1415
import 'package:protobuf/protobuf.dart' as $pb;
1516

1617
/// Value types that can be used as label values.
1718
class LabelDescriptor_ValueType extends $pb.ProtobufEnum {
19+
/// A variable-length string. This is the default.
1820
static const LabelDescriptor_ValueType STRING =
1921
LabelDescriptor_ValueType._(0, _omitEnumNames ? '' : 'STRING');
22+
23+
/// Boolean; true or false.
2024
static const LabelDescriptor_ValueType BOOL =
2125
LabelDescriptor_ValueType._(1, _omitEnumNames ? '' : 'BOOL');
26+
27+
/// A 64-bit signed integer.
2228
static const LabelDescriptor_ValueType INT64 =
2329
LabelDescriptor_ValueType._(2, _omitEnumNames ? '' : 'INT64');
2430

@@ -29,11 +35,13 @@ class LabelDescriptor_ValueType extends $pb.ProtobufEnum {
2935
INT64,
3036
];
3137

32-
static final $core.Map<$core.int, LabelDescriptor_ValueType> _byValue =
33-
$pb.ProtobufEnum.initByValue(values);
34-
static LabelDescriptor_ValueType? valueOf($core.int value) => _byValue[value];
38+
static final $core.List<LabelDescriptor_ValueType?> _byValue =
39+
$pb.ProtobufEnum.$_initByValueList(values, 2);
40+
static LabelDescriptor_ValueType? valueOf($core.int value) =>
41+
value < 0 || value >= _byValue.length ? null : _byValue[value];
3542

36-
const LabelDescriptor_ValueType._($core.int v, $core.String n) : super(v, n);
43+
const LabelDescriptor_ValueType._(super.value, super.name);
3744
}
3845

39-
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
46+
const $core.bool _omitEnumNames =
47+
$core.bool.fromEnvironment('protobuf.omit_enum_names');

example/googleapis/lib/src/generated/google/api/label.pbjson.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/label.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/label.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names, unused_import
1112

1213
import 'dart:convert' as $convert;
1314
import 'dart:core' as $core;
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/launch_stage.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/launch_stage.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names
1112

1213
import 'dart:core' as $core;
1314

15+
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
16+
1417
export 'launch_stage.pbenum.dart';
Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/launch_stage.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/launch_stage.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names
1112

1213
import 'dart:core' as $core;
1314

@@ -16,19 +17,55 @@ import 'package:protobuf/protobuf.dart' as $pb;
1617
/// The launch stage as defined by [Google Cloud Platform
1718
/// Launch Stages](https://cloud.google.com/terms/launch-stages).
1819
class LaunchStage extends $pb.ProtobufEnum {
20+
/// Do not use this default value.
1921
static const LaunchStage LAUNCH_STAGE_UNSPECIFIED =
2022
LaunchStage._(0, _omitEnumNames ? '' : 'LAUNCH_STAGE_UNSPECIFIED');
23+
24+
/// The feature is not yet implemented. Users can not use it.
2125
static const LaunchStage UNIMPLEMENTED =
2226
LaunchStage._(6, _omitEnumNames ? '' : 'UNIMPLEMENTED');
27+
28+
/// Prelaunch features are hidden from users and are only visible internally.
2329
static const LaunchStage PRELAUNCH =
2430
LaunchStage._(7, _omitEnumNames ? '' : 'PRELAUNCH');
31+
32+
/// Early Access features are limited to a closed group of testers. To use
33+
/// these features, you must sign up in advance and sign a Trusted Tester
34+
/// agreement (which includes confidentiality provisions). These features may
35+
/// be unstable, changed in backward-incompatible ways, and are not
36+
/// guaranteed to be released.
2537
static const LaunchStage EARLY_ACCESS =
2638
LaunchStage._(1, _omitEnumNames ? '' : 'EARLY_ACCESS');
39+
40+
/// Alpha is a limited availability test for releases before they are cleared
41+
/// for widespread use. By Alpha, all significant design issues are resolved
42+
/// and we are in the process of verifying functionality. Alpha customers
43+
/// need to apply for access, agree to applicable terms, and have their
44+
/// projects allowlisted. Alpha releases don't have to be feature complete,
45+
/// no SLAs are provided, and there are no technical support obligations, but
46+
/// they will be far enough along that customers can actually use them in
47+
/// test environments or for limited-use tests -- just like they would in
48+
/// normal production cases.
2749
static const LaunchStage ALPHA =
2850
LaunchStage._(2, _omitEnumNames ? '' : 'ALPHA');
51+
52+
/// Beta is the point at which we are ready to open a release for any
53+
/// customer to use. There are no SLA or technical support obligations in a
54+
/// Beta release. Products will be complete from a feature perspective, but
55+
/// may have some open outstanding issues. Beta releases are suitable for
56+
/// limited production use cases.
2957
static const LaunchStage BETA =
3058
LaunchStage._(3, _omitEnumNames ? '' : 'BETA');
59+
60+
/// GA features are open to all developers and are considered stable and
61+
/// fully qualified for production use.
3162
static const LaunchStage GA = LaunchStage._(4, _omitEnumNames ? '' : 'GA');
63+
64+
/// Deprecated features are scheduled to be shut down and removed. For more
65+
/// information, see the "Deprecation Policy" section of our [Terms of
66+
/// Service](https://cloud.google.com/terms/)
67+
/// and the [Google Cloud Platform Subject to the Deprecation
68+
/// Policy](https://cloud.google.com/terms/deprecation) documentation.
3269
static const LaunchStage DEPRECATED =
3370
LaunchStage._(5, _omitEnumNames ? '' : 'DEPRECATED');
3471

@@ -43,11 +80,13 @@ class LaunchStage extends $pb.ProtobufEnum {
4380
DEPRECATED,
4481
];
4582

46-
static final $core.Map<$core.int, LaunchStage> _byValue =
47-
$pb.ProtobufEnum.initByValue(values);
48-
static LaunchStage? valueOf($core.int value) => _byValue[value];
83+
static final $core.List<LaunchStage?> _byValue =
84+
$pb.ProtobufEnum.$_initByValueList(values, 7);
85+
static LaunchStage? valueOf($core.int value) =>
86+
value < 0 || value >= _byValue.length ? null : _byValue[value];
4987

50-
const LaunchStage._($core.int v, $core.String n) : super(v, n);
88+
const LaunchStage._(super.value, super.name);
5189
}
5290

53-
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
91+
const $core.bool _omitEnumNames =
92+
$core.bool.fromEnvironment('protobuf.omit_enum_names');

example/googleapis/lib/src/generated/google/api/launch_stage.pbjson.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
// This is a generated file - do not edit.
12
//
2-
// Generated code. Do not modify.
3-
// source: google/api/launch_stage.proto
4-
//
5-
// @dart = 2.12
3+
// Generated from google/api/launch_stage.proto.
4+
5+
// @dart = 3.3
66

77
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
8-
// ignore_for_file: constant_identifier_names, library_prefixes
9-
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
10-
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
8+
// ignore_for_file: constant_identifier_names
9+
// ignore_for_file: curly_braces_in_flow_control_structures
10+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
11+
// ignore_for_file: non_constant_identifier_names, unused_import
1112

1213
import 'dart:convert' as $convert;
1314
import 'dart:core' as $core;

0 commit comments

Comments
 (0)