@devvit/protos 0.11.17-next-2025-05-29-91b3cf49f.0 → 0.11.17-next-2025-05-29-de9726085.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/schema/.snootobuf/deps/google/api/annotations.proto +1 -1
- package/schema/.snootobuf/deps/google/api/auth.proto +75 -19
- package/schema/.snootobuf/deps/google/api/backend.proto +142 -8
- package/schema/.snootobuf/deps/google/api/billing.proto +23 -13
- package/schema/.snootobuf/deps/google/api/client.proto +333 -1
- package/schema/.snootobuf/deps/google/api/config_change.proto +2 -3
- package/schema/.snootobuf/deps/google/api/consumer.proto +1 -2
- package/schema/.snootobuf/deps/google/api/context.proto +34 -5
- package/schema/.snootobuf/deps/google/api/control.proto +15 -7
- package/schema/.snootobuf/deps/google/api/distribution.proto +5 -5
- package/schema/.snootobuf/deps/google/api/documentation.proto +27 -16
- package/schema/.snootobuf/deps/google/api/endpoint.proto +23 -25
- package/schema/.snootobuf/deps/google/api/field_behavior.proto +23 -3
- package/schema/.snootobuf/deps/google/api/http.proto +173 -120
- package/schema/.snootobuf/deps/google/api/httpbody.proto +11 -6
- package/schema/.snootobuf/deps/google/api/label.proto +1 -2
- package/schema/.snootobuf/deps/google/api/launch_stage.proto +10 -5
- package/schema/.snootobuf/deps/google/api/log.proto +1 -2
- package/schema/.snootobuf/deps/google/api/logging.proto +6 -8
- package/schema/.snootobuf/deps/google/api/metric.proto +116 -40
- package/schema/.snootobuf/deps/google/api/monitored_resource.proto +38 -24
- package/schema/.snootobuf/deps/google/api/monitoring.proto +43 -25
- package/schema/.snootobuf/deps/google/api/quota.proto +20 -95
- package/schema/.snootobuf/deps/google/api/resource.proto +18 -74
- package/schema/.snootobuf/deps/google/api/routing.proto +1 -1
- package/schema/.snootobuf/deps/google/api/service.proto +54 -38
- package/schema/.snootobuf/deps/google/api/source_info.proto +1 -2
- package/schema/.snootobuf/deps/google/api/system_parameter.proto +3 -3
- package/schema/.snootobuf/deps/google/api/usage.proto +9 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2024 Google LLC
|
2
2
|
//
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
// you may not use this file except in compliance with the License.
|
@@ -16,49 +16,47 @@ syntax = "proto3";
|
|
16
16
|
|
17
17
|
package google.api;
|
18
18
|
|
19
|
-
import "google/api/annotations.proto";
|
20
|
-
|
21
19
|
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
|
22
20
|
option java_multiple_files = true;
|
23
21
|
option java_outer_classname = "EndpointProto";
|
24
22
|
option java_package = "com.google.api";
|
25
23
|
option objc_class_prefix = "GAPI";
|
26
24
|
|
27
|
-
|
28
|
-
//
|
29
|
-
//
|
30
|
-
//
|
31
|
-
// configuration.
|
25
|
+
// `Endpoint` describes a network address of a service that serves a set of
|
26
|
+
// APIs. It is commonly known as a service endpoint. A service may expose
|
27
|
+
// any number of service endpoints, and all service endpoints share the same
|
28
|
+
// service definition, such as quota limits and monitoring metrics.
|
32
29
|
//
|
33
|
-
// Example
|
30
|
+
// Example:
|
34
31
|
//
|
32
|
+
// type: google.api.Service
|
35
33
|
// name: library-example.googleapis.com
|
36
34
|
// endpoints:
|
37
|
-
// #
|
38
|
-
// #
|
39
|
-
// #
|
40
|
-
// #
|
41
|
-
// # allowed to proceed.
|
35
|
+
// # Declares network address `https://library-example.googleapis.com`
|
36
|
+
// # for service `library-example.googleapis.com`. The `https` scheme
|
37
|
+
// # is implicit for all service endpoints. Other schemes may be
|
38
|
+
// # supported in the future.
|
42
39
|
// - name: library-example.googleapis.com
|
40
|
+
// allow_cors: false
|
41
|
+
// - name: content-staging-library-example.googleapis.com
|
42
|
+
// # Allows HTTP OPTIONS calls to be passed to the API frontend, for it
|
43
|
+
// # to decide whether the subsequent cross-origin request is allowed
|
44
|
+
// # to proceed.
|
43
45
|
// allow_cors: true
|
44
46
|
message Endpoint {
|
45
47
|
// The canonical name of this endpoint.
|
46
48
|
string name = 1;
|
47
49
|
|
48
|
-
//
|
49
|
-
//
|
50
|
-
//
|
51
|
-
//
|
52
|
-
// Additional names that this endpoint will be hosted on.
|
50
|
+
// Aliases for this endpoint, these will be served by the same UrlMap as the
|
51
|
+
// parent endpoint, and will be provisioned in the GCP stack for the Regional
|
52
|
+
// Endpoints.
|
53
53
|
repeated string aliases = 2;
|
54
54
|
|
55
|
-
// The list of features enabled on this endpoint.
|
56
|
-
repeated string features = 4;
|
57
|
-
|
58
55
|
// The specification of an Internet routable address of API frontend that will
|
59
|
-
// handle requests to this [API
|
60
|
-
// It should be
|
61
|
-
//
|
56
|
+
// handle requests to this [API
|
57
|
+
// Endpoint](https://cloud.google.com/apis/design/glossary). It should be
|
58
|
+
// either a valid IPv4 address or a fully-qualified domain name. For example,
|
59
|
+
// "8.8.8.8" or "myservice.appspot.com".
|
62
60
|
string target = 101;
|
63
61
|
|
64
62
|
// Allowing
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2024 Google LLC
|
2
2
|
//
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
// you may not use this file except in compliance with the License.
|
@@ -37,7 +37,7 @@ extend google.protobuf.FieldOptions {
|
|
37
37
|
// google.protobuf.Timestamp expire_time = 1
|
38
38
|
// [(google.api.field_behavior) = OUTPUT_ONLY,
|
39
39
|
// (google.api.field_behavior) = IMMUTABLE];
|
40
|
-
repeated google.api.FieldBehavior field_behavior = 1052;
|
40
|
+
repeated google.api.FieldBehavior field_behavior = 1052 [packed = false];
|
41
41
|
}
|
42
42
|
|
43
43
|
// An indicator of the behavior of a given field (for example, that a field
|
@@ -78,7 +78,27 @@ enum FieldBehavior {
|
|
78
78
|
|
79
79
|
// Denotes that a (repeated) field is an unordered list.
|
80
80
|
// This indicates that the service may provide the elements of the list
|
81
|
-
// in any arbitrary
|
81
|
+
// in any arbitrary order, rather than the order the user originally
|
82
82
|
// provided. Additionally, the list's order may or may not be stable.
|
83
83
|
UNORDERED_LIST = 6;
|
84
|
+
|
85
|
+
// Denotes that this field returns a non-empty default value if not set.
|
86
|
+
// This indicates that if the user provides the empty value in a request,
|
87
|
+
// a non-empty value will be returned. The user will not be aware of what
|
88
|
+
// non-empty value to expect.
|
89
|
+
NON_EMPTY_DEFAULT = 7;
|
90
|
+
|
91
|
+
// Denotes that the field in a resource (a message annotated with
|
92
|
+
// google.api.resource) is used in the resource name to uniquely identify the
|
93
|
+
// resource. For AIP-compliant APIs, this should only be applied to the
|
94
|
+
// `name` field on the resource.
|
95
|
+
//
|
96
|
+
// This behavior should not be applied to references to other resources within
|
97
|
+
// the message.
|
98
|
+
//
|
99
|
+
// The identifier field of resources often have different field behavior
|
100
|
+
// depending on the request it is embedded in (e.g. for Create methods name
|
101
|
+
// is optional and unused, while for Update methods it is required). Instead
|
102
|
+
// of method-specific annotations, only `IDENTIFIER` is required.
|
103
|
+
IDENTIFIER = 8;
|
84
104
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2024 Google LLC
|
2
2
|
//
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
// you may not use this file except in compliance with the License.
|
@@ -23,7 +23,6 @@ option java_outer_classname = "HttpProto";
|
|
23
23
|
option java_package = "com.google.api";
|
24
24
|
option objc_class_prefix = "GAPI";
|
25
25
|
|
26
|
-
|
27
26
|
// Defines the HTTP configuration for an API service. It contains a list of
|
28
27
|
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
|
29
28
|
// to one or more HTTP REST API methods.
|
@@ -33,7 +32,7 @@ message Http {
|
|
33
32
|
// **NOTE:** All service configuration rules follow "last one wins" order.
|
34
33
|
repeated HttpRule rules = 1;
|
35
34
|
|
36
|
-
// When set to true, URL path
|
35
|
+
// When set to true, URL path parameters will be fully URI-decoded except in
|
37
36
|
// cases of single segment matches in reserved expansion, where "%2F" will be
|
38
37
|
// left encoded.
|
39
38
|
//
|
@@ -42,94 +41,91 @@ message Http {
|
|
42
41
|
bool fully_decode_reserved_expansion = 2;
|
43
42
|
}
|
44
43
|
|
45
|
-
//
|
46
|
-
//
|
47
|
-
//
|
48
|
-
// HTTP
|
49
|
-
//
|
50
|
-
//
|
51
|
-
//
|
52
|
-
//
|
53
|
-
//
|
54
|
-
//
|
55
|
-
//
|
56
|
-
//
|
44
|
+
// gRPC Transcoding
|
45
|
+
//
|
46
|
+
// gRPC Transcoding is a feature for mapping between a gRPC method and one or
|
47
|
+
// more HTTP REST endpoints. It allows developers to build a single API service
|
48
|
+
// that supports both gRPC APIs and REST APIs. Many systems, including [Google
|
49
|
+
// APIs](https://github.com/googleapis/googleapis),
|
50
|
+
// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
|
51
|
+
// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
|
52
|
+
// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
|
53
|
+
// and use it for large scale production services.
|
54
|
+
//
|
55
|
+
// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
|
56
|
+
// how different portions of the gRPC request message are mapped to the URL
|
57
|
+
// path, URL query parameters, and HTTP request body. It also controls how the
|
58
|
+
// gRPC response message is mapped to the HTTP response body. `HttpRule` is
|
59
|
+
// typically specified as an `google.api.http` annotation on the gRPC method.
|
60
|
+
//
|
61
|
+
// Each mapping specifies a URL path template and an HTTP method. The path
|
62
|
+
// template may refer to one or more fields in the gRPC request message, as long
|
63
|
+
// as each field is a non-repeated field with a primitive (non-message) type.
|
64
|
+
// The path template controls how fields of the request message are mapped to
|
65
|
+
// the URL path.
|
66
|
+
//
|
67
|
+
// Example:
|
57
68
|
//
|
58
69
|
// service Messaging {
|
59
70
|
// rpc GetMessage(GetMessageRequest) returns (Message) {
|
60
|
-
// option (google.api.http)
|
71
|
+
// option (google.api.http) = {
|
72
|
+
// get: "/v1/{name=messages/*}"
|
73
|
+
// };
|
61
74
|
// }
|
62
75
|
// }
|
63
76
|
// message GetMessageRequest {
|
64
|
-
//
|
65
|
-
// string subfield = 1;
|
66
|
-
// }
|
67
|
-
// string message_id = 1; // mapped to the URL
|
68
|
-
// SubMessage sub = 2; // `sub.subfield` is url-mapped
|
77
|
+
// string name = 1; // Mapped to URL path.
|
69
78
|
// }
|
70
79
|
// message Message {
|
71
|
-
// string text = 1; //
|
80
|
+
// string text = 1; // The resource content.
|
72
81
|
// }
|
73
82
|
//
|
74
|
-
//
|
75
|
-
// `GRPC API Configuration` YAML file.
|
83
|
+
// This enables an HTTP REST to gRPC mapping as below:
|
76
84
|
//
|
77
|
-
//
|
78
|
-
//
|
79
|
-
// - selector: <proto_package_name>.Messaging.GetMessage
|
80
|
-
// get: /v1/messages/{message_id}/{sub.subfield}
|
81
|
-
//
|
82
|
-
// This definition enables an automatic, bidrectional mapping of HTTP
|
83
|
-
// JSON to RPC. Example:
|
84
|
-
//
|
85
|
-
// HTTP | RPC
|
86
|
-
// -----|-----
|
87
|
-
// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
|
88
|
-
//
|
89
|
-
// In general, not only fields but also field paths can be referenced
|
90
|
-
// from a path pattern. Fields mapped to the path pattern cannot be
|
91
|
-
// repeated and must have a primitive (non-message) type.
|
92
|
-
//
|
93
|
-
// Any fields in the request message which are not bound by the path
|
94
|
-
// pattern automatically become (optional) HTTP query
|
95
|
-
// parameters. Assume the following definition of the request message:
|
85
|
+
// - HTTP: `GET /v1/messages/123456`
|
86
|
+
// - gRPC: `GetMessage(name: "messages/123456")`
|
96
87
|
//
|
88
|
+
// Any fields in the request message which are not bound by the path template
|
89
|
+
// automatically become HTTP query parameters if there is no HTTP request body.
|
90
|
+
// For example:
|
97
91
|
//
|
98
92
|
// service Messaging {
|
99
93
|
// rpc GetMessage(GetMessageRequest) returns (Message) {
|
100
|
-
// option (google.api.http)
|
94
|
+
// option (google.api.http) = {
|
95
|
+
// get:"/v1/messages/{message_id}"
|
96
|
+
// };
|
101
97
|
// }
|
102
98
|
// }
|
103
99
|
// message GetMessageRequest {
|
104
100
|
// message SubMessage {
|
105
101
|
// string subfield = 1;
|
106
102
|
// }
|
107
|
-
// string message_id = 1; //
|
108
|
-
// int64 revision = 2; //
|
109
|
-
// SubMessage sub = 3; // `sub.subfield
|
103
|
+
// string message_id = 1; // Mapped to URL path.
|
104
|
+
// int64 revision = 2; // Mapped to URL query parameter `revision`.
|
105
|
+
// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
|
110
106
|
// }
|
111
107
|
//
|
112
|
-
//
|
113
108
|
// This enables a HTTP JSON to RPC mapping as below:
|
114
109
|
//
|
115
|
-
// HTTP
|
116
|
-
//
|
117
|
-
//
|
110
|
+
// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
|
111
|
+
// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
|
112
|
+
// SubMessage(subfield: "foo"))`
|
118
113
|
//
|
119
|
-
// Note that fields which are mapped to
|
120
|
-
// primitive type or a repeated primitive type
|
121
|
-
//
|
122
|
-
//
|
114
|
+
// Note that fields which are mapped to URL query parameters must have a
|
115
|
+
// primitive type or a repeated primitive type or a non-repeated message type.
|
116
|
+
// In the case of a repeated type, the parameter can be repeated in the URL
|
117
|
+
// as `...?param=A¶m=B`. In the case of a message type, each field of the
|
118
|
+
// message is mapped to a separate parameter, such as
|
119
|
+
// `...?foo.a=A&foo.b=B&foo.c=C`.
|
123
120
|
//
|
124
|
-
// For HTTP
|
121
|
+
// For HTTP methods that allow a request body, the `body` field
|
125
122
|
// specifies the mapping. Consider a REST update method on the
|
126
123
|
// message resource collection:
|
127
124
|
//
|
128
|
-
//
|
129
125
|
// service Messaging {
|
130
126
|
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
|
131
127
|
// option (google.api.http) = {
|
132
|
-
//
|
128
|
+
// patch: "/v1/messages/{message_id}"
|
133
129
|
// body: "message"
|
134
130
|
// };
|
135
131
|
// }
|
@@ -139,14 +135,12 @@ message Http {
|
|
139
135
|
// Message message = 2; // mapped to the body
|
140
136
|
// }
|
141
137
|
//
|
142
|
-
//
|
143
138
|
// The following HTTP JSON to RPC mapping is enabled, where the
|
144
139
|
// representation of the JSON in the request body is determined by
|
145
140
|
// protos JSON encoding:
|
146
141
|
//
|
147
|
-
// HTTP
|
148
|
-
//
|
149
|
-
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
|
142
|
+
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
143
|
+
// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
|
150
144
|
//
|
151
145
|
// The special name `*` can be used in the body mapping to define that
|
152
146
|
// every field not bound by the path template should be mapped to the
|
@@ -156,7 +150,7 @@ message Http {
|
|
156
150
|
// service Messaging {
|
157
151
|
// rpc UpdateMessage(Message) returns (Message) {
|
158
152
|
// option (google.api.http) = {
|
159
|
-
//
|
153
|
+
// patch: "/v1/messages/{message_id}"
|
160
154
|
// body: "*"
|
161
155
|
// };
|
162
156
|
// }
|
@@ -169,13 +163,12 @@ message Http {
|
|
169
163
|
//
|
170
164
|
// The following HTTP JSON to RPC mapping is enabled:
|
171
165
|
//
|
172
|
-
// HTTP
|
173
|
-
//
|
174
|
-
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
|
166
|
+
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
167
|
+
// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
|
175
168
|
//
|
176
169
|
// Note that when using `*` in the body mapping, it is not possible to
|
177
170
|
// have HTTP parameters, as all fields not bound by the path end in
|
178
|
-
// the body. This makes this option more rarely used in practice
|
171
|
+
// the body. This makes this option more rarely used in practice when
|
179
172
|
// defining REST APIs. The common usage of `*` is in custom methods
|
180
173
|
// which don't use the URL at all for transferring data.
|
181
174
|
//
|
@@ -197,32 +190,34 @@ message Http {
|
|
197
190
|
// string user_id = 2;
|
198
191
|
// }
|
199
192
|
//
|
193
|
+
// This enables the following two alternative HTTP JSON to RPC mappings:
|
200
194
|
//
|
201
|
-
//
|
202
|
-
//
|
203
|
-
//
|
204
|
-
// HTTP | RPC
|
205
|
-
// -----|-----
|
206
|
-
// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
|
207
|
-
// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
|
195
|
+
// - HTTP: `GET /v1/messages/123456`
|
196
|
+
// - gRPC: `GetMessage(message_id: "123456")`
|
208
197
|
//
|
209
|
-
//
|
198
|
+
// - HTTP: `GET /v1/users/me/messages/123456`
|
199
|
+
// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
|
210
200
|
//
|
211
|
-
//
|
212
|
-
// to the request message are as follows:
|
201
|
+
// Rules for HTTP mapping
|
213
202
|
//
|
214
|
-
// 1.
|
215
|
-
//
|
216
|
-
//
|
217
|
-
//
|
218
|
-
//
|
219
|
-
//
|
220
|
-
//
|
221
|
-
//
|
222
|
-
//
|
223
|
-
//
|
203
|
+
// 1. Leaf request fields (recursive expansion nested messages in the request
|
204
|
+
// message) are classified into three categories:
|
205
|
+
// - Fields referred by the path template. They are passed via the URL path.
|
206
|
+
// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
|
207
|
+
// are passed via the HTTP
|
208
|
+
// request body.
|
209
|
+
// - All other fields are passed via the URL query parameters, and the
|
210
|
+
// parameter name is the field path in the request message. A repeated
|
211
|
+
// field can be represented as multiple query parameters under the same
|
212
|
+
// name.
|
213
|
+
// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
|
214
|
+
// query parameter, all fields
|
215
|
+
// are passed via URL path and HTTP request body.
|
216
|
+
// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
|
217
|
+
// request body, all
|
218
|
+
// fields are passed via URL path and URL query parameters.
|
224
219
|
//
|
225
|
-
//
|
220
|
+
// Path template syntax
|
226
221
|
//
|
227
222
|
// Template = "/" Segments [ Verb ] ;
|
228
223
|
// Segments = Segment { "/" Segment } ;
|
@@ -231,57 +226,110 @@ message Http {
|
|
231
226
|
// FieldPath = IDENT { "." IDENT } ;
|
232
227
|
// Verb = ":" LITERAL ;
|
233
228
|
//
|
234
|
-
// The syntax `*` matches a single path segment. The syntax `**` matches
|
235
|
-
// or more path segments, which must be the last part of the path
|
236
|
-
// `Verb`.
|
229
|
+
// The syntax `*` matches a single URL path segment. The syntax `**` matches
|
230
|
+
// zero or more URL path segments, which must be the last part of the URL path
|
231
|
+
// except the `Verb`.
|
237
232
|
//
|
238
233
|
// The syntax `Variable` matches part of the URL path as specified by its
|
239
234
|
// template. A variable template must not contain other variables. If a variable
|
240
235
|
// matches a single path segment, its template may be omitted, e.g. `{var}`
|
241
236
|
// is equivalent to `{var=*}`.
|
242
237
|
//
|
238
|
+
// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
|
239
|
+
// contains any reserved character, such characters should be percent-encoded
|
240
|
+
// before the matching.
|
241
|
+
//
|
243
242
|
// If a variable contains exactly one path segment, such as `"{var}"` or
|
244
|
-
// `"{var=*}"`, when such a variable is expanded into a URL path
|
245
|
-
// except `[-_.~0-9a-zA-Z]` are percent-encoded.
|
246
|
-
//
|
247
|
-
//
|
248
|
-
//
|
249
|
-
//
|
250
|
-
//
|
251
|
-
//
|
252
|
-
//
|
253
|
-
//
|
254
|
-
//
|
255
|
-
//
|
256
|
-
//
|
243
|
+
// `"{var=*}"`, when such a variable is expanded into a URL path on the client
|
244
|
+
// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
|
245
|
+
// server side does the reverse decoding. Such variables show up in the
|
246
|
+
// [Discovery
|
247
|
+
// Document](https://developers.google.com/discovery/v1/reference/apis) as
|
248
|
+
// `{var}`.
|
249
|
+
//
|
250
|
+
// If a variable contains multiple path segments, such as `"{var=foo/*}"`
|
251
|
+
// or `"{var=**}"`, when such a variable is expanded into a URL path on the
|
252
|
+
// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
|
253
|
+
// The server side does the reverse decoding, except "%2F" and "%2f" are left
|
254
|
+
// unchanged. Such variables show up in the
|
255
|
+
// [Discovery
|
256
|
+
// Document](https://developers.google.com/discovery/v1/reference/apis) as
|
257
|
+
// `{+var}`.
|
258
|
+
//
|
259
|
+
// Using gRPC API Service Configuration
|
260
|
+
//
|
261
|
+
// gRPC API Service Configuration (service config) is a configuration language
|
262
|
+
// for configuring a gRPC service to become a user-facing product. The
|
263
|
+
// service config is simply the YAML representation of the `google.api.Service`
|
264
|
+
// proto message.
|
265
|
+
//
|
266
|
+
// As an alternative to annotating your proto file, you can configure gRPC
|
267
|
+
// transcoding in your service config YAML files. You do this by specifying a
|
268
|
+
// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
|
269
|
+
// effect as the proto annotation. This can be particularly useful if you
|
270
|
+
// have a proto that is reused in multiple services. Note that any transcoding
|
271
|
+
// specified in the service config will override any matching transcoding
|
272
|
+
// configuration in the proto.
|
273
|
+
//
|
274
|
+
// The following example selects a gRPC method and applies an `HttpRule` to it:
|
275
|
+
//
|
276
|
+
// http:
|
277
|
+
// rules:
|
278
|
+
// - selector: example.v1.Messaging.GetMessage
|
279
|
+
// get: /v1/messages/{message_id}/{sub.subfield}
|
280
|
+
//
|
281
|
+
// Special notes
|
282
|
+
//
|
283
|
+
// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
|
284
|
+
// proto to JSON conversion must follow the [proto3
|
285
|
+
// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
286
|
+
//
|
287
|
+
// While the single segment variable follows the semantics of
|
288
|
+
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
|
289
|
+
// Expansion, the multi segment variable **does not** follow RFC 6570 Section
|
290
|
+
// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
|
257
291
|
// does not expand special characters like `?` and `#`, which would lead
|
258
|
-
// to invalid URLs.
|
292
|
+
// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
|
293
|
+
// for multi segment variables.
|
294
|
+
//
|
295
|
+
// The path variables **must not** refer to any repeated or mapped field,
|
296
|
+
// because client libraries are not capable of handling such variable expansion.
|
259
297
|
//
|
260
|
-
//
|
261
|
-
//
|
298
|
+
// The path variables **must not** capture the leading "/" character. The reason
|
299
|
+
// is that the most common use case "{var}" does not capture the leading "/"
|
300
|
+
// character. For consistency, all path variables must share the same behavior.
|
301
|
+
//
|
302
|
+
// Repeated message fields must not be mapped to URL query parameters, because
|
303
|
+
// no client library can support such complicated mapping.
|
304
|
+
//
|
305
|
+
// If an API needs to use a JSON array for request or response body, it can map
|
306
|
+
// the request or response body to a repeated field. However, some gRPC
|
307
|
+
// Transcoding implementations may not support this feature.
|
262
308
|
message HttpRule {
|
263
|
-
// Selects
|
309
|
+
// Selects a method to which this rule applies.
|
264
310
|
//
|
265
|
-
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
311
|
+
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
312
|
+
// details.
|
266
313
|
string selector = 1;
|
267
314
|
|
268
315
|
// Determines the URL pattern is matched by this rules. This pattern can be
|
269
316
|
// used with any of the {get|put|post|delete|patch} methods. A custom method
|
270
317
|
// can be defined using the 'custom' field.
|
271
318
|
oneof pattern {
|
272
|
-
// Used for listing and getting information about
|
319
|
+
// Maps to HTTP GET. Used for listing and getting information about
|
320
|
+
// resources.
|
273
321
|
string get = 2;
|
274
322
|
|
275
|
-
// Used for
|
323
|
+
// Maps to HTTP PUT. Used for replacing a resource.
|
276
324
|
string put = 3;
|
277
325
|
|
278
|
-
// Used for creating a resource.
|
326
|
+
// Maps to HTTP POST. Used for creating a resource or performing an action.
|
279
327
|
string post = 4;
|
280
328
|
|
281
|
-
// Used for deleting a resource.
|
329
|
+
// Maps to HTTP DELETE. Used for deleting a resource.
|
282
330
|
string delete = 5;
|
283
331
|
|
284
|
-
// Used for updating a resource.
|
332
|
+
// Maps to HTTP PATCH. Used for updating a resource.
|
285
333
|
string patch = 6;
|
286
334
|
|
287
335
|
// The custom pattern is used for specifying an HTTP method that is not
|
@@ -291,15 +339,20 @@ message HttpRule {
|
|
291
339
|
CustomHttpPattern custom = 8;
|
292
340
|
}
|
293
341
|
|
294
|
-
// The name of the request field whose value is mapped to the HTTP
|
295
|
-
// `*` for mapping all fields not captured by the path
|
296
|
-
//
|
297
|
-
//
|
342
|
+
// The name of the request field whose value is mapped to the HTTP request
|
343
|
+
// body, or `*` for mapping all request fields not captured by the path
|
344
|
+
// pattern to the HTTP body, or omitted for not having any HTTP request body.
|
345
|
+
//
|
346
|
+
// NOTE: the referred field must be present at the top-level of the request
|
347
|
+
// message type.
|
298
348
|
string body = 7;
|
299
349
|
|
300
350
|
// Optional. The name of the response field whose value is mapped to the HTTP
|
301
|
-
// body
|
302
|
-
//
|
351
|
+
// response body. When omitted, the entire response message will be used
|
352
|
+
// as the HTTP response body.
|
353
|
+
//
|
354
|
+
// NOTE: The referred field must be present at the top-level of the response
|
355
|
+
// message type.
|
303
356
|
string response_body = 12;
|
304
357
|
|
305
358
|
// Additional HTTP bindings for the selector. Nested bindings must
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2024 Google LLC
|
2
2
|
//
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
// you may not use this file except in compliance with the License.
|
@@ -18,13 +18,13 @@ package google.api;
|
|
18
18
|
|
19
19
|
import "google/protobuf/any.proto";
|
20
20
|
|
21
|
+
option cc_enable_arenas = true;
|
21
22
|
option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
|
22
23
|
option java_multiple_files = true;
|
23
24
|
option java_outer_classname = "HttpBodyProto";
|
24
25
|
option java_package = "com.google.api";
|
25
26
|
option objc_class_prefix = "GAPI";
|
26
27
|
|
27
|
-
|
28
28
|
// Message that represents an arbitrary HTTP body. It should only be used for
|
29
29
|
// payload formats that can't be represented as JSON, such as raw binary or
|
30
30
|
// an HTML page.
|
@@ -45,11 +45,15 @@ option objc_class_prefix = "GAPI";
|
|
45
45
|
//
|
46
46
|
// // The raw HTTP body is bound to this field.
|
47
47
|
// google.api.HttpBody http_body = 2;
|
48
|
+
//
|
48
49
|
// }
|
49
50
|
//
|
50
51
|
// service ResourceService {
|
51
|
-
// rpc GetResource(GetResourceRequest)
|
52
|
-
//
|
52
|
+
// rpc GetResource(GetResourceRequest)
|
53
|
+
// returns (google.api.HttpBody);
|
54
|
+
// rpc UpdateResource(google.api.HttpBody)
|
55
|
+
// returns (google.protobuf.Empty);
|
56
|
+
//
|
53
57
|
// }
|
54
58
|
//
|
55
59
|
// Example with streaming methods:
|
@@ -59,15 +63,16 @@ option objc_class_prefix = "GAPI";
|
|
59
63
|
// returns (stream google.api.HttpBody);
|
60
64
|
// rpc UpdateCalendar(stream google.api.HttpBody)
|
61
65
|
// returns (stream google.api.HttpBody);
|
66
|
+
//
|
62
67
|
// }
|
63
68
|
//
|
64
69
|
// Use of this type only changes how the request and response bodies are
|
65
70
|
// handled, all other features will continue to work unchanged.
|
66
71
|
message HttpBody {
|
67
|
-
// The HTTP Content-Type
|
72
|
+
// The HTTP Content-Type header value specifying the content type of the body.
|
68
73
|
string content_type = 1;
|
69
74
|
|
70
|
-
// HTTP body binary
|
75
|
+
// The HTTP request/response body as raw binary.
|
71
76
|
bytes data = 2;
|
72
77
|
|
73
78
|
// Application specific response metadata. Must be set in the first response
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2024 Google LLC
|
2
2
|
//
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
// you may not use this file except in compliance with the License.
|
@@ -23,7 +23,6 @@ option java_outer_classname = "LabelProto";
|
|
23
23
|
option java_package = "com.google.api";
|
24
24
|
option objc_class_prefix = "GAPI";
|
25
25
|
|
26
|
-
|
27
26
|
// A description of a label.
|
28
27
|
message LabelDescriptor {
|
29
28
|
// Value types that can be used as label values.
|