Skip to content

Commit f43e2ea

Browse files
committed
Re-generate
1 parent d867ba7 commit f43e2ea

File tree

5 files changed

+1770
-101
lines changed

5 files changed

+1770
-101
lines changed

src/google/api/http.ts

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface Http {
2626
fullyDecodeReservedExpansion: boolean;
2727
}
2828
/**
29-
* # gRPC Transcoding
29+
* gRPC Transcoding
3030
*
3131
* gRPC Transcoding is a feature for mapping between a gRPC method and one or
3232
* more HTTP REST endpoints. It allows developers to build a single API service
@@ -67,9 +67,8 @@ export interface Http {
6767
*
6868
* This enables an HTTP REST to gRPC mapping as below:
6969
*
70-
* HTTP | gRPC
71-
* -----|-----
72-
* `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
70+
* - HTTP: `GET /v1/messages/123456`
71+
* - gRPC: `GetMessage(name: "messages/123456")`
7372
*
7473
* Any fields in the request message which are not bound by the path template
7574
* automatically become HTTP query parameters if there is no HTTP request body.
@@ -93,11 +92,9 @@ export interface Http {
9392
*
9493
* This enables a HTTP JSON to RPC mapping as below:
9594
*
96-
* HTTP | gRPC
97-
* -----|-----
98-
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
99-
* `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
100-
* "foo"))`
95+
* - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
96+
* - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
97+
* SubMessage(subfield: "foo"))`
10198
*
10299
* Note that fields which are mapped to URL query parameters must have a
103100
* primitive type or a repeated primitive type or a non-repeated message type.
@@ -127,10 +124,8 @@ export interface Http {
127124
* representation of the JSON in the request body is determined by
128125
* protos JSON encoding:
129126
*
130-
* HTTP | gRPC
131-
* -----|-----
132-
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
133-
* "123456" message { text: "Hi!" })`
127+
* - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
128+
* - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
134129
*
135130
* The special name `*` can be used in the body mapping to define that
136131
* every field not bound by the path template should be mapped to the
@@ -153,10 +148,8 @@ export interface Http {
153148
*
154149
* The following HTTP JSON to RPC mapping is enabled:
155150
*
156-
* HTTP | gRPC
157-
* -----|-----
158-
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
159-
* "123456" text: "Hi!")`
151+
* - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
152+
* - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
160153
*
161154
* Note that when using `*` in the body mapping, it is not possible to
162155
* have HTTP parameters, as all fields not bound by the path end in
@@ -184,29 +177,32 @@ export interface Http {
184177
*
185178
* This enables the following two alternative HTTP JSON to RPC mappings:
186179
*
187-
* HTTP | gRPC
188-
* -----|-----
189-
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
190-
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
191-
* "123456")`
180+
* - HTTP: `GET /v1/messages/123456`
181+
* - gRPC: `GetMessage(message_id: "123456")`
192182
*
193-
* ## Rules for HTTP mapping
183+
* - HTTP: `GET /v1/users/me/messages/123456`
184+
* - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
185+
*
186+
* Rules for HTTP mapping
194187
*
195188
* 1. Leaf request fields (recursive expansion nested messages in the request
196189
* message) are classified into three categories:
197190
* - Fields referred by the path template. They are passed via the URL path.
198-
* - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
191+
* - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
192+
* are passed via the HTTP
199193
* request body.
200194
* - All other fields are passed via the URL query parameters, and the
201195
* parameter name is the field path in the request message. A repeated
202196
* field can be represented as multiple query parameters under the same
203197
* name.
204-
* 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
198+
* 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
199+
* query parameter, all fields
205200
* are passed via URL path and HTTP request body.
206-
* 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
201+
* 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
202+
* request body, all
207203
* fields are passed via URL path and URL query parameters.
208204
*
209-
* ### Path template syntax
205+
* Path template syntax
210206
*
211207
* Template = "/" Segments [ Verb ] ;
212208
* Segments = Segment { "/" Segment } ;
@@ -245,7 +241,7 @@ export interface Http {
245241
* Document](https://developers.google.com/discovery/v1/reference/apis) as
246242
* `{+var}`.
247243
*
248-
* ## Using gRPC API Service Configuration
244+
* Using gRPC API Service Configuration
249245
*
250246
* gRPC API Service Configuration (service config) is a configuration language
251247
* for configuring a gRPC service to become a user-facing product. The
@@ -260,15 +256,14 @@ export interface Http {
260256
* specified in the service config will override any matching transcoding
261257
* configuration in the proto.
262258
*
263-
* Example:
259+
* The following example selects a gRPC method and applies an `HttpRule` to it:
264260
*
265261
* http:
266262
* rules:
267-
* # Selects a gRPC method and applies HttpRule to it.
268263
* - selector: example.v1.Messaging.GetMessage
269264
* get: /v1/messages/{message_id}/{sub.subfield}
270265
*
271-
* ## Special notes
266+
* Special notes
272267
*
273268
* When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
274269
* proto to JSON conversion must follow the [proto3
@@ -300,7 +295,8 @@ export interface HttpRule {
300295
/**
301296
* Selects a method to which this rule applies.
302297
*
303-
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
298+
* Refer to [selector][google.api.DocumentationRule.selector] for syntax
299+
* details.
304300
*/
305301
selector: string;
306302
/**

src/google/protobuf/any.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export const protobufPackage = "google.protobuf";
2828
* if (any.is(Foo.class)) {
2929
* foo = any.unpack(Foo.class);
3030
* }
31+
* // or ...
32+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
33+
* foo = any.unpack(Foo.getDefaultInstance());
34+
* }
3135
*
3236
* Example 3: Pack and unpack a message in Python.
3337
*
@@ -42,10 +46,13 @@ export const protobufPackage = "google.protobuf";
4246
* Example 4: Pack and unpack a message in Go
4347
*
4448
* foo := &pb.Foo{...}
45-
* any, err := ptypes.MarshalAny(foo)
49+
* any, err := anypb.New(foo)
50+
* if err != nil {
51+
* ...
52+
* }
4653
* ...
4754
* foo := &pb.Foo{}
48-
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
55+
* if err := any.UnmarshalTo(foo); err != nil {
4956
* ...
5057
* }
5158
*
@@ -55,7 +62,6 @@ export const protobufPackage = "google.protobuf";
5562
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
5663
* name "y.z".
5764
*
58-
*
5965
* JSON
6066
* ====
6167
* The JSON representation of an `Any` value uses the regular
@@ -109,7 +115,8 @@ export interface Any {
109115
*
110116
* Note: this functionality is not currently available in the official
111117
* protobuf release, and it is not used for type URLs beginning with
112-
* type.googleapis.com.
118+
* type.googleapis.com. As of May 2023, there are no widely used type server
119+
* implementations and no plans to implement one.
113120
*
114121
* Schemes other than `http`, `https` (or the empty scheme) might be
115122
* used with implementation specific semantics.

0 commit comments

Comments
 (0)