|
1 |
| -/// |
| 1 | +// |
2 | 2 | // Generated code. Do not modify.
|
3 | 3 | // source: google/protobuf/any.proto
|
4 | 4 | //
|
5 |
| -// @dart = 2.12 |
6 |
| -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields |
| 5 | +// @dart = 3.3 |
| 6 | + |
| 7 | +// 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 |
7 | 11 |
|
8 | 12 | import 'dart:core' as $core;
|
9 | 13 |
|
10 | 14 | import 'package:protobuf/protobuf.dart' as $pb;
|
11 |
| - |
12 | 15 | import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
13 | 16 |
|
14 |
| -class Any extends $pb.GeneratedMessage with $mixin.AnyMixin { |
15 |
| - static final $pb.BuilderInfo _i = $pb.BuilderInfo( |
16 |
| - const $core.bool.fromEnvironment('protobuf.omit_message_names') |
17 |
| - ? '' |
18 |
| - : 'Any', |
19 |
| - package: const $pb.PackageName( |
20 |
| - const $core.bool.fromEnvironment('protobuf.omit_message_names') |
21 |
| - ? '' |
22 |
| - : 'google.protobuf'), |
23 |
| - createEmptyInstance: create, |
24 |
| - toProto3Json: $mixin.AnyMixin.toProto3JsonHelper, |
25 |
| - fromProto3Json: $mixin.AnyMixin.fromProto3JsonHelper) |
26 |
| - ..aOS( |
27 |
| - 1, |
28 |
| - const $core.bool.fromEnvironment('protobuf.omit_field_names') |
29 |
| - ? '' |
30 |
| - : 'typeUrl') |
31 |
| - ..a<$core.List<$core.int>>( |
32 |
| - 2, |
33 |
| - const $core.bool.fromEnvironment('protobuf.omit_field_names') |
34 |
| - ? '' |
35 |
| - : 'value', |
36 |
| - $pb.PbFieldType.OY) |
37 |
| - ..hasRequiredFields = false; |
| 17 | +export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions; |
38 | 18 |
|
39 |
| - Any._() : super(); |
| 19 | +/// `Any` contains an arbitrary serialized protocol buffer message along with a |
| 20 | +/// URL that describes the type of the serialized message. |
| 21 | +/// |
| 22 | +/// Protobuf library provides support to pack/unpack Any values in the form |
| 23 | +/// of utility functions or additional generated methods of the Any type. |
| 24 | +/// |
| 25 | +/// Example 1: Pack and unpack a message in C++. |
| 26 | +/// |
| 27 | +/// Foo foo = ...; |
| 28 | +/// Any any; |
| 29 | +/// any.PackFrom(foo); |
| 30 | +/// ... |
| 31 | +/// if (any.UnpackTo(&foo)) { |
| 32 | +/// ... |
| 33 | +/// } |
| 34 | +/// |
| 35 | +/// Example 2: Pack and unpack a message in Java. |
| 36 | +/// |
| 37 | +/// Foo foo = ...; |
| 38 | +/// Any any = Any.pack(foo); |
| 39 | +/// ... |
| 40 | +/// if (any.is(Foo.class)) { |
| 41 | +/// foo = any.unpack(Foo.class); |
| 42 | +/// } |
| 43 | +/// |
| 44 | +/// Example 3: Pack and unpack a message in Python. |
| 45 | +/// |
| 46 | +/// foo = Foo(...) |
| 47 | +/// any = Any() |
| 48 | +/// any.Pack(foo) |
| 49 | +/// ... |
| 50 | +/// if any.Is(Foo.DESCRIPTOR): |
| 51 | +/// any.Unpack(foo) |
| 52 | +/// ... |
| 53 | +/// |
| 54 | +/// Example 4: Pack and unpack a message in Go |
| 55 | +/// |
| 56 | +/// foo := &pb.Foo{...} |
| 57 | +/// any, err := anypb.New(foo) |
| 58 | +/// if err != nil { |
| 59 | +/// ... |
| 60 | +/// } |
| 61 | +/// ... |
| 62 | +/// foo := &pb.Foo{} |
| 63 | +/// if err := any.UnmarshalTo(foo); err != nil { |
| 64 | +/// ... |
| 65 | +/// } |
| 66 | +/// |
| 67 | +/// The pack methods provided by protobuf library will by default use |
| 68 | +/// 'type.googleapis.com/full.type.name' as the type URL and the unpack |
| 69 | +/// methods only use the fully qualified type name after the last '/' |
| 70 | +/// in the type URL, for example "foo.bar.com/x/y.z" will yield type |
| 71 | +/// name "y.z". |
| 72 | +/// |
| 73 | +/// |
| 74 | +/// JSON |
| 75 | +/// |
| 76 | +/// The JSON representation of an `Any` value uses the regular |
| 77 | +/// representation of the deserialized, embedded message, with an |
| 78 | +/// additional field `@type` which contains the type URL. Example: |
| 79 | +/// |
| 80 | +/// package google.profile; |
| 81 | +/// message Person { |
| 82 | +/// string first_name = 1; |
| 83 | +/// string last_name = 2; |
| 84 | +/// } |
| 85 | +/// |
| 86 | +/// { |
| 87 | +/// "@type": "type.googleapis.com/google.profile.Person", |
| 88 | +/// "firstName": <string>, |
| 89 | +/// "lastName": <string> |
| 90 | +/// } |
| 91 | +/// |
| 92 | +/// If the embedded message type is well-known and has a custom JSON |
| 93 | +/// representation, that representation will be embedded adding a field |
| 94 | +/// `value` which holds the custom JSON in addition to the `@type` |
| 95 | +/// field. Example (for message [google.protobuf.Duration][]): |
| 96 | +/// |
| 97 | +/// { |
| 98 | +/// "@type": "type.googleapis.com/google.protobuf.Duration", |
| 99 | +/// "value": "1.212s" |
| 100 | +/// } |
| 101 | +class Any extends $pb.GeneratedMessage with $mixin.AnyMixin { |
40 | 102 | factory Any({
|
41 | 103 | $core.String? typeUrl,
|
42 | 104 | $core.List<$core.int>? value,
|
43 | 105 | }) {
|
44 |
| - final _result = create(); |
| 106 | + final $result = create(); |
45 | 107 | if (typeUrl != null) {
|
46 |
| - _result.typeUrl = typeUrl; |
| 108 | + $result.typeUrl = typeUrl; |
47 | 109 | }
|
48 | 110 | if (value != null) {
|
49 |
| - _result.value = value; |
| 111 | + $result.value = value; |
50 | 112 | }
|
51 |
| - return _result; |
| 113 | + return $result; |
52 | 114 | }
|
53 |
| - factory Any.fromBuffer($core.List<$core.int> i, |
54 |
| - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => |
55 |
| - create()..mergeFromBuffer(i, r); |
56 |
| - factory Any.fromJson($core.String i, |
57 |
| - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => |
58 |
| - create()..mergeFromJson(i, r); |
59 |
| - @$core.Deprecated('Using this can add significant overhead to your binary. ' |
60 |
| - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
61 |
| - 'Will be removed in next major version') |
| 115 | + Any._() : super(); |
| 116 | + factory Any.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
| 117 | + factory Any.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
| 118 | + |
| 119 | + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Any', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.AnyMixin.toProto3JsonHelper, fromProto3Json: $mixin.AnyMixin.fromProto3JsonHelper) |
| 120 | + ..aOS(1, _omitFieldNames ? '' : 'typeUrl') |
| 121 | + ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OY) |
| 122 | + ..hasRequiredFields = false |
| 123 | + ; |
| 124 | + |
| 125 | + @$core.Deprecated( |
| 126 | + 'Using this can add significant overhead to your binary. ' |
| 127 | + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
| 128 | + 'Will be removed in next major version') |
62 | 129 | Any clone() => Any()..mergeFromMessage(this);
|
63 |
| - @$core.Deprecated('Using this can add significant overhead to your binary. ' |
64 |
| - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
65 |
| - 'Will be removed in next major version') |
66 |
| - Any copyWith(void Function(Any) updates) => |
67 |
| - super.copyWith((message) => updates(message as Any)) |
68 |
| - as Any; // ignore: deprecated_member_use |
| 130 | + @$core.Deprecated( |
| 131 | + 'Using this can add significant overhead to your binary. ' |
| 132 | + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
| 133 | + 'Will be removed in next major version') |
| 134 | + Any copyWith(void Function(Any) updates) => super.copyWith((message) => updates(message as Any)) as Any; |
| 135 | + |
69 | 136 | $pb.BuilderInfo get info_ => _i;
|
| 137 | + |
70 | 138 | @$core.pragma('dart2js:noInline')
|
71 | 139 | static Any create() => Any._();
|
72 | 140 | Any createEmptyInstance() => create();
|
73 | 141 | static $pb.PbList<Any> createRepeated() => $pb.PbList<Any>();
|
74 | 142 | @$core.pragma('dart2js:noInline')
|
75 |
| - static Any getDefault() => |
76 |
| - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Any>(create); |
| 143 | + static Any getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Any>(create); |
77 | 144 | static Any? _defaultInstance;
|
78 | 145 |
|
| 146 | + /// A URL/resource name that uniquely identifies the type of the serialized |
| 147 | + /// protocol buffer message. This string must contain at least |
| 148 | + /// one "/" character. The last segment of the URL's path must represent |
| 149 | + /// the fully qualified name of the type (as in |
| 150 | + /// `path/google.protobuf.Duration`). The name should be in a canonical form |
| 151 | + /// (e.g., leading "." is not accepted). |
| 152 | + /// |
| 153 | + /// In practice, teams usually precompile into the binary all types that they |
| 154 | + /// expect it to use in the context of Any. However, for URLs which use the |
| 155 | + /// scheme `http`, `https`, or no scheme, one can optionally set up a type |
| 156 | + /// server that maps type URLs to message definitions as follows: |
| 157 | + /// |
| 158 | + /// * If no scheme is provided, `https` is assumed. |
| 159 | + /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] |
| 160 | + /// value in binary format, or produce an error. |
| 161 | + /// * Applications are allowed to cache lookup results based on the |
| 162 | + /// URL, or have them precompiled into a binary to avoid any |
| 163 | + /// lookup. Therefore, binary compatibility needs to be preserved |
| 164 | + /// on changes to types. (Use versioned type names to manage |
| 165 | + /// breaking changes.) |
| 166 | + /// |
| 167 | + /// Note: this functionality is not currently available in the official |
| 168 | + /// protobuf release, and it is not used for type URLs beginning with |
| 169 | + /// type.googleapis.com. |
| 170 | + /// |
| 171 | + /// Schemes other than `http`, `https` (or the empty scheme) might be |
| 172 | + /// used with implementation specific semantics. |
79 | 173 | @$pb.TagNumber(1)
|
80 | 174 | $core.String get typeUrl => $_getSZ(0);
|
81 | 175 | @$pb.TagNumber(1)
|
82 |
| - set typeUrl($core.String v) { |
83 |
| - $_setString(0, v); |
84 |
| - } |
85 |
| - |
| 176 | + set typeUrl($core.String v) { $_setString(0, v); } |
86 | 177 | @$pb.TagNumber(1)
|
87 | 178 | $core.bool hasTypeUrl() => $_has(0);
|
88 | 179 | @$pb.TagNumber(1)
|
89 |
| - void clearTypeUrl() => clearField(1); |
| 180 | + void clearTypeUrl() => $_clearField(1); |
90 | 181 |
|
| 182 | + /// Must be a valid serialized protocol buffer of the above specified type. |
91 | 183 | @$pb.TagNumber(2)
|
92 | 184 | $core.List<$core.int> get value => $_getN(1);
|
93 | 185 | @$pb.TagNumber(2)
|
94 |
| - set value($core.List<$core.int> v) { |
95 |
| - $_setBytes(1, v); |
96 |
| - } |
97 |
| - |
| 186 | + set value($core.List<$core.int> v) { $_setBytes(1, v); } |
98 | 187 | @$pb.TagNumber(2)
|
99 | 188 | $core.bool hasValue() => $_has(1);
|
100 | 189 | @$pb.TagNumber(2)
|
101 |
| - void clearValue() => clearField(2); |
102 |
| - |
| 190 | + void clearValue() => $_clearField(2); |
103 | 191 | /// Creates a new [Any] encoding [message].
|
104 | 192 | ///
|
105 | 193 | /// The [typeUrl] will be [typeUrlPrefix]/`fullName` where `fullName` is
|
106 | 194 | /// the fully qualified name of the type of [message].
|
107 | 195 | static Any pack($pb.GeneratedMessage message,
|
108 |
| - {$core.String typeUrlPrefix = 'type.googleapis.com'}) { |
| 196 | + {$core.String typeUrlPrefix = 'type.googleapis.com'}) { |
109 | 197 | final result = create();
|
110 |
| - $mixin.AnyMixin.packIntoAny(result, message, typeUrlPrefix: typeUrlPrefix); |
| 198 | + $mixin.AnyMixin.packIntoAny(result, message, |
| 199 | + typeUrlPrefix: typeUrlPrefix); |
111 | 200 | return result;
|
112 | 201 | }
|
113 | 202 | }
|
| 203 | + |
| 204 | + |
| 205 | +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
| 206 | +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
0 commit comments