Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d582a31

Browse files
authoredJun 4, 2025··
Regenerate Google protos with documentation (#415)
1 parent c194823 commit d582a31

File tree

12 files changed

+602
-97
lines changed

12 files changed

+602
-97
lines changed
 

‎lib/elixirpb.pb.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Elixirpb.FileOptions do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
4+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
55

66
field :module_prefix, 1, optional: true, type: :string, json_name: "modulePrefix"
77
end

‎lib/elixirpb/pb_extension.pb.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Elixirpb.PbExtension do
22
@moduledoc false
33

4-
use Protobuf, protoc_gen_elixir_version: "0.14.0"
4+
use Protobuf, protoc_gen_elixir_version: "0.14.1"
55

66
extend Google.Protobuf.FileOptions, :file, 1047, optional: true, type: Elixirpb.FileOptions
77
end

‎lib/google/protobuf/any.pb.ex

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,93 @@
11
defmodule Google.Protobuf.Any do
2-
@moduledoc false
2+
@moduledoc """
3+
`Any` contains an arbitrary serialized protocol buffer message along with a
4+
URL that describes the type of the serialized message.
35
4-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3
6+
Protobuf library provides support to pack/unpack Any values in the form
7+
of utility functions or additional generated methods of the Any type.
8+
9+
Example 1: Pack and unpack a message in C++.
10+
11+
Foo foo = ...;
12+
Any any;
13+
any.PackFrom(foo);
14+
...
15+
if (any.UnpackTo(&foo)) {
16+
...
17+
}
18+
19+
Example 2: Pack and unpack a message in Java.
20+
21+
Foo foo = ...;
22+
Any any = Any.pack(foo);
23+
...
24+
if (any.is(Foo.class)) {
25+
foo = any.unpack(Foo.class);
26+
}
27+
// or ...
28+
if (any.isSameTypeAs(Foo.getDefaultInstance())) {
29+
foo = any.unpack(Foo.getDefaultInstance());
30+
}
31+
32+
Example 3: Pack and unpack a message in Python.
33+
34+
foo = Foo(...)
35+
any = Any()
36+
any.Pack(foo)
37+
...
38+
if any.Is(Foo.DESCRIPTOR):
39+
any.Unpack(foo)
40+
...
41+
42+
Example 4: Pack and unpack a message in Go
43+
44+
foo := &pb.Foo{...}
45+
any, err := anypb.New(foo)
46+
if err != nil {
47+
...
48+
}
49+
...
50+
foo := &pb.Foo{}
51+
if err := any.UnmarshalTo(foo); err != nil {
52+
...
53+
}
54+
55+
The pack methods provided by protobuf library will by default use
56+
'type.googleapis.com/full.type.name' as the type URL and the unpack
57+
methods only use the fully qualified type name after the last '/'
58+
in the type URL, for example "foo.bar.com/x/y.z" will yield type
59+
name "y.z".
60+
61+
JSON
62+
====
63+
The JSON representation of an `Any` value uses the regular
64+
representation of the deserialized, embedded message, with an
65+
additional field `@type` which contains the type URL. Example:
66+
67+
package google.profile;
68+
message Person {
69+
string first_name = 1;
70+
string last_name = 2;
71+
}
72+
73+
{
74+
"@type": "type.googleapis.com/google.profile.Person",
75+
"firstName": <string>,
76+
"lastName": <string>
77+
}
78+
79+
If the embedded message type is well-known and has a custom JSON
80+
representation, that representation will be embedded adding a field
81+
`value` which holds the custom JSON in addition to the `@type`
82+
field. Example (for message [google.protobuf.Duration][]):
83+
84+
{
85+
"@type": "type.googleapis.com/google.protobuf.Duration",
86+
"value": "1.212s"
87+
}
88+
"""
89+
90+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
591

692
def descriptor do
793
# credo:disable-for-next-line

‎lib/google/protobuf/compiler/plugin.pb.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.Feature do
22
@moduledoc false
33

4-
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
4+
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
55

66
field :FEATURE_NONE, 0
77
field :FEATURE_PROTO3_OPTIONAL, 1
@@ -11,7 +11,7 @@ end
1111
defmodule Google.Protobuf.Compiler.Version do
1212
@moduledoc false
1313

14-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
14+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
1515

1616
field :major, 1, optional: true, type: :int32
1717
field :minor, 2, optional: true, type: :int32
@@ -22,7 +22,7 @@ end
2222
defmodule Google.Protobuf.Compiler.CodeGeneratorRequest do
2323
@moduledoc false
2424

25-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
25+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
2626

2727
field :file_to_generate, 1, repeated: true, type: :string, json_name: "fileToGenerate"
2828
field :parameter, 2, optional: true, type: :string
@@ -46,7 +46,7 @@ end
4646
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.File do
4747
@moduledoc false
4848

49-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
49+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
5050

5151
field :name, 1, optional: true, type: :string
5252
field :insertion_point, 2, optional: true, type: :string, json_name: "insertionPoint"
@@ -61,7 +61,7 @@ end
6161
defmodule Google.Protobuf.Compiler.CodeGeneratorResponse do
6262
@moduledoc false
6363

64-
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto2
64+
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto2
6565

6666
field :error, 1, optional: true, type: :string
6767
field :supported_features, 2, optional: true, type: :uint64, json_name: "supportedFeatures"

0 commit comments

Comments
 (0)
Please sign in to comment.