Skip to content

Commit a805985

Browse files
committed
Updated generated proto files
1 parent 38c054b commit a805985

File tree

34 files changed

+1385
-32
lines changed

34 files changed

+1385
-32
lines changed

protobuf/protobuf-core/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ protoSourceSets {
7272
}
7373
}
7474

75+
rpc {
76+
protoc.buf.generate.comments {
77+
includeFileLevelComments = false
78+
}
79+
}
80+
7581
configureLocalProtocGenDevelopmentDependency("Main", "Test")
7682

7783
val generatedCodeDir = layout.projectDirectory

protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/Any.kt

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,130 @@ package com.google.protobuf.kotlin
33

44
import kotlinx.rpc.internal.utils.*
55

6+
/**
7+
* `Any` contains an arbitrary serialized protocol buffer message along with a
8+
* URL that describes the type of the serialized message.
9+
*
10+
* Protobuf library provides support to pack/unpack Any values in the form
11+
* of utility functions or additional generated methods of the Any type.
12+
*
13+
* Example 1: Pack and unpack a message in C++.
14+
*
15+
* Foo foo = ...;
16+
* Any any;
17+
* any.PackFrom(foo);
18+
* ...
19+
* if (any.UnpackTo(&foo)) {
20+
* ...
21+
* }
22+
*
23+
* Example 2: Pack and unpack a message in Java.
24+
*
25+
* Foo foo = ...;
26+
* Any any = Any.pack(foo);
27+
* ...
28+
* if (any.is(Foo.class)) {
29+
* foo = any.unpack(Foo.class);
30+
* }
31+
* // or ...
32+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
33+
* foo = any.unpack(Foo.getDefaultInstance());
34+
* }
35+
*
36+
* Example 3: Pack and unpack a message in Python.
37+
*
38+
* foo = Foo(...)
39+
* any = Any()
40+
* any.Pack(foo)
41+
* ...
42+
* if any.Is(Foo.DESCRIPTOR):
43+
* any.Unpack(foo)
44+
* ...
45+
*
46+
* Example 4: Pack and unpack a message in Go
47+
*
48+
* foo := &pb.Foo{...}
49+
* any, err := anypb.New(foo)
50+
* if err != nil {
51+
* ...
52+
* }
53+
* ...
54+
* foo := &pb.Foo{}
55+
* if err := any.UnmarshalTo(foo); err != nil {
56+
* ...
57+
* }
58+
*
59+
* The pack methods provided by protobuf library will by default use
60+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
61+
* methods only use the fully qualified type name after the last '/'
62+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
63+
* name "y.z".
64+
*
65+
* JSON
66+
* ====
67+
* The JSON representation of an `Any` value uses the regular
68+
* representation of the deserialized, embedded message, with an
69+
* additional field `@type` which contains the type URL. Example:
70+
*
71+
* package google.profile;
72+
* message Person {
73+
* string first_name = 1;
74+
* string last_name = 2;
75+
* }
76+
*
77+
* {
78+
* "@type": "type.googleapis.com/google.profile.Person",
79+
* "firstName": <string>,
80+
* "lastName": <string>
81+
* }
82+
*
83+
* If the embedded message type is well-known and has a custom JSON
84+
* representation, that representation will be embedded adding a field
85+
* `value` which holds the custom JSON in addition to the `@type`
86+
* field. Example (for message [google.protobuf.Duration][]):
87+
*
88+
* {
89+
* "@type": "type.googleapis.com/google.protobuf.Duration",
90+
* "value": "1.212s"
91+
* }
92+
*/
693
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf.kotlin.AnyInternal.CODEC::class)
794
public interface Any {
95+
/**
96+
* A URL/resource name that uniquely identifies the type of the serialized
97+
* protocol buffer message. This string must contain at least
98+
* one "/" character. The last segment of the URL's path must represent
99+
* the fully qualified name of the type (as in
100+
* `path/google.protobuf.Duration`). The name should be in a canonical form
101+
* (e.g., leading "." is not accepted).
102+
*
103+
* In practice, teams usually precompile into the binary all types that they
104+
* expect it to use in the context of Any. However, for URLs which use the
105+
* scheme `http`, `https`, or no scheme, one can optionally set up a type
106+
* server that maps type URLs to message definitions as follows:
107+
*
108+
* * If no scheme is provided, `https` is assumed.
109+
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
110+
* value in binary format, or produce an error.
111+
* * Applications are allowed to cache lookup results based on the
112+
* URL, or have them precompiled into a binary to avoid any
113+
* lookup. Therefore, binary compatibility needs to be preserved
114+
* on changes to types. (Use versioned type names to manage
115+
* breaking changes.)
116+
*
117+
* Note: this functionality is not currently available in the official
118+
* protobuf release, and it is not used for type URLs beginning with
119+
* type.googleapis.com. As of May 2023, there are no widely used type server
120+
* implementations and no plans to implement one.
121+
*
122+
* Schemes other than `http`, `https` (or the empty scheme) might be
123+
* used with implementation specific semantics.
124+
*/
8125
public val typeUrl: String
126+
/**
127+
* Must be a valid serialized protocol buffer of the above specified type.
128+
*/
9129
public val value: ByteArray
10130

11131
public companion object
12132
}
13-

protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/Api.kt

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,199 @@ package com.google.protobuf.kotlin
33

44
import kotlinx.rpc.internal.utils.*
55

6+
/**
7+
* Api is a light-weight descriptor for an API Interface.
8+
*
9+
* Interfaces are also described as "protocol buffer services" in some contexts,
10+
* such as by the "service" keyword in a .proto file, but they are different
11+
* from API Services, which represent a concrete implementation of an interface
12+
* as opposed to simply a description of methods and bindings. They are also
13+
* sometimes simply referred to as "APIs" in other contexts, such as the name of
14+
* this message itself. See https://cloud.google.com/apis/design/glossary for
15+
* detailed terminology.
16+
*/
617
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf.kotlin.ApiInternal.CODEC::class)
718
public interface Api {
19+
/**
20+
* The fully qualified name of this interface, including package name
21+
* followed by the interface's simple name.
22+
*/
823
public val name: String
24+
/**
25+
* The methods of this interface, in unspecified order.
26+
*/
927
public val methods: List<com.google.protobuf.kotlin.Method>
28+
/**
29+
* Any metadata attached to the interface.
30+
*/
1031
public val options: List<com.google.protobuf.kotlin.Option>
32+
/**
33+
* A version string for this interface. If specified, must have the form
34+
* `major-version.minor-version`, as in `1.10`. If the minor version is
35+
* omitted, it defaults to zero. If the entire version field is empty, the
36+
* major version is derived from the package name, as outlined below. If the
37+
* field is not empty, the version in the package name will be verified to be
38+
* consistent with what is provided here.
39+
*
40+
* The versioning schema uses [semantic
41+
* versioning](http://semver.org) where the major version number
42+
* indicates a breaking change and the minor version an additive,
43+
* non-breaking change. Both version numbers are signals to users
44+
* what to expect from different versions, and should be carefully
45+
* chosen based on the product plan.
46+
*
47+
* The major version is also reflected in the package name of the
48+
* interface, which must end in `v<major-version>`, as in
49+
* `google.feature.v1`. For major versions 0 and 1, the suffix can
50+
* be omitted. Zero major versions must only be used for
51+
* experimental, non-GA interfaces.
52+
*/
1153
public val version: String
54+
/**
55+
* Source context for the protocol buffer service represented by this
56+
* message.
57+
*/
1258
public val sourceContext: com.google.protobuf.kotlin.SourceContext
59+
/**
60+
* Included interfaces. See [Mixin][].
61+
*/
1362
public val mixins: List<com.google.protobuf.kotlin.Mixin>
63+
/**
64+
* The source syntax of the service.
65+
*/
1466
public val syntax: com.google.protobuf.kotlin.Syntax
1567

1668
public companion object
1769
}
1870

