Add well-known type support (#1081)
- Add generated Dart for the well-known protos to the package.
- Special case `google/protobuf/...` imports in the plugin to generate imports
to the libraries in the protobuf package.
Note: `protoc` already special cases these imports, you don't have to specify
paths to them with `-I...`.
With this change you also don't have to manually compile them to Dart
classes.
Fixes #1073.
Fixes #817.
Fixes #780.
Fixes #483.
diff --git a/protobuf/CHANGELOG.md b/protobuf/CHANGELOG.md
index cd2605e..d2f12ba 100644
--- a/protobuf/CHANGELOG.md
+++ b/protobuf/CHANGELOG.md
@@ -4,9 +4,14 @@
added to convert the message into the [official protocol buffers text
format][text format]. ([#1080], [#125])
+* Add [well-known proto types][wkts] as libraries. This change is required for
+ protoc_plugin-25.0.0. ([#1081])
+
[text format]: https://protobuf.dev/reference/protobuf/textformat-spec/
[#1080]: https://github.com/google/protobuf.dart/pull/1080
[#125]: https://github.com/google/protobuf.dart/issues/125
+[wkts]: https://protobuf.dev/reference/protobuf/google.protobuf
+[#1081]: https://github.com/google/protobuf.dart/pull/1081
## 5.1.0
diff --git a/protobuf/build_wkts.sh b/protobuf/build_wkts.sh
new file mode 100755
index 0000000..049be19
--- /dev/null
+++ b/protobuf/build_wkts.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This scripts generates the classes for well-known protobuf types which are
+# included in the package.
+
+set -e
+set -x
+
+mkdir -p lib/well_known_types/google/protobuf
+
+protoc \
+ --dart_out=lib/well_known_types \
+ --plugin=protoc-gen-dart=$(realpath '../protoc_plugin/bin/protoc-gen-dart-debug') \
+ google/protobuf/*.proto
+
+# Remove empty .pbenum files.
+rm lib/well_known_types/google/protobuf/any.pbenum.dart
+rm lib/well_known_types/google/protobuf/api.pbenum.dart
+rm lib/well_known_types/google/protobuf/duration.pbenum.dart
+rm lib/well_known_types/google/protobuf/empty.pbenum.dart
+rm lib/well_known_types/google/protobuf/field_mask.pbenum.dart
+rm lib/well_known_types/google/protobuf/source_context.pbenum.dart
+rm lib/well_known_types/google/protobuf/timestamp.pbenum.dart
+rm lib/well_known_types/google/protobuf/wrappers.pbenum.dart
diff --git a/protoc_plugin/test/protos/google/protobuf/any.proto b/protobuf/google/protobuf/any.proto
similarity index 89%
rename from protoc_plugin/test/protos/google/protobuf/any.proto
rename to protobuf/google/protobuf/any.proto
index 4932942..eff44e5 100644
--- a/protoc_plugin/test/protos/google/protobuf/any.proto
+++ b/protobuf/google/protobuf/any.proto
@@ -32,12 +32,12 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option go_package = "github.com/golang/protobuf/ptypes/any";
+option go_package = "google.golang.org/protobuf/types/known/anypb";
option java_package = "com.google.protobuf";
option java_outer_classname = "AnyProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
@@ -63,6 +63,10 @@
// if (any.is(Foo.class)) {
// foo = any.unpack(Foo.class);
// }
+// // or ...
+// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
+// foo = any.unpack(Foo.getDefaultInstance());
+// }
//
// Example 3: Pack and unpack a message in Python.
//
@@ -77,10 +81,13 @@
// Example 4: Pack and unpack a message in Go
//
// foo := &pb.Foo{...}
-// any, err := ptypes.MarshalAny(foo)
+// any, err := anypb.New(foo)
+// if err != nil {
+// ...
+// }
// ...
// foo := &pb.Foo{}
-// if err := ptypes.UnmarshalAny(any, foo); err != nil {
+// if err := any.UnmarshalTo(foo); err != nil {
// ...
// }
//
@@ -90,7 +97,6 @@
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
// name "y.z".
//
-//
// JSON
// ====
// The JSON representation of an `Any` value uses the regular
@@ -121,7 +127,8 @@
//
message Any {
// A URL/resource name that uniquely identifies the type of the serialized
- // protocol buffer message. The last segment of the URL's path must represent
+ // protocol buffer message. This string must contain at least
+ // one "/" character. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
@@ -142,7 +149,8 @@
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
- // type.googleapis.com.
+ // type.googleapis.com. As of May 2023, there are no widely used type server
+ // implementations and no plans to implement one.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
diff --git a/protoc_plugin/test/protos/google/protobuf/api.proto b/protobuf/google/protobuf/api.proto
similarity index 85%
rename from protoc_plugin/test/protos/google/protobuf/api.proto
rename to protobuf/google/protobuf/api.proto
index f37ee2f..c8f7425 100644
--- a/protoc_plugin/test/protos/google/protobuf/api.proto
+++ b/protobuf/google/protobuf/api.proto
@@ -35,12 +35,12 @@
import "google/protobuf/source_context.proto";
import "google/protobuf/type.proto";
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option java_package = "com.google.protobuf";
option java_outer_classname = "ApiProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-option go_package = "google.golang.org/genproto/protobuf/api;api";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "google.golang.org/protobuf/types/known/apipb";
// Api is a light-weight descriptor for an API Interface.
//
@@ -51,8 +51,12 @@
// sometimes simply referred to as "APIs" in other contexts, such as the name of
// this message itself. See https://cloud.google.com/apis/design/glossary for
// detailed terminology.
+//
+// New usages of this message as an alternative to ServiceDescriptorProto are
+// strongly discouraged. This message does not reliability preserve all
+// information necessary to model the schema and preserve semantics. Instead
+// make use of FileDescriptorSet which preserves the necessary information.
message Api {
-
// The fully qualified name of this interface, including package name
// followed by the interface's simple name.
string name = 1;
@@ -83,7 +87,6 @@
// be omitted. Zero major versions must only be used for
// experimental, non-GA interfaces.
//
- //
string version = 4;
// Source context for the protocol buffer service represented by this
@@ -95,11 +98,18 @@
// The source syntax of the service.
Syntax syntax = 7;
+
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ string edition = 8;
}
// Method represents a method of an API interface.
+//
+// New usages of this message as an alternative to MethodDescriptorProto are
+// strongly discouraged. This message does not reliability preserve all
+// information necessary to model the schema and preserve semantics. Instead
+// make use of FileDescriptorSet which preserves the necessary information.
message Method {
-
// The simple name of this method.
string name = 1;
@@ -119,7 +129,16 @@
repeated Option options = 6;
// The source syntax of this method.
- Syntax syntax = 7;
+ //
+ // This field should be ignored, instead the syntax should be inherited from
+ // Api. This is similar to Field and EnumValue.
+ Syntax syntax = 7 [deprecated = true];
+
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ //
+ // This field should be ignored, instead the edition should be inherited from
+ // Api. This is similar to Field and EnumValue.
+ string edition = 8 [deprecated = true];
}
// Declares an API Interface to be included in this interface. The including
@@ -169,7 +188,7 @@
// The mixin construct implies that all methods in `AccessControl` are
// also declared with same name and request/response types in
// `Storage`. A documentation generator or annotation processor will
-// see the effective `Storage.GetAcl` method after inherting
+// see the effective `Storage.GetAcl` method after inheriting
// documentation and annotations as follows:
//
// service Storage {
diff --git a/protoc_plugin/protos/google/protobuf/duration.proto b/protobuf/google/protobuf/duration.proto
similarity index 100%
rename from protoc_plugin/protos/google/protobuf/duration.proto
rename to protobuf/google/protobuf/duration.proto
diff --git a/protoc_plugin/test/protos/google/protobuf/empty.proto b/protobuf/google/protobuf/empty.proto
similarity index 94%
rename from protoc_plugin/test/protos/google/protobuf/empty.proto
rename to protobuf/google/protobuf/empty.proto
index 03cacd2..b87c89d 100644
--- a/protoc_plugin/test/protos/google/protobuf/empty.proto
+++ b/protobuf/google/protobuf/empty.proto
@@ -32,12 +32,12 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option go_package = "github.com/golang/protobuf/ptypes/empty";
+option go_package = "google.golang.org/protobuf/types/known/emptypb";
option java_package = "com.google.protobuf";
option java_outer_classname = "EmptyProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
// A generic empty message that you can re-use to avoid defining duplicated
@@ -48,5 +48,4 @@
// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
// }
//
-// The JSON representation for `Empty` is empty JSON object `{}`.
message Empty {}
diff --git a/protoc_plugin/test/protos/google/protobuf/field_mask.proto b/protobuf/google/protobuf/field_mask.proto
similarity index 89%
rename from protoc_plugin/test/protos/google/protobuf/field_mask.proto
rename to protobuf/google/protobuf/field_mask.proto
index 76e09f3..b28334b 100644
--- a/protoc_plugin/test/protos/google/protobuf/field_mask.proto
+++ b/protobuf/google/protobuf/field_mask.proto
@@ -32,12 +32,13 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option java_package = "com.google.protobuf";
option java_outer_classname = "FieldMaskProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb";
+option cc_enable_arenas = true;
// `FieldMask` represents a set of symbolic field paths, for example:
//
@@ -107,57 +108,49 @@
// describe the updated values, the API ignores the values of all
// fields not covered by the mask.
//
-// If a repeated field is specified for an update operation, the existing
-// repeated values in the target resource will be overwritten by the new values.
-// Note that a repeated field is only allowed in the last position of a `paths`
-// string.
+// If a repeated field is specified for an update operation, new values will
+// be appended to the existing repeated field in the target resource. Note that
+// a repeated field is only allowed in the last position of a `paths` string.
//
// If a sub-message is specified in the last position of the field mask for an
-// update operation, then the existing sub-message in the target resource is
-// overwritten. Given the target message:
+// update operation, then new value will be merged into the existing sub-message
+// in the target resource.
+//
+// For example, given the target message:
//
// f {
// b {
-// d : 1
-// x : 2
+// d: 1
+// x: 2
// }
-// c : 1
+// c: [1]
// }
//
// And an update message:
//
// f {
// b {
-// d : 10
+// d: 10
// }
+// c: [2]
// }
//
// then if the field mask is:
//
-// paths: "f.b"
+// paths: ["f.b", "f.c"]
//
// then the result will be:
//
// f {
// b {
-// d : 10
+// d: 10
+// x: 2
// }
-// c : 1
+// c: [1, 2]
// }
//
-// However, if the update mask was:
-//
-// paths: "f.b.d"
-//
-// then the result would be:
-//
-// f {
-// b {
-// d : 10
-// x : 2
-// }
-// c : 1
-// }
+// An implementation may provide options to override this default behavior for
+// repeated and message fields.
//
// In order to reset a field's value to the default, the field must
// be in the mask and set to the default value in the provided resource.
@@ -245,7 +238,7 @@
//
// The implementation of any API method which has a FieldMask type field in the
// request should verify the included field paths, and return an
-// `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
+// `INVALID_ARGUMENT` error if any path is unmappable.
message FieldMask {
// The set of field mask paths.
repeated string paths = 1;
diff --git a/protoc_plugin/test/protos/google/protobuf/source_context.proto b/protobuf/google/protobuf/source_context.proto
similarity index 95%
rename from protoc_plugin/test/protos/google/protobuf/source_context.proto
rename to protobuf/google/protobuf/source_context.proto
index f3b2c96..135f50f 100644
--- a/protoc_plugin/test/protos/google/protobuf/source_context.proto
+++ b/protobuf/google/protobuf/source_context.proto
@@ -32,12 +32,12 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option java_package = "com.google.protobuf";
option java_outer_classname = "SourceContextProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-option go_package = "google.golang.org/genproto/protobuf/source_context;source_context";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb";
// `SourceContext` represents information about the source of a
// protobuf element, like the file in which it is defined.
diff --git a/protoc_plugin/test/protos/google/protobuf/struct.proto b/protobuf/google/protobuf/struct.proto
similarity index 94%
rename from protoc_plugin/test/protos/google/protobuf/struct.proto
rename to protobuf/google/protobuf/struct.proto
index 7d7808e..1bf0c1a 100644
--- a/protoc_plugin/test/protos/google/protobuf/struct.proto
+++ b/protobuf/google/protobuf/struct.proto
@@ -32,14 +32,13 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/struct;structpb";
+option go_package = "google.golang.org/protobuf/types/known/structpb";
option java_package = "com.google.protobuf";
option java_outer_classname = "StructProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// `Struct` represents a structured data value, consisting of fields
// which map to dynamically typed values. In some languages, `Struct`
@@ -56,8 +55,8 @@
// `Value` represents a dynamically typed value which can be either
// null, a number, a string, a boolean, a recursive struct value, or a
-// list of values. A producer of value is expected to set one of that
-// variants, absence of any variant indicates an error.
+// list of values. A producer of value is expected to set one of these
+// variants. Absence of any variant indicates an error.
//
// The JSON representation for `Value` is JSON value.
message Value {
@@ -81,7 +80,7 @@
// `NullValue` is a singleton enumeration to represent the null value for the
// `Value` type union.
//
-// The JSON representation for `NullValue` is JSON `null`.
+// The JSON representation for `NullValue` is JSON `null`.
enum NullValue {
// Null value.
NULL_VALUE = 0;
diff --git a/protoc_plugin/test/protos/google/protobuf/timestamp.proto b/protobuf/google/protobuf/timestamp.proto
similarity index 77%
rename from protoc_plugin/test/protos/google/protobuf/timestamp.proto
rename to protobuf/google/protobuf/timestamp.proto
index 2b9e26a..6bc1efc 100644
--- a/protoc_plugin/test/protos/google/protobuf/timestamp.proto
+++ b/protobuf/google/protobuf/timestamp.proto
@@ -32,13 +32,13 @@
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/timestamp";
+option go_package = "google.golang.org/protobuf/types/known/timestamppb";
option java_package = "com.google.protobuf";
option java_outer_classname = "TimestampProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at
@@ -90,8 +90,15 @@
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
+// Example 5: Compute Timestamp from Java `Instant.now()`.
//
-// Example 5: Compute Timestamp from current time in Python.
+// Instant now = Instant.now();
+//
+// Timestamp timestamp =
+// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
+// .setNanos(now.getNano()).build();
+//
+// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
@@ -105,33 +112,34 @@
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
-// is required. A proto3 JSON serializer should always use UTC (as indicated by
-// "Z") when printing the Timestamp type and a proto3 JSON parser should be
+// is required. A ProtoJSON serializer should always use UTC (as indicated by
+// "Z") when printing the Timestamp type and a ProtoJSON parser should be
// able to accept both UTC and other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
// 01:30 UTC on January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the
-// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
+// standard
+// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted
-// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
-// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
-// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
-// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
+// to this format using
+// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
+// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
+// the Joda Time's [`ISODateTimeFormat.dateTime()`](
+// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
// ) to obtain a formatter capable of generating timestamps in this format.
//
-//
message Timestamp {
-
- // Represents seconds of UTC time since Unix epoch
- // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
- // 9999-12-31T23:59:59Z inclusive.
+ // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
+ // be between -62135596800 and 253402300799 inclusive (which corresponds to
+ // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
int64 seconds = 1;
- // Non-negative fractions of a second at nanosecond resolution. Negative
- // second values with fractions must still have non-negative nanos values
- // that count forward in time. Must be from 0 to 999,999,999
+ // Non-negative fractions of a second at nanosecond resolution. This field is
+ // the nanosecond portion of the duration, not an alternative to seconds.
+ // Negative second values with fractions must still have non-negative nanos
+ // values that count forward in time. Must be between 0 and 999,999,999
// inclusive.
int32 nanos = 2;
}
diff --git a/protoc_plugin/test/protos/google/protobuf/type.proto b/protobuf/google/protobuf/type.proto
similarity index 72%
rename from protoc_plugin/test/protos/google/protobuf/type.proto
rename to protobuf/google/protobuf/type.proto
index 624c15e..2c7615e 100644
--- a/protoc_plugin/test/protos/google/protobuf/type.proto
+++ b/protobuf/google/protobuf/type.proto
@@ -35,15 +35,20 @@
import "google/protobuf/any.proto";
import "google/protobuf/source_context.proto";
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
option java_package = "com.google.protobuf";
option java_outer_classname = "TypeProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-option go_package = "google.golang.org/genproto/protobuf/ptype;ptype";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "google.golang.org/protobuf/types/known/typepb";
// A protocol buffer message type.
+//
+// New usages of this message as an alternative to DescriptorProto are strongly
+// discouraged. This message does not reliability preserve all information
+// necessary to model the schema and preserve semantics. Instead make use of
+// FileDescriptorSet which preserves the necessary information.
message Type {
// The fully qualified message name.
string name = 1;
@@ -57,51 +62,58 @@
SourceContext source_context = 5;
// The source syntax.
Syntax syntax = 6;
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ string edition = 7;
}
// A single field of a message type.
+//
+// New usages of this message as an alternative to FieldDescriptorProto are
+// strongly discouraged. This message does not reliability preserve all
+// information necessary to model the schema and preserve semantics. Instead
+// make use of FileDescriptorSet which preserves the necessary information.
message Field {
// Basic field types.
enum Kind {
// Field type unknown.
- TYPE_UNKNOWN = 0;
+ TYPE_UNKNOWN = 0;
// Field type double.
- TYPE_DOUBLE = 1;
+ TYPE_DOUBLE = 1;
// Field type float.
- TYPE_FLOAT = 2;
+ TYPE_FLOAT = 2;
// Field type int64.
- TYPE_INT64 = 3;
+ TYPE_INT64 = 3;
// Field type uint64.
- TYPE_UINT64 = 4;
+ TYPE_UINT64 = 4;
// Field type int32.
- TYPE_INT32 = 5;
+ TYPE_INT32 = 5;
// Field type fixed64.
- TYPE_FIXED64 = 6;
+ TYPE_FIXED64 = 6;
// Field type fixed32.
- TYPE_FIXED32 = 7;
+ TYPE_FIXED32 = 7;
// Field type bool.
- TYPE_BOOL = 8;
+ TYPE_BOOL = 8;
// Field type string.
- TYPE_STRING = 9;
+ TYPE_STRING = 9;
// Field type group. Proto2 syntax only, and deprecated.
- TYPE_GROUP = 10;
+ TYPE_GROUP = 10;
// Field type message.
- TYPE_MESSAGE = 11;
+ TYPE_MESSAGE = 11;
// Field type bytes.
- TYPE_BYTES = 12;
+ TYPE_BYTES = 12;
// Field type uint32.
- TYPE_UINT32 = 13;
+ TYPE_UINT32 = 13;
// Field type enum.
- TYPE_ENUM = 14;
+ TYPE_ENUM = 14;
// Field type sfixed32.
- TYPE_SFIXED32 = 15;
+ TYPE_SFIXED32 = 15;
// Field type sfixed64.
- TYPE_SFIXED64 = 16;
+ TYPE_SFIXED64 = 16;
// Field type sint32.
- TYPE_SINT32 = 17;
+ TYPE_SINT32 = 17;
// Field type sint64.
- TYPE_SINT64 = 18;
- };
+ TYPE_SINT64 = 18;
+ }
// Whether a field is optional, required, or repeated.
enum Cardinality {
@@ -113,7 +125,7 @@
CARDINALITY_REQUIRED = 2;
// For repeated fields.
CARDINALITY_REPEATED = 3;
- };
+ }
// The field type.
Kind kind = 1;
@@ -140,6 +152,11 @@
}
// Enum type definition.
+//
+// New usages of this message as an alternative to EnumDescriptorProto are
+// strongly discouraged. This message does not reliability preserve all
+// information necessary to model the schema and preserve semantics. Instead
+// make use of FileDescriptorSet which preserves the necessary information.
message Enum {
// Enum type name.
string name = 1;
@@ -151,9 +168,16 @@
SourceContext source_context = 4;
// The source syntax.
Syntax syntax = 5;
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ string edition = 6;
}
// Enum value definition.
+//
+// New usages of this message as an alternative to EnumValueDescriptorProto are
+// strongly discouraged. This message does not reliability preserve all
+// information necessary to model the schema and preserve semantics. Instead
+// make use of FileDescriptorSet which preserves the necessary information.
message EnumValue {
// Enum value name.
string name = 1;
@@ -165,6 +189,10 @@
// A protocol buffer option, which can be attached to a message, field,
// enumeration, etc.
+//
+// New usages of this message as an alternative to FileOptions, MessageOptions,
+// FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions
+// are strongly discouraged.
message Option {
// The option's name. For protobuf built-in options (options defined in
// descriptor.proto), this is the short name. For example, `"map_entry"`.
@@ -184,4 +212,6 @@
SYNTAX_PROTO2 = 0;
// Syntax `proto3`.
SYNTAX_PROTO3 = 1;
+ // Syntax `editions`.
+ SYNTAX_EDITIONS = 2;
}
diff --git a/protoc_plugin/test/protos/google/protobuf/wrappers.proto b/protobuf/google/protobuf/wrappers.proto
similarity index 63%
rename from protoc_plugin/test/protos/google/protobuf/wrappers.proto
rename to protobuf/google/protobuf/wrappers.proto
index 0194763..e583e7c 100644
--- a/protoc_plugin/test/protos/google/protobuf/wrappers.proto
+++ b/protobuf/google/protobuf/wrappers.proto
@@ -27,27 +27,42 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Wrappers for primitive (non-message) types. These types are useful
-// for embedding primitives in the `google.protobuf.Any` type and for places
-// where we need to distinguish between the absence of a primitive
-// typed field and its default value.
+//
+// Wrappers for primitive (non-message) types. These types were needed
+// for legacy reasons and are not recommended for use in new APIs.
+//
+// Historically these wrappers were useful to have presence on proto3 primitive
+// fields, but proto3 syntax has been updated to support the `optional` keyword.
+// Using that keyword is now the strongly preferred way to add presence to
+// proto3 primitive fields.
+//
+// A secondary usecase was to embed primitives in the `google.protobuf.Any`
+// type: it is now recommended that you embed your value in your own wrapper
+// message which can be specifically documented.
+//
+// These wrappers have no meaningful use within repeated fields as they lack
+// the ability to detect presence on individual elements.
+// These wrappers have no meaningful use within a map or a oneof since
+// individual entries of a map or fields of a oneof can already detect presence.
syntax = "proto3";
package google.protobuf;
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/wrappers";
+option go_package = "google.golang.org/protobuf/types/known/wrapperspb";
option java_package = "com.google.protobuf";
option java_outer_classname = "WrappersProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// Wrapper message for `double`.
//
// The JSON representation for `DoubleValue` is JSON number.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message DoubleValue {
// The double value.
double value = 1;
@@ -56,6 +71,9 @@
// Wrapper message for `float`.
//
// The JSON representation for `FloatValue` is JSON number.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message FloatValue {
// The float value.
float value = 1;
@@ -64,6 +82,9 @@
// Wrapper message for `int64`.
//
// The JSON representation for `Int64Value` is JSON string.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message Int64Value {
// The int64 value.
int64 value = 1;
@@ -72,6 +93,9 @@
// Wrapper message for `uint64`.
//
// The JSON representation for `UInt64Value` is JSON string.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message UInt64Value {
// The uint64 value.
uint64 value = 1;
@@ -80,6 +104,9 @@
// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message Int32Value {
// The int32 value.
int32 value = 1;
@@ -88,6 +115,9 @@
// Wrapper message for `uint32`.
//
// The JSON representation for `UInt32Value` is JSON number.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message UInt32Value {
// The uint32 value.
uint32 value = 1;
@@ -96,6 +126,9 @@
// Wrapper message for `bool`.
//
// The JSON representation for `BoolValue` is JSON `true` and `false`.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message BoolValue {
// The bool value.
bool value = 1;
@@ -104,6 +137,9 @@
// Wrapper message for `string`.
//
// The JSON representation for `StringValue` is JSON string.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message StringValue {
// The string value.
string value = 1;
@@ -112,6 +148,9 @@
// Wrapper message for `bytes`.
//
// The JSON representation for `BytesValue` is JSON string.
+//
+// Not recommended for use in new APIs, but still useful for legacy APIs and
+// has no plan to be removed.
message BytesValue {
// The bytes value.
bytes value = 1;
diff --git a/protobuf/lib/well_known_types/google/protobuf/any.pb.dart b/protobuf/lib/well_known_types/google/protobuf/any.pb.dart
new file mode 100644
index 0000000..2623677
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/any.pb.dart
@@ -0,0 +1,217 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/any.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
+// ignore_for_file: implementation_imports, library_prefixes
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// `Any` contains an arbitrary serialized protocol buffer message along with a
+/// URL that describes the type of the serialized message.
+///
+/// Protobuf library provides support to pack/unpack Any values in the form
+/// of utility functions or additional generated methods of the Any type.
+///
+/// Example 1: Pack and unpack a message in C++.
+///
+/// Foo foo = ...;
+/// Any any;
+/// any.PackFrom(foo);
+/// ...
+/// if (any.UnpackTo(&foo)) {
+/// ...
+/// }
+///
+/// Example 2: Pack and unpack a message in Java.
+///
+/// Foo foo = ...;
+/// Any any = Any.pack(foo);
+/// ...
+/// if (any.is(Foo.class)) {
+/// foo = any.unpack(Foo.class);
+/// }
+/// // or ...
+/// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
+/// foo = any.unpack(Foo.getDefaultInstance());
+/// }
+///
+/// Example 3: Pack and unpack a message in Python.
+///
+/// foo = Foo(...)
+/// any = Any()
+/// any.Pack(foo)
+/// ...
+/// if any.Is(Foo.DESCRIPTOR):
+/// any.Unpack(foo)
+/// ...
+///
+/// Example 4: Pack and unpack a message in Go
+///
+/// foo := &pb.Foo{...}
+/// any, err := anypb.New(foo)
+/// if err != nil {
+/// ...
+/// }
+/// ...
+/// foo := &pb.Foo{}
+/// if err := any.UnmarshalTo(foo); err != nil {
+/// ...
+/// }
+///
+/// The pack methods provided by protobuf library will by default use
+/// 'type.googleapis.com/full.type.name' as the type URL and the unpack
+/// methods only use the fully qualified type name after the last '/'
+/// in the type URL, for example "foo.bar.com/x/y.z" will yield type
+/// name "y.z".
+///
+/// JSON
+/// ====
+/// The JSON representation of an `Any` value uses the regular
+/// representation of the deserialized, embedded message, with an
+/// additional field `@type` which contains the type URL. Example:
+///
+/// package google.profile;
+/// message Person {
+/// string first_name = 1;
+/// string last_name = 2;
+/// }
+///
+/// {
+/// "@type": "type.googleapis.com/google.profile.Person",
+/// "firstName": <string>,
+/// "lastName": <string>
+/// }
+///
+/// If the embedded message type is well-known and has a custom JSON
+/// representation, that representation will be embedded adding a field
+/// `value` which holds the custom JSON in addition to the `@type`
+/// field. Example (for message [google.protobuf.Duration][]):
+///
+/// {
+/// "@type": "type.googleapis.com/google.protobuf.Duration",
+/// "value": "1.212s"
+/// }
+class Any extends $pb.GeneratedMessage with $mixin.AnyMixin {
+ factory Any({
+ $core.String? typeUrl,
+ $core.List<$core.int>? value,
+ }) {
+ final result = create();
+ if (typeUrl != null) result.typeUrl = typeUrl;
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ Any._();
+
+ factory Any.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Any.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Any',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.any)
+ ..aOS(1, _omitFieldNames ? '' : 'typeUrl')
+ ..a<$core.List<$core.int>>(
+ 2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OY)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Any clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Any copyWith(void Function(Any) updates) =>
+ super.copyWith((message) => updates(message as Any)) as Any;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Any create() => Any._();
+ @$core.override
+ Any createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Any getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Any>(create);
+ static Any? _defaultInstance;
+
+ /// A URL/resource name that uniquely identifies the type of the serialized
+ /// protocol buffer message. This string must contain at least
+ /// one "/" character. The last segment of the URL's path must represent
+ /// the fully qualified name of the type (as in
+ /// `path/google.protobuf.Duration`). The name should be in a canonical form
+ /// (e.g., leading "." is not accepted).
+ ///
+ /// In practice, teams usually precompile into the binary all types that they
+ /// expect it to use in the context of Any. However, for URLs which use the
+ /// scheme `http`, `https`, or no scheme, one can optionally set up a type
+ /// server that maps type URLs to message definitions as follows:
+ ///
+ /// * If no scheme is provided, `https` is assumed.
+ /// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+ /// value in binary format, or produce an error.
+ /// * Applications are allowed to cache lookup results based on the
+ /// URL, or have them precompiled into a binary to avoid any
+ /// lookup. Therefore, binary compatibility needs to be preserved
+ /// on changes to types. (Use versioned type names to manage
+ /// breaking changes.)
+ ///
+ /// Note: this functionality is not currently available in the official
+ /// protobuf release, and it is not used for type URLs beginning with
+ /// type.googleapis.com. As of May 2023, there are no widely used type server
+ /// implementations and no plans to implement one.
+ ///
+ /// Schemes other than `http`, `https` (or the empty scheme) might be
+ /// used with implementation specific semantics.
+ @$pb.TagNumber(1)
+ $core.String get typeUrl => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set typeUrl($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasTypeUrl() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearTypeUrl() => $_clearField(1);
+
+ /// Must be a valid serialized protocol buffer of the above specified type.
+ @$pb.TagNumber(2)
+ $core.List<$core.int> get value => $_getN(1);
+ @$pb.TagNumber(2)
+ set value($core.List<$core.int> value) => $_setBytes(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasValue() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearValue() => $_clearField(2);
+
+ /// Creates a new [Any] encoding [message].
+ ///
+ /// The [typeUrl] will be [typeUrlPrefix]/`fullName` where `fullName` is
+ /// the fully qualified name of the type of [message].
+ static Any pack($pb.GeneratedMessage message,
+ {$core.String typeUrlPrefix = 'type.googleapis.com'}) {
+ final result = create();
+ $mixin.AnyMixin.packIntoAny(result, message, typeUrlPrefix: typeUrlPrefix);
+ return result;
+ }
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/any.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/any.pbjson.dart
new file mode 100644
index 0000000..2ae7093
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/any.pbjson.dart
@@ -0,0 +1,29 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/any.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use anyDescriptor instead')
+const Any$json = {
+ '1': 'Any',
+ '2': [
+ {'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'},
+ {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `Any`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List anyDescriptor = $convert.base64Decode(
+ 'CgNBbnkSGQoIdHlwZV91cmwYASABKAlSB3R5cGVVcmwSFAoFdmFsdWUYAiABKAxSBXZhbHVl');
diff --git a/protobuf/lib/well_known_types/google/protobuf/api.pb.dart b/protobuf/lib/well_known_types/google/protobuf/api.pb.dart
new file mode 100644
index 0000000..b276106
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/api.pb.dart
@@ -0,0 +1,502 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/api.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/well_known_types/google/protobuf/source_context.pb.dart'
+ as $1;
+import 'package:protobuf/well_known_types/google/protobuf/type.pb.dart' as $0;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// Api is a light-weight descriptor for an API Interface.
+///
+/// Interfaces are also described as "protocol buffer services" in some contexts,
+/// such as by the "service" keyword in a .proto file, but they are different
+/// from API Services, which represent a concrete implementation of an interface
+/// as opposed to simply a description of methods and bindings. They are also
+/// sometimes simply referred to as "APIs" in other contexts, such as the name of
+/// this message itself. See https://cloud.google.com/apis/design/glossary for
+/// detailed terminology.
+///
+/// New usages of this message as an alternative to ServiceDescriptorProto are
+/// strongly discouraged. This message does not reliability preserve all
+/// information necessary to model the schema and preserve semantics. Instead
+/// make use of FileDescriptorSet which preserves the necessary information.
+class Api extends $pb.GeneratedMessage {
+ factory Api({
+ $core.String? name,
+ $core.Iterable<Method>? methods,
+ $core.Iterable<$0.Option>? options,
+ $core.String? version,
+ $1.SourceContext? sourceContext,
+ $core.Iterable<Mixin>? mixins,
+ $0.Syntax? syntax,
+ $core.String? edition,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (methods != null) result.methods.addAll(methods);
+ if (options != null) result.options.addAll(options);
+ if (version != null) result.version = version;
+ if (sourceContext != null) result.sourceContext = sourceContext;
+ if (mixins != null) result.mixins.addAll(mixins);
+ if (syntax != null) result.syntax = syntax;
+ if (edition != null) result.edition = edition;
+ return result;
+ }
+
+ Api._();
+
+ factory Api.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Api.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Api',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..pPM<Method>(2, _omitFieldNames ? '' : 'methods',
+ subBuilder: Method.create)
+ ..pPM<$0.Option>(3, _omitFieldNames ? '' : 'options',
+ subBuilder: $0.Option.create)
+ ..aOS(4, _omitFieldNames ? '' : 'version')
+ ..aOM<$1.SourceContext>(5, _omitFieldNames ? '' : 'sourceContext',
+ subBuilder: $1.SourceContext.create)
+ ..pPM<Mixin>(6, _omitFieldNames ? '' : 'mixins', subBuilder: Mixin.create)
+ ..aE<$0.Syntax>(7, _omitFieldNames ? '' : 'syntax',
+ enumValues: $0.Syntax.values)
+ ..aOS(8, _omitFieldNames ? '' : 'edition')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Api clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Api copyWith(void Function(Api) updates) =>
+ super.copyWith((message) => updates(message as Api)) as Api;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Api create() => Api._();
+ @$core.override
+ Api createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Api getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Api>(create);
+ static Api? _defaultInstance;
+
+ /// The fully qualified name of this interface, including package name
+ /// followed by the interface's simple name.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// The methods of this interface, in unspecified order.
+ @$pb.TagNumber(2)
+ $pb.PbList<Method> get methods => $_getList(1);
+
+ /// Any metadata attached to the interface.
+ @$pb.TagNumber(3)
+ $pb.PbList<$0.Option> get options => $_getList(2);
+
+ /// A version string for this interface. If specified, must have the form
+ /// `major-version.minor-version`, as in `1.10`. If the minor version is
+ /// omitted, it defaults to zero. If the entire version field is empty, the
+ /// major version is derived from the package name, as outlined below. If the
+ /// field is not empty, the version in the package name will be verified to be
+ /// consistent with what is provided here.
+ ///
+ /// The versioning schema uses [semantic
+ /// versioning](http://semver.org) where the major version number
+ /// indicates a breaking change and the minor version an additive,
+ /// non-breaking change. Both version numbers are signals to users
+ /// what to expect from different versions, and should be carefully
+ /// chosen based on the product plan.
+ ///
+ /// The major version is also reflected in the package name of the
+ /// interface, which must end in `v<major-version>`, as in
+ /// `google.feature.v1`. For major versions 0 and 1, the suffix can
+ /// be omitted. Zero major versions must only be used for
+ /// experimental, non-GA interfaces.
+ @$pb.TagNumber(4)
+ $core.String get version => $_getSZ(3);
+ @$pb.TagNumber(4)
+ set version($core.String value) => $_setString(3, value);
+ @$pb.TagNumber(4)
+ $core.bool hasVersion() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearVersion() => $_clearField(4);
+
+ /// Source context for the protocol buffer service represented by this
+ /// message.
+ @$pb.TagNumber(5)
+ $1.SourceContext get sourceContext => $_getN(4);
+ @$pb.TagNumber(5)
+ set sourceContext($1.SourceContext value) => $_setField(5, value);
+ @$pb.TagNumber(5)
+ $core.bool hasSourceContext() => $_has(4);
+ @$pb.TagNumber(5)
+ void clearSourceContext() => $_clearField(5);
+ @$pb.TagNumber(5)
+ $1.SourceContext ensureSourceContext() => $_ensure(4);
+
+ /// Included interfaces. See [Mixin][].
+ @$pb.TagNumber(6)
+ $pb.PbList<Mixin> get mixins => $_getList(5);
+
+ /// The source syntax of the service.
+ @$pb.TagNumber(7)
+ $0.Syntax get syntax => $_getN(6);
+ @$pb.TagNumber(7)
+ set syntax($0.Syntax value) => $_setField(7, value);
+ @$pb.TagNumber(7)
+ $core.bool hasSyntax() => $_has(6);
+ @$pb.TagNumber(7)
+ void clearSyntax() => $_clearField(7);
+
+ /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ @$pb.TagNumber(8)
+ $core.String get edition => $_getSZ(7);
+ @$pb.TagNumber(8)
+ set edition($core.String value) => $_setString(7, value);
+ @$pb.TagNumber(8)
+ $core.bool hasEdition() => $_has(7);
+ @$pb.TagNumber(8)
+ void clearEdition() => $_clearField(8);
+}
+
+/// Method represents a method of an API interface.
+///
+/// New usages of this message as an alternative to MethodDescriptorProto are
+/// strongly discouraged. This message does not reliability preserve all
+/// information necessary to model the schema and preserve semantics. Instead
+/// make use of FileDescriptorSet which preserves the necessary information.
+class Method extends $pb.GeneratedMessage {
+ factory Method({
+ $core.String? name,
+ $core.String? requestTypeUrl,
+ $core.bool? requestStreaming,
+ $core.String? responseTypeUrl,
+ $core.bool? responseStreaming,
+ $core.Iterable<$0.Option>? options,
+ @$core.Deprecated('This field is deprecated.') $0.Syntax? syntax,
+ @$core.Deprecated('This field is deprecated.') $core.String? edition,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (requestTypeUrl != null) result.requestTypeUrl = requestTypeUrl;
+ if (requestStreaming != null) result.requestStreaming = requestStreaming;
+ if (responseTypeUrl != null) result.responseTypeUrl = responseTypeUrl;
+ if (responseStreaming != null) result.responseStreaming = responseStreaming;
+ if (options != null) result.options.addAll(options);
+ if (syntax != null) result.syntax = syntax;
+ if (edition != null) result.edition = edition;
+ return result;
+ }
+
+ Method._();
+
+ factory Method.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Method.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Method',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..aOS(2, _omitFieldNames ? '' : 'requestTypeUrl')
+ ..aOB(3, _omitFieldNames ? '' : 'requestStreaming')
+ ..aOS(4, _omitFieldNames ? '' : 'responseTypeUrl')
+ ..aOB(5, _omitFieldNames ? '' : 'responseStreaming')
+ ..pPM<$0.Option>(6, _omitFieldNames ? '' : 'options',
+ subBuilder: $0.Option.create)
+ ..aE<$0.Syntax>(7, _omitFieldNames ? '' : 'syntax',
+ enumValues: $0.Syntax.values)
+ ..aOS(8, _omitFieldNames ? '' : 'edition')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Method clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Method copyWith(void Function(Method) updates) =>
+ super.copyWith((message) => updates(message as Method)) as Method;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Method create() => Method._();
+ @$core.override
+ Method createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Method getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Method>(create);
+ static Method? _defaultInstance;
+
+ /// The simple name of this method.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// A URL of the input message type.
+ @$pb.TagNumber(2)
+ $core.String get requestTypeUrl => $_getSZ(1);
+ @$pb.TagNumber(2)
+ set requestTypeUrl($core.String value) => $_setString(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasRequestTypeUrl() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearRequestTypeUrl() => $_clearField(2);
+
+ /// If true, the request is streamed.
+ @$pb.TagNumber(3)
+ $core.bool get requestStreaming => $_getBF(2);
+ @$pb.TagNumber(3)
+ set requestStreaming($core.bool value) => $_setBool(2, value);
+ @$pb.TagNumber(3)
+ $core.bool hasRequestStreaming() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearRequestStreaming() => $_clearField(3);
+
+ /// The URL of the output message type.
+ @$pb.TagNumber(4)
+ $core.String get responseTypeUrl => $_getSZ(3);
+ @$pb.TagNumber(4)
+ set responseTypeUrl($core.String value) => $_setString(3, value);
+ @$pb.TagNumber(4)
+ $core.bool hasResponseTypeUrl() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearResponseTypeUrl() => $_clearField(4);
+
+ /// If true, the response is streamed.
+ @$pb.TagNumber(5)
+ $core.bool get responseStreaming => $_getBF(4);
+ @$pb.TagNumber(5)
+ set responseStreaming($core.bool value) => $_setBool(4, value);
+ @$pb.TagNumber(5)
+ $core.bool hasResponseStreaming() => $_has(4);
+ @$pb.TagNumber(5)
+ void clearResponseStreaming() => $_clearField(5);
+
+ /// Any metadata attached to the method.
+ @$pb.TagNumber(6)
+ $pb.PbList<$0.Option> get options => $_getList(5);
+
+ /// The source syntax of this method.
+ ///
+ /// This field should be ignored, instead the syntax should be inherited from
+ /// Api. This is similar to Field and EnumValue.
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(7)
+ $0.Syntax get syntax => $_getN(6);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(7)
+ set syntax($0.Syntax value) => $_setField(7, value);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(7)
+ $core.bool hasSyntax() => $_has(6);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(7)
+ void clearSyntax() => $_clearField(7);
+
+ /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ ///
+ /// This field should be ignored, instead the edition should be inherited from
+ /// Api. This is similar to Field and EnumValue.
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(8)
+ $core.String get edition => $_getSZ(7);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(8)
+ set edition($core.String value) => $_setString(7, value);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(8)
+ $core.bool hasEdition() => $_has(7);
+ @$core.Deprecated('This field is deprecated.')
+ @$pb.TagNumber(8)
+ void clearEdition() => $_clearField(8);
+}
+
+/// Declares an API Interface to be included in this interface. The including
+/// interface must redeclare all the methods from the included interface, but
+/// documentation and options are inherited as follows:
+///
+/// - If after comment and whitespace stripping, the documentation
+/// string of the redeclared method is empty, it will be inherited
+/// from the original method.
+///
+/// - Each annotation belonging to the service config (http,
+/// visibility) which is not set in the redeclared method will be
+/// inherited.
+///
+/// - If an http annotation is inherited, the path pattern will be
+/// modified as follows. Any version prefix will be replaced by the
+/// version of the including interface plus the [root][] path if
+/// specified.
+///
+/// Example of a simple mixin:
+///
+/// package google.acl.v1;
+/// service AccessControl {
+/// // Get the underlying ACL object.
+/// rpc GetAcl(GetAclRequest) returns (Acl) {
+/// option (google.api.http).get = "/v1/{resource=**}:getAcl";
+/// }
+/// }
+///
+/// package google.storage.v2;
+/// service Storage {
+/// rpc GetAcl(GetAclRequest) returns (Acl);
+///
+/// // Get a data record.
+/// rpc GetData(GetDataRequest) returns (Data) {
+/// option (google.api.http).get = "/v2/{resource=**}";
+/// }
+/// }
+///
+/// Example of a mixin configuration:
+///
+/// apis:
+/// - name: google.storage.v2.Storage
+/// mixins:
+/// - name: google.acl.v1.AccessControl
+///
+/// The mixin construct implies that all methods in `AccessControl` are
+/// also declared with same name and request/response types in
+/// `Storage`. A documentation generator or annotation processor will
+/// see the effective `Storage.GetAcl` method after inheriting
+/// documentation and annotations as follows:
+///
+/// service Storage {
+/// // Get the underlying ACL object.
+/// rpc GetAcl(GetAclRequest) returns (Acl) {
+/// option (google.api.http).get = "/v2/{resource=**}:getAcl";
+/// }
+/// ...
+/// }
+///
+/// Note how the version in the path pattern changed from `v1` to `v2`.
+///
+/// If the `root` field in the mixin is specified, it should be a
+/// relative path under which inherited HTTP paths are placed. Example:
+///
+/// apis:
+/// - name: google.storage.v2.Storage
+/// mixins:
+/// - name: google.acl.v1.AccessControl
+/// root: acls
+///
+/// This implies the following inherited HTTP annotation:
+///
+/// service Storage {
+/// // Get the underlying ACL object.
+/// rpc GetAcl(GetAclRequest) returns (Acl) {
+/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
+/// }
+/// ...
+/// }
+class Mixin extends $pb.GeneratedMessage {
+ factory Mixin({
+ $core.String? name,
+ $core.String? root,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (root != null) result.root = root;
+ return result;
+ }
+
+ Mixin._();
+
+ factory Mixin.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Mixin.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Mixin',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..aOS(2, _omitFieldNames ? '' : 'root')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Mixin clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Mixin copyWith(void Function(Mixin) updates) =>
+ super.copyWith((message) => updates(message as Mixin)) as Mixin;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Mixin create() => Mixin._();
+ @$core.override
+ Mixin createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Mixin getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Mixin>(create);
+ static Mixin? _defaultInstance;
+
+ /// The fully qualified name of the interface which is included.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// If non-empty specifies a path under which inherited HTTP paths
+ /// are rooted.
+ @$pb.TagNumber(2)
+ $core.String get root => $_getSZ(1);
+ @$pb.TagNumber(2)
+ set root($core.String value) => $_setString(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasRoot() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearRoot() => $_clearField(2);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/api.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/api.pbjson.dart
new file mode 100644
index 0000000..f175b9d
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/api.pbjson.dart
@@ -0,0 +1,148 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/api.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use apiDescriptor instead')
+const Api$json = {
+ '1': 'Api',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {
+ '1': 'methods',
+ '3': 2,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Method',
+ '10': 'methods'
+ },
+ {
+ '1': 'options',
+ '3': 3,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ {'1': 'version', '3': 4, '4': 1, '5': 9, '10': 'version'},
+ {
+ '1': 'source_context',
+ '3': 5,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.SourceContext',
+ '10': 'sourceContext'
+ },
+ {
+ '1': 'mixins',
+ '3': 6,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Mixin',
+ '10': 'mixins'
+ },
+ {
+ '1': 'syntax',
+ '3': 7,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Syntax',
+ '10': 'syntax'
+ },
+ {'1': 'edition', '3': 8, '4': 1, '5': 9, '10': 'edition'},
+ ],
+};
+
+/// Descriptor for `Api`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List apiDescriptor = $convert.base64Decode(
+ 'CgNBcGkSEgoEbmFtZRgBIAEoCVIEbmFtZRIxCgdtZXRob2RzGAIgAygLMhcuZ29vZ2xlLnByb3'
+ 'RvYnVmLk1ldGhvZFIHbWV0aG9kcxIxCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVm'
+ 'Lk9wdGlvblIHb3B0aW9ucxIYCgd2ZXJzaW9uGAQgASgJUgd2ZXJzaW9uEkUKDnNvdXJjZV9jb2'
+ '50ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3RvYnVmLlNvdXJjZUNvbnRleHRSDXNvdXJjZUNvbnRl'
+ 'eHQSLgoGbWl4aW5zGAYgAygLMhYuZ29vZ2xlLnByb3RvYnVmLk1peGluUgZtaXhpbnMSLwoGc3'
+ 'ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRheFIGc3ludGF4EhgKB2VkaXRpb24Y'
+ 'CCABKAlSB2VkaXRpb24=');
+
+@$core.Deprecated('Use methodDescriptor instead')
+const Method$json = {
+ '1': 'Method',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {'1': 'request_type_url', '3': 2, '4': 1, '5': 9, '10': 'requestTypeUrl'},
+ {
+ '1': 'request_streaming',
+ '3': 3,
+ '4': 1,
+ '5': 8,
+ '10': 'requestStreaming'
+ },
+ {'1': 'response_type_url', '3': 4, '4': 1, '5': 9, '10': 'responseTypeUrl'},
+ {
+ '1': 'response_streaming',
+ '3': 5,
+ '4': 1,
+ '5': 8,
+ '10': 'responseStreaming'
+ },
+ {
+ '1': 'options',
+ '3': 6,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ {
+ '1': 'syntax',
+ '3': 7,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Syntax',
+ '8': {'3': true},
+ '10': 'syntax',
+ },
+ {
+ '1': 'edition',
+ '3': 8,
+ '4': 1,
+ '5': 9,
+ '8': {'3': true},
+ '10': 'edition',
+ },
+ ],
+};
+
+/// Descriptor for `Method`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List methodDescriptor = $convert.base64Decode(
+ 'CgZNZXRob2QSEgoEbmFtZRgBIAEoCVIEbmFtZRIoChByZXF1ZXN0X3R5cGVfdXJsGAIgASgJUg'
+ '5yZXF1ZXN0VHlwZVVybBIrChFyZXF1ZXN0X3N0cmVhbWluZxgDIAEoCFIQcmVxdWVzdFN0cmVh'
+ 'bWluZxIqChFyZXNwb25zZV90eXBlX3VybBgEIAEoCVIPcmVzcG9uc2VUeXBlVXJsEi0KEnJlc3'
+ 'BvbnNlX3N0cmVhbWluZxgFIAEoCFIRcmVzcG9uc2VTdHJlYW1pbmcSMQoHb3B0aW9ucxgGIAMo'
+ 'CzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb25SB29wdGlvbnMSMwoGc3ludGF4GAcgASgOMhcuZ2'
+ '9vZ2xlLnByb3RvYnVmLlN5bnRheEICGAFSBnN5bnRheBIcCgdlZGl0aW9uGAggASgJQgIYAVIH'
+ 'ZWRpdGlvbg==');
+
+@$core.Deprecated('Use mixinDescriptor instead')
+const Mixin$json = {
+ '1': 'Mixin',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {'1': 'root', '3': 2, '4': 1, '5': 9, '10': 'root'},
+ ],
+};
+
+/// Descriptor for `Mixin`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List mixinDescriptor = $convert.base64Decode(
+ 'CgVNaXhpbhISCgRuYW1lGAEgASgJUgRuYW1lEhIKBHJvb3QYAiABKAlSBHJvb3Q=');
diff --git a/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart b/protobuf/lib/well_known_types/google/protobuf/duration.pb.dart
similarity index 98%
rename from protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart
rename to protobuf/lib/well_known_types/google/protobuf/duration.pb.dart
index bd08462..1d2be31 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/duration.pb.dart
+++ b/protobuf/lib/well_known_types/google/protobuf/duration.pb.dart
@@ -9,7 +9,7 @@
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports, library_prefixes
-// ignore_for_file: non_constant_identifier_names
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protobuf/lib/well_known_types/google/protobuf/duration.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/duration.pbjson.dart
new file mode 100644
index 0000000..8a9047b
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/duration.pbjson.dart
@@ -0,0 +1,30 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/duration.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use durationDescriptor instead')
+const Duration$json = {
+ '1': 'Duration',
+ '2': [
+ {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
+ {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
+ ],
+};
+
+/// Descriptor for `Duration`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List durationDescriptor = $convert.base64Decode(
+ 'CghEdXJhdGlvbhIYCgdzZWNvbmRzGAEgASgDUgdzZWNvbmRzEhQKBW5hbm9zGAIgASgFUgVuYW'
+ '5vcw==');
diff --git a/protobuf/lib/well_known_types/google/protobuf/empty.pb.dart b/protobuf/lib/well_known_types/google/protobuf/empty.pb.dart
new file mode 100644
index 0000000..8c77bb7
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/empty.pb.dart
@@ -0,0 +1,65 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/empty.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// A generic empty message that you can re-use to avoid defining duplicated
+/// empty messages in your APIs. A typical example is to use it as the request
+/// or the response type of an API method. For instance:
+///
+/// service Foo {
+/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+/// }
+class Empty extends $pb.GeneratedMessage {
+ factory Empty() => create();
+
+ Empty._();
+
+ factory Empty.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Empty.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Empty',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Empty clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Empty copyWith(void Function(Empty) updates) =>
+ super.copyWith((message) => updates(message as Empty)) as Empty;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Empty create() => Empty._();
+ @$core.override
+ Empty createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Empty getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
+ static Empty? _defaultInstance;
+}
+
+const $core.bool _omitMessageNames =
+ $core.bool.fromEnvironment('protobuf.omit_message_names');
diff --git a/protobuf/lib/well_known_types/google/protobuf/empty.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/empty.pbjson.dart
new file mode 100644
index 0000000..07cdbb3
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/empty.pbjson.dart
@@ -0,0 +1,25 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/empty.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use emptyDescriptor instead')
+const Empty$json = {
+ '1': 'Empty',
+};
+
+/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List emptyDescriptor =
+ $convert.base64Decode('CgVFbXB0eQ==');
diff --git a/protobuf/lib/well_known_types/google/protobuf/field_mask.pb.dart b/protobuf/lib/well_known_types/google/protobuf/field_mask.pb.dart
new file mode 100644
index 0000000..a41c1e7
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/field_mask.pb.dart
@@ -0,0 +1,273 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/field_mask.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
+// ignore_for_file: implementation_imports, library_prefixes
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// `FieldMask` represents a set of symbolic field paths, for example:
+///
+/// paths: "f.a"
+/// paths: "f.b.d"
+///
+/// Here `f` represents a field in some root message, `a` and `b`
+/// fields in the message found in `f`, and `d` a field found in the
+/// message in `f.b`.
+///
+/// Field masks are used to specify a subset of fields that should be
+/// returned by a get operation or modified by an update operation.
+/// Field masks also have a custom JSON encoding (see below).
+///
+/// # Field Masks in Projections
+///
+/// When used in the context of a projection, a response message or
+/// sub-message is filtered by the API to only contain those fields as
+/// specified in the mask. For example, if the mask in the previous
+/// example is applied to a response message as follows:
+///
+/// f {
+/// a : 22
+/// b {
+/// d : 1
+/// x : 2
+/// }
+/// y : 13
+/// }
+/// z: 8
+///
+/// The result will not contain specific values for fields x,y and z
+/// (their value will be set to the default, and omitted in proto text
+/// output):
+///
+///
+/// f {
+/// a : 22
+/// b {
+/// d : 1
+/// }
+/// }
+///
+/// A repeated field is not allowed except at the last position of a
+/// paths string.
+///
+/// If a FieldMask object is not present in a get operation, the
+/// operation applies to all fields (as if a FieldMask of all fields
+/// had been specified).
+///
+/// Note that a field mask does not necessarily apply to the
+/// top-level response message. In case of a REST get operation, the
+/// field mask applies directly to the response, but in case of a REST
+/// list operation, the mask instead applies to each individual message
+/// in the returned resource list. In case of a REST custom method,
+/// other definitions may be used. Where the mask applies will be
+/// clearly documented together with its declaration in the API. In
+/// any case, the effect on the returned resource/resources is required
+/// behavior for APIs.
+///
+/// # Field Masks in Update Operations
+///
+/// A field mask in update operations specifies which fields of the
+/// targeted resource are going to be updated. The API is required
+/// to only change the values of the fields as specified in the mask
+/// and leave the others untouched. If a resource is passed in to
+/// describe the updated values, the API ignores the values of all
+/// fields not covered by the mask.
+///
+/// If a repeated field is specified for an update operation, new values will
+/// be appended to the existing repeated field in the target resource. Note that
+/// a repeated field is only allowed in the last position of a `paths` string.
+///
+/// If a sub-message is specified in the last position of the field mask for an
+/// update operation, then new value will be merged into the existing sub-message
+/// in the target resource.
+///
+/// For example, given the target message:
+///
+/// f {
+/// b {
+/// d: 1
+/// x: 2
+/// }
+/// c: [1]
+/// }
+///
+/// And an update message:
+///
+/// f {
+/// b {
+/// d: 10
+/// }
+/// c: [2]
+/// }
+///
+/// then if the field mask is:
+///
+/// paths: ["f.b", "f.c"]
+///
+/// then the result will be:
+///
+/// f {
+/// b {
+/// d: 10
+/// x: 2
+/// }
+/// c: [1, 2]
+/// }
+///
+/// An implementation may provide options to override this default behavior for
+/// repeated and message fields.
+///
+/// In order to reset a field's value to the default, the field must
+/// be in the mask and set to the default value in the provided resource.
+/// Hence, in order to reset all fields of a resource, provide a default
+/// instance of the resource and set all fields in the mask, or do
+/// not provide a mask as described below.
+///
+/// If a field mask is not present on update, the operation applies to
+/// all fields (as if a field mask of all fields has been specified).
+/// Note that in the presence of schema evolution, this may mean that
+/// fields the client does not know and has therefore not filled into
+/// the request will be reset to their default. If this is unwanted
+/// behavior, a specific service may require a client to always specify
+/// a field mask, producing an error if not.
+///
+/// As with get operations, the location of the resource which
+/// describes the updated values in the request message depends on the
+/// operation kind. In any case, the effect of the field mask is
+/// required to be honored by the API.
+///
+/// ## Considerations for HTTP REST
+///
+/// The HTTP kind of an update operation which uses a field mask must
+/// be set to PATCH instead of PUT in order to satisfy HTTP semantics
+/// (PUT must only be used for full updates).
+///
+/// # JSON Encoding of Field Masks
+///
+/// In JSON, a field mask is encoded as a single string where paths are
+/// separated by a comma. Fields name in each path are converted
+/// to/from lower-camel naming conventions.
+///
+/// As an example, consider the following message declarations:
+///
+/// message Profile {
+/// User user = 1;
+/// Photo photo = 2;
+/// }
+/// message User {
+/// string display_name = 1;
+/// string address = 2;
+/// }
+///
+/// In proto a field mask for `Profile` may look as such:
+///
+/// mask {
+/// paths: "user.display_name"
+/// paths: "photo"
+/// }
+///
+/// In JSON, the same mask is represented as below:
+///
+/// {
+/// mask: "user.displayName,photo"
+/// }
+///
+/// # Field Masks and Oneof Fields
+///
+/// Field masks treat fields in oneofs just as regular fields. Consider the
+/// following message:
+///
+/// message SampleMessage {
+/// oneof test_oneof {
+/// string name = 4;
+/// SubMessage sub_message = 9;
+/// }
+/// }
+///
+/// The field mask can be:
+///
+/// mask {
+/// paths: "name"
+/// }
+///
+/// Or:
+///
+/// mask {
+/// paths: "sub_message"
+/// }
+///
+/// Note that oneof type names ("test_oneof" in this case) cannot be used in
+/// paths.
+///
+/// ## Field Mask Verification
+///
+/// The implementation of any API method which has a FieldMask type field in the
+/// request should verify the included field paths, and return an
+/// `INVALID_ARGUMENT` error if any path is unmappable.
+class FieldMask extends $pb.GeneratedMessage with $mixin.FieldMaskMixin {
+ factory FieldMask({
+ $core.Iterable<$core.String>? paths,
+ }) {
+ final result = create();
+ if (paths != null) result.paths.addAll(paths);
+ return result;
+ }
+
+ FieldMask._();
+
+ factory FieldMask.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory FieldMask.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'FieldMask',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.fieldMask)
+ ..pPS(1, _omitFieldNames ? '' : 'paths')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ FieldMask clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ FieldMask copyWith(void Function(FieldMask) updates) =>
+ super.copyWith((message) => updates(message as FieldMask)) as FieldMask;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static FieldMask create() => FieldMask._();
+ @$core.override
+ FieldMask createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static FieldMask getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<FieldMask>(create);
+ static FieldMask? _defaultInstance;
+
+ /// The set of field mask paths.
+ @$pb.TagNumber(1)
+ $pb.PbList<$core.String> get paths => $_getList(0);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/field_mask.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/field_mask.pbjson.dart
new file mode 100644
index 0000000..7bd6b2d
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/field_mask.pbjson.dart
@@ -0,0 +1,28 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/field_mask.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use fieldMaskDescriptor instead')
+const FieldMask$json = {
+ '1': 'FieldMask',
+ '2': [
+ {'1': 'paths', '3': 1, '4': 3, '5': 9, '10': 'paths'},
+ ],
+};
+
+/// Descriptor for `FieldMask`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List fieldMaskDescriptor =
+ $convert.base64Decode('CglGaWVsZE1hc2sSFAoFcGF0aHMYASADKAlSBXBhdGhz');
diff --git a/protobuf/lib/well_known_types/google/protobuf/source_context.pb.dart b/protobuf/lib/well_known_types/google/protobuf/source_context.pb.dart
new file mode 100644
index 0000000..b266326
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/source_context.pb.dart
@@ -0,0 +1,81 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/source_context.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// `SourceContext` represents information about the source of a
+/// protobuf element, like the file in which it is defined.
+class SourceContext extends $pb.GeneratedMessage {
+ factory SourceContext({
+ $core.String? fileName,
+ }) {
+ final result = create();
+ if (fileName != null) result.fileName = fileName;
+ return result;
+ }
+
+ SourceContext._();
+
+ factory SourceContext.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory SourceContext.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'SourceContext',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'fileName')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ SourceContext clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ SourceContext copyWith(void Function(SourceContext) updates) =>
+ super.copyWith((message) => updates(message as SourceContext))
+ as SourceContext;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static SourceContext create() => SourceContext._();
+ @$core.override
+ SourceContext createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static SourceContext getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<SourceContext>(create);
+ static SourceContext? _defaultInstance;
+
+ /// The path-qualified name of the .proto file that contained the associated
+ /// protobuf element. For example: `"google/protobuf/source_context.proto"`.
+ @$pb.TagNumber(1)
+ $core.String get fileName => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set fileName($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasFileName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearFileName() => $_clearField(1);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/source_context.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/source_context.pbjson.dart
new file mode 100644
index 0000000..b607f9e
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/source_context.pbjson.dart
@@ -0,0 +1,28 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/source_context.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use sourceContextDescriptor instead')
+const SourceContext$json = {
+ '1': 'SourceContext',
+ '2': [
+ {'1': 'file_name', '3': 1, '4': 1, '5': 9, '10': 'fileName'},
+ ],
+};
+
+/// Descriptor for `SourceContext`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List sourceContextDescriptor = $convert.base64Decode(
+ 'Cg1Tb3VyY2VDb250ZXh0EhsKCWZpbGVfbmFtZRgBIAEoCVIIZmlsZU5hbWU=');
diff --git a/protobuf/lib/well_known_types/google/protobuf/struct.pb.dart b/protobuf/lib/well_known_types/google/protobuf/struct.pb.dart
new file mode 100644
index 0000000..ba3ba12
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/struct.pb.dart
@@ -0,0 +1,312 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/struct.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
+// ignore_for_file: implementation_imports, library_prefixes
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
+import 'package:protobuf/well_known_types/google/protobuf/struct.pbenum.dart';
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+export 'package:protobuf/well_known_types/google/protobuf/struct.pbenum.dart';
+
+/// `Struct` represents a structured data value, consisting of fields
+/// which map to dynamically typed values. In some languages, `Struct`
+/// might be supported by a native representation. For example, in
+/// scripting languages like JS a struct is represented as an
+/// object. The details of that representation are described together
+/// with the proto support for the language.
+///
+/// The JSON representation for `Struct` is JSON object.
+class Struct extends $pb.GeneratedMessage with $mixin.StructMixin {
+ factory Struct({
+ $core.Iterable<$core.MapEntry<$core.String, Value>>? fields,
+ }) {
+ final result = create();
+ if (fields != null) result.fields.addEntries(fields);
+ return result;
+ }
+
+ Struct._();
+
+ factory Struct.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Struct.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Struct',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.struct)
+ ..m<$core.String, Value>(1, _omitFieldNames ? '' : 'fields',
+ entryClassName: 'Struct.FieldsEntry',
+ keyFieldType: $pb.PbFieldType.OS,
+ valueFieldType: $pb.PbFieldType.OM,
+ valueCreator: Value.create,
+ valueDefaultOrMaker: Value.getDefault,
+ packageName: const $pb.PackageName('google.protobuf'))
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Struct clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Struct copyWith(void Function(Struct) updates) =>
+ super.copyWith((message) => updates(message as Struct)) as Struct;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Struct create() => Struct._();
+ @$core.override
+ Struct createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Struct getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Struct>(create);
+ static Struct? _defaultInstance;
+
+ /// Unordered map of dynamically typed values.
+ @$pb.TagNumber(1)
+ $pb.PbMap<$core.String, Value> get fields => $_getMap(0);
+}
+
+enum Value_Kind {
+ nullValue,
+ numberValue,
+ stringValue,
+ boolValue,
+ structValue,
+ listValue,
+ notSet
+}
+
+/// `Value` represents a dynamically typed value which can be either
+/// null, a number, a string, a boolean, a recursive struct value, or a
+/// list of values. A producer of value is expected to set one of these
+/// variants. Absence of any variant indicates an error.
+///
+/// The JSON representation for `Value` is JSON value.
+class Value extends $pb.GeneratedMessage with $mixin.ValueMixin {
+ factory Value({
+ NullValue? nullValue,
+ $core.double? numberValue,
+ $core.String? stringValue,
+ $core.bool? boolValue,
+ Struct? structValue,
+ ListValue? listValue,
+ }) {
+ final result = create();
+ if (nullValue != null) result.nullValue = nullValue;
+ if (numberValue != null) result.numberValue = numberValue;
+ if (stringValue != null) result.stringValue = stringValue;
+ if (boolValue != null) result.boolValue = boolValue;
+ if (structValue != null) result.structValue = structValue;
+ if (listValue != null) result.listValue = listValue;
+ return result;
+ }
+
+ Value._();
+
+ factory Value.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Value.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static const $core.Map<$core.int, Value_Kind> _Value_KindByTag = {
+ 1: Value_Kind.nullValue,
+ 2: Value_Kind.numberValue,
+ 3: Value_Kind.stringValue,
+ 4: Value_Kind.boolValue,
+ 5: Value_Kind.structValue,
+ 6: Value_Kind.listValue,
+ 0: Value_Kind.notSet
+ };
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Value',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.value)
+ ..oo(0, [1, 2, 3, 4, 5, 6])
+ ..aE<NullValue>(1, _omitFieldNames ? '' : 'nullValue',
+ enumValues: NullValue.values)
+ ..aD(2, _omitFieldNames ? '' : 'numberValue')
+ ..aOS(3, _omitFieldNames ? '' : 'stringValue')
+ ..aOB(4, _omitFieldNames ? '' : 'boolValue')
+ ..aOM<Struct>(5, _omitFieldNames ? '' : 'structValue',
+ subBuilder: Struct.create)
+ ..aOM<ListValue>(6, _omitFieldNames ? '' : 'listValue',
+ subBuilder: ListValue.create)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Value clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Value copyWith(void Function(Value) updates) =>
+ super.copyWith((message) => updates(message as Value)) as Value;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Value create() => Value._();
+ @$core.override
+ Value createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Value getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Value>(create);
+ static Value? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ @$pb.TagNumber(2)
+ @$pb.TagNumber(3)
+ @$pb.TagNumber(4)
+ @$pb.TagNumber(5)
+ @$pb.TagNumber(6)
+ Value_Kind whichKind() => _Value_KindByTag[$_whichOneof(0)]!;
+ @$pb.TagNumber(1)
+ @$pb.TagNumber(2)
+ @$pb.TagNumber(3)
+ @$pb.TagNumber(4)
+ @$pb.TagNumber(5)
+ @$pb.TagNumber(6)
+ void clearKind() => $_clearField($_whichOneof(0));
+
+ /// Represents a null value.
+ @$pb.TagNumber(1)
+ NullValue get nullValue => $_getN(0);
+ @$pb.TagNumber(1)
+ set nullValue(NullValue value) => $_setField(1, value);
+ @$pb.TagNumber(1)
+ $core.bool hasNullValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearNullValue() => $_clearField(1);
+
+ /// Represents a double value.
+ @$pb.TagNumber(2)
+ $core.double get numberValue => $_getN(1);
+ @$pb.TagNumber(2)
+ set numberValue($core.double value) => $_setDouble(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasNumberValue() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearNumberValue() => $_clearField(2);
+
+ /// Represents a string value.
+ @$pb.TagNumber(3)
+ $core.String get stringValue => $_getSZ(2);
+ @$pb.TagNumber(3)
+ set stringValue($core.String value) => $_setString(2, value);
+ @$pb.TagNumber(3)
+ $core.bool hasStringValue() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearStringValue() => $_clearField(3);
+
+ /// Represents a boolean value.
+ @$pb.TagNumber(4)
+ $core.bool get boolValue => $_getBF(3);
+ @$pb.TagNumber(4)
+ set boolValue($core.bool value) => $_setBool(3, value);
+ @$pb.TagNumber(4)
+ $core.bool hasBoolValue() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearBoolValue() => $_clearField(4);
+
+ /// Represents a structured value.
+ @$pb.TagNumber(5)
+ Struct get structValue => $_getN(4);
+ @$pb.TagNumber(5)
+ set structValue(Struct value) => $_setField(5, value);
+ @$pb.TagNumber(5)
+ $core.bool hasStructValue() => $_has(4);
+ @$pb.TagNumber(5)
+ void clearStructValue() => $_clearField(5);
+ @$pb.TagNumber(5)
+ Struct ensureStructValue() => $_ensure(4);
+
+ /// Represents a repeated `Value`.
+ @$pb.TagNumber(6)
+ ListValue get listValue => $_getN(5);
+ @$pb.TagNumber(6)
+ set listValue(ListValue value) => $_setField(6, value);
+ @$pb.TagNumber(6)
+ $core.bool hasListValue() => $_has(5);
+ @$pb.TagNumber(6)
+ void clearListValue() => $_clearField(6);
+ @$pb.TagNumber(6)
+ ListValue ensureListValue() => $_ensure(5);
+}
+
+/// `ListValue` is a wrapper around a repeated field of values.
+///
+/// The JSON representation for `ListValue` is JSON array.
+class ListValue extends $pb.GeneratedMessage with $mixin.ListValueMixin {
+ factory ListValue({
+ $core.Iterable<Value>? values,
+ }) {
+ final result = create();
+ if (values != null) result.values.addAll(values);
+ return result;
+ }
+
+ ListValue._();
+
+ factory ListValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory ListValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'ListValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.listValue)
+ ..pPM<Value>(1, _omitFieldNames ? '' : 'values', subBuilder: Value.create)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ ListValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ ListValue copyWith(void Function(ListValue) updates) =>
+ super.copyWith((message) => updates(message as ListValue)) as ListValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static ListValue create() => ListValue._();
+ @$core.override
+ ListValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static ListValue getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ListValue>(create);
+ static ListValue? _defaultInstance;
+
+ /// Repeated field of dynamically typed values.
+ @$pb.TagNumber(1)
+ $pb.PbList<Value> get values => $_getList(0);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/struct.pbenum.dart b/protobuf/lib/well_known_types/google/protobuf/struct.pbenum.dart
new file mode 100644
index 0000000..4734206
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/struct.pbenum.dart
@@ -0,0 +1,39 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/struct.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+
+/// `NullValue` is a singleton enumeration to represent the null value for the
+/// `Value` type union.
+///
+/// The JSON representation for `NullValue` is JSON `null`.
+class NullValue extends $pb.ProtobufEnum {
+ /// Null value.
+ static const NullValue NULL_VALUE =
+ NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE');
+
+ static const $core.List<NullValue> values = <NullValue>[
+ NULL_VALUE,
+ ];
+
+ static final $core.List<NullValue?> _byValue =
+ $pb.ProtobufEnum.$_initByValueList(values, 0);
+ static NullValue? valueOf($core.int value) =>
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
+
+ const NullValue._(super.value, super.name);
+}
+
+const $core.bool _omitEnumNames =
+ $core.bool.fromEnvironment('protobuf.omit_enum_names');
diff --git a/protobuf/lib/well_known_types/google/protobuf/struct.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/struct.pbjson.dart
new file mode 100644
index 0000000..a8d906a
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/struct.pbjson.dart
@@ -0,0 +1,136 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/struct.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use nullValueDescriptor instead')
+const NullValue$json = {
+ '1': 'NullValue',
+ '2': [
+ {'1': 'NULL_VALUE', '2': 0},
+ ],
+};
+
+/// Descriptor for `NullValue`. Decode as a `google.protobuf.EnumDescriptorProto`.
+final $typed_data.Uint8List nullValueDescriptor =
+ $convert.base64Decode('CglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAA');
+
+@$core.Deprecated('Use structDescriptor instead')
+const Struct$json = {
+ '1': 'Struct',
+ '2': [
+ {
+ '1': 'fields',
+ '3': 1,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Struct.FieldsEntry',
+ '10': 'fields'
+ },
+ ],
+ '3': [Struct_FieldsEntry$json],
+};
+
+@$core.Deprecated('Use structDescriptor instead')
+const Struct_FieldsEntry$json = {
+ '1': 'FieldsEntry',
+ '2': [
+ {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
+ {
+ '1': 'value',
+ '3': 2,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.Value',
+ '10': 'value'
+ },
+ ],
+ '7': {'7': true},
+};
+
+/// Descriptor for `Struct`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List structDescriptor = $convert.base64Decode(
+ 'CgZTdHJ1Y3QSOwoGZmllbGRzGAEgAygLMiMuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdC5GaWVsZH'
+ 'NFbnRyeVIGZmllbGRzGlEKC0ZpZWxkc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EiwKBXZhbHVl'
+ 'GAIgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgV2YWx1ZToCOAE=');
+
+@$core.Deprecated('Use valueDescriptor instead')
+const Value$json = {
+ '1': 'Value',
+ '2': [
+ {
+ '1': 'null_value',
+ '3': 1,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.NullValue',
+ '9': 0,
+ '10': 'nullValue'
+ },
+ {'1': 'number_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'numberValue'},
+ {'1': 'string_value', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'stringValue'},
+ {'1': 'bool_value', '3': 4, '4': 1, '5': 8, '9': 0, '10': 'boolValue'},
+ {
+ '1': 'struct_value',
+ '3': 5,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.Struct',
+ '9': 0,
+ '10': 'structValue'
+ },
+ {
+ '1': 'list_value',
+ '3': 6,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.ListValue',
+ '9': 0,
+ '10': 'listValue'
+ },
+ ],
+ '8': [
+ {'1': 'kind'},
+ ],
+};
+
+/// Descriptor for `Value`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List valueDescriptor = $convert.base64Decode(
+ 'CgVWYWx1ZRI7CgpudWxsX3ZhbHVlGAEgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZU'
+ 'gAUgludWxsVmFsdWUSIwoMbnVtYmVyX3ZhbHVlGAIgASgBSABSC251bWJlclZhbHVlEiMKDHN0'
+ 'cmluZ192YWx1ZRgDIAEoCUgAUgtzdHJpbmdWYWx1ZRIfCgpib29sX3ZhbHVlGAQgASgISABSCW'
+ 'Jvb2xWYWx1ZRI8CgxzdHJ1Y3RfdmFsdWUYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0'
+ 'SABSC3N0cnVjdFZhbHVlEjsKCmxpc3RfdmFsdWUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuTG'
+ 'lzdFZhbHVlSABSCWxpc3RWYWx1ZUIGCgRraW5k');
+
+@$core.Deprecated('Use listValueDescriptor instead')
+const ListValue$json = {
+ '1': 'ListValue',
+ '2': [
+ {
+ '1': 'values',
+ '3': 1,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Value',
+ '10': 'values'
+ },
+ ],
+};
+
+/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode(
+ 'CglMaXN0VmFsdWUSLgoGdmFsdWVzGAEgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgZ2YW'
+ 'x1ZXM=');
diff --git a/protobuf/lib/well_known_types/google/protobuf/timestamp.pb.dart b/protobuf/lib/well_known_types/google/protobuf/timestamp.pb.dart
new file mode 100644
index 0000000..0df118c
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/timestamp.pb.dart
@@ -0,0 +1,198 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/timestamp.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
+// ignore_for_file: implementation_imports, library_prefixes
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:fixnum/fixnum.dart' as $fixnum;
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// A Timestamp represents a point in time independent of any time zone or local
+/// calendar, encoded as a count of seconds and fractions of seconds at
+/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
+/// January 1, 1970, in the proleptic Gregorian calendar which extends the
+/// Gregorian calendar backwards to year one.
+///
+/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
+/// second table is needed for interpretation, using a [24-hour linear
+/// smear](https://developers.google.com/time/smear).
+///
+/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
+/// restricting to that range, we ensure that we can convert to and from [RFC
+/// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
+///
+/// # Examples
+///
+/// Example 1: Compute Timestamp from POSIX `time()`.
+///
+/// Timestamp timestamp;
+/// timestamp.set_seconds(time(NULL));
+/// timestamp.set_nanos(0);
+///
+/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
+///
+/// struct timeval tv;
+/// gettimeofday(&tv, NULL);
+///
+/// Timestamp timestamp;
+/// timestamp.set_seconds(tv.tv_sec);
+/// timestamp.set_nanos(tv.tv_usec * 1000);
+///
+/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
+///
+/// FILETIME ft;
+/// GetSystemTimeAsFileTime(&ft);
+/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
+///
+/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
+/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
+/// Timestamp timestamp;
+/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
+/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
+///
+/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
+///
+/// long millis = System.currentTimeMillis();
+///
+/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
+/// .setNanos((int) ((millis % 1000) * 1000000)).build();
+///
+/// Example 5: Compute Timestamp from Java `Instant.now()`.
+///
+/// Instant now = Instant.now();
+///
+/// Timestamp timestamp =
+/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
+/// .setNanos(now.getNano()).build();
+///
+/// Example 6: Compute Timestamp from current time in Python.
+///
+/// timestamp = Timestamp()
+/// timestamp.GetCurrentTime()
+///
+/// # JSON Mapping
+///
+/// In JSON format, the Timestamp type is encoded as a string in the
+/// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
+/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
+/// where {year} is always expressed using four digits while {month}, {day},
+/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
+/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
+/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
+/// is required. A ProtoJSON serializer should always use UTC (as indicated by
+/// "Z") when printing the Timestamp type and a ProtoJSON parser should be
+/// able to accept both UTC and other timezones (as indicated by an offset).
+///
+/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
+/// 01:30 UTC on January 15, 2017.
+///
+/// In JavaScript, one can convert a Date object to this format using the
+/// standard
+/// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
+/// method. In Python, a standard `datetime.datetime` object can be converted
+/// to this format using
+/// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
+/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
+/// the Joda Time's [`ISODateTimeFormat.dateTime()`](
+/// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
+/// ) to obtain a formatter capable of generating timestamps in this format.
+class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin {
+ factory Timestamp({
+ $fixnum.Int64? seconds,
+ $core.int? nanos,
+ }) {
+ final result = create();
+ if (seconds != null) result.seconds = seconds;
+ if (nanos != null) result.nanos = nanos;
+ return result;
+ }
+
+ Timestamp._();
+
+ factory Timestamp.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Timestamp.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Timestamp',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.timestamp)
+ ..aInt64(1, _omitFieldNames ? '' : 'seconds')
+ ..aI(2, _omitFieldNames ? '' : 'nanos')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Timestamp clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Timestamp copyWith(void Function(Timestamp) updates) =>
+ super.copyWith((message) => updates(message as Timestamp)) as Timestamp;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Timestamp create() => Timestamp._();
+ @$core.override
+ Timestamp createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Timestamp getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Timestamp>(create);
+ static Timestamp? _defaultInstance;
+
+ /// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
+ /// be between -62135596800 and 253402300799 inclusive (which corresponds to
+ /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
+ @$pb.TagNumber(1)
+ $fixnum.Int64 get seconds => $_getI64(0);
+ @$pb.TagNumber(1)
+ set seconds($fixnum.Int64 value) => $_setInt64(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasSeconds() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearSeconds() => $_clearField(1);
+
+ /// Non-negative fractions of a second at nanosecond resolution. This field is
+ /// the nanosecond portion of the duration, not an alternative to seconds.
+ /// Negative second values with fractions must still have non-negative nanos
+ /// values that count forward in time. Must be between 0 and 999,999,999
+ /// inclusive.
+ @$pb.TagNumber(2)
+ $core.int get nanos => $_getIZ(1);
+ @$pb.TagNumber(2)
+ set nanos($core.int value) => $_setSignedInt32(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasNanos() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearNanos() => $_clearField(2);
+
+ /// Creates a new instance from [dateTime].
+ ///
+ /// Time zone information will not be preserved.
+ static Timestamp fromDateTime($core.DateTime dateTime) {
+ final result = create();
+ $mixin.TimestampMixin.setFromDateTime(result, dateTime);
+ return result;
+ }
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/timestamp.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/timestamp.pbjson.dart
new file mode 100644
index 0000000..739dd55
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/timestamp.pbjson.dart
@@ -0,0 +1,30 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/timestamp.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use timestampDescriptor instead')
+const Timestamp$json = {
+ '1': 'Timestamp',
+ '2': [
+ {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
+ {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
+ ],
+};
+
+/// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode(
+ 'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbm'
+ 'Fub3M=');
diff --git a/protobuf/lib/well_known_types/google/protobuf/type.pb.dart b/protobuf/lib/well_known_types/google/protobuf/type.pb.dart
new file mode 100644
index 0000000..020580e
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/type.pb.dart
@@ -0,0 +1,612 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/type.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/well_known_types/google/protobuf/any.pb.dart' as $1;
+import 'package:protobuf/well_known_types/google/protobuf/source_context.pb.dart'
+ as $0;
+import 'package:protobuf/well_known_types/google/protobuf/type.pbenum.dart';
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+export 'package:protobuf/well_known_types/google/protobuf/type.pbenum.dart';
+
+/// A protocol buffer message type.
+///
+/// New usages of this message as an alternative to DescriptorProto are strongly
+/// discouraged. This message does not reliability preserve all information
+/// necessary to model the schema and preserve semantics. Instead make use of
+/// FileDescriptorSet which preserves the necessary information.
+class Type extends $pb.GeneratedMessage {
+ factory Type({
+ $core.String? name,
+ $core.Iterable<Field>? fields,
+ $core.Iterable<$core.String>? oneofs,
+ $core.Iterable<Option>? options,
+ $0.SourceContext? sourceContext,
+ Syntax? syntax,
+ $core.String? edition,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (fields != null) result.fields.addAll(fields);
+ if (oneofs != null) result.oneofs.addAll(oneofs);
+ if (options != null) result.options.addAll(options);
+ if (sourceContext != null) result.sourceContext = sourceContext;
+ if (syntax != null) result.syntax = syntax;
+ if (edition != null) result.edition = edition;
+ return result;
+ }
+
+ Type._();
+
+ factory Type.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Type.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Type',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..pPM<Field>(2, _omitFieldNames ? '' : 'fields', subBuilder: Field.create)
+ ..pPS(3, _omitFieldNames ? '' : 'oneofs')
+ ..pPM<Option>(4, _omitFieldNames ? '' : 'options',
+ subBuilder: Option.create)
+ ..aOM<$0.SourceContext>(5, _omitFieldNames ? '' : 'sourceContext',
+ subBuilder: $0.SourceContext.create)
+ ..aE<Syntax>(6, _omitFieldNames ? '' : 'syntax', enumValues: Syntax.values)
+ ..aOS(7, _omitFieldNames ? '' : 'edition')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Type clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Type copyWith(void Function(Type) updates) =>
+ super.copyWith((message) => updates(message as Type)) as Type;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Type create() => Type._();
+ @$core.override
+ Type createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Type getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Type>(create);
+ static Type? _defaultInstance;
+
+ /// The fully qualified message name.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// The list of fields.
+ @$pb.TagNumber(2)
+ $pb.PbList<Field> get fields => $_getList(1);
+
+ /// The list of types appearing in `oneof` definitions in this type.
+ @$pb.TagNumber(3)
+ $pb.PbList<$core.String> get oneofs => $_getList(2);
+
+ /// The protocol buffer options.
+ @$pb.TagNumber(4)
+ $pb.PbList<Option> get options => $_getList(3);
+
+ /// The source context.
+ @$pb.TagNumber(5)
+ $0.SourceContext get sourceContext => $_getN(4);
+ @$pb.TagNumber(5)
+ set sourceContext($0.SourceContext value) => $_setField(5, value);
+ @$pb.TagNumber(5)
+ $core.bool hasSourceContext() => $_has(4);
+ @$pb.TagNumber(5)
+ void clearSourceContext() => $_clearField(5);
+ @$pb.TagNumber(5)
+ $0.SourceContext ensureSourceContext() => $_ensure(4);
+
+ /// The source syntax.
+ @$pb.TagNumber(6)
+ Syntax get syntax => $_getN(5);
+ @$pb.TagNumber(6)
+ set syntax(Syntax value) => $_setField(6, value);
+ @$pb.TagNumber(6)
+ $core.bool hasSyntax() => $_has(5);
+ @$pb.TagNumber(6)
+ void clearSyntax() => $_clearField(6);
+
+ /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ @$pb.TagNumber(7)
+ $core.String get edition => $_getSZ(6);
+ @$pb.TagNumber(7)
+ set edition($core.String value) => $_setString(6, value);
+ @$pb.TagNumber(7)
+ $core.bool hasEdition() => $_has(6);
+ @$pb.TagNumber(7)
+ void clearEdition() => $_clearField(7);
+}
+
+/// A single field of a message type.
+///
+/// New usages of this message as an alternative to FieldDescriptorProto are
+/// strongly discouraged. This message does not reliability preserve all
+/// information necessary to model the schema and preserve semantics. Instead
+/// make use of FileDescriptorSet which preserves the necessary information.
+class Field extends $pb.GeneratedMessage {
+ factory Field({
+ Field_Kind? kind,
+ Field_Cardinality? cardinality,
+ $core.int? number,
+ $core.String? name,
+ $core.String? typeUrl,
+ $core.int? oneofIndex,
+ $core.bool? packed,
+ $core.Iterable<Option>? options,
+ $core.String? jsonName,
+ $core.String? defaultValue,
+ }) {
+ final result = create();
+ if (kind != null) result.kind = kind;
+ if (cardinality != null) result.cardinality = cardinality;
+ if (number != null) result.number = number;
+ if (name != null) result.name = name;
+ if (typeUrl != null) result.typeUrl = typeUrl;
+ if (oneofIndex != null) result.oneofIndex = oneofIndex;
+ if (packed != null) result.packed = packed;
+ if (options != null) result.options.addAll(options);
+ if (jsonName != null) result.jsonName = jsonName;
+ if (defaultValue != null) result.defaultValue = defaultValue;
+ return result;
+ }
+
+ Field._();
+
+ factory Field.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Field.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Field',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aE<Field_Kind>(1, _omitFieldNames ? '' : 'kind',
+ enumValues: Field_Kind.values)
+ ..aE<Field_Cardinality>(2, _omitFieldNames ? '' : 'cardinality',
+ enumValues: Field_Cardinality.values)
+ ..aI(3, _omitFieldNames ? '' : 'number')
+ ..aOS(4, _omitFieldNames ? '' : 'name')
+ ..aOS(6, _omitFieldNames ? '' : 'typeUrl')
+ ..aI(7, _omitFieldNames ? '' : 'oneofIndex')
+ ..aOB(8, _omitFieldNames ? '' : 'packed')
+ ..pPM<Option>(9, _omitFieldNames ? '' : 'options',
+ subBuilder: Option.create)
+ ..aOS(10, _omitFieldNames ? '' : 'jsonName')
+ ..aOS(11, _omitFieldNames ? '' : 'defaultValue')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Field clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Field copyWith(void Function(Field) updates) =>
+ super.copyWith((message) => updates(message as Field)) as Field;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Field create() => Field._();
+ @$core.override
+ Field createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Field getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Field>(create);
+ static Field? _defaultInstance;
+
+ /// The field type.
+ @$pb.TagNumber(1)
+ Field_Kind get kind => $_getN(0);
+ @$pb.TagNumber(1)
+ set kind(Field_Kind value) => $_setField(1, value);
+ @$pb.TagNumber(1)
+ $core.bool hasKind() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearKind() => $_clearField(1);
+
+ /// The field cardinality.
+ @$pb.TagNumber(2)
+ Field_Cardinality get cardinality => $_getN(1);
+ @$pb.TagNumber(2)
+ set cardinality(Field_Cardinality value) => $_setField(2, value);
+ @$pb.TagNumber(2)
+ $core.bool hasCardinality() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearCardinality() => $_clearField(2);
+
+ /// The field number.
+ @$pb.TagNumber(3)
+ $core.int get number => $_getIZ(2);
+ @$pb.TagNumber(3)
+ set number($core.int value) => $_setSignedInt32(2, value);
+ @$pb.TagNumber(3)
+ $core.bool hasNumber() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearNumber() => $_clearField(3);
+
+ /// The field name.
+ @$pb.TagNumber(4)
+ $core.String get name => $_getSZ(3);
+ @$pb.TagNumber(4)
+ set name($core.String value) => $_setString(3, value);
+ @$pb.TagNumber(4)
+ $core.bool hasName() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearName() => $_clearField(4);
+
+ /// The field type URL, without the scheme, for message or enumeration
+ /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+ @$pb.TagNumber(6)
+ $core.String get typeUrl => $_getSZ(4);
+ @$pb.TagNumber(6)
+ set typeUrl($core.String value) => $_setString(4, value);
+ @$pb.TagNumber(6)
+ $core.bool hasTypeUrl() => $_has(4);
+ @$pb.TagNumber(6)
+ void clearTypeUrl() => $_clearField(6);
+
+ /// The index of the field type in `Type.oneofs`, for message or enumeration
+ /// types. The first type has index 1; zero means the type is not in the list.
+ @$pb.TagNumber(7)
+ $core.int get oneofIndex => $_getIZ(5);
+ @$pb.TagNumber(7)
+ set oneofIndex($core.int value) => $_setSignedInt32(5, value);
+ @$pb.TagNumber(7)
+ $core.bool hasOneofIndex() => $_has(5);
+ @$pb.TagNumber(7)
+ void clearOneofIndex() => $_clearField(7);
+
+ /// Whether to use alternative packed wire representation.
+ @$pb.TagNumber(8)
+ $core.bool get packed => $_getBF(6);
+ @$pb.TagNumber(8)
+ set packed($core.bool value) => $_setBool(6, value);
+ @$pb.TagNumber(8)
+ $core.bool hasPacked() => $_has(6);
+ @$pb.TagNumber(8)
+ void clearPacked() => $_clearField(8);
+
+ /// The protocol buffer options.
+ @$pb.TagNumber(9)
+ $pb.PbList<Option> get options => $_getList(7);
+
+ /// The field JSON name.
+ @$pb.TagNumber(10)
+ $core.String get jsonName => $_getSZ(8);
+ @$pb.TagNumber(10)
+ set jsonName($core.String value) => $_setString(8, value);
+ @$pb.TagNumber(10)
+ $core.bool hasJsonName() => $_has(8);
+ @$pb.TagNumber(10)
+ void clearJsonName() => $_clearField(10);
+
+ /// The string value of the default value of this field. Proto2 syntax only.
+ @$pb.TagNumber(11)
+ $core.String get defaultValue => $_getSZ(9);
+ @$pb.TagNumber(11)
+ set defaultValue($core.String value) => $_setString(9, value);
+ @$pb.TagNumber(11)
+ $core.bool hasDefaultValue() => $_has(9);
+ @$pb.TagNumber(11)
+ void clearDefaultValue() => $_clearField(11);
+}
+
+/// Enum type definition.
+///
+/// New usages of this message as an alternative to EnumDescriptorProto are
+/// strongly discouraged. This message does not reliability preserve all
+/// information necessary to model the schema and preserve semantics. Instead
+/// make use of FileDescriptorSet which preserves the necessary information.
+class Enum extends $pb.GeneratedMessage {
+ factory Enum({
+ $core.String? name,
+ $core.Iterable<EnumValue>? enumvalue,
+ $core.Iterable<Option>? options,
+ $0.SourceContext? sourceContext,
+ Syntax? syntax,
+ $core.String? edition,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (enumvalue != null) result.enumvalue.addAll(enumvalue);
+ if (options != null) result.options.addAll(options);
+ if (sourceContext != null) result.sourceContext = sourceContext;
+ if (syntax != null) result.syntax = syntax;
+ if (edition != null) result.edition = edition;
+ return result;
+ }
+
+ Enum._();
+
+ factory Enum.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Enum.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Enum',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..pPM<EnumValue>(2, _omitFieldNames ? '' : 'enumvalue',
+ subBuilder: EnumValue.create)
+ ..pPM<Option>(3, _omitFieldNames ? '' : 'options',
+ subBuilder: Option.create)
+ ..aOM<$0.SourceContext>(4, _omitFieldNames ? '' : 'sourceContext',
+ subBuilder: $0.SourceContext.create)
+ ..aE<Syntax>(5, _omitFieldNames ? '' : 'syntax', enumValues: Syntax.values)
+ ..aOS(6, _omitFieldNames ? '' : 'edition')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Enum clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Enum copyWith(void Function(Enum) updates) =>
+ super.copyWith((message) => updates(message as Enum)) as Enum;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Enum create() => Enum._();
+ @$core.override
+ Enum createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Enum getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Enum>(create);
+ static Enum? _defaultInstance;
+
+ /// Enum type name.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// Enum value definitions.
+ @$pb.TagNumber(2)
+ $pb.PbList<EnumValue> get enumvalue => $_getList(1);
+
+ /// Protocol buffer options.
+ @$pb.TagNumber(3)
+ $pb.PbList<Option> get options => $_getList(2);
+
+ /// The source context.
+ @$pb.TagNumber(4)
+ $0.SourceContext get sourceContext => $_getN(3);
+ @$pb.TagNumber(4)
+ set sourceContext($0.SourceContext value) => $_setField(4, value);
+ @$pb.TagNumber(4)
+ $core.bool hasSourceContext() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearSourceContext() => $_clearField(4);
+ @$pb.TagNumber(4)
+ $0.SourceContext ensureSourceContext() => $_ensure(3);
+
+ /// The source syntax.
+ @$pb.TagNumber(5)
+ Syntax get syntax => $_getN(4);
+ @$pb.TagNumber(5)
+ set syntax(Syntax value) => $_setField(5, value);
+ @$pb.TagNumber(5)
+ $core.bool hasSyntax() => $_has(4);
+ @$pb.TagNumber(5)
+ void clearSyntax() => $_clearField(5);
+
+ /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
+ @$pb.TagNumber(6)
+ $core.String get edition => $_getSZ(5);
+ @$pb.TagNumber(6)
+ set edition($core.String value) => $_setString(5, value);
+ @$pb.TagNumber(6)
+ $core.bool hasEdition() => $_has(5);
+ @$pb.TagNumber(6)
+ void clearEdition() => $_clearField(6);
+}
+
+/// Enum value definition.
+///
+/// New usages of this message as an alternative to EnumValueDescriptorProto are
+/// strongly discouraged. This message does not reliability preserve all
+/// information necessary to model the schema and preserve semantics. Instead
+/// make use of FileDescriptorSet which preserves the necessary information.
+class EnumValue extends $pb.GeneratedMessage {
+ factory EnumValue({
+ $core.String? name,
+ $core.int? number,
+ $core.Iterable<Option>? options,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (number != null) result.number = number;
+ if (options != null) result.options.addAll(options);
+ return result;
+ }
+
+ EnumValue._();
+
+ factory EnumValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory EnumValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'EnumValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..aI(2, _omitFieldNames ? '' : 'number')
+ ..pPM<Option>(3, _omitFieldNames ? '' : 'options',
+ subBuilder: Option.create)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ EnumValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ EnumValue copyWith(void Function(EnumValue) updates) =>
+ super.copyWith((message) => updates(message as EnumValue)) as EnumValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static EnumValue create() => EnumValue._();
+ @$core.override
+ EnumValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static EnumValue getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EnumValue>(create);
+ static EnumValue? _defaultInstance;
+
+ /// Enum value name.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// Enum value number.
+ @$pb.TagNumber(2)
+ $core.int get number => $_getIZ(1);
+ @$pb.TagNumber(2)
+ set number($core.int value) => $_setSignedInt32(1, value);
+ @$pb.TagNumber(2)
+ $core.bool hasNumber() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearNumber() => $_clearField(2);
+
+ /// Protocol buffer options.
+ @$pb.TagNumber(3)
+ $pb.PbList<Option> get options => $_getList(2);
+}
+
+/// A protocol buffer option, which can be attached to a message, field,
+/// enumeration, etc.
+///
+/// New usages of this message as an alternative to FileOptions, MessageOptions,
+/// FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions
+/// are strongly discouraged.
+class Option extends $pb.GeneratedMessage {
+ factory Option({
+ $core.String? name,
+ $1.Any? value,
+ }) {
+ final result = create();
+ if (name != null) result.name = name;
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ Option._();
+
+ factory Option.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Option.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Option',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'name')
+ ..aOM<$1.Any>(2, _omitFieldNames ? '' : 'value', subBuilder: $1.Any.create)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Option clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Option copyWith(void Function(Option) updates) =>
+ super.copyWith((message) => updates(message as Option)) as Option;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Option create() => Option._();
+ @$core.override
+ Option createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Option getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Option>(create);
+ static Option? _defaultInstance;
+
+ /// The option's name. For protobuf built-in options (options defined in
+ /// descriptor.proto), this is the short name. For example, `"map_entry"`.
+ /// For custom options, it should be the fully-qualified name. For example,
+ /// `"google.api.http"`.
+ @$pb.TagNumber(1)
+ $core.String get name => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set name($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasName() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearName() => $_clearField(1);
+
+ /// The option's value packed in an Any message. If the value is a primitive,
+ /// the corresponding wrapper type defined in google/protobuf/wrappers.proto
+ /// should be used. If the value is an enum, it should be stored as an int32
+ /// value using the google.protobuf.Int32Value type.
+ @$pb.TagNumber(2)
+ $1.Any get value => $_getN(1);
+ @$pb.TagNumber(2)
+ set value($1.Any value) => $_setField(2, value);
+ @$pb.TagNumber(2)
+ $core.bool hasValue() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearValue() => $_clearField(2);
+ @$pb.TagNumber(2)
+ $1.Any ensureValue() => $_ensure(1);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/type.pbenum.dart b/protobuf/lib/well_known_types/google/protobuf/type.pbenum.dart
new file mode 100644
index 0000000..959d8e8
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/type.pbenum.dart
@@ -0,0 +1,187 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/type.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, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:protobuf/protobuf.dart' as $pb;
+
+/// The syntax in which a protocol buffer element is defined.
+class Syntax extends $pb.ProtobufEnum {
+ /// Syntax `proto2`.
+ static const Syntax SYNTAX_PROTO2 =
+ Syntax._(0, _omitEnumNames ? '' : 'SYNTAX_PROTO2');
+
+ /// Syntax `proto3`.
+ static const Syntax SYNTAX_PROTO3 =
+ Syntax._(1, _omitEnumNames ? '' : 'SYNTAX_PROTO3');
+
+ /// Syntax `editions`.
+ static const Syntax SYNTAX_EDITIONS =
+ Syntax._(2, _omitEnumNames ? '' : 'SYNTAX_EDITIONS');
+
+ static const $core.List<Syntax> values = <Syntax>[
+ SYNTAX_PROTO2,
+ SYNTAX_PROTO3,
+ SYNTAX_EDITIONS,
+ ];
+
+ static final $core.List<Syntax?> _byValue =
+ $pb.ProtobufEnum.$_initByValueList(values, 2);
+ static Syntax? valueOf($core.int value) =>
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
+
+ const Syntax._(super.value, super.name);
+}
+
+/// Basic field types.
+class Field_Kind extends $pb.ProtobufEnum {
+ /// Field type unknown.
+ static const Field_Kind TYPE_UNKNOWN =
+ Field_Kind._(0, _omitEnumNames ? '' : 'TYPE_UNKNOWN');
+
+ /// Field type double.
+ static const Field_Kind TYPE_DOUBLE =
+ Field_Kind._(1, _omitEnumNames ? '' : 'TYPE_DOUBLE');
+
+ /// Field type float.
+ static const Field_Kind TYPE_FLOAT =
+ Field_Kind._(2, _omitEnumNames ? '' : 'TYPE_FLOAT');
+
+ /// Field type int64.
+ static const Field_Kind TYPE_INT64 =
+ Field_Kind._(3, _omitEnumNames ? '' : 'TYPE_INT64');
+
+ /// Field type uint64.
+ static const Field_Kind TYPE_UINT64 =
+ Field_Kind._(4, _omitEnumNames ? '' : 'TYPE_UINT64');
+
+ /// Field type int32.
+ static const Field_Kind TYPE_INT32 =
+ Field_Kind._(5, _omitEnumNames ? '' : 'TYPE_INT32');
+
+ /// Field type fixed64.
+ static const Field_Kind TYPE_FIXED64 =
+ Field_Kind._(6, _omitEnumNames ? '' : 'TYPE_FIXED64');
+
+ /// Field type fixed32.
+ static const Field_Kind TYPE_FIXED32 =
+ Field_Kind._(7, _omitEnumNames ? '' : 'TYPE_FIXED32');
+
+ /// Field type bool.
+ static const Field_Kind TYPE_BOOL =
+ Field_Kind._(8, _omitEnumNames ? '' : 'TYPE_BOOL');
+
+ /// Field type string.
+ static const Field_Kind TYPE_STRING =
+ Field_Kind._(9, _omitEnumNames ? '' : 'TYPE_STRING');
+
+ /// Field type group. Proto2 syntax only, and deprecated.
+ static const Field_Kind TYPE_GROUP =
+ Field_Kind._(10, _omitEnumNames ? '' : 'TYPE_GROUP');
+
+ /// Field type message.
+ static const Field_Kind TYPE_MESSAGE =
+ Field_Kind._(11, _omitEnumNames ? '' : 'TYPE_MESSAGE');
+
+ /// Field type bytes.
+ static const Field_Kind TYPE_BYTES =
+ Field_Kind._(12, _omitEnumNames ? '' : 'TYPE_BYTES');
+
+ /// Field type uint32.
+ static const Field_Kind TYPE_UINT32 =
+ Field_Kind._(13, _omitEnumNames ? '' : 'TYPE_UINT32');
+
+ /// Field type enum.
+ static const Field_Kind TYPE_ENUM =
+ Field_Kind._(14, _omitEnumNames ? '' : 'TYPE_ENUM');
+
+ /// Field type sfixed32.
+ static const Field_Kind TYPE_SFIXED32 =
+ Field_Kind._(15, _omitEnumNames ? '' : 'TYPE_SFIXED32');
+
+ /// Field type sfixed64.
+ static const Field_Kind TYPE_SFIXED64 =
+ Field_Kind._(16, _omitEnumNames ? '' : 'TYPE_SFIXED64');
+
+ /// Field type sint32.
+ static const Field_Kind TYPE_SINT32 =
+ Field_Kind._(17, _omitEnumNames ? '' : 'TYPE_SINT32');
+
+ /// Field type sint64.
+ static const Field_Kind TYPE_SINT64 =
+ Field_Kind._(18, _omitEnumNames ? '' : 'TYPE_SINT64');
+
+ static const $core.List<Field_Kind> values = <Field_Kind>[
+ TYPE_UNKNOWN,
+ TYPE_DOUBLE,
+ TYPE_FLOAT,
+ TYPE_INT64,
+ TYPE_UINT64,
+ TYPE_INT32,
+ TYPE_FIXED64,
+ TYPE_FIXED32,
+ TYPE_BOOL,
+ TYPE_STRING,
+ TYPE_GROUP,
+ TYPE_MESSAGE,
+ TYPE_BYTES,
+ TYPE_UINT32,
+ TYPE_ENUM,
+ TYPE_SFIXED32,
+ TYPE_SFIXED64,
+ TYPE_SINT32,
+ TYPE_SINT64,
+ ];
+
+ static final $core.List<Field_Kind?> _byValue =
+ $pb.ProtobufEnum.$_initByValueList(values, 18);
+ static Field_Kind? valueOf($core.int value) =>
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
+
+ const Field_Kind._(super.value, super.name);
+}
+
+/// Whether a field is optional, required, or repeated.
+class Field_Cardinality extends $pb.ProtobufEnum {
+ /// For fields with unknown cardinality.
+ static const Field_Cardinality CARDINALITY_UNKNOWN =
+ Field_Cardinality._(0, _omitEnumNames ? '' : 'CARDINALITY_UNKNOWN');
+
+ /// For optional fields.
+ static const Field_Cardinality CARDINALITY_OPTIONAL =
+ Field_Cardinality._(1, _omitEnumNames ? '' : 'CARDINALITY_OPTIONAL');
+
+ /// For required fields. Proto2 syntax only.
+ static const Field_Cardinality CARDINALITY_REQUIRED =
+ Field_Cardinality._(2, _omitEnumNames ? '' : 'CARDINALITY_REQUIRED');
+
+ /// For repeated fields.
+ static const Field_Cardinality CARDINALITY_REPEATED =
+ Field_Cardinality._(3, _omitEnumNames ? '' : 'CARDINALITY_REPEATED');
+
+ static const $core.List<Field_Cardinality> values = <Field_Cardinality>[
+ CARDINALITY_UNKNOWN,
+ CARDINALITY_OPTIONAL,
+ CARDINALITY_REQUIRED,
+ CARDINALITY_REPEATED,
+ ];
+
+ static final $core.List<Field_Cardinality?> _byValue =
+ $pb.ProtobufEnum.$_initByValueList(values, 3);
+ static Field_Cardinality? valueOf($core.int value) =>
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
+
+ const Field_Cardinality._(super.value, super.name);
+}
+
+const $core.bool _omitEnumNames =
+ $core.bool.fromEnvironment('protobuf.omit_enum_names');
diff --git a/protobuf/lib/well_known_types/google/protobuf/type.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/type.pbjson.dart
new file mode 100644
index 0000000..2889dae
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/type.pbjson.dart
@@ -0,0 +1,269 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/type.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use syntaxDescriptor instead')
+const Syntax$json = {
+ '1': 'Syntax',
+ '2': [
+ {'1': 'SYNTAX_PROTO2', '2': 0},
+ {'1': 'SYNTAX_PROTO3', '2': 1},
+ {'1': 'SYNTAX_EDITIONS', '2': 2},
+ ],
+};
+
+/// Descriptor for `Syntax`. Decode as a `google.protobuf.EnumDescriptorProto`.
+final $typed_data.Uint8List syntaxDescriptor = $convert.base64Decode(
+ 'CgZTeW50YXgSEQoNU1lOVEFYX1BST1RPMhAAEhEKDVNZTlRBWF9QUk9UTzMQARITCg9TWU5UQV'
+ 'hfRURJVElPTlMQAg==');
+
+@$core.Deprecated('Use typeDescriptor instead')
+const Type$json = {
+ '1': 'Type',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {
+ '1': 'fields',
+ '3': 2,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Field',
+ '10': 'fields'
+ },
+ {'1': 'oneofs', '3': 3, '4': 3, '5': 9, '10': 'oneofs'},
+ {
+ '1': 'options',
+ '3': 4,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ {
+ '1': 'source_context',
+ '3': 5,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.SourceContext',
+ '10': 'sourceContext'
+ },
+ {
+ '1': 'syntax',
+ '3': 6,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Syntax',
+ '10': 'syntax'
+ },
+ {'1': 'edition', '3': 7, '4': 1, '5': 9, '10': 'edition'},
+ ],
+};
+
+/// Descriptor for `Type`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List typeDescriptor = $convert.base64Decode(
+ 'CgRUeXBlEhIKBG5hbWUYASABKAlSBG5hbWUSLgoGZmllbGRzGAIgAygLMhYuZ29vZ2xlLnByb3'
+ 'RvYnVmLkZpZWxkUgZmaWVsZHMSFgoGb25lb2ZzGAMgAygJUgZvbmVvZnMSMQoHb3B0aW9ucxgE'
+ 'IAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb25SB29wdGlvbnMSRQoOc291cmNlX2NvbnRleH'
+ 'QYBSABKAsyHi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dFINc291cmNlQ29udGV4dBIv'
+ 'CgZzeW50YXgYBiABKA4yFy5nb29nbGUucHJvdG9idWYuU3ludGF4UgZzeW50YXgSGAoHZWRpdG'
+ 'lvbhgHIAEoCVIHZWRpdGlvbg==');
+
+@$core.Deprecated('Use fieldDescriptor instead')
+const Field$json = {
+ '1': 'Field',
+ '2': [
+ {
+ '1': 'kind',
+ '3': 1,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Field.Kind',
+ '10': 'kind'
+ },
+ {
+ '1': 'cardinality',
+ '3': 2,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Field.Cardinality',
+ '10': 'cardinality'
+ },
+ {'1': 'number', '3': 3, '4': 1, '5': 5, '10': 'number'},
+ {'1': 'name', '3': 4, '4': 1, '5': 9, '10': 'name'},
+ {'1': 'type_url', '3': 6, '4': 1, '5': 9, '10': 'typeUrl'},
+ {'1': 'oneof_index', '3': 7, '4': 1, '5': 5, '10': 'oneofIndex'},
+ {'1': 'packed', '3': 8, '4': 1, '5': 8, '10': 'packed'},
+ {
+ '1': 'options',
+ '3': 9,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ {'1': 'json_name', '3': 10, '4': 1, '5': 9, '10': 'jsonName'},
+ {'1': 'default_value', '3': 11, '4': 1, '5': 9, '10': 'defaultValue'},
+ ],
+ '4': [Field_Kind$json, Field_Cardinality$json],
+};
+
+@$core.Deprecated('Use fieldDescriptor instead')
+const Field_Kind$json = {
+ '1': 'Kind',
+ '2': [
+ {'1': 'TYPE_UNKNOWN', '2': 0},
+ {'1': 'TYPE_DOUBLE', '2': 1},
+ {'1': 'TYPE_FLOAT', '2': 2},
+ {'1': 'TYPE_INT64', '2': 3},
+ {'1': 'TYPE_UINT64', '2': 4},
+ {'1': 'TYPE_INT32', '2': 5},
+ {'1': 'TYPE_FIXED64', '2': 6},
+ {'1': 'TYPE_FIXED32', '2': 7},
+ {'1': 'TYPE_BOOL', '2': 8},
+ {'1': 'TYPE_STRING', '2': 9},
+ {'1': 'TYPE_GROUP', '2': 10},
+ {'1': 'TYPE_MESSAGE', '2': 11},
+ {'1': 'TYPE_BYTES', '2': 12},
+ {'1': 'TYPE_UINT32', '2': 13},
+ {'1': 'TYPE_ENUM', '2': 14},
+ {'1': 'TYPE_SFIXED32', '2': 15},
+ {'1': 'TYPE_SFIXED64', '2': 16},
+ {'1': 'TYPE_SINT32', '2': 17},
+ {'1': 'TYPE_SINT64', '2': 18},
+ ],
+};
+
+@$core.Deprecated('Use fieldDescriptor instead')
+const Field_Cardinality$json = {
+ '1': 'Cardinality',
+ '2': [
+ {'1': 'CARDINALITY_UNKNOWN', '2': 0},
+ {'1': 'CARDINALITY_OPTIONAL', '2': 1},
+ {'1': 'CARDINALITY_REQUIRED', '2': 2},
+ {'1': 'CARDINALITY_REPEATED', '2': 3},
+ ],
+};
+
+/// Descriptor for `Field`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List fieldDescriptor = $convert.base64Decode(
+ 'CgVGaWVsZBIvCgRraW5kGAEgASgOMhsuZ29vZ2xlLnByb3RvYnVmLkZpZWxkLktpbmRSBGtpbm'
+ 'QSRAoLY2FyZGluYWxpdHkYAiABKA4yIi5nb29nbGUucHJvdG9idWYuRmllbGQuQ2FyZGluYWxp'
+ 'dHlSC2NhcmRpbmFsaXR5EhYKBm51bWJlchgDIAEoBVIGbnVtYmVyEhIKBG5hbWUYBCABKAlSBG'
+ '5hbWUSGQoIdHlwZV91cmwYBiABKAlSB3R5cGVVcmwSHwoLb25lb2ZfaW5kZXgYByABKAVSCm9u'
+ 'ZW9mSW5kZXgSFgoGcGFja2VkGAggASgIUgZwYWNrZWQSMQoHb3B0aW9ucxgJIAMoCzIXLmdvb2'
+ 'dsZS5wcm90b2J1Zi5PcHRpb25SB29wdGlvbnMSGwoJanNvbl9uYW1lGAogASgJUghqc29uTmFt'
+ 'ZRIjCg1kZWZhdWx0X3ZhbHVlGAsgASgJUgxkZWZhdWx0VmFsdWUiyAIKBEtpbmQSEAoMVFlQRV'
+ '9VTktOT1dOEAASDwoLVFlQRV9ET1VCTEUQARIOCgpUWVBFX0ZMT0FUEAISDgoKVFlQRV9JTlQ2'
+ 'NBADEg8KC1RZUEVfVUlOVDY0EAQSDgoKVFlQRV9JTlQzMhAFEhAKDFRZUEVfRklYRUQ2NBAGEh'
+ 'AKDFRZUEVfRklYRUQzMhAHEg0KCVRZUEVfQk9PTBAIEg8KC1RZUEVfU1RSSU5HEAkSDgoKVFlQ'
+ 'RV9HUk9VUBAKEhAKDFRZUEVfTUVTU0FHRRALEg4KClRZUEVfQllURVMQDBIPCgtUWVBFX1VJTl'
+ 'QzMhANEg0KCVRZUEVfRU5VTRAOEhEKDVRZUEVfU0ZJWEVEMzIQDxIRCg1UWVBFX1NGSVhFRDY0'
+ 'EBASDwoLVFlQRV9TSU5UMzIQERIPCgtUWVBFX1NJTlQ2NBASInQKC0NhcmRpbmFsaXR5EhcKE0'
+ 'NBUkRJTkFMSVRZX1VOS05PV04QABIYChRDQVJESU5BTElUWV9PUFRJT05BTBABEhgKFENBUkRJ'
+ 'TkFMSVRZX1JFUVVJUkVEEAISGAoUQ0FSRElOQUxJVFlfUkVQRUFURUQQAw==');
+
+@$core.Deprecated('Use enumDescriptor instead')
+const Enum$json = {
+ '1': 'Enum',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {
+ '1': 'enumvalue',
+ '3': 2,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.EnumValue',
+ '10': 'enumvalue'
+ },
+ {
+ '1': 'options',
+ '3': 3,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ {
+ '1': 'source_context',
+ '3': 4,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.SourceContext',
+ '10': 'sourceContext'
+ },
+ {
+ '1': 'syntax',
+ '3': 5,
+ '4': 1,
+ '5': 14,
+ '6': '.google.protobuf.Syntax',
+ '10': 'syntax'
+ },
+ {'1': 'edition', '3': 6, '4': 1, '5': 9, '10': 'edition'},
+ ],
+};
+
+/// Descriptor for `Enum`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List enumDescriptor = $convert.base64Decode(
+ 'CgRFbnVtEhIKBG5hbWUYASABKAlSBG5hbWUSOAoJZW51bXZhbHVlGAIgAygLMhouZ29vZ2xlLn'
+ 'Byb3RvYnVmLkVudW1WYWx1ZVIJZW51bXZhbHVlEjEKB29wdGlvbnMYAyADKAsyFy5nb29nbGUu'
+ 'cHJvdG9idWYuT3B0aW9uUgdvcHRpb25zEkUKDnNvdXJjZV9jb250ZXh0GAQgASgLMh4uZ29vZ2'
+ 'xlLnByb3RvYnVmLlNvdXJjZUNvbnRleHRSDXNvdXJjZUNvbnRleHQSLwoGc3ludGF4GAUgASgO'
+ 'MhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRheFIGc3ludGF4EhgKB2VkaXRpb24YBiABKAlSB2VkaX'
+ 'Rpb24=');
+
+@$core.Deprecated('Use enumValueDescriptor instead')
+const EnumValue$json = {
+ '1': 'EnumValue',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {'1': 'number', '3': 2, '4': 1, '5': 5, '10': 'number'},
+ {
+ '1': 'options',
+ '3': 3,
+ '4': 3,
+ '5': 11,
+ '6': '.google.protobuf.Option',
+ '10': 'options'
+ },
+ ],
+};
+
+/// Descriptor for `EnumValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List enumValueDescriptor = $convert.base64Decode(
+ 'CglFbnVtVmFsdWUSEgoEbmFtZRgBIAEoCVIEbmFtZRIWCgZudW1iZXIYAiABKAVSBm51bWJlch'
+ 'IxCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvblIHb3B0aW9ucw==');
+
+@$core.Deprecated('Use optionDescriptor instead')
+const Option$json = {
+ '1': 'Option',
+ '2': [
+ {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
+ {
+ '1': 'value',
+ '3': 2,
+ '4': 1,
+ '5': 11,
+ '6': '.google.protobuf.Any',
+ '10': 'value'
+ },
+ ],
+};
+
+/// Descriptor for `Option`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List optionDescriptor = $convert.base64Decode(
+ 'CgZPcHRpb24SEgoEbmFtZRgBIAEoCVIEbmFtZRIqCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm'
+ '90b2J1Zi5BbnlSBXZhbHVl');
diff --git a/protobuf/lib/well_known_types/google/protobuf/wrappers.pb.dart b/protobuf/lib/well_known_types/google/protobuf/wrappers.pb.dart
new file mode 100644
index 0000000..f802750
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/wrappers.pb.dart
@@ -0,0 +1,589 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/wrappers.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
+// ignore_for_file: implementation_imports, library_prefixes
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+
+import 'dart:core' as $core;
+
+import 'package:fixnum/fixnum.dart' as $fixnum;
+import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
+
+export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
+
+/// Wrapper message for `double`.
+///
+/// The JSON representation for `DoubleValue` is JSON number.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class DoubleValue extends $pb.GeneratedMessage with $mixin.DoubleValueMixin {
+ factory DoubleValue({
+ $core.double? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ DoubleValue._();
+
+ factory DoubleValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory DoubleValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'DoubleValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.doubleValue)
+ ..aD(1, _omitFieldNames ? '' : 'value')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ DoubleValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ DoubleValue copyWith(void Function(DoubleValue) updates) =>
+ super.copyWith((message) => updates(message as DoubleValue))
+ as DoubleValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static DoubleValue create() => DoubleValue._();
+ @$core.override
+ DoubleValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static DoubleValue getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<DoubleValue>(create);
+ static DoubleValue? _defaultInstance;
+
+ /// The double value.
+ @$pb.TagNumber(1)
+ $core.double get value => $_getN(0);
+ @$pb.TagNumber(1)
+ set value($core.double value) => $_setDouble(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `float`.
+///
+/// The JSON representation for `FloatValue` is JSON number.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class FloatValue extends $pb.GeneratedMessage with $mixin.FloatValueMixin {
+ factory FloatValue({
+ $core.double? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ FloatValue._();
+
+ factory FloatValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory FloatValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'FloatValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.floatValue)
+ ..aD(1, _omitFieldNames ? '' : 'value', fieldType: $pb.PbFieldType.OF)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ FloatValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ FloatValue copyWith(void Function(FloatValue) updates) =>
+ super.copyWith((message) => updates(message as FloatValue)) as FloatValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static FloatValue create() => FloatValue._();
+ @$core.override
+ FloatValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static FloatValue getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<FloatValue>(create);
+ static FloatValue? _defaultInstance;
+
+ /// The float value.
+ @$pb.TagNumber(1)
+ $core.double get value => $_getN(0);
+ @$pb.TagNumber(1)
+ set value($core.double value) => $_setFloat(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `int64`.
+///
+/// The JSON representation for `Int64Value` is JSON string.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class Int64Value extends $pb.GeneratedMessage with $mixin.Int64ValueMixin {
+ factory Int64Value({
+ $fixnum.Int64? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ Int64Value._();
+
+ factory Int64Value.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Int64Value.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Int64Value',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.int64Value)
+ ..aInt64(1, _omitFieldNames ? '' : 'value')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Int64Value clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Int64Value copyWith(void Function(Int64Value) updates) =>
+ super.copyWith((message) => updates(message as Int64Value)) as Int64Value;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Int64Value create() => Int64Value._();
+ @$core.override
+ Int64Value createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Int64Value getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<Int64Value>(create);
+ static Int64Value? _defaultInstance;
+
+ /// The int64 value.
+ @$pb.TagNumber(1)
+ $fixnum.Int64 get value => $_getI64(0);
+ @$pb.TagNumber(1)
+ set value($fixnum.Int64 value) => $_setInt64(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `uint64`.
+///
+/// The JSON representation for `UInt64Value` is JSON string.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class UInt64Value extends $pb.GeneratedMessage with $mixin.UInt64ValueMixin {
+ factory UInt64Value({
+ $fixnum.Int64? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ UInt64Value._();
+
+ factory UInt64Value.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory UInt64Value.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'UInt64Value',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.uint64Value)
+ ..a<$fixnum.Int64>(1, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OU6,
+ defaultOrMaker: $fixnum.Int64.ZERO)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ UInt64Value clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ UInt64Value copyWith(void Function(UInt64Value) updates) =>
+ super.copyWith((message) => updates(message as UInt64Value))
+ as UInt64Value;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static UInt64Value create() => UInt64Value._();
+ @$core.override
+ UInt64Value createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static UInt64Value getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<UInt64Value>(create);
+ static UInt64Value? _defaultInstance;
+
+ /// The uint64 value.
+ @$pb.TagNumber(1)
+ $fixnum.Int64 get value => $_getI64(0);
+ @$pb.TagNumber(1)
+ set value($fixnum.Int64 value) => $_setInt64(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `int32`.
+///
+/// The JSON representation for `Int32Value` is JSON number.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class Int32Value extends $pb.GeneratedMessage with $mixin.Int32ValueMixin {
+ factory Int32Value({
+ $core.int? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ Int32Value._();
+
+ factory Int32Value.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory Int32Value.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'Int32Value',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.int32Value)
+ ..aI(1, _omitFieldNames ? '' : 'value')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Int32Value clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ Int32Value copyWith(void Function(Int32Value) updates) =>
+ super.copyWith((message) => updates(message as Int32Value)) as Int32Value;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static Int32Value create() => Int32Value._();
+ @$core.override
+ Int32Value createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static Int32Value getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<Int32Value>(create);
+ static Int32Value? _defaultInstance;
+
+ /// The int32 value.
+ @$pb.TagNumber(1)
+ $core.int get value => $_getIZ(0);
+ @$pb.TagNumber(1)
+ set value($core.int value) => $_setSignedInt32(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `uint32`.
+///
+/// The JSON representation for `UInt32Value` is JSON number.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class UInt32Value extends $pb.GeneratedMessage with $mixin.UInt32ValueMixin {
+ factory UInt32Value({
+ $core.int? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ UInt32Value._();
+
+ factory UInt32Value.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory UInt32Value.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'UInt32Value',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.uint32Value)
+ ..aI(1, _omitFieldNames ? '' : 'value', fieldType: $pb.PbFieldType.OU3)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ UInt32Value clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ UInt32Value copyWith(void Function(UInt32Value) updates) =>
+ super.copyWith((message) => updates(message as UInt32Value))
+ as UInt32Value;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static UInt32Value create() => UInt32Value._();
+ @$core.override
+ UInt32Value createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static UInt32Value getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<UInt32Value>(create);
+ static UInt32Value? _defaultInstance;
+
+ /// The uint32 value.
+ @$pb.TagNumber(1)
+ $core.int get value => $_getIZ(0);
+ @$pb.TagNumber(1)
+ set value($core.int value) => $_setUnsignedInt32(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `bool`.
+///
+/// The JSON representation for `BoolValue` is JSON `true` and `false`.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class BoolValue extends $pb.GeneratedMessage with $mixin.BoolValueMixin {
+ factory BoolValue({
+ $core.bool? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ BoolValue._();
+
+ factory BoolValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory BoolValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'BoolValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.boolValue)
+ ..aOB(1, _omitFieldNames ? '' : 'value')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ BoolValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ BoolValue copyWith(void Function(BoolValue) updates) =>
+ super.copyWith((message) => updates(message as BoolValue)) as BoolValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static BoolValue create() => BoolValue._();
+ @$core.override
+ BoolValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static BoolValue getDefault() =>
+ _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<BoolValue>(create);
+ static BoolValue? _defaultInstance;
+
+ /// The bool value.
+ @$pb.TagNumber(1)
+ $core.bool get value => $_getBF(0);
+ @$pb.TagNumber(1)
+ set value($core.bool value) => $_setBool(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `string`.
+///
+/// The JSON representation for `StringValue` is JSON string.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class StringValue extends $pb.GeneratedMessage with $mixin.StringValueMixin {
+ factory StringValue({
+ $core.String? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ StringValue._();
+
+ factory StringValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory StringValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'StringValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.stringValue)
+ ..aOS(1, _omitFieldNames ? '' : 'value')
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ StringValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ StringValue copyWith(void Function(StringValue) updates) =>
+ super.copyWith((message) => updates(message as StringValue))
+ as StringValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static StringValue create() => StringValue._();
+ @$core.override
+ StringValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static StringValue getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<StringValue>(create);
+ static StringValue? _defaultInstance;
+
+ /// The string value.
+ @$pb.TagNumber(1)
+ $core.String get value => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set value($core.String value) => $_setString(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+/// Wrapper message for `bytes`.
+///
+/// The JSON representation for `BytesValue` is JSON string.
+///
+/// Not recommended for use in new APIs, but still useful for legacy APIs and
+/// has no plan to be removed.
+class BytesValue extends $pb.GeneratedMessage with $mixin.BytesValueMixin {
+ factory BytesValue({
+ $core.List<$core.int>? value,
+ }) {
+ final result = create();
+ if (value != null) result.value = value;
+ return result;
+ }
+
+ BytesValue._();
+
+ factory BytesValue.fromBuffer($core.List<$core.int> data,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromBuffer(data, registry);
+ factory BytesValue.fromJson($core.String json,
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
+ create()..mergeFromJson(json, registry);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+ _omitMessageNames ? '' : 'BytesValue',
+ package:
+ const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
+ createEmptyInstance: create,
+ wellKnownType: $mixin.WellKnownType.bytesValue)
+ ..a<$core.List<$core.int>>(
+ 1, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OY)
+ ..hasRequiredFields = false;
+
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ BytesValue clone() => deepCopy();
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
+ BytesValue copyWith(void Function(BytesValue) updates) =>
+ super.copyWith((message) => updates(message as BytesValue)) as BytesValue;
+
+ @$core.override
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static BytesValue create() => BytesValue._();
+ @$core.override
+ BytesValue createEmptyInstance() => create();
+ @$core.pragma('dart2js:noInline')
+ static BytesValue getDefault() => _defaultInstance ??=
+ $pb.GeneratedMessage.$_defaultFor<BytesValue>(create);
+ static BytesValue? _defaultInstance;
+
+ /// The bytes value.
+ @$pb.TagNumber(1)
+ $core.List<$core.int> get value => $_getN(0);
+ @$pb.TagNumber(1)
+ set value($core.List<$core.int> value) => $_setBytes(0, value);
+ @$pb.TagNumber(1)
+ $core.bool hasValue() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearValue() => $_clearField(1);
+}
+
+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/protobuf/lib/well_known_types/google/protobuf/wrappers.pbjson.dart b/protobuf/lib/well_known_types/google/protobuf/wrappers.pbjson.dart
new file mode 100644
index 0000000..7cdc3d7
--- /dev/null
+++ b/protobuf/lib/well_known_types/google/protobuf/wrappers.pbjson.dart
@@ -0,0 +1,124 @@
+// This is a generated file - do not edit.
+//
+// Generated from google/protobuf/wrappers.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, prefer_relative_imports
+// ignore_for_file: unused_import
+
+import 'dart:convert' as $convert;
+import 'dart:core' as $core;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use doubleValueDescriptor instead')
+const DoubleValue$json = {
+ '1': 'DoubleValue',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 1, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `DoubleValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List doubleValueDescriptor =
+ $convert.base64Decode('CgtEb3VibGVWYWx1ZRIUCgV2YWx1ZRgBIAEoAVIFdmFsdWU=');
+
+@$core.Deprecated('Use floatValueDescriptor instead')
+const FloatValue$json = {
+ '1': 'FloatValue',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 2, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `FloatValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List floatValueDescriptor =
+ $convert.base64Decode('CgpGbG9hdFZhbHVlEhQKBXZhbHVlGAEgASgCUgV2YWx1ZQ==');
+
+@$core.Deprecated('Use int64ValueDescriptor instead')
+const Int64Value$json = {
+ '1': 'Int64Value',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 3, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `Int64Value`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List int64ValueDescriptor =
+ $convert.base64Decode('CgpJbnQ2NFZhbHVlEhQKBXZhbHVlGAEgASgDUgV2YWx1ZQ==');
+
+@$core.Deprecated('Use uInt64ValueDescriptor instead')
+const UInt64Value$json = {
+ '1': 'UInt64Value',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 4, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `UInt64Value`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List uInt64ValueDescriptor =
+ $convert.base64Decode('CgtVSW50NjRWYWx1ZRIUCgV2YWx1ZRgBIAEoBFIFdmFsdWU=');
+
+@$core.Deprecated('Use int32ValueDescriptor instead')
+const Int32Value$json = {
+ '1': 'Int32Value',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 5, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `Int32Value`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List int32ValueDescriptor =
+ $convert.base64Decode('CgpJbnQzMlZhbHVlEhQKBXZhbHVlGAEgASgFUgV2YWx1ZQ==');
+
+@$core.Deprecated('Use uInt32ValueDescriptor instead')
+const UInt32Value$json = {
+ '1': 'UInt32Value',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 13, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `UInt32Value`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List uInt32ValueDescriptor =
+ $convert.base64Decode('CgtVSW50MzJWYWx1ZRIUCgV2YWx1ZRgBIAEoDVIFdmFsdWU=');
+
+@$core.Deprecated('Use boolValueDescriptor instead')
+const BoolValue$json = {
+ '1': 'BoolValue',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 8, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `BoolValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List boolValueDescriptor =
+ $convert.base64Decode('CglCb29sVmFsdWUSFAoFdmFsdWUYASABKAhSBXZhbHVl');
+
+@$core.Deprecated('Use stringValueDescriptor instead')
+const StringValue$json = {
+ '1': 'StringValue',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `StringValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List stringValueDescriptor =
+ $convert.base64Decode('CgtTdHJpbmdWYWx1ZRIUCgV2YWx1ZRgBIAEoCVIFdmFsdWU=');
+
+@$core.Deprecated('Use bytesValueDescriptor instead')
+const BytesValue$json = {
+ '1': 'BytesValue',
+ '2': [
+ {'1': 'value', '3': 1, '4': 1, '5': 12, '10': 'value'},
+ ],
+};
+
+/// Descriptor for `BytesValue`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List bytesValueDescriptor =
+ $convert.base64Decode('CgpCeXRlc1ZhbHVlEhQKBXZhbHVlGAEgASgMUgV2YWx1ZQ==');
diff --git a/protoc_plugin/CHANGELOG.md b/protoc_plugin/CHANGELOG.md
index aa19116..add00ba 100644
--- a/protoc_plugin/CHANGELOG.md
+++ b/protoc_plugin/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 25.0.0
+
+Note: this version requires protobuf 5.2.0.
+
+* Handle importing [well-known protos][wkts]. ([#1081])
+
+[wkts]: https://protobuf.dev/reference/protobuf/google.protobuf
+[#1081]: https://github.com/google/protobuf.dart/pull/1081
+
## 24.0.0
* **Breaking:** Don't generate `createRepeated` methods.
diff --git a/protoc_plugin/Makefile b/protoc_plugin/Makefile
index 987a844..0df0178 100644
--- a/protoc_plugin/Makefile
+++ b/protoc_plugin/Makefile
@@ -8,21 +8,11 @@
TEST_PROTO_LIST = \
_leading_underscores \
- google/protobuf/any \
- google/protobuf/api \
- google/protobuf/duration \
- google/protobuf/empty \
- google/protobuf/field_mask \
- google/protobuf/source_context \
- google/protobuf/struct \
- google/protobuf/timestamp \
- google/protobuf/type \
google/protobuf/unittest_import \
google/protobuf/unittest_import_public \
google/protobuf/unittest_optimize_for \
google/protobuf/unittest_well_known_types \
google/protobuf/unittest \
- google/protobuf/wrappers \
custom_option \
dart_name \
deprecations \
diff --git a/protoc_plugin/lib/src/file_generator.dart b/protoc_plugin/lib/src/file_generator.dart
index c85ae57..eb7225b 100644
--- a/protoc_plugin/lib/src/file_generator.dart
+++ b/protoc_plugin/lib/src/file_generator.dart
@@ -893,4 +893,5 @@
'deprecated_member_use_from_same_package',
'library_prefixes',
'non_constant_identifier_names',
+ 'prefer_relative_imports',
};
diff --git a/protoc_plugin/lib/src/gen/dart_options.pb.dart b/protoc_plugin/lib/src/gen/dart_options.pb.dart
index c5c559e..4f81a4a 100644
--- a/protoc_plugin/lib/src/gen/dart_options.pb.dart
+++ b/protoc_plugin/lib/src/gen/dart_options.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/dart_options.pbenum.dart b/protoc_plugin/lib/src/gen/dart_options.pbenum.dart
index 35fa9cb..b48296e 100644
--- a/protoc_plugin/lib/src/gen/dart_options.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/dart_options.pbenum.dart
@@ -8,4 +8,4 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
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 375dc08..b3c3f8a 100644
--- a/protoc_plugin/lib/src/gen/google/api/client.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/api/client.pb.dart
@@ -8,13 +8,14 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
+import 'package:protobuf/well_known_types/google/protobuf/duration.pb.dart'
+ as $0;
-import '../protobuf/duration.pb.dart' as $0;
import 'client.pbenum.dart';
import 'launch_stage.pbenum.dart' as $1;
diff --git a/protoc_plugin/lib/src/gen/google/api/client.pbenum.dart b/protoc_plugin/lib/src/gen/google/api/client.pbenum.dart
index d6b803e..f8a06ef 100644
--- a/protoc_plugin/lib/src/gen/google/api/client.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/api/client.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
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 3aab488..53ded61 100644
--- a/protoc_plugin/lib/src/gen/google/api/http.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/api/http.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/api/http.pbenum.dart b/protoc_plugin/lib/src/gen/google/api/http.pbenum.dart
index 6ed73bf..0299d10 100644
--- a/protoc_plugin/lib/src/gen/google/api/http.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/api/http.pbenum.dart
@@ -8,4 +8,4 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
diff --git a/protoc_plugin/lib/src/gen/google/api/launch_stage.pb.dart b/protoc_plugin/lib/src/gen/google/api/launch_stage.pb.dart
index 4d97868..17d571f 100644
--- a/protoc_plugin/lib/src/gen/google/api/launch_stage.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/api/launch_stage.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/api/launch_stage.pbenum.dart b/protoc_plugin/lib/src/gen/google/api/launch_stage.pbenum.dart
index b441be8..ea1e47e 100644
--- a/protoc_plugin/lib/src/gen/google/api/launch_stage.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/api/launch_stage.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
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 79cb616..dd8c130 100644
--- a/protoc_plugin/lib/src/gen/google/api/routing.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/api/routing.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/api/routing.pbenum.dart b/protoc_plugin/lib/src/gen/google/api/routing.pbenum.dart
index 765f1e3..c927bc3 100644
--- a/protoc_plugin/lib/src/gen/google/api/routing.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/api/routing.pbenum.dart
@@ -8,4 +8,4 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
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 25f5db8..2395e70 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
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pbenum.dart b/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pbenum.dart
index b97b431..ae3b91e 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/protobuf/compiler/plugin.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
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 84dce86..f70dbd4 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pbenum.dart b/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pbenum.dart
index f7479ef..66ea4ff 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/protobuf/descriptor.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/gen/google/protobuf/duration.pbenum.dart b/protoc_plugin/lib/src/gen/google/protobuf/duration.pbenum.dart
deleted file mode 100644
index bc98025..0000000
--- a/protoc_plugin/lib/src/gen/google/protobuf/duration.pbenum.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// This is a generated file - do not edit.
-//
-// Generated from google/protobuf/duration.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
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
index 7b26251..4489dfd 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pb.dart
+++ b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
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
index 2aea267..6cb0c70 100644
--- a/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pbenum.dart
+++ b/protoc_plugin/lib/src/gen/google/protobuf/unittest_features.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/lib/src/output_config.dart b/protoc_plugin/lib/src/output_config.dart
index 9ef88c3..7df3aa8 100644
--- a/protoc_plugin/lib/src/output_config.dart
+++ b/protoc_plugin/lib/src/output_config.dart
@@ -39,7 +39,12 @@
@override
Uri resolveImport(Uri target, Uri source, String extension) {
+ assert(extension.startsWith('.'));
final targetPath = path.url.fromUri(target);
+ final wellKnownImport = _wellKnownProtoImport(targetPath, extension);
+ if (wellKnownImport != null) {
+ return path.url.toUri(wellKnownImport);
+ }
final sourceDir = path.url.dirname(path.url.fromUri(source));
final base = path.withoutExtension(
path.url.relative(targetPath, from: sourceDir),
@@ -47,3 +52,26 @@
return path.url.toUri('$base$extension');
}
}
+
+const _wktImportPrefix = 'google/protobuf/';
+
+Set<String> _wellKnownTypeProtoPaths = {
+ '${_wktImportPrefix}any.proto',
+ '${_wktImportPrefix}api.proto',
+ '${_wktImportPrefix}duration.proto',
+ '${_wktImportPrefix}empty.proto',
+ '${_wktImportPrefix}field_mask.proto',
+ '${_wktImportPrefix}source_context.proto',
+ '${_wktImportPrefix}struct.proto',
+ '${_wktImportPrefix}timestamp.proto',
+ '${_wktImportPrefix}type.proto',
+ '${_wktImportPrefix}wrappers.proto',
+};
+
+String? _wellKnownProtoImport(String importPath, String extension) {
+ if (!_wellKnownTypeProtoPaths.contains(importPath)) {
+ return null;
+ }
+ final importPathWithoutExtension = path.withoutExtension(importPath);
+ return 'package:protobuf/well_known_types/$importPathWithoutExtension$extension';
+}
diff --git a/protoc_plugin/pubspec.yaml b/protoc_plugin/pubspec.yaml
index 3d2c047..6e55b50 100644
--- a/protoc_plugin/pubspec.yaml
+++ b/protoc_plugin/pubspec.yaml
@@ -1,5 +1,5 @@
name: protoc_plugin
-version: 24.0.0
+version: 25.0.0
description: A protobuf protoc compiler plugin used to generate Dart code.
repository: https://github.com/google/protobuf.dart/tree/master/protoc_plugin
@@ -14,7 +14,7 @@
dart_style: ^3.0.0
fixnum: ^1.0.0
path: ^1.8.0
- protobuf: ^5.0.0
+ protobuf: ^5.2.0
pub_semver: ^2.2.0
dev_dependencies:
diff --git a/protoc_plugin/test/any_test.dart b/protoc_plugin/test/any_test.dart
index 6164e07..9a0d8e2 100644
--- a/protoc_plugin/test/any_test.dart
+++ b/protoc_plugin/test/any_test.dart
@@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:protobuf/protobuf.dart';
+import 'package:protobuf/well_known_types/google/protobuf/any.pb.dart';
import 'package:test/test.dart';
-import 'gen/google/protobuf/any.pb.dart';
import 'gen/service.pb.dart';
import 'gen/toplevel.pb.dart' as toplevel;
import 'gen/using_any.pb.dart';
diff --git a/protoc_plugin/test/duration_test.dart b/protoc_plugin/test/duration_test.dart
index bb582ab..157518e 100644
--- a/protoc_plugin/test/duration_test.dart
+++ b/protoc_plugin/test/duration_test.dart
@@ -3,10 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:fixnum/fixnum.dart';
+import 'package:protobuf/well_known_types/google/protobuf/duration.pb.dart'
+ as pb;
import 'package:test/test.dart';
-import 'gen/google/protobuf/duration.pb.dart' as pb;
-
void main() {
test('core duration -> proto duration', () {
final coreDuration = Duration(
diff --git a/protoc_plugin/test/goldens/deprecations.pb.dart b/protoc_plugin/test/goldens/deprecations.pb.dart
index 96f9dbf..8d9c6a5 100644
--- a/protoc_plugin/test/goldens/deprecations.pb.dart
+++ b/protoc_plugin/test/goldens/deprecations.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:async' as $async;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/deprecations.pbenum.dart b/protoc_plugin/test/goldens/deprecations.pbenum.dart
index 835b3ab..7ec5304 100644
--- a/protoc_plugin/test/goldens/deprecations.pbenum.dart
+++ b/protoc_plugin/test/goldens/deprecations.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/doc_comments.pb.dart b/protoc_plugin/test/goldens/doc_comments.pb.dart
index c89cb1d..0b8b02d 100644
--- a/protoc_plugin/test/goldens/doc_comments.pb.dart
+++ b/protoc_plugin/test/goldens/doc_comments.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:async' as $async;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/doc_comments.pbenum.dart b/protoc_plugin/test/goldens/doc_comments.pbenum.dart
index 70c8fda..7c470a1 100644
--- a/protoc_plugin/test/goldens/doc_comments.pbenum.dart
+++ b/protoc_plugin/test/goldens/doc_comments.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/grpc_service.pb.dart b/protoc_plugin/test/goldens/grpc_service.pb.dart
index e1fc97e..e95ebd9 100644
--- a/protoc_plugin/test/goldens/grpc_service.pb.dart
+++ b/protoc_plugin/test/goldens/grpc_service.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/grpc_service.pbgrpc.~dart b/protoc_plugin/test/goldens/grpc_service.pbgrpc.~dart
index 107b83b..39fe590 100644
--- a/protoc_plugin/test/goldens/grpc_service.pbgrpc.~dart
+++ b/protoc_plugin/test/goldens/grpc_service.pbgrpc.~dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:async' as $async;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/header_in_package.pb.dart b/protoc_plugin/test/goldens/header_in_package.pb.dart
index 3664f16..ac6fd29 100644
--- a/protoc_plugin/test/goldens/header_in_package.pb.dart
+++ b/protoc_plugin/test/goldens/header_in_package.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/header_with_fixnum.pb.dart b/protoc_plugin/test/goldens/header_with_fixnum.pb.dart
index 33ea570..d26a517 100644
--- a/protoc_plugin/test/goldens/header_with_fixnum.pb.dart
+++ b/protoc_plugin/test/goldens/header_with_fixnum.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/imports.pb.dart b/protoc_plugin/test/goldens/imports.pb.dart
index 6a4b42d..ab3d779 100644
--- a/protoc_plugin/test/goldens/imports.pb.dart
+++ b/protoc_plugin/test/goldens/imports.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/imports.pbjson.dart b/protoc_plugin/test/goldens/imports.pbjson.dart
index 73d19b9..c6134db 100644
--- a/protoc_plugin/test/goldens/imports.pbjson.dart
+++ b/protoc_plugin/test/goldens/imports.pbjson.dart
@@ -8,4 +8,4 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
diff --git a/protoc_plugin/test/goldens/int64.pb.dart b/protoc_plugin/test/goldens/int64.pb.dart
index 91888c4..64e790e 100644
--- a/protoc_plugin/test/goldens/int64.pb.dart
+++ b/protoc_plugin/test/goldens/int64.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/oneMessage.pb.dart b/protoc_plugin/test/goldens/oneMessage.pb.dart
index 3a33d98..cfadf0f 100644
--- a/protoc_plugin/test/goldens/oneMessage.pb.dart
+++ b/protoc_plugin/test/goldens/oneMessage.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/oneMessage.pb.dart.meta b/protoc_plugin/test/goldens/oneMessage.pb.dart.meta
index 56b0cfa..aeeaaaf 100644
--- a/protoc_plugin/test/goldens/oneMessage.pb.dart.meta
+++ b/protoc_plugin/test/goldens/oneMessage.pb.dart.meta
@@ -2,15 +2,15 @@
path: 4
path: 0
sourceFile: test
- begin: 565
- end: 576
+ begin: 590
+ end: 601
}
annotation: {
path: 4
path: 0
sourceFile: test
- begin: 648
- end: 659
+ begin: 673
+ end: 684
}
annotation: {
path: 4
@@ -18,8 +18,8 @@
path: 2
path: 0
sourceFile: test
- begin: 2081
- end: 2087
+ begin: 2106
+ end: 2112
}
annotation: {
path: 4
@@ -27,8 +27,8 @@
path: 2
path: 0
sourceFile: test
- begin: 2129
- end: 2135
+ begin: 2154
+ end: 2160
}
annotation: {
path: 4
@@ -36,8 +36,8 @@
path: 2
path: 0
sourceFile: test
- begin: 2215
- end: 2224
+ begin: 2240
+ end: 2249
}
annotation: {
path: 4
@@ -45,8 +45,8 @@
path: 2
path: 0
sourceFile: test
- begin: 2267
- end: 2278
+ begin: 2292
+ end: 2303
}
annotation: {
path: 4
@@ -54,8 +54,8 @@
path: 2
path: 1
sourceFile: test
- begin: 2338
- end: 2342
+ begin: 2363
+ end: 2367
}
annotation: {
path: 4
@@ -63,8 +63,8 @@
path: 2
path: 1
sourceFile: test
- begin: 2384
- end: 2388
+ begin: 2409
+ end: 2413
}
annotation: {
path: 4
@@ -72,8 +72,8 @@
path: 2
path: 1
sourceFile: test
- begin: 2470
- end: 2477
+ begin: 2495
+ end: 2502
}
annotation: {
path: 4
@@ -81,8 +81,8 @@
path: 2
path: 1
sourceFile: test
- begin: 2520
- end: 2529
+ begin: 2545
+ end: 2554
}
annotation: {
path: 4
@@ -90,8 +90,8 @@
path: 2
path: 2
sourceFile: test
- begin: 2592
- end: 2596
+ begin: 2617
+ end: 2621
}
annotation: {
path: 4
@@ -99,8 +99,8 @@
path: 2
path: 2
sourceFile: test
- begin: 2643
- end: 2647
+ begin: 2668
+ end: 2672
}
annotation: {
path: 4
@@ -108,8 +108,8 @@
path: 2
path: 2
sourceFile: test
- begin: 2727
- end: 2734
+ begin: 2752
+ end: 2759
}
annotation: {
path: 4
@@ -117,6 +117,6 @@
path: 2
path: 2
sourceFile: test
- begin: 2777
- end: 2786
+ begin: 2802
+ end: 2811
}
diff --git a/protoc_plugin/test/goldens/oneMessage.pbjson.dart b/protoc_plugin/test/goldens/oneMessage.pbjson.dart
index 4994a4c..7c32040 100644
--- a/protoc_plugin/test/goldens/oneMessage.pbjson.dart
+++ b/protoc_plugin/test/goldens/oneMessage.pbjson.dart
@@ -8,7 +8,8 @@
// 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, unused_import
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+// ignore_for_file: unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/service.pb.dart b/protoc_plugin/test/goldens/service.pb.dart
index 756f198..1f2aea6 100644
--- a/protoc_plugin/test/goldens/service.pb.dart
+++ b/protoc_plugin/test/goldens/service.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:async' as $async;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/service.pbserver.dart b/protoc_plugin/test/goldens/service.pbserver.dart
index e87ea47..e80fbbf 100644
--- a/protoc_plugin/test/goldens/service.pbserver.dart
+++ b/protoc_plugin/test/goldens/service.pbserver.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:async' as $async;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/serviceGenerator.pbjson.dart b/protoc_plugin/test/goldens/serviceGenerator.pbjson.dart
index 2acb937..2542671 100644
--- a/protoc_plugin/test/goldens/serviceGenerator.pbjson.dart
+++ b/protoc_plugin/test/goldens/serviceGenerator.pbjson.dart
@@ -8,7 +8,8 @@
// 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, unused_import
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+// ignore_for_file: unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/topLevelEnum.pb.dart b/protoc_plugin/test/goldens/topLevelEnum.pb.dart
index abea4d0..03fea04 100644
--- a/protoc_plugin/test/goldens/topLevelEnum.pb.dart
+++ b/protoc_plugin/test/goldens/topLevelEnum.pb.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart b/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart
index 4303c14..5d21ccd 100644
--- a/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart
+++ b/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart
@@ -8,7 +8,7 @@
// 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
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart.meta b/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart.meta
index 4f5fcd0..2648104 100644
--- a/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart.meta
+++ b/protoc_plugin/test/goldens/topLevelEnum.pbenum.dart.meta
@@ -2,8 +2,8 @@
path: 5
path: 0
sourceFile: test
- begin: 484
- end: 493
+ begin: 509
+ end: 518
}
annotation: {
path: 5
@@ -11,8 +11,8 @@
path: 2
path: 0
sourceFile: test
- begin: 546
- end: 552
+ begin: 571
+ end: 577
}
annotation: {
path: 5
@@ -20,8 +20,8 @@
path: 2
path: 1
sourceFile: test
- begin: 628
- end: 632
+ begin: 653
+ end: 657
}
annotation: {
path: 5
@@ -29,8 +29,8 @@
path: 2
path: 2
sourceFile: test
- begin: 706
- end: 710
+ begin: 731
+ end: 735
}
annotation: {
path: 5
@@ -38,6 +38,6 @@
path: 2
path: 3
sourceFile: test
- begin: 785
- end: 793
+ begin: 810
+ end: 818
}
diff --git a/protoc_plugin/test/goldens/topLevelEnum.pbjson.dart b/protoc_plugin/test/goldens/topLevelEnum.pbjson.dart
index 06eef1d..e8e0bcf 100644
--- a/protoc_plugin/test/goldens/topLevelEnum.pbjson.dart
+++ b/protoc_plugin/test/goldens/topLevelEnum.pbjson.dart
@@ -8,7 +8,8 @@
// 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, unused_import
+// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
+// ignore_for_file: unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
diff --git a/protoc_plugin/test/high_tagnumber_test.dart b/protoc_plugin/test/high_tagnumber_test.dart
index c230d48..2480e90 100644
--- a/protoc_plugin/test/high_tagnumber_test.dart
+++ b/protoc_plugin/test/high_tagnumber_test.dart
@@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:fixnum/fixnum.dart';
+import 'package:protobuf/well_known_types/google/protobuf/empty.pb.dart';
import 'package:test/test.dart';
-import 'gen/google/protobuf/empty.pb.dart';
import 'gen/high_tagnumber.pb.dart';
void main() {
diff --git a/protoc_plugin/test/message_set_test.dart b/protoc_plugin/test/message_set_test.dart
index 350622f..663a1f9 100644
--- a/protoc_plugin/test/message_set_test.dart
+++ b/protoc_plugin/test/message_set_test.dart
@@ -6,9 +6,9 @@
import 'package:fixnum/fixnum.dart';
import 'package:protobuf/protobuf.dart';
+import 'package:protobuf/well_known_types/google/protobuf/empty.pb.dart';
import 'package:test/test.dart';
-import 'gen/google/protobuf/empty.pb.dart';
import 'gen/message_set.pb.dart';
void main() {
diff --git a/protoc_plugin/test/proto3_json_test.dart b/protoc_plugin/test/proto3_json_test.dart
index 5654dc9..dc3a57a 100644
--- a/protoc_plugin/test/proto3_json_test.dart
+++ b/protoc_plugin/test/proto3_json_test.dart
@@ -7,19 +7,19 @@
import 'package:fixnum/fixnum.dart';
import 'package:protobuf/protobuf.dart';
+import 'package:protobuf/well_known_types/google/protobuf/any.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/duration.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/empty.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/field_mask.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/struct.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/timestamp.pb.dart';
+import 'package:protobuf/well_known_types/google/protobuf/wrappers.pb.dart';
import 'package:test/test.dart';
import 'gen/entity.pb.dart';
import 'gen/enum_name.pb.dart';
-import 'gen/google/protobuf/any.pb.dart';
-import 'gen/google/protobuf/duration.pb.dart';
-import 'gen/google/protobuf/empty.pb.dart';
-import 'gen/google/protobuf/field_mask.pb.dart';
-import 'gen/google/protobuf/struct.pb.dart';
-import 'gen/google/protobuf/timestamp.pb.dart';
import 'gen/google/protobuf/unittest.pb.dart';
import 'gen/google/protobuf/unittest_well_known_types.pb.dart';
-import 'gen/google/protobuf/wrappers.pb.dart';
import 'gen/map_field.pb.dart';
import 'gen/nested_any.pb.dart';
import 'gen/oneof.pb.dart';
@@ -398,25 +398,25 @@
test('wrapper types', () {
final t =
TestWellKnownTypes()
- ..doubleField = (DoubleValue()..value = 10.01)
- ..floatField = (FloatValue()..value = 3.0)
- ..int64Field = (Int64Value()..value = Int64.MIN_VALUE)
- ..uint64Field = (UInt64Value()..value = Int64.MIN_VALUE)
- ..int32Field = (Int32Value()..value = 101)
- ..uint32Field = (UInt32Value()..value = 102)
- ..boolField = (BoolValue()..value = false)
- ..stringField = (StringValue()..value = 'Pop')
- ..bytesField = (BytesValue()..value = [8, 9, 10]);
+ ..doubleValueField = (DoubleValue()..value = 10.01)
+ ..floatValueField = (FloatValue()..value = 3.0)
+ ..int64ValueField = (Int64Value()..value = Int64.MIN_VALUE)
+ ..uint64ValueField = (UInt64Value()..value = Int64.MIN_VALUE)
+ ..int32ValueField = (Int32Value()..value = 101)
+ ..uint32ValueField = (UInt32Value()..value = 102)
+ ..boolValueField = (BoolValue()..value = false)
+ ..stringValueField = (StringValue()..value = 'Pop')
+ ..bytesValueField = (BytesValue()..value = [8, 9, 10]);
expect(t.toProto3Json(), {
- 'doubleField': 10.01,
- 'floatField': 3,
- 'int64Field': '-9223372036854775808',
- 'uint64Field': '9223372036854775808',
- 'int32Field': 101,
- 'uint32Field': 102,
- 'boolField': false,
- 'stringField': 'Pop',
- 'bytesField': 'CAkK',
+ 'doubleValueField': 10.01,
+ 'floatValueField': 3,
+ 'int64ValueField': '-9223372036854775808',
+ 'uint64ValueField': '9223372036854775808',
+ 'int32ValueField': 101,
+ 'uint32ValueField': 102,
+ 'boolValueField': false,
+ 'stringValueField': 'Pop',
+ 'bytesValueField': 'CAkK',
});
});
@@ -1319,130 +1319,156 @@
test('wrapper types', () {
expect(
TestWellKnownTypes()..mergeFromProto3Json({
- 'doubleField': 10.01,
- 'floatField': 3,
- 'int64Field': '-9223372036854775808',
- 'uint64Field': '9223372036854775808',
- 'int32Field': 101,
- 'uint32Field': 102,
- 'boolField': false,
- 'stringField': 'Pop',
- 'bytesField': 'CAkK',
+ 'doubleValueField': 10.01,
+ 'floatValueField': 3,
+ 'int64ValueField': '-9223372036854775808',
+ 'uint64ValueField': '9223372036854775808',
+ 'int32ValueField': 101,
+ 'uint32ValueField': 102,
+ 'boolValueField': false,
+ 'stringValueField': 'Pop',
+ 'bytesValueField': 'CAkK',
}),
TestWellKnownTypes()
- ..doubleField = (DoubleValue()..value = 10.01)
- ..floatField = (FloatValue()..value = 3.0)
- ..int64Field = (Int64Value()..value = Int64.MIN_VALUE)
- ..uint64Field = (UInt64Value()..value = Int64.MIN_VALUE)
- ..int32Field = (Int32Value()..value = 101)
- ..uint32Field = (UInt32Value()..value = 102)
- ..boolField = (BoolValue()..value = false)
- ..stringField = (StringValue()..value = 'Pop')
- ..bytesField = (BytesValue()..value = [8, 9, 10]),
+ ..doubleValueField = (DoubleValue()..value = 10.01)
+ ..floatValueField = (FloatValue()..value = 3.0)
+ ..int64ValueField = (Int64Value()..value = Int64.MIN_VALUE)
+ ..uint64ValueField = (UInt64Value()..value = Int64.MIN_VALUE)
+ ..int32ValueField = (Int32Value()..value = 101)
+ ..uint32ValueField = (UInt32Value()..value = 102)
+ ..boolValueField = (BoolValue()..value = false)
+ ..stringValueField = (StringValue()..value = 'Pop')
+ ..bytesValueField = (BytesValue()..value = [8, 9, 10]),
);
expect(
TestWellKnownTypes()..mergeFromProto3Json({
- 'doubleField': '10.01',
- 'floatField': '3',
- 'int64Field': -854775808,
- 'uint64Field': 854775808,
- 'int32Field': '101',
- 'uint32Field': '102',
- 'boolField': false,
+ 'doubleValueField': '10.01',
+ 'floatValueField': '3',
+ 'int64ValueField': -854775808,
+ 'uint64ValueField': 854775808,
+ 'int32ValueField': '101',
+ 'uint32ValueField': '102',
+ 'boolValueField': false,
}),
TestWellKnownTypes()
- ..doubleField = (DoubleValue()..value = 10.01)
- ..floatField = (FloatValue()..value = 3.0)
- ..int64Field = (Int64Value()..value = Int64(-854775808))
- ..uint64Field = (UInt64Value()..value = Int64(854775808))
- ..int32Field = (Int32Value()..value = 101)
- ..uint32Field = (UInt32Value()..value = 102)
- ..boolField = (BoolValue()..value = false),
+ ..doubleValueField = (DoubleValue()..value = 10.01)
+ ..floatValueField = (FloatValue()..value = 3.0)
+ ..int64ValueField = (Int64Value()..value = Int64(-854775808))
+ ..uint64ValueField = (UInt64Value()..value = Int64(854775808))
+ ..int32ValueField = (Int32Value()..value = 101)
+ ..uint32ValueField = (UInt32Value()..value = 102)
+ ..boolValueField = (BoolValue()..value = false),
reason: 'alternative representations should be accepted',
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'doubleField': 'a'}),
- parseFailure(['doubleField']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'doubleValueField': 'a'}),
+ parseFailure(['doubleValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'doubleField': {}}),
- parseFailure(['doubleField']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'doubleValueField': {}}),
+ parseFailure(['doubleValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'floatField': 'a'}),
- parseFailure(['floatField']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'floatValueField': 'a'}),
+ parseFailure(['floatValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'floatField': {}}),
- parseFailure(['floatField']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'floatValueField': {}}),
+ parseFailure(['floatValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'int64Field': 'a'}),
- parseFailure(['int64Field']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'int64ValueField': 'a'}),
+ parseFailure(['int64ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'int64Field': {}}),
- parseFailure(['int64Field']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'int64ValueField': {}}),
+ parseFailure(['int64ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'int64Field': 10.4}),
- parseFailure(['int64Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'int64ValueField': 10.4}),
+ parseFailure(['int64ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'uint64Field': 'a'}),
- parseFailure(['uint64Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'uint64ValueField': 'a'}),
+ parseFailure(['uint64ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'uint64Field': 10.4}),
- parseFailure(['uint64Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'uint64ValueField': 10.4}),
+ parseFailure(['uint64ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'int32Field': 'a'}),
- parseFailure(['int32Field']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'int32ValueField': 'a'}),
+ parseFailure(['int32ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'int32Field': 10.4}),
- parseFailure(['int32Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'int32ValueField': 10.4}),
+ parseFailure(['int32ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'uint32Field': 'a'}),
- parseFailure(['uint32Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'uint32ValueField': 'a'}),
+ parseFailure(['uint32ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'uint32Field': 10.4}),
- parseFailure(['uint32Field']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'uint32ValueField': 10.4}),
+ parseFailure(['uint32ValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'boolField': 'false'}),
- parseFailure(['boolField']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'boolValueField': 'false'}),
+ parseFailure(['boolValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'stringField': 22}),
- parseFailure(['stringField']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'stringValueField': 22}),
+ parseFailure(['stringValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'bytesField': 22}),
- parseFailure(['bytesField']),
+ () =>
+ TestWellKnownTypes()..mergeFromProto3Json({'bytesValueField': 22}),
+ parseFailure(['bytesValueField']),
);
expect(
- () => TestWellKnownTypes()..mergeFromProto3Json({'bytesField': '()'}),
- parseFailure(['bytesField']),
+ () =>
+ TestWellKnownTypes()
+ ..mergeFromProto3Json({'bytesValueField': '()'}),
+ parseFailure(['bytesValueField']),
);
expect(
TestWellKnownTypes()..mergeFromProto3Json({
- 'doubleField': null,
- 'floatField': null,
- 'int64Field': null,
- 'uint64Field': null,
- 'int32Field': null,
- 'uint32Field': null,
- 'boolField': null,
- 'stringField': null,
- 'bytesField': null,
+ 'doubleValueField': null,
+ 'floatValueField': null,
+ 'int64ValueField': null,
+ 'uint64ValueField': null,
+ 'int32ValueField': null,
+ 'uint32ValueField': null,
+ 'boolValueField': null,
+ 'stringValueField': null,
+ 'bytesValueField': null,
}),
TestWellKnownTypes(),
reason:
diff --git a/protoc_plugin/test/protos/google/protobuf/duration.proto b/protoc_plugin/test/protos/google/protobuf/duration.proto
deleted file mode 100644
index 975fce4..0000000
--- a/protoc_plugin/test/protos/google/protobuf/duration.proto
+++ /dev/null
@@ -1,117 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/duration";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "DurationProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-// A Duration represents a signed, fixed-length span of time represented
-// as a count of seconds and fractions of seconds at nanosecond
-// resolution. It is independent of any calendar and concepts like "day"
-// or "month". It is related to Timestamp in that the difference between
-// two Timestamp values is a Duration and it can be added or subtracted
-// from a Timestamp. Range is approximately +-10,000 years.
-//
-// # Examples
-//
-// Example 1: Compute Duration from two Timestamps in pseudo code.
-//
-// Timestamp start = ...;
-// Timestamp end = ...;
-// Duration duration = ...;
-//
-// duration.seconds = end.seconds - start.seconds;
-// duration.nanos = end.nanos - start.nanos;
-//
-// if (duration.seconds < 0 && duration.nanos > 0) {
-// duration.seconds += 1;
-// duration.nanos -= 1000000000;
-// } else if (durations.seconds > 0 && duration.nanos < 0) {
-// duration.seconds -= 1;
-// duration.nanos += 1000000000;
-// }
-//
-// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
-//
-// Timestamp start = ...;
-// Duration duration = ...;
-// Timestamp end = ...;
-//
-// end.seconds = start.seconds + duration.seconds;
-// end.nanos = start.nanos + duration.nanos;
-//
-// if (end.nanos < 0) {
-// end.seconds -= 1;
-// end.nanos += 1000000000;
-// } else if (end.nanos >= 1000000000) {
-// end.seconds += 1;
-// end.nanos -= 1000000000;
-// }
-//
-// Example 3: Compute Duration from datetime.timedelta in Python.
-//
-// td = datetime.timedelta(days=3, minutes=10)
-// duration = Duration()
-// duration.FromTimedelta(td)
-//
-// # JSON Mapping
-//
-// In JSON format, the Duration type is encoded as a string rather than an
-// object, where the string ends in the suffix "s" (indicating seconds) and
-// is preceded by the number of seconds, with nanoseconds expressed as
-// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
-// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
-// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
-// microsecond should be expressed in JSON format as "3.000001s".
-//
-//
-message Duration {
-
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive. Note: these bounds are computed from:
- // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- int64 seconds = 1;
-
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- int32 nanos = 2;
-}
diff --git a/protoc_plugin/test/protos/google/protobuf/unittest_well_known_types.proto b/protoc_plugin/test/protos/google/protobuf/unittest_well_known_types.proto
index c907524..5741292 100644
--- a/protoc_plugin/test/protos/google/protobuf/unittest_well_known_types.proto
+++ b/protoc_plugin/test/protos/google/protobuf/unittest_well_known_types.proto
@@ -17,98 +17,141 @@
import "google/protobuf/type.proto";
import "google/protobuf/wrappers.proto";
-// Test that we can include all well-known types.
-// Each wrapper type is included separately, as languages
-// map handle different wrappers in different ways.
+// Test that we can include all well-known types. Each wrapper type is included
+// separately, as languages map handle different wrappers in different ways.
message TestWellKnownTypes {
- google.protobuf.Any any_field = 1;
- google.protobuf.Api api_field = 2;
- google.protobuf.Duration duration_field = 3;
- google.protobuf.Empty empty_field = 4;
- google.protobuf.FieldMask field_mask_field = 5;
- google.protobuf.SourceContext source_context_field = 6;
- google.protobuf.Struct struct_field = 7;
- google.protobuf.Timestamp timestamp_field = 8;
- google.protobuf.Type type_field = 9;
- google.protobuf.DoubleValue double_field = 10;
- google.protobuf.FloatValue float_field = 11;
- google.protobuf.Int64Value int64_field = 12;
- google.protobuf.UInt64Value uint64_field = 13;
- google.protobuf.Int32Value int32_field = 14;
- google.protobuf.UInt32Value uint32_field = 15;
- google.protobuf.BoolValue bool_field = 16;
- google.protobuf.StringValue string_field = 17;
- google.protobuf.BytesValue bytes_field = 18;
- // Part of struct, but useful to be able to test separately
- google.protobuf.Value value_field = 19;
+ google.protobuf.Any any_field = 1;
+ google.protobuf.Api api_field = 2;
+ google.protobuf.BoolValue bool_value_field = 3;
+ google.protobuf.BytesValue bytes_value_field = 4;
+ google.protobuf.DoubleValue double_value_field = 5;
+ google.protobuf.Duration duration_field = 6;
+ google.protobuf.Empty empty_field = 7;
+ google.protobuf.Enum enum_field = 8;
+ google.protobuf.EnumValue enum_value_field = 9;
+ google.protobuf.Field field_field = 10;
+ google.protobuf.Field.Cardinality field_cardinality_field = 11;
+ google.protobuf.Field.Kind field_kind_field = 12;
+ google.protobuf.FieldMask field_mask_field = 13;
+ google.protobuf.FloatValue float_value_field = 14;
+ google.protobuf.Int32Value int32_value_field = 15;
+ google.protobuf.Int64Value int64_value_field = 16;
+ google.protobuf.ListValue list_value_field = 17;
+ google.protobuf.Method method_field = 18;
+ google.protobuf.Mixin mixin_field = 19;
+ google.protobuf.NullValue null_value_field = 20;
+ google.protobuf.Option option_field = 21;
+ google.protobuf.SourceContext source_context_field = 22;
+ google.protobuf.StringValue string_value_field = 23;
+ google.protobuf.Struct struct_field = 24;
+ google.protobuf.Syntax syntax_field = 25;
+ google.protobuf.Timestamp timestamp_field = 26;
+ google.protobuf.Type type_field = 27;
+ google.protobuf.UInt32Value uint32_value_field = 28;
+ google.protobuf.UInt64Value uint64_value_field = 29;
+ google.protobuf.Value value_field = 30;
}
// A repeated field for each well-known type.
message RepeatedWellKnownTypes {
repeated google.protobuf.Any any_field = 1;
repeated google.protobuf.Api api_field = 2;
- repeated google.protobuf.Duration duration_field = 3;
- repeated google.protobuf.Empty empty_field = 4;
- repeated google.protobuf.FieldMask field_mask_field = 5;
- repeated google.protobuf.SourceContext source_context_field = 6;
- repeated google.protobuf.Struct struct_field = 7;
- repeated google.protobuf.Timestamp timestamp_field = 8;
- repeated google.protobuf.Type type_field = 9;
- // These don't actually make a lot of sense, but they're not prohibited...
- repeated google.protobuf.DoubleValue double_field = 10;
- repeated google.protobuf.FloatValue float_field = 11;
- repeated google.protobuf.Int64Value int64_field = 12;
- repeated google.protobuf.UInt64Value uint64_field = 13;
- repeated google.protobuf.Int32Value int32_field = 14;
- repeated google.protobuf.UInt32Value uint32_field = 15;
- repeated google.protobuf.BoolValue bool_field = 16;
- repeated google.protobuf.StringValue string_field = 17;
- repeated google.protobuf.BytesValue bytes_field = 18;
+ repeated google.protobuf.BoolValue bool_value_field = 3;
+ repeated google.protobuf.BytesValue bytes_value_field = 4;
+ repeated google.protobuf.DoubleValue double_value_field = 5;
+ repeated google.protobuf.Duration duration_field = 6;
+ repeated google.protobuf.Empty empty_field = 7;
+ repeated google.protobuf.Enum enum_field = 8;
+ repeated google.protobuf.EnumValue enum_value_field = 9;
+ repeated google.protobuf.Field field_field = 10;
+ repeated google.protobuf.Field.Cardinality field_cardinality_field = 11;
+ repeated google.protobuf.Field.Kind field_kind_field = 12;
+ repeated google.protobuf.FieldMask field_mask_field = 13;
+ repeated google.protobuf.FloatValue float_value_field = 14;
+ repeated google.protobuf.Int32Value int32_value_field = 15;
+ repeated google.protobuf.Int64Value int64_value_field = 16;
+ repeated google.protobuf.ListValue list_value_field = 17;
+ repeated google.protobuf.Method method_field = 18;
+ repeated google.protobuf.Mixin mixin_field = 19;
+ repeated google.protobuf.NullValue null_value_field = 20;
+ repeated google.protobuf.Option option_field = 21;
+ repeated google.protobuf.SourceContext source_context_field = 22;
+ repeated google.protobuf.StringValue string_value_field = 23;
+ repeated google.protobuf.Struct struct_field = 24;
+ repeated google.protobuf.Syntax syntax_field = 25;
+ repeated google.protobuf.Timestamp timestamp_field = 26;
+ repeated google.protobuf.Type type_field = 27;
+ repeated google.protobuf.UInt32Value uint32_value_field = 28;
+ repeated google.protobuf.UInt64Value uint64_value_field = 29;
+ repeated google.protobuf.Value value_field = 30;
}
message OneofWellKnownTypes {
oneof oneof_field {
- google.protobuf.Any any_field = 1;
- google.protobuf.Api api_field = 2;
- google.protobuf.Duration duration_field = 3;
- google.protobuf.Empty empty_field = 4;
- google.protobuf.FieldMask field_mask_field = 5;
- google.protobuf.SourceContext source_context_field = 6;
- google.protobuf.Struct struct_field = 7;
- google.protobuf.Timestamp timestamp_field = 8;
- google.protobuf.Type type_field = 9;
- google.protobuf.DoubleValue double_field = 10;
- google.protobuf.FloatValue float_field = 11;
- google.protobuf.Int64Value int64_field = 12;
- google.protobuf.UInt64Value uint64_field = 13;
- google.protobuf.Int32Value int32_field = 14;
- google.protobuf.UInt32Value uint32_field = 15;
- google.protobuf.BoolValue bool_field = 16;
- google.protobuf.StringValue string_field = 17;
- google.protobuf.BytesValue bytes_field = 18;
+ google.protobuf.Any any_field = 1;
+ google.protobuf.Api api_field = 2;
+ google.protobuf.BoolValue bool_value_field = 3;
+ google.protobuf.BytesValue bytes_value_field = 4;
+ google.protobuf.DoubleValue double_value_field = 5;
+ google.protobuf.Duration duration_field = 6;
+ google.protobuf.Empty empty_field = 7;
+ google.protobuf.Enum enum_field = 8;
+ google.protobuf.EnumValue enum_value_field = 9;
+ google.protobuf.Field field_field = 10;
+ google.protobuf.Field.Cardinality field_cardinality_field = 11;
+ google.protobuf.Field.Kind field_kind_field = 12;
+ google.protobuf.FieldMask field_mask_field = 13;
+ google.protobuf.FloatValue float_value_field = 14;
+ google.protobuf.Int32Value int32_value_field = 15;
+ google.protobuf.Int64Value int64_value_field = 16;
+ google.protobuf.ListValue list_value_field = 17;
+ google.protobuf.Method method_field = 18;
+ google.protobuf.Mixin mixin_field = 19;
+ google.protobuf.NullValue null_value_field = 20;
+ google.protobuf.Option option_field = 21;
+ google.protobuf.SourceContext source_context_field = 22;
+ google.protobuf.StringValue string_value_field = 23;
+ google.protobuf.Struct struct_field = 24;
+ google.protobuf.Syntax syntax_field = 25;
+ google.protobuf.Timestamp timestamp_field = 26;
+ google.protobuf.Type type_field = 27;
+ google.protobuf.UInt32Value uint32_value_field = 28;
+ google.protobuf.UInt64Value uint64_value_field = 29;
+ google.protobuf.Value value_field = 30;
}
}
-// A map field for each well-known type. We only
-// need to worry about the value part of the map being the
-// well-known types, as messages can't be map keys.
+// A map field for each well-known type. We only need to worry about the value
+// part of the map being the well-known types, as messages can't be map keys.
message MapWellKnownTypes {
- map<int32,google.protobuf.Any> any_field = 1;
- map<int32,google.protobuf.Api> api_field = 2;
- map<int32,google.protobuf.Duration> duration_field = 3;
- map<int32,google.protobuf.Empty> empty_field = 4;
- map<int32,google.protobuf.FieldMask> field_mask_field = 5;
- map<int32,google.protobuf.SourceContext> source_context_field = 6;
- map<int32,google.protobuf.Struct> struct_field = 7;
- map<int32,google.protobuf.Timestamp> timestamp_field = 8;
- map<int32,google.protobuf.Type> type_field = 9;
- map<int32,google.protobuf.DoubleValue> double_field = 10;
- map<int32,google.protobuf.FloatValue> float_field = 11;
- map<int32,google.protobuf.Int64Value> int64_field = 12;
- map<int32,google.protobuf.UInt64Value> uint64_field = 13;
- map<int32,google.protobuf.Int32Value> int32_field = 14;
- map<int32,google.protobuf.UInt32Value> uint32_field = 15;
- map<int32,google.protobuf.BoolValue> bool_field = 16;
- map<int32,google.protobuf.StringValue> string_field = 17;
- map<int32,google.protobuf.BytesValue> bytes_field = 18;
+ map<int32, google.protobuf.Any> any_field = 1;
+ map<int32, google.protobuf.Api> api_field = 2;
+ map<int32, google.protobuf.BoolValue> bool_value_field = 3;
+ map<int32, google.protobuf.BytesValue> bytes_value_field = 4;
+ map<int32, google.protobuf.DoubleValue> double_value_field = 5;
+ map<int32, google.protobuf.Duration> duration_field = 6;
+ map<int32, google.protobuf.Empty> empty_field = 7;
+ map<int32, google.protobuf.Enum> enum_field = 8;
+ map<int32, google.protobuf.EnumValue> enum_value_field = 9;
+ map<int32, google.protobuf.Field> field_field = 10;
+ map<int32, google.protobuf.Field.Cardinality> field_cardinality_field = 11;
+ map<int32, google.protobuf.Field.Kind> field_kind_field = 12;
+ map<int32, google.protobuf.FieldMask> field_mask_field = 13;
+ map<int32, google.protobuf.FloatValue> float_value_field = 14;
+ map<int32, google.protobuf.Int32Value> int32_value_field = 15;
+ map<int32, google.protobuf.Int64Value> int64_value_field = 16;
+ map<int32, google.protobuf.ListValue> list_value_field = 17;
+ map<int32, google.protobuf.Method> method_field = 18;
+ map<int32, google.protobuf.Mixin> mixin_field = 19;
+ map<int32, google.protobuf.NullValue> null_value_field = 20;
+ map<int32, google.protobuf.Option> option_field = 21;
+ map<int32, google.protobuf.SourceContext> source_context_field = 22;
+ map<int32, google.protobuf.StringValue> string_value_field = 23;
+ map<int32, google.protobuf.Struct> struct_field = 24;
+ map<int32, google.protobuf.Syntax> syntax_field = 25;
+ map<int32, google.protobuf.Timestamp> timestamp_field = 26;
+ map<int32, google.protobuf.Type> type_field = 27;
+ map<int32, google.protobuf.UInt32Value> uint32_value_field = 28;
+ map<int32, google.protobuf.UInt64Value> uint64_value_field = 29;
+ map<int32, google.protobuf.Value> value_field = 30;
}
diff --git a/protoc_plugin/test/timestamp_test.dart b/protoc_plugin/test/timestamp_test.dart
index d039bd4..782b310 100644
--- a/protoc_plugin/test/timestamp_test.dart
+++ b/protoc_plugin/test/timestamp_test.dart
@@ -3,10 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:fixnum/fixnum.dart';
+import 'package:protobuf/well_known_types/google/protobuf/timestamp.pb.dart';
import 'package:test/test.dart';
-import 'gen/google/protobuf/timestamp.pb.dart';
-
void main() {
test('timestamp -> datetime -> timestamp', () {
final timestamp =