Skip to content

Commit

Permalink
Merge branch 'gilbert/update-google-wellknown-protos'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-abrahamsson committed Dec 13, 2023
2 parents e8f5b0c + 0ad3c54 commit 42dd97c
Show file tree
Hide file tree
Showing 12 changed files with 413 additions and 90 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [smp:12:12] [async-threads:10] [ker
Eshell V8.0.3 (abort with ^G)
1> rr("x.hrl").
['Person']
2> x:encode_msg(#'Person'{name="abc def", id=345, email="[email protected]"}).
2> x:encode_msg(#'Person'{name="abc def", id=345, email="[email protected]"}).
<<10,7,97,98,99,32,100,101,102,16,217,2,26,13,97,64,101,
120,97,109,112,108,101,46,99,111,109>>
3> Bin = v(-1).
Expand Down
21 changes: 14 additions & 7 deletions priv/proto3/google/protobuf/any.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is imported from protobuf 3.12.3
// This file is imported from protobuf 4.25.1
//

// Protocol Buffers - Google's data interchange format
Expand Down Expand Up @@ -35,12 +35,12 @@ syntax = "proto3";

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.
Expand All @@ -66,6 +66,10 @@ option objc_class_prefix = "GPB";
// 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.
//
Expand All @@ -80,10 +84,13 @@ option objc_class_prefix = "GPB";
// 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 {
// ...
// }
//
Expand All @@ -93,7 +100,6 @@ option objc_class_prefix = "GPB";
// 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
Expand Down Expand Up @@ -146,7 +152,8 @@ message Any {
//
// 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.
Expand Down
9 changes: 3 additions & 6 deletions priv/proto3/google/protobuf/api.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is imported from protobuf 3.12.3
// This file is imported from protobuf 4.25.1
//

// Protocol Buffers - Google's data interchange format
Expand Down Expand Up @@ -38,12 +38,12 @@ package google.protobuf;
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.
//
Expand All @@ -55,7 +55,6 @@ option go_package = "google.golang.org/genproto/protobuf/api;api";
// this message itself. See https://cloud.google.com/apis/design/glossary for
// detailed terminology.
message Api {

// The fully qualified name of this interface, including package name
// followed by the interface's simple name.
string name = 1;
Expand Down Expand Up @@ -86,7 +85,6 @@ message Api {
// 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
Expand All @@ -102,7 +100,6 @@ message Api {

// Method represents a method of an API interface.
message Method {

// The simple name of this method.
string name = 1;

Expand Down
Loading

0 comments on commit 42dd97c

Please sign in to comment.