71+
/**
72+
* Method represents a method of an API interface.
73+
*/
1974
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf.kotlin.MethodInternal.CODEC::class)
2075
public interface Method {
76+
/**
77+
* The simple name of this method.
78+
*/
2179
public val name: String
80+
/**
81+
* A URL of the input message type.
82+
*/
2283
public val requestTypeUrl: String
84+
/**
85+
* If true, the request is streamed.
86+
*/
2387
public val requestStreaming: Boolean
88+
/**
89+
* The URL of the output message type.
90+
*/
2491
public val responseTypeUrl: String
92+
/**
93+
* If true, the response is streamed.
94+
*/
2595
public val responseStreaming: Boolean
96+
/**
97+
* Any metadata attached to the method.
98+
*/
2699
public val options: List<com.google.protobuf.kotlin.Option>
100+
/**
101+
* The source syntax of this method.
102+
*/
27103
public val syntax: com.google.protobuf.kotlin.Syntax
28104

29105
public companion object
30106
}
31107

108+
/**
109+
* Declares an API Interface to be included in this interface. The including
110+
* interface must redeclare all the methods from the included interface, but
111+
* documentation and options are inherited as follows:
112+
*
113+
* - If after comment and whitespace stripping, the documentation
114+
* string of the redeclared method is empty, it will be inherited
115+
* from the original method.
116+
*
117+
* - Each annotation belonging to the service config (http,
118+
* visibility) which is not set in the redeclared method will be
119+
* inherited.
120+
*
121+
* - If an http annotation is inherited, the path pattern will be
122+
* modified as follows. Any version prefix will be replaced by the
123+
* version of the including interface plus the [root][] path if
124+
* specified.
125+
*
126+
* Example of a simple mixin:
127+
*
128+
* package google.acl.v1;
129+
* service AccessControl {
130+
* // Get the underlying ACL object.
131+
* rpc GetAcl(GetAclRequest) returns (Acl) {
132+
* option (google.api.http).get = "/v1/{resource=**}:getAcl";
133+
* }
134+
* }
135+
*
136+
* package google.storage.v2;
137+
* service Storage {
138+
* rpc GetAcl(GetAclRequest) returns (Acl);
139+
*
140+
* // Get a data record.
141+
* rpc GetData(GetDataRequest) returns (Data) {
142+
* option (google.api.http).get = "/v2/{resource=**}";
143+
* }
144+
* }
145+
*
146+
* Example of a mixin configuration:
147+
*
148+
* apis:
149+
* - name: google.storage.v2.Storage
150+
* mixins:
151+
* - name: google.acl.v1.AccessControl
152+
*
153+
* The mixin construct implies that all methods in `AccessControl` are
154+
* also declared with same name and request/response types in
155+
* `Storage`. A documentation generator or annotation processor will
156+
* see the effective `Storage.GetAcl` method after inheriting
157+
* documentation and annotations as follows:
158+
*
159+
* service Storage {
160+
* // Get the underlying ACL object.
161+
* rpc GetAcl(GetAclRequest) returns (Acl) {
162+
* option (google.api.http).get = "/v2/{resource=**}:getAcl";
163+
* }
164+
* ...
165+
* }
166+
*
167+
* Note how the version in the path pattern changed from `v1` to `v2`.
168+
*
169+
* If the `root` field in the mixin is specified, it should be a
170+
* relative path under which inherited HTTP paths are placed. Example:
171+
*
172+
* apis:
173+
* - name: google.storage.v2.Storage
174+
* mixins:
175+
* - name: google.acl.v1.AccessControl
176+
* root: acls
177+
*
178+
* This implies the following inherited HTTP annotation:
179+
*
180+
* service Storage {
181+
* // Get the underlying ACL object.
182+
* rpc GetAcl(GetAclRequest) returns (Acl) {
183+
* option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
184+
* }
185+
* ...
186+
* }
187+
*/
32188
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf.kotlin.MixinInternal.CODEC::class)
33189
public interface Mixin {
190+
/**
191+
* The fully qualified name of the interface which is included.
192+
*/
34193
public val name: String
194+
/**
195+
* If non-empty specifies a path under which inherited HTTP paths
196+
* are rooted.
197+
*/
35198
public val root: String
36199

37200
public companion object
38201
}
39-

0 commit comments

Comments
 (0)