@diia-inhouse/types 11.4.0 → 11.4.2

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.
@@ -1,378 +0,0 @@
1
- // Copyright 2023 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.api;
18
-
19
- option cc_enable_arenas = true;
20
- option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
21
- option java_multiple_files = true;
22
- option java_outer_classname = "HttpProto";
23
- option java_package = "com.google.api";
24
- option objc_class_prefix = "GAPI";
25
-
26
- // Defines the HTTP configuration for an API service. It contains a list of
27
- // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
28
- // to one or more HTTP REST API methods.
29
- message Http {
30
- // A list of HTTP configuration rules that apply to individual API methods.
31
- //
32
- // **NOTE:** All service configuration rules follow "last one wins" order.
33
- repeated HttpRule rules = 1;
34
-
35
- // When set to true, URL path parameters will be fully URI-decoded except in
36
- // cases of single segment matches in reserved expansion, where "%2F" will be
37
- // left encoded.
38
- //
39
- // The default behavior is to not decode RFC 6570 reserved characters in multi
40
- // segment matches.
41
- bool fully_decode_reserved_expansion = 2;
42
- }
43
-
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 Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
51
- // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
52
- // and use it for large scale production services.
53
- //
54
- // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
55
- // how different portions of the gRPC request message are mapped to the URL
56
- // path, URL query parameters, and HTTP request body. It also controls how the
57
- // gRPC response message is mapped to the HTTP response body. `HttpRule` is
58
- // typically specified as an `google.api.http` annotation on the gRPC method.
59
- //
60
- // Each mapping specifies a URL path template and an HTTP method. The path
61
- // template may refer to one or more fields in the gRPC request message, as long
62
- // as each field is a non-repeated field with a primitive (non-message) type.
63
- // The path template controls how fields of the request message are mapped to
64
- // the URL path.
65
- //
66
- // Example:
67
- //
68
- // service Messaging {
69
- // rpc GetMessage(GetMessageRequest) returns (Message) {
70
- // option (google.api.http) = {
71
- // get: "/v1/{name=messages/*}"
72
- // };
73
- // }
74
- // }
75
- // message GetMessageRequest {
76
- // string name = 1; // Mapped to URL path.
77
- // }
78
- // message Message {
79
- // string text = 1; // The resource content.
80
- // }
81
- //
82
- // This enables an HTTP REST to gRPC mapping as below:
83
- //
84
- // HTTP | gRPC
85
- // -----|-----
86
- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
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:
91
- //
92
- // service Messaging {
93
- // rpc GetMessage(GetMessageRequest) returns (Message) {
94
- // option (google.api.http) = {
95
- // get:"/v1/messages/{message_id}"
96
- // };
97
- // }
98
- // }
99
- // message GetMessageRequest {
100
- // message SubMessage {
101
- // string subfield = 1;
102
- // }
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`.
106
- // }
107
- //
108
- // This enables a HTTP JSON to RPC mapping as below:
109
- //
110
- // HTTP | gRPC
111
- // -----|-----
112
- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
113
- // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
114
- // "foo"))`
115
- //
116
- // Note that fields which are mapped to URL query parameters must have a
117
- // primitive type or a repeated primitive type or a non-repeated message type.
118
- // In the case of a repeated type, the parameter can be repeated in the URL
119
- // as `...?param=A&param=B`. In the case of a message type, each field of the
120
- // message is mapped to a separate parameter, such as
121
- // `...?foo.a=A&foo.b=B&foo.c=C`.
122
- //
123
- // For HTTP methods that allow a request body, the `body` field
124
- // specifies the mapping. Consider a REST update method on the
125
- // message resource collection:
126
- //
127
- // service Messaging {
128
- // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
129
- // option (google.api.http) = {
130
- // patch: "/v1/messages/{message_id}"
131
- // body: "message"
132
- // };
133
- // }
134
- // }
135
- // message UpdateMessageRequest {
136
- // string message_id = 1; // mapped to the URL
137
- // Message message = 2; // mapped to the body
138
- // }
139
- //
140
- // The following HTTP JSON to RPC mapping is enabled, where the
141
- // representation of the JSON in the request body is determined by
142
- // protos JSON encoding:
143
- //
144
- // HTTP | gRPC
145
- // -----|-----
146
- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
147
- // "123456" message { text: "Hi!" })`
148
- //
149
- // The special name `*` can be used in the body mapping to define that
150
- // every field not bound by the path template should be mapped to the
151
- // request body. This enables the following alternative definition of
152
- // the update method:
153
- //
154
- // service Messaging {
155
- // rpc UpdateMessage(Message) returns (Message) {
156
- // option (google.api.http) = {
157
- // patch: "/v1/messages/{message_id}"
158
- // body: "*"
159
- // };
160
- // }
161
- // }
162
- // message Message {
163
- // string message_id = 1;
164
- // string text = 2;
165
- // }
166
- //
167
- //
168
- // The following HTTP JSON to RPC mapping is enabled:
169
- //
170
- // HTTP | gRPC
171
- // -----|-----
172
- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
173
- // "123456" text: "Hi!")`
174
- //
175
- // Note that when using `*` in the body mapping, it is not possible to
176
- // have HTTP parameters, as all fields not bound by the path end in
177
- // the body. This makes this option more rarely used in practice when
178
- // defining REST APIs. The common usage of `*` is in custom methods
179
- // which don't use the URL at all for transferring data.
180
- //
181
- // It is possible to define multiple HTTP methods for one RPC by using
182
- // the `additional_bindings` option. Example:
183
- //
184
- // service Messaging {
185
- // rpc GetMessage(GetMessageRequest) returns (Message) {
186
- // option (google.api.http) = {
187
- // get: "/v1/messages/{message_id}"
188
- // additional_bindings {
189
- // get: "/v1/users/{user_id}/messages/{message_id}"
190
- // }
191
- // };
192
- // }
193
- // }
194
- // message GetMessageRequest {
195
- // string message_id = 1;
196
- // string user_id = 2;
197
- // }
198
- //
199
- // This enables the following two alternative HTTP JSON to RPC mappings:
200
- //
201
- // HTTP | gRPC
202
- // -----|-----
203
- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
204
- // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
205
- // "123456")`
206
- //
207
- // ## Rules for HTTP mapping
208
- //
209
- // 1. Leaf request fields (recursive expansion nested messages in the request
210
- // message) are classified into three categories:
211
- // - Fields referred by the path template. They are passed via the URL path.
212
- // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
213
- // are passed via the HTTP
214
- // request body.
215
- // - All other fields are passed via the URL query parameters, and the
216
- // parameter name is the field path in the request message. A repeated
217
- // field can be represented as multiple query parameters under the same
218
- // name.
219
- // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
220
- // query parameter, all fields
221
- // are passed via URL path and HTTP request body.
222
- // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
223
- // request body, all
224
- // fields are passed via URL path and URL query parameters.
225
- //
226
- // ### Path template syntax
227
- //
228
- // Template = "/" Segments [ Verb ] ;
229
- // Segments = Segment { "/" Segment } ;
230
- // Segment = "*" | "**" | LITERAL | Variable ;
231
- // Variable = "{" FieldPath [ "=" Segments ] "}" ;
232
- // FieldPath = IDENT { "." IDENT } ;
233
- // Verb = ":" LITERAL ;
234
- //
235
- // The syntax `*` matches a single URL path segment. The syntax `**` matches
236
- // zero or more URL path segments, which must be the last part of the URL path
237
- // except the `Verb`.
238
- //
239
- // The syntax `Variable` matches part of the URL path as specified by its
240
- // template. A variable template must not contain other variables. If a variable
241
- // matches a single path segment, its template may be omitted, e.g. `{var}`
242
- // is equivalent to `{var=*}`.
243
- //
244
- // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
245
- // contains any reserved character, such characters should be percent-encoded
246
- // before the matching.
247
- //
248
- // If a variable contains exactly one path segment, such as `"{var}"` or
249
- // `"{var=*}"`, when such a variable is expanded into a URL path on the client
250
- // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
251
- // server side does the reverse decoding. Such variables show up in the
252
- // [Discovery
253
- // Document](https://developers.google.com/discovery/v1/reference/apis) as
254
- // `{var}`.
255
- //
256
- // If a variable contains multiple path segments, such as `"{var=foo/*}"`
257
- // or `"{var=**}"`, when such a variable is expanded into a URL path on the
258
- // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
259
- // The server side does the reverse decoding, except "%2F" and "%2f" are left
260
- // unchanged. Such variables show up in the
261
- // [Discovery
262
- // Document](https://developers.google.com/discovery/v1/reference/apis) as
263
- // `{+var}`.
264
- //
265
- // ## Using gRPC API Service Configuration
266
- //
267
- // gRPC API Service Configuration (service config) is a configuration language
268
- // for configuring a gRPC service to become a user-facing product. The
269
- // service config is simply the YAML representation of the `google.api.Service`
270
- // proto message.
271
- //
272
- // As an alternative to annotating your proto file, you can configure gRPC
273
- // transcoding in your service config YAML files. You do this by specifying a
274
- // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
275
- // effect as the proto annotation. This can be particularly useful if you
276
- // have a proto that is reused in multiple services. Note that any transcoding
277
- // specified in the service config will override any matching transcoding
278
- // configuration in the proto.
279
- //
280
- // Example:
281
- //
282
- // http:
283
- // rules:
284
- // # Selects a gRPC method and applies HttpRule to it.
285
- // - selector: example.v1.Messaging.GetMessage
286
- // get: /v1/messages/{message_id}/{sub.subfield}
287
- //
288
- // ## Special notes
289
- //
290
- // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
291
- // proto to JSON conversion must follow the [proto3
292
- // specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
293
- //
294
- // While the single segment variable follows the semantics of
295
- // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
296
- // Expansion, the multi segment variable **does not** follow RFC 6570 Section
297
- // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
298
- // does not expand special characters like `?` and `#`, which would lead
299
- // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
300
- // for multi segment variables.
301
- //
302
- // The path variables **must not** refer to any repeated or mapped field,
303
- // because client libraries are not capable of handling such variable expansion.
304
- //
305
- // The path variables **must not** capture the leading "/" character. The reason
306
- // is that the most common use case "{var}" does not capture the leading "/"
307
- // character. For consistency, all path variables must share the same behavior.
308
- //
309
- // Repeated message fields must not be mapped to URL query parameters, because
310
- // no client library can support such complicated mapping.
311
- //
312
- // If an API needs to use a JSON array for request or response body, it can map
313
- // the request or response body to a repeated field. However, some gRPC
314
- // Transcoding implementations may not support this feature.
315
- message HttpRule {
316
- // Selects a method to which this rule applies.
317
- //
318
- // Refer to [selector][google.api.DocumentationRule.selector] for syntax
319
- // details.
320
- string selector = 1;
321
-
322
- // Determines the URL pattern is matched by this rules. This pattern can be
323
- // used with any of the {get|put|post|delete|patch} methods. A custom method
324
- // can be defined using the 'custom' field.
325
- oneof pattern {
326
- // Maps to HTTP GET. Used for listing and getting information about
327
- // resources.
328
- string get = 2;
329
-
330
- // Maps to HTTP PUT. Used for replacing a resource.
331
- string put = 3;
332
-
333
- // Maps to HTTP POST. Used for creating a resource or performing an action.
334
- string post = 4;
335
-
336
- // Maps to HTTP DELETE. Used for deleting a resource.
337
- string delete = 5;
338
-
339
- // Maps to HTTP PATCH. Used for updating a resource.
340
- string patch = 6;
341
-
342
- // The custom pattern is used for specifying an HTTP method that is not
343
- // included in the `pattern` field, such as HEAD, or "*" to leave the
344
- // HTTP method unspecified for this rule. The wild-card rule is useful
345
- // for services that provide content to Web (HTML) clients.
346
- CustomHttpPattern custom = 8;
347
- }
348
-
349
- // The name of the request field whose value is mapped to the HTTP request
350
- // body, or `*` for mapping all request fields not captured by the path
351
- // pattern to the HTTP body, or omitted for not having any HTTP request body.
352
- //
353
- // NOTE: the referred field must be present at the top-level of the request
354
- // message type.
355
- string body = 7;
356
-
357
- // Optional. The name of the response field whose value is mapped to the HTTP
358
- // response body. When omitted, the entire response message will be used
359
- // as the HTTP response body.
360
- //
361
- // NOTE: The referred field must be present at the top-level of the response
362
- // message type.
363
- string response_body = 12;
364
-
365
- // Additional HTTP bindings for the selector. Nested bindings must
366
- // not contain an `additional_bindings` field themselves (that is,
367
- // the nesting may only be one level deep).
368
- repeated HttpRule additional_bindings = 11;
369
- }
370
-
371
- // A custom pattern is used for defining custom HTTP verb.
372
- message CustomHttpPattern {
373
- // The name of this custom HTTP verb.
374
- string kind = 1;
375
-
376
- // The path matched by this custom verb.
377
- string path = 2;
378
- }
@@ -1,81 +0,0 @@
1
- // Copyright 2023 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.api;
18
-
19
- import "google/protobuf/any.proto";
20
-
21
- option cc_enable_arenas = true;
22
- option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
23
- option java_multiple_files = true;
24
- option java_outer_classname = "HttpBodyProto";
25
- option java_package = "com.google.api";
26
- option objc_class_prefix = "GAPI";
27
-
28
- // Message that represents an arbitrary HTTP body. It should only be used for
29
- // payload formats that can't be represented as JSON, such as raw binary or
30
- // an HTML page.
31
- //
32
- //
33
- // This message can be used both in streaming and non-streaming API methods in
34
- // the request as well as the response.
35
- //
36
- // It can be used as a top-level request field, which is convenient if one
37
- // wants to extract parameters from either the URL or HTTP template into the
38
- // request fields and also want access to the raw HTTP body.
39
- //
40
- // Example:
41
- //
42
- // message GetResourceRequest {
43
- // // A unique request id.
44
- // string request_id = 1;
45
- //
46
- // // The raw HTTP body is bound to this field.
47
- // google.api.HttpBody http_body = 2;
48
- //
49
- // }
50
- //
51
- // service ResourceService {
52
- // rpc GetResource(GetResourceRequest)
53
- // returns (google.api.HttpBody);
54
- // rpc UpdateResource(google.api.HttpBody)
55
- // returns (google.protobuf.Empty);
56
- //
57
- // }
58
- //
59
- // Example with streaming methods:
60
- //
61
- // service CaldavService {
62
- // rpc GetCalendar(stream google.api.HttpBody)
63
- // returns (stream google.api.HttpBody);
64
- // rpc UpdateCalendar(stream google.api.HttpBody)
65
- // returns (stream google.api.HttpBody);
66
- //
67
- // }
68
- //
69
- // Use of this type only changes how the request and response bodies are
70
- // handled, all other features will continue to work unchanged.
71
- message HttpBody {
72
- // The HTTP Content-Type header value specifying the content type of the body.
73
- string content_type = 1;
74
-
75
- // The HTTP request/response body as raw binary.
76
- bytes data = 2;
77
-
78
- // Application specific response metadata. Must be set in the first response
79
- // for streaming APIs.
80
- repeated google.protobuf.Any extensions = 3;
81
- }
@@ -1,18 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "google.api";
3
- export interface Stub {
4
- }
5
- export declare const Stub: MessageFns<Stub>;
6
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
7
- export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
8
- [K in keyof T]?: DeepPartial<T[K]>;
9
- } : Partial<T>;
10
- export interface MessageFns<T> {
11
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
12
- decode(input: BinaryReader | Uint8Array, length?: number): T;
13
- fromJSON(object: any): T;
14
- toJSON(message: T): unknown;
15
- create(base?: DeepPartial<T>): T;
16
- fromPartial(object: DeepPartial<T>): T;
17
- }
18
- export {};