@agoric/cosmic-proto 0.3.1-upgrade-14-dev-c8f9e7b.0 → 0.4.1-orchestration-dev-096c4e8.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.
Files changed (167) hide show
  1. package/README.md +220 -6
  2. package/dist/codegen/agoric/bundle.d.ts +1006 -0
  3. package/dist/codegen/agoric/bundle.js +71 -0
  4. package/dist/codegen/agoric/bundle.js.map +1 -0
  5. package/dist/codegen/agoric/client.d.ts +47 -0
  6. package/dist/codegen/agoric/client.js +36 -0
  7. package/dist/codegen/agoric/client.js.map +1 -0
  8. package/dist/codegen/agoric/lien/genesis.d.ts +77 -0
  9. package/dist/codegen/agoric/lien/genesis.js +179 -0
  10. package/dist/codegen/agoric/lien/genesis.js.map +1 -0
  11. package/dist/codegen/agoric/lien/lien.d.ts +51 -0
  12. package/dist/codegen/agoric/lien/lien.js +111 -0
  13. package/dist/codegen/agoric/lien/lien.js.map +1 -0
  14. package/dist/codegen/agoric/rpc.query.d.ts +21 -0
  15. package/dist/codegen/agoric/rpc.query.js +15 -0
  16. package/dist/codegen/agoric/rpc.query.js.map +1 -0
  17. package/dist/codegen/agoric/rpc.tx.d.ts +9 -0
  18. package/dist/codegen/agoric/rpc.tx.js +7 -0
  19. package/dist/codegen/agoric/rpc.tx.js.map +1 -0
  20. package/dist/codegen/agoric/swingset/genesis.d.ts +79 -0
  21. package/dist/codegen/agoric/swingset/genesis.js +213 -0
  22. package/dist/codegen/agoric/swingset/genesis.js.map +1 -0
  23. package/dist/codegen/agoric/swingset/msgs.amino.d.ts +28 -0
  24. package/dist/codegen/agoric/swingset/msgs.amino.js +30 -0
  25. package/dist/codegen/agoric/swingset/msgs.amino.js.map +1 -0
  26. package/dist/codegen/agoric/swingset/msgs.d.ts +406 -0
  27. package/dist/codegen/agoric/swingset/msgs.js +896 -0
  28. package/dist/codegen/agoric/swingset/msgs.js.map +1 -0
  29. package/dist/codegen/agoric/swingset/msgs.registry.d.ts +116 -0
  30. package/dist/codegen/agoric/swingset/msgs.registry.js +176 -0
  31. package/dist/codegen/agoric/swingset/msgs.registry.js.map +1 -0
  32. package/dist/codegen/agoric/swingset/msgs.rpc.msg.d.ts +24 -0
  33. package/dist/codegen/agoric/swingset/msgs.rpc.msg.js +39 -0
  34. package/dist/codegen/agoric/swingset/msgs.rpc.msg.js.map +1 -0
  35. package/dist/codegen/agoric/swingset/query.d.ts +205 -0
  36. package/dist/codegen/agoric/swingset/query.js +441 -0
  37. package/dist/codegen/agoric/swingset/query.js.map +1 -0
  38. package/dist/codegen/agoric/swingset/query.rpc.Query.d.ts +24 -0
  39. package/dist/codegen/agoric/swingset/query.rpc.Query.js +43 -0
  40. package/dist/codegen/agoric/swingset/query.rpc.Query.js.map +1 -0
  41. package/dist/codegen/agoric/swingset/swingset.d.ts +499 -0
  42. package/dist/codegen/agoric/swingset/swingset.js +945 -0
  43. package/dist/codegen/agoric/swingset/swingset.js.map +1 -0
  44. package/dist/codegen/agoric/vbank/genesis.d.ts +43 -0
  45. package/dist/codegen/agoric/vbank/genesis.js +100 -0
  46. package/dist/codegen/agoric/vbank/genesis.js.map +1 -0
  47. package/dist/codegen/agoric/vbank/msgs.d.ts +1 -0
  48. package/dist/codegen/agoric/vbank/msgs.js +2 -0
  49. package/dist/codegen/agoric/vbank/msgs.js.map +1 -0
  50. package/dist/codegen/agoric/vbank/query.d.ts +136 -0
  51. package/dist/codegen/agoric/vbank/query.js +273 -0
  52. package/dist/codegen/agoric/vbank/query.js.map +1 -0
  53. package/dist/codegen/agoric/vbank/query.rpc.Query.d.ts +20 -0
  54. package/dist/codegen/agoric/vbank/query.rpc.Query.js +34 -0
  55. package/dist/codegen/agoric/vbank/query.rpc.Query.js.map +1 -0
  56. package/dist/codegen/agoric/vbank/vbank.d.ts +135 -0
  57. package/dist/codegen/agoric/vbank/vbank.js +288 -0
  58. package/dist/codegen/agoric/vbank/vbank.js.map +1 -0
  59. package/dist/codegen/agoric/vibc/msgs.amino.d.ts +8 -0
  60. package/dist/codegen/agoric/vibc/msgs.amino.js +10 -0
  61. package/dist/codegen/agoric/vibc/msgs.amino.js.map +1 -0
  62. package/dist/codegen/agoric/vibc/msgs.d.ts +70 -0
  63. package/dist/codegen/agoric/vibc/msgs.js +156 -0
  64. package/dist/codegen/agoric/vibc/msgs.js.map +1 -0
  65. package/dist/codegen/agoric/vibc/msgs.registry.d.ts +36 -0
  66. package/dist/codegen/agoric/vibc/msgs.registry.js +52 -0
  67. package/dist/codegen/agoric/vibc/msgs.registry.js.map +1 -0
  68. package/dist/codegen/agoric/vibc/msgs.rpc.msg.d.ts +12 -0
  69. package/dist/codegen/agoric/vibc/msgs.rpc.msg.js +15 -0
  70. package/dist/codegen/agoric/vibc/msgs.rpc.msg.js.map +1 -0
  71. package/dist/codegen/agoric/vlocalchain/vlocalchain.d.ts +159 -0
  72. package/dist/codegen/agoric/vlocalchain/vlocalchain.js +389 -0
  73. package/dist/codegen/agoric/vlocalchain/vlocalchain.js.map +1 -0
  74. package/dist/codegen/agoric/vstorage/genesis.d.ts +89 -0
  75. package/dist/codegen/agoric/vstorage/genesis.js +174 -0
  76. package/dist/codegen/agoric/vstorage/genesis.js.map +1 -0
  77. package/dist/codegen/agoric/vstorage/query.d.ts +269 -0
  78. package/dist/codegen/agoric/vstorage/query.js +562 -0
  79. package/dist/codegen/agoric/vstorage/query.js.map +1 -0
  80. package/dist/codegen/agoric/vstorage/query.rpc.Query.d.ts +27 -0
  81. package/dist/codegen/agoric/vstorage/query.rpc.Query.js +43 -0
  82. package/dist/codegen/agoric/vstorage/query.rpc.Query.js.map +1 -0
  83. package/dist/codegen/agoric/vstorage/vstorage.d.ts +78 -0
  84. package/dist/codegen/agoric/vstorage/vstorage.js +160 -0
  85. package/dist/codegen/agoric/vstorage/vstorage.js.map +1 -0
  86. package/dist/codegen/binary.d.ts +130 -0
  87. package/dist/codegen/binary.js +367 -0
  88. package/dist/codegen/binary.js.map +1 -0
  89. package/dist/codegen/cosmos/base/query/v1beta1/pagination.d.ts +202 -0
  90. package/dist/codegen/cosmos/base/query/v1beta1/pagination.js +252 -0
  91. package/dist/codegen/cosmos/base/query/v1beta1/pagination.js.map +1 -0
  92. package/dist/codegen/cosmos/base/v1beta1/coin.d.ts +177 -0
  93. package/dist/codegen/cosmos/base/v1beta1/coin.js +348 -0
  94. package/dist/codegen/cosmos/base/v1beta1/coin.js.map +1 -0
  95. package/dist/codegen/cosmos/bundle.d.ts +167 -0
  96. package/dist/codegen/cosmos/bundle.js +26 -0
  97. package/dist/codegen/cosmos/bundle.js.map +1 -0
  98. package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.d.ts +282 -0
  99. package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.js +468 -0
  100. package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.js.map +1 -0
  101. package/dist/codegen/cosmos_proto/bundle.d.ts +36 -0
  102. package/dist/codegen/cosmos_proto/bundle.js +6 -0
  103. package/dist/codegen/cosmos_proto/bundle.js.map +1 -0
  104. package/dist/codegen/cosmos_proto/cosmos.d.ts +175 -0
  105. package/dist/codegen/cosmos_proto/cosmos.js +254 -0
  106. package/dist/codegen/cosmos_proto/cosmos.js.map +1 -0
  107. package/dist/codegen/gogoproto/bundle.d.ts +1 -0
  108. package/dist/codegen/gogoproto/bundle.js +6 -0
  109. package/dist/codegen/gogoproto/bundle.js.map +1 -0
  110. package/dist/codegen/gogoproto/gogo.d.ts +1 -0
  111. package/dist/codegen/gogoproto/gogo.js +2 -0
  112. package/dist/codegen/gogoproto/gogo.js.map +1 -0
  113. package/dist/codegen/google/api/annotations.d.ts +1 -0
  114. package/dist/codegen/google/api/annotations.js +2 -0
  115. package/dist/codegen/google/api/annotations.js.map +1 -0
  116. package/dist/codegen/google/api/http.d.ts +1079 -0
  117. package/dist/codegen/google/api/http.js +418 -0
  118. package/dist/codegen/google/api/http.js.map +1 -0
  119. package/dist/codegen/google/bundle.d.ts +443 -0
  120. package/dist/codegen/google/bundle.js +13 -0
  121. package/dist/codegen/google/bundle.js.map +1 -0
  122. package/dist/codegen/google/protobuf/any.d.ts +340 -0
  123. package/dist/codegen/google/protobuf/any.js +91 -0
  124. package/dist/codegen/google/protobuf/any.js.map +1 -0
  125. package/dist/codegen/google/protobuf/descriptor.d.ts +2332 -0
  126. package/dist/codegen/google/protobuf/descriptor.js +4419 -0
  127. package/dist/codegen/google/protobuf/descriptor.js.map +1 -0
  128. package/dist/codegen/google/protobuf/timestamp.d.ts +295 -0
  129. package/dist/codegen/google/protobuf/timestamp.js +89 -0
  130. package/dist/codegen/google/protobuf/timestamp.js.map +1 -0
  131. package/dist/codegen/helpers.d.ts +81 -0
  132. package/dist/codegen/helpers.js +124 -0
  133. package/dist/codegen/helpers.js.map +1 -0
  134. package/dist/codegen/ibc/bundle.d.ts +234 -0
  135. package/dist/codegen/ibc/bundle.js +22 -0
  136. package/dist/codegen/ibc/bundle.js.map +1 -0
  137. package/dist/codegen/ibc/core/channel/v1/channel.d.ts +513 -0
  138. package/dist/codegen/ibc/core/channel/v1/channel.js +1106 -0
  139. package/dist/codegen/ibc/core/channel/v1/channel.js.map +1 -0
  140. package/dist/codegen/ibc/core/client/v1/client.d.ts +414 -0
  141. package/dist/codegen/ibc/core/client/v1/client.js +786 -0
  142. package/dist/codegen/ibc/core/client/v1/client.js.map +1 -0
  143. package/dist/codegen/index.d.ts +15 -0
  144. package/dist/codegen/index.js +17 -0
  145. package/dist/codegen/index.js.map +1 -0
  146. package/dist/codegen/utf8.d.ts +27 -0
  147. package/dist/codegen/utf8.js +138 -0
  148. package/dist/codegen/utf8.js.map +1 -0
  149. package/dist/codegen/varint.d.ts +105 -0
  150. package/dist/codegen/varint.js +409 -0
  151. package/dist/codegen/varint.js.map +1 -0
  152. package/dist/index.d.ts +1 -0
  153. package/dist/index.js +2 -0
  154. package/dist/index.js.map +1 -0
  155. package/package.json +65 -27
  156. package/CHANGELOG.md +0 -41
  157. package/dist/agoric/swingset/msgs.d.ts +0 -450
  158. package/dist/agoric/swingset/msgs.js +0 -630
  159. package/dist/agoric/swingset/query.d.ts +0 -406
  160. package/dist/agoric/swingset/query.js +0 -346
  161. package/dist/agoric/swingset/swingset.d.ts +0 -571
  162. package/dist/agoric/swingset/swingset.js +0 -644
  163. package/dist/cosmos/base/v1beta1/coin.d.ts +0 -90
  164. package/dist/cosmos/base/v1beta1/coin.js +0 -197
  165. package/swingset/msgs.js +0 -2
  166. package/swingset/query.js +0 -2
  167. package/swingset/swingset.js +0 -2
@@ -0,0 +1,1079 @@
1
+ import { BinaryReader, BinaryWriter } from '../../binary.js';
2
+ /**
3
+ * Defines the HTTP configuration for an API service. It contains a list of
4
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
5
+ * to one or more HTTP REST API methods.
6
+ */
7
+ export interface Http {
8
+ /**
9
+ * A list of HTTP configuration rules that apply to individual API methods.
10
+ *
11
+ * **NOTE:** All service configuration rules follow "last one wins" order.
12
+ */
13
+ rules: HttpRule[];
14
+ /**
15
+ * When set to true, URL path parameters will be fully URI-decoded except in
16
+ * cases of single segment matches in reserved expansion, where "%2F" will be
17
+ * left encoded.
18
+ *
19
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
20
+ * segment matches.
21
+ */
22
+ fullyDecodeReservedExpansion: boolean;
23
+ }
24
+ export interface HttpProtoMsg {
25
+ typeUrl: '/google.api.Http';
26
+ value: Uint8Array;
27
+ }
28
+ /**
29
+ * Defines the HTTP configuration for an API service. It contains a list of
30
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
31
+ * to one or more HTTP REST API methods.
32
+ */
33
+ export interface HttpAmino {
34
+ /**
35
+ * A list of HTTP configuration rules that apply to individual API methods.
36
+ *
37
+ * **NOTE:** All service configuration rules follow "last one wins" order.
38
+ */
39
+ rules?: HttpRuleAmino[];
40
+ /**
41
+ * When set to true, URL path parameters will be fully URI-decoded except in
42
+ * cases of single segment matches in reserved expansion, where "%2F" will be
43
+ * left encoded.
44
+ *
45
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
46
+ * segment matches.
47
+ */
48
+ fully_decode_reserved_expansion?: boolean;
49
+ }
50
+ export interface HttpAminoMsg {
51
+ type: '/google.api.Http';
52
+ value: HttpAmino;
53
+ }
54
+ /**
55
+ * Defines the HTTP configuration for an API service. It contains a list of
56
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
57
+ * to one or more HTTP REST API methods.
58
+ */
59
+ export interface HttpSDKType {
60
+ rules: HttpRuleSDKType[];
61
+ fully_decode_reserved_expansion: boolean;
62
+ }
63
+ /**
64
+ * # gRPC Transcoding
65
+ *
66
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
67
+ * more HTTP REST endpoints. It allows developers to build a single API service
68
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
69
+ * APIs](https://github.com/googleapis/googleapis),
70
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
71
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
72
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
73
+ * and use it for large scale production services.
74
+ *
75
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
76
+ * how different portions of the gRPC request message are mapped to the URL
77
+ * path, URL query parameters, and HTTP request body. It also controls how the
78
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
79
+ * typically specified as an `google.api.http` annotation on the gRPC method.
80
+ *
81
+ * Each mapping specifies a URL path template and an HTTP method. The path
82
+ * template may refer to one or more fields in the gRPC request message, as long
83
+ * as each field is a non-repeated field with a primitive (non-message) type.
84
+ * The path template controls how fields of the request message are mapped to
85
+ * the URL path.
86
+ *
87
+ * Example:
88
+ *
89
+ * service Messaging {
90
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
91
+ * option (google.api.http) = {
92
+ * get: "/v1/{name=messages/*}"
93
+ * };
94
+ * }
95
+ * }
96
+ * message GetMessageRequest {
97
+ * string name = 1; // Mapped to URL path.
98
+ * }
99
+ * message Message {
100
+ * string text = 1; // The resource content.
101
+ * }
102
+ *
103
+ * This enables an HTTP REST to gRPC mapping as below:
104
+ *
105
+ * HTTP | gRPC
106
+ * -----|-----
107
+ * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
108
+ *
109
+ * Any fields in the request message which are not bound by the path template
110
+ * automatically become HTTP query parameters if there is no HTTP request body.
111
+ * For example:
112
+ *
113
+ * service Messaging {
114
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
115
+ * option (google.api.http) = {
116
+ * get:"/v1/messages/{message_id}"
117
+ * };
118
+ * }
119
+ * }
120
+ * message GetMessageRequest {
121
+ * message SubMessage {
122
+ * string subfield = 1;
123
+ * }
124
+ * string message_id = 1; // Mapped to URL path.
125
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
126
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
127
+ * }
128
+ *
129
+ * This enables a HTTP JSON to RPC mapping as below:
130
+ *
131
+ * HTTP | gRPC
132
+ * -----|-----
133
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
134
+ * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
135
+ * "foo"))`
136
+ *
137
+ * Note that fields which are mapped to URL query parameters must have a
138
+ * primitive type or a repeated primitive type or a non-repeated message type.
139
+ * In the case of a repeated type, the parameter can be repeated in the URL
140
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
141
+ * message is mapped to a separate parameter, such as
142
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
143
+ *
144
+ * For HTTP methods that allow a request body, the `body` field
145
+ * specifies the mapping. Consider a REST update method on the
146
+ * message resource collection:
147
+ *
148
+ * service Messaging {
149
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
150
+ * option (google.api.http) = {
151
+ * patch: "/v1/messages/{message_id}"
152
+ * body: "message"
153
+ * };
154
+ * }
155
+ * }
156
+ * message UpdateMessageRequest {
157
+ * string message_id = 1; // mapped to the URL
158
+ * Message message = 2; // mapped to the body
159
+ * }
160
+ *
161
+ * The following HTTP JSON to RPC mapping is enabled, where the
162
+ * representation of the JSON in the request body is determined by
163
+ * protos JSON encoding:
164
+ *
165
+ * HTTP | gRPC
166
+ * -----|-----
167
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
168
+ * "123456" message { text: "Hi!" })`
169
+ *
170
+ * The special name `*` can be used in the body mapping to define that
171
+ * every field not bound by the path template should be mapped to the
172
+ * request body. This enables the following alternative definition of
173
+ * the update method:
174
+ *
175
+ * service Messaging {
176
+ * rpc UpdateMessage(Message) returns (Message) {
177
+ * option (google.api.http) = {
178
+ * patch: "/v1/messages/{message_id}"
179
+ * body: "*"
180
+ * };
181
+ * }
182
+ * }
183
+ * message Message {
184
+ * string message_id = 1;
185
+ * string text = 2;
186
+ * }
187
+ *
188
+ *
189
+ * The following HTTP JSON to RPC mapping is enabled:
190
+ *
191
+ * HTTP | gRPC
192
+ * -----|-----
193
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
194
+ * "123456" text: "Hi!")`
195
+ *
196
+ * Note that when using `*` in the body mapping, it is not possible to
197
+ * have HTTP parameters, as all fields not bound by the path end in
198
+ * the body. This makes this option more rarely used in practice when
199
+ * defining REST APIs. The common usage of `*` is in custom methods
200
+ * which don't use the URL at all for transferring data.
201
+ *
202
+ * It is possible to define multiple HTTP methods for one RPC by using
203
+ * the `additional_bindings` option. Example:
204
+ *
205
+ * service Messaging {
206
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
207
+ * option (google.api.http) = {
208
+ * get: "/v1/messages/{message_id}"
209
+ * additional_bindings {
210
+ * get: "/v1/users/{user_id}/messages/{message_id}"
211
+ * }
212
+ * };
213
+ * }
214
+ * }
215
+ * message GetMessageRequest {
216
+ * string message_id = 1;
217
+ * string user_id = 2;
218
+ * }
219
+ *
220
+ * This enables the following two alternative HTTP JSON to RPC mappings:
221
+ *
222
+ * HTTP | gRPC
223
+ * -----|-----
224
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
225
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
226
+ * "123456")`
227
+ *
228
+ * ## Rules for HTTP mapping
229
+ *
230
+ * 1. Leaf request fields (recursive expansion nested messages in the request
231
+ * message) are classified into three categories:
232
+ * - Fields referred by the path template. They are passed via the URL path.
233
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
234
+ * are passed via the HTTP
235
+ * request body.
236
+ * - All other fields are passed via the URL query parameters, and the
237
+ * parameter name is the field path in the request message. A repeated
238
+ * field can be represented as multiple query parameters under the same
239
+ * name.
240
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
241
+ * query parameter, all fields
242
+ * are passed via URL path and HTTP request body.
243
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
244
+ * request body, all
245
+ * fields are passed via URL path and URL query parameters.
246
+ *
247
+ * ### Path template syntax
248
+ *
249
+ * Template = "/" Segments [ Verb ] ;
250
+ * Segments = Segment { "/" Segment } ;
251
+ * Segment = "*" | "**" | LITERAL | Variable ;
252
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
253
+ * FieldPath = IDENT { "." IDENT } ;
254
+ * Verb = ":" LITERAL ;
255
+ *
256
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
257
+ * zero or more URL path segments, which must be the last part of the URL path
258
+ * except the `Verb`.
259
+ *
260
+ * The syntax `Variable` matches part of the URL path as specified by its
261
+ * template. A variable template must not contain other variables. If a variable
262
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
263
+ * is equivalent to `{var=*}`.
264
+ *
265
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
266
+ * contains any reserved character, such characters should be percent-encoded
267
+ * before the matching.
268
+ *
269
+ * If a variable contains exactly one path segment, such as `"{var}"` or
270
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
271
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
272
+ * server side does the reverse decoding. Such variables show up in the
273
+ * [Discovery
274
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
275
+ * `{var}`.
276
+ *
277
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
278
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
279
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
280
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
281
+ * unchanged. Such variables show up in the
282
+ * [Discovery
283
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
284
+ * `{+var}`.
285
+ *
286
+ * ## Using gRPC API Service Configuration
287
+ *
288
+ * gRPC API Service Configuration (service config) is a configuration language
289
+ * for configuring a gRPC service to become a user-facing product. The
290
+ * service config is simply the YAML representation of the `google.api.Service`
291
+ * proto message.
292
+ *
293
+ * As an alternative to annotating your proto file, you can configure gRPC
294
+ * transcoding in your service config YAML files. You do this by specifying a
295
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
296
+ * effect as the proto annotation. This can be particularly useful if you
297
+ * have a proto that is reused in multiple services. Note that any transcoding
298
+ * specified in the service config will override any matching transcoding
299
+ * configuration in the proto.
300
+ *
301
+ * Example:
302
+ *
303
+ * http:
304
+ * rules:
305
+ * # Selects a gRPC method and applies HttpRule to it.
306
+ * - selector: example.v1.Messaging.GetMessage
307
+ * get: /v1/messages/{message_id}/{sub.subfield}
308
+ *
309
+ * ## Special notes
310
+ *
311
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
312
+ * proto to JSON conversion must follow the [proto3
313
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
314
+ *
315
+ * While the single segment variable follows the semantics of
316
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
317
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
318
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
319
+ * does not expand special characters like `?` and `#`, which would lead
320
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
321
+ * for multi segment variables.
322
+ *
323
+ * The path variables **must not** refer to any repeated or mapped field,
324
+ * because client libraries are not capable of handling such variable expansion.
325
+ *
326
+ * The path variables **must not** capture the leading "/" character. The reason
327
+ * is that the most common use case "{var}" does not capture the leading "/"
328
+ * character. For consistency, all path variables must share the same behavior.
329
+ *
330
+ * Repeated message fields must not be mapped to URL query parameters, because
331
+ * no client library can support such complicated mapping.
332
+ *
333
+ * If an API needs to use a JSON array for request or response body, it can map
334
+ * the request or response body to a repeated field. However, some gRPC
335
+ * Transcoding implementations may not support this feature.
336
+ */
337
+ export interface HttpRule {
338
+ /**
339
+ * Selects a method to which this rule applies.
340
+ *
341
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
342
+ * details.
343
+ */
344
+ selector: string;
345
+ /**
346
+ * Maps to HTTP GET. Used for listing and getting information about
347
+ * resources.
348
+ */
349
+ get?: string;
350
+ /** Maps to HTTP PUT. Used for replacing a resource. */
351
+ put?: string;
352
+ /** Maps to HTTP POST. Used for creating a resource or performing an action. */
353
+ post?: string;
354
+ /** Maps to HTTP DELETE. Used for deleting a resource. */
355
+ delete?: string;
356
+ /** Maps to HTTP PATCH. Used for updating a resource. */
357
+ patch?: string;
358
+ /**
359
+ * The custom pattern is used for specifying an HTTP method that is not
360
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
361
+ * HTTP method unspecified for this rule. The wild-card rule is useful
362
+ * for services that provide content to Web (HTML) clients.
363
+ */
364
+ custom?: CustomHttpPattern;
365
+ /**
366
+ * The name of the request field whose value is mapped to the HTTP request
367
+ * body, or `*` for mapping all request fields not captured by the path
368
+ * pattern to the HTTP body, or omitted for not having any HTTP request body.
369
+ *
370
+ * NOTE: the referred field must be present at the top-level of the request
371
+ * message type.
372
+ */
373
+ body: string;
374
+ /**
375
+ * Optional. The name of the response field whose value is mapped to the HTTP
376
+ * response body. When omitted, the entire response message will be used
377
+ * as the HTTP response body.
378
+ *
379
+ * NOTE: The referred field must be present at the top-level of the response
380
+ * message type.
381
+ */
382
+ responseBody: string;
383
+ /**
384
+ * Additional HTTP bindings for the selector. Nested bindings must
385
+ * not contain an `additional_bindings` field themselves (that is,
386
+ * the nesting may only be one level deep).
387
+ */
388
+ additionalBindings: HttpRule[];
389
+ }
390
+ export interface HttpRuleProtoMsg {
391
+ typeUrl: '/google.api.HttpRule';
392
+ value: Uint8Array;
393
+ }
394
+ /**
395
+ * # gRPC Transcoding
396
+ *
397
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
398
+ * more HTTP REST endpoints. It allows developers to build a single API service
399
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
400
+ * APIs](https://github.com/googleapis/googleapis),
401
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
402
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
403
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
404
+ * and use it for large scale production services.
405
+ *
406
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
407
+ * how different portions of the gRPC request message are mapped to the URL
408
+ * path, URL query parameters, and HTTP request body. It also controls how the
409
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
410
+ * typically specified as an `google.api.http` annotation on the gRPC method.
411
+ *
412
+ * Each mapping specifies a URL path template and an HTTP method. The path
413
+ * template may refer to one or more fields in the gRPC request message, as long
414
+ * as each field is a non-repeated field with a primitive (non-message) type.
415
+ * The path template controls how fields of the request message are mapped to
416
+ * the URL path.
417
+ *
418
+ * Example:
419
+ *
420
+ * service Messaging {
421
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
422
+ * option (google.api.http) = {
423
+ * get: "/v1/{name=messages/*}"
424
+ * };
425
+ * }
426
+ * }
427
+ * message GetMessageRequest {
428
+ * string name = 1; // Mapped to URL path.
429
+ * }
430
+ * message Message {
431
+ * string text = 1; // The resource content.
432
+ * }
433
+ *
434
+ * This enables an HTTP REST to gRPC mapping as below:
435
+ *
436
+ * HTTP | gRPC
437
+ * -----|-----
438
+ * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
439
+ *
440
+ * Any fields in the request message which are not bound by the path template
441
+ * automatically become HTTP query parameters if there is no HTTP request body.
442
+ * For example:
443
+ *
444
+ * service Messaging {
445
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
446
+ * option (google.api.http) = {
447
+ * get:"/v1/messages/{message_id}"
448
+ * };
449
+ * }
450
+ * }
451
+ * message GetMessageRequest {
452
+ * message SubMessage {
453
+ * string subfield = 1;
454
+ * }
455
+ * string message_id = 1; // Mapped to URL path.
456
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
457
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
458
+ * }
459
+ *
460
+ * This enables a HTTP JSON to RPC mapping as below:
461
+ *
462
+ * HTTP | gRPC
463
+ * -----|-----
464
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
465
+ * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
466
+ * "foo"))`
467
+ *
468
+ * Note that fields which are mapped to URL query parameters must have a
469
+ * primitive type or a repeated primitive type or a non-repeated message type.
470
+ * In the case of a repeated type, the parameter can be repeated in the URL
471
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
472
+ * message is mapped to a separate parameter, such as
473
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
474
+ *
475
+ * For HTTP methods that allow a request body, the `body` field
476
+ * specifies the mapping. Consider a REST update method on the
477
+ * message resource collection:
478
+ *
479
+ * service Messaging {
480
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
481
+ * option (google.api.http) = {
482
+ * patch: "/v1/messages/{message_id}"
483
+ * body: "message"
484
+ * };
485
+ * }
486
+ * }
487
+ * message UpdateMessageRequest {
488
+ * string message_id = 1; // mapped to the URL
489
+ * Message message = 2; // mapped to the body
490
+ * }
491
+ *
492
+ * The following HTTP JSON to RPC mapping is enabled, where the
493
+ * representation of the JSON in the request body is determined by
494
+ * protos JSON encoding:
495
+ *
496
+ * HTTP | gRPC
497
+ * -----|-----
498
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
499
+ * "123456" message { text: "Hi!" })`
500
+ *
501
+ * The special name `*` can be used in the body mapping to define that
502
+ * every field not bound by the path template should be mapped to the
503
+ * request body. This enables the following alternative definition of
504
+ * the update method:
505
+ *
506
+ * service Messaging {
507
+ * rpc UpdateMessage(Message) returns (Message) {
508
+ * option (google.api.http) = {
509
+ * patch: "/v1/messages/{message_id}"
510
+ * body: "*"
511
+ * };
512
+ * }
513
+ * }
514
+ * message Message {
515
+ * string message_id = 1;
516
+ * string text = 2;
517
+ * }
518
+ *
519
+ *
520
+ * The following HTTP JSON to RPC mapping is enabled:
521
+ *
522
+ * HTTP | gRPC
523
+ * -----|-----
524
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
525
+ * "123456" text: "Hi!")`
526
+ *
527
+ * Note that when using `*` in the body mapping, it is not possible to
528
+ * have HTTP parameters, as all fields not bound by the path end in
529
+ * the body. This makes this option more rarely used in practice when
530
+ * defining REST APIs. The common usage of `*` is in custom methods
531
+ * which don't use the URL at all for transferring data.
532
+ *
533
+ * It is possible to define multiple HTTP methods for one RPC by using
534
+ * the `additional_bindings` option. Example:
535
+ *
536
+ * service Messaging {
537
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
538
+ * option (google.api.http) = {
539
+ * get: "/v1/messages/{message_id}"
540
+ * additional_bindings {
541
+ * get: "/v1/users/{user_id}/messages/{message_id}"
542
+ * }
543
+ * };
544
+ * }
545
+ * }
546
+ * message GetMessageRequest {
547
+ * string message_id = 1;
548
+ * string user_id = 2;
549
+ * }
550
+ *
551
+ * This enables the following two alternative HTTP JSON to RPC mappings:
552
+ *
553
+ * HTTP | gRPC
554
+ * -----|-----
555
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
556
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
557
+ * "123456")`
558
+ *
559
+ * ## Rules for HTTP mapping
560
+ *
561
+ * 1. Leaf request fields (recursive expansion nested messages in the request
562
+ * message) are classified into three categories:
563
+ * - Fields referred by the path template. They are passed via the URL path.
564
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
565
+ * are passed via the HTTP
566
+ * request body.
567
+ * - All other fields are passed via the URL query parameters, and the
568
+ * parameter name is the field path in the request message. A repeated
569
+ * field can be represented as multiple query parameters under the same
570
+ * name.
571
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
572
+ * query parameter, all fields
573
+ * are passed via URL path and HTTP request body.
574
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
575
+ * request body, all
576
+ * fields are passed via URL path and URL query parameters.
577
+ *
578
+ * ### Path template syntax
579
+ *
580
+ * Template = "/" Segments [ Verb ] ;
581
+ * Segments = Segment { "/" Segment } ;
582
+ * Segment = "*" | "**" | LITERAL | Variable ;
583
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
584
+ * FieldPath = IDENT { "." IDENT } ;
585
+ * Verb = ":" LITERAL ;
586
+ *
587
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
588
+ * zero or more URL path segments, which must be the last part of the URL path
589
+ * except the `Verb`.
590
+ *
591
+ * The syntax `Variable` matches part of the URL path as specified by its
592
+ * template. A variable template must not contain other variables. If a variable
593
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
594
+ * is equivalent to `{var=*}`.
595
+ *
596
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
597
+ * contains any reserved character, such characters should be percent-encoded
598
+ * before the matching.
599
+ *
600
+ * If a variable contains exactly one path segment, such as `"{var}"` or
601
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
602
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
603
+ * server side does the reverse decoding. Such variables show up in the
604
+ * [Discovery
605
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
606
+ * `{var}`.
607
+ *
608
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
609
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
610
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
611
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
612
+ * unchanged. Such variables show up in the
613
+ * [Discovery
614
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
615
+ * `{+var}`.
616
+ *
617
+ * ## Using gRPC API Service Configuration
618
+ *
619
+ * gRPC API Service Configuration (service config) is a configuration language
620
+ * for configuring a gRPC service to become a user-facing product. The
621
+ * service config is simply the YAML representation of the `google.api.Service`
622
+ * proto message.
623
+ *
624
+ * As an alternative to annotating your proto file, you can configure gRPC
625
+ * transcoding in your service config YAML files. You do this by specifying a
626
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
627
+ * effect as the proto annotation. This can be particularly useful if you
628
+ * have a proto that is reused in multiple services. Note that any transcoding
629
+ * specified in the service config will override any matching transcoding
630
+ * configuration in the proto.
631
+ *
632
+ * Example:
633
+ *
634
+ * http:
635
+ * rules:
636
+ * # Selects a gRPC method and applies HttpRule to it.
637
+ * - selector: example.v1.Messaging.GetMessage
638
+ * get: /v1/messages/{message_id}/{sub.subfield}
639
+ *
640
+ * ## Special notes
641
+ *
642
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
643
+ * proto to JSON conversion must follow the [proto3
644
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
645
+ *
646
+ * While the single segment variable follows the semantics of
647
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
648
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
649
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
650
+ * does not expand special characters like `?` and `#`, which would lead
651
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
652
+ * for multi segment variables.
653
+ *
654
+ * The path variables **must not** refer to any repeated or mapped field,
655
+ * because client libraries are not capable of handling such variable expansion.
656
+ *
657
+ * The path variables **must not** capture the leading "/" character. The reason
658
+ * is that the most common use case "{var}" does not capture the leading "/"
659
+ * character. For consistency, all path variables must share the same behavior.
660
+ *
661
+ * Repeated message fields must not be mapped to URL query parameters, because
662
+ * no client library can support such complicated mapping.
663
+ *
664
+ * If an API needs to use a JSON array for request or response body, it can map
665
+ * the request or response body to a repeated field. However, some gRPC
666
+ * Transcoding implementations may not support this feature.
667
+ */
668
+ export interface HttpRuleAmino {
669
+ /**
670
+ * Selects a method to which this rule applies.
671
+ *
672
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
673
+ * details.
674
+ */
675
+ selector?: string;
676
+ /**
677
+ * Maps to HTTP GET. Used for listing and getting information about
678
+ * resources.
679
+ */
680
+ get?: string;
681
+ /** Maps to HTTP PUT. Used for replacing a resource. */
682
+ put?: string;
683
+ /** Maps to HTTP POST. Used for creating a resource or performing an action. */
684
+ post?: string;
685
+ /** Maps to HTTP DELETE. Used for deleting a resource. */
686
+ delete?: string;
687
+ /** Maps to HTTP PATCH. Used for updating a resource. */
688
+ patch?: string;
689
+ /**
690
+ * The custom pattern is used for specifying an HTTP method that is not
691
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
692
+ * HTTP method unspecified for this rule. The wild-card rule is useful
693
+ * for services that provide content to Web (HTML) clients.
694
+ */
695
+ custom?: CustomHttpPatternAmino;
696
+ /**
697
+ * The name of the request field whose value is mapped to the HTTP request
698
+ * body, or `*` for mapping all request fields not captured by the path
699
+ * pattern to the HTTP body, or omitted for not having any HTTP request body.
700
+ *
701
+ * NOTE: the referred field must be present at the top-level of the request
702
+ * message type.
703
+ */
704
+ body?: string;
705
+ /**
706
+ * Optional. The name of the response field whose value is mapped to the HTTP
707
+ * response body. When omitted, the entire response message will be used
708
+ * as the HTTP response body.
709
+ *
710
+ * NOTE: The referred field must be present at the top-level of the response
711
+ * message type.
712
+ */
713
+ response_body?: string;
714
+ /**
715
+ * Additional HTTP bindings for the selector. Nested bindings must
716
+ * not contain an `additional_bindings` field themselves (that is,
717
+ * the nesting may only be one level deep).
718
+ */
719
+ additional_bindings?: HttpRuleAmino[];
720
+ }
721
+ export interface HttpRuleAminoMsg {
722
+ type: '/google.api.HttpRule';
723
+ value: HttpRuleAmino;
724
+ }
725
+ /**
726
+ * # gRPC Transcoding
727
+ *
728
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
729
+ * more HTTP REST endpoints. It allows developers to build a single API service
730
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
731
+ * APIs](https://github.com/googleapis/googleapis),
732
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
733
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
734
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
735
+ * and use it for large scale production services.
736
+ *
737
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
738
+ * how different portions of the gRPC request message are mapped to the URL
739
+ * path, URL query parameters, and HTTP request body. It also controls how the
740
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
741
+ * typically specified as an `google.api.http` annotation on the gRPC method.
742
+ *
743
+ * Each mapping specifies a URL path template and an HTTP method. The path
744
+ * template may refer to one or more fields in the gRPC request message, as long
745
+ * as each field is a non-repeated field with a primitive (non-message) type.
746
+ * The path template controls how fields of the request message are mapped to
747
+ * the URL path.
748
+ *
749
+ * Example:
750
+ *
751
+ * service Messaging {
752
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
753
+ * option (google.api.http) = {
754
+ * get: "/v1/{name=messages/*}"
755
+ * };
756
+ * }
757
+ * }
758
+ * message GetMessageRequest {
759
+ * string name = 1; // Mapped to URL path.
760
+ * }
761
+ * message Message {
762
+ * string text = 1; // The resource content.
763
+ * }
764
+ *
765
+ * This enables an HTTP REST to gRPC mapping as below:
766
+ *
767
+ * HTTP | gRPC
768
+ * -----|-----
769
+ * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
770
+ *
771
+ * Any fields in the request message which are not bound by the path template
772
+ * automatically become HTTP query parameters if there is no HTTP request body.
773
+ * For example:
774
+ *
775
+ * service Messaging {
776
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
777
+ * option (google.api.http) = {
778
+ * get:"/v1/messages/{message_id}"
779
+ * };
780
+ * }
781
+ * }
782
+ * message GetMessageRequest {
783
+ * message SubMessage {
784
+ * string subfield = 1;
785
+ * }
786
+ * string message_id = 1; // Mapped to URL path.
787
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
788
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
789
+ * }
790
+ *
791
+ * This enables a HTTP JSON to RPC mapping as below:
792
+ *
793
+ * HTTP | gRPC
794
+ * -----|-----
795
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
796
+ * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
797
+ * "foo"))`
798
+ *
799
+ * Note that fields which are mapped to URL query parameters must have a
800
+ * primitive type or a repeated primitive type or a non-repeated message type.
801
+ * In the case of a repeated type, the parameter can be repeated in the URL
802
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
803
+ * message is mapped to a separate parameter, such as
804
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
805
+ *
806
+ * For HTTP methods that allow a request body, the `body` field
807
+ * specifies the mapping. Consider a REST update method on the
808
+ * message resource collection:
809
+ *
810
+ * service Messaging {
811
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
812
+ * option (google.api.http) = {
813
+ * patch: "/v1/messages/{message_id}"
814
+ * body: "message"
815
+ * };
816
+ * }
817
+ * }
818
+ * message UpdateMessageRequest {
819
+ * string message_id = 1; // mapped to the URL
820
+ * Message message = 2; // mapped to the body
821
+ * }
822
+ *
823
+ * The following HTTP JSON to RPC mapping is enabled, where the
824
+ * representation of the JSON in the request body is determined by
825
+ * protos JSON encoding:
826
+ *
827
+ * HTTP | gRPC
828
+ * -----|-----
829
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
830
+ * "123456" message { text: "Hi!" })`
831
+ *
832
+ * The special name `*` can be used in the body mapping to define that
833
+ * every field not bound by the path template should be mapped to the
834
+ * request body. This enables the following alternative definition of
835
+ * the update method:
836
+ *
837
+ * service Messaging {
838
+ * rpc UpdateMessage(Message) returns (Message) {
839
+ * option (google.api.http) = {
840
+ * patch: "/v1/messages/{message_id}"
841
+ * body: "*"
842
+ * };
843
+ * }
844
+ * }
845
+ * message Message {
846
+ * string message_id = 1;
847
+ * string text = 2;
848
+ * }
849
+ *
850
+ *
851
+ * The following HTTP JSON to RPC mapping is enabled:
852
+ *
853
+ * HTTP | gRPC
854
+ * -----|-----
855
+ * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
856
+ * "123456" text: "Hi!")`
857
+ *
858
+ * Note that when using `*` in the body mapping, it is not possible to
859
+ * have HTTP parameters, as all fields not bound by the path end in
860
+ * the body. This makes this option more rarely used in practice when
861
+ * defining REST APIs. The common usage of `*` is in custom methods
862
+ * which don't use the URL at all for transferring data.
863
+ *
864
+ * It is possible to define multiple HTTP methods for one RPC by using
865
+ * the `additional_bindings` option. Example:
866
+ *
867
+ * service Messaging {
868
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
869
+ * option (google.api.http) = {
870
+ * get: "/v1/messages/{message_id}"
871
+ * additional_bindings {
872
+ * get: "/v1/users/{user_id}/messages/{message_id}"
873
+ * }
874
+ * };
875
+ * }
876
+ * }
877
+ * message GetMessageRequest {
878
+ * string message_id = 1;
879
+ * string user_id = 2;
880
+ * }
881
+ *
882
+ * This enables the following two alternative HTTP JSON to RPC mappings:
883
+ *
884
+ * HTTP | gRPC
885
+ * -----|-----
886
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
887
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
888
+ * "123456")`
889
+ *
890
+ * ## Rules for HTTP mapping
891
+ *
892
+ * 1. Leaf request fields (recursive expansion nested messages in the request
893
+ * message) are classified into three categories:
894
+ * - Fields referred by the path template. They are passed via the URL path.
895
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
896
+ * are passed via the HTTP
897
+ * request body.
898
+ * - All other fields are passed via the URL query parameters, and the
899
+ * parameter name is the field path in the request message. A repeated
900
+ * field can be represented as multiple query parameters under the same
901
+ * name.
902
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
903
+ * query parameter, all fields
904
+ * are passed via URL path and HTTP request body.
905
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
906
+ * request body, all
907
+ * fields are passed via URL path and URL query parameters.
908
+ *
909
+ * ### Path template syntax
910
+ *
911
+ * Template = "/" Segments [ Verb ] ;
912
+ * Segments = Segment { "/" Segment } ;
913
+ * Segment = "*" | "**" | LITERAL | Variable ;
914
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
915
+ * FieldPath = IDENT { "." IDENT } ;
916
+ * Verb = ":" LITERAL ;
917
+ *
918
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
919
+ * zero or more URL path segments, which must be the last part of the URL path
920
+ * except the `Verb`.
921
+ *
922
+ * The syntax `Variable` matches part of the URL path as specified by its
923
+ * template. A variable template must not contain other variables. If a variable
924
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
925
+ * is equivalent to `{var=*}`.
926
+ *
927
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
928
+ * contains any reserved character, such characters should be percent-encoded
929
+ * before the matching.
930
+ *
931
+ * If a variable contains exactly one path segment, such as `"{var}"` or
932
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
933
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
934
+ * server side does the reverse decoding. Such variables show up in the
935
+ * [Discovery
936
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
937
+ * `{var}`.
938
+ *
939
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
940
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
941
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
942
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
943
+ * unchanged. Such variables show up in the
944
+ * [Discovery
945
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
946
+ * `{+var}`.
947
+ *
948
+ * ## Using gRPC API Service Configuration
949
+ *
950
+ * gRPC API Service Configuration (service config) is a configuration language
951
+ * for configuring a gRPC service to become a user-facing product. The
952
+ * service config is simply the YAML representation of the `google.api.Service`
953
+ * proto message.
954
+ *
955
+ * As an alternative to annotating your proto file, you can configure gRPC
956
+ * transcoding in your service config YAML files. You do this by specifying a
957
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
958
+ * effect as the proto annotation. This can be particularly useful if you
959
+ * have a proto that is reused in multiple services. Note that any transcoding
960
+ * specified in the service config will override any matching transcoding
961
+ * configuration in the proto.
962
+ *
963
+ * Example:
964
+ *
965
+ * http:
966
+ * rules:
967
+ * # Selects a gRPC method and applies HttpRule to it.
968
+ * - selector: example.v1.Messaging.GetMessage
969
+ * get: /v1/messages/{message_id}/{sub.subfield}
970
+ *
971
+ * ## Special notes
972
+ *
973
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
974
+ * proto to JSON conversion must follow the [proto3
975
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
976
+ *
977
+ * While the single segment variable follows the semantics of
978
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
979
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
980
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
981
+ * does not expand special characters like `?` and `#`, which would lead
982
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
983
+ * for multi segment variables.
984
+ *
985
+ * The path variables **must not** refer to any repeated or mapped field,
986
+ * because client libraries are not capable of handling such variable expansion.
987
+ *
988
+ * The path variables **must not** capture the leading "/" character. The reason
989
+ * is that the most common use case "{var}" does not capture the leading "/"
990
+ * character. For consistency, all path variables must share the same behavior.
991
+ *
992
+ * Repeated message fields must not be mapped to URL query parameters, because
993
+ * no client library can support such complicated mapping.
994
+ *
995
+ * If an API needs to use a JSON array for request or response body, it can map
996
+ * the request or response body to a repeated field. However, some gRPC
997
+ * Transcoding implementations may not support this feature.
998
+ */
999
+ export interface HttpRuleSDKType {
1000
+ selector: string;
1001
+ get?: string;
1002
+ put?: string;
1003
+ post?: string;
1004
+ delete?: string;
1005
+ patch?: string;
1006
+ custom?: CustomHttpPatternSDKType;
1007
+ body: string;
1008
+ response_body: string;
1009
+ additional_bindings: HttpRuleSDKType[];
1010
+ }
1011
+ /** A custom pattern is used for defining custom HTTP verb. */
1012
+ export interface CustomHttpPattern {
1013
+ /** The name of this custom HTTP verb. */
1014
+ kind: string;
1015
+ /** The path matched by this custom verb. */
1016
+ path: string;
1017
+ }
1018
+ export interface CustomHttpPatternProtoMsg {
1019
+ typeUrl: '/google.api.CustomHttpPattern';
1020
+ value: Uint8Array;
1021
+ }
1022
+ /** A custom pattern is used for defining custom HTTP verb. */
1023
+ export interface CustomHttpPatternAmino {
1024
+ /** The name of this custom HTTP verb. */
1025
+ kind?: string;
1026
+ /** The path matched by this custom verb. */
1027
+ path?: string;
1028
+ }
1029
+ export interface CustomHttpPatternAminoMsg {
1030
+ type: '/google.api.CustomHttpPattern';
1031
+ value: CustomHttpPatternAmino;
1032
+ }
1033
+ /** A custom pattern is used for defining custom HTTP verb. */
1034
+ export interface CustomHttpPatternSDKType {
1035
+ kind: string;
1036
+ path: string;
1037
+ }
1038
+ export declare const Http: {
1039
+ typeUrl: string;
1040
+ encode(message: Http, writer?: BinaryWriter): BinaryWriter;
1041
+ decode(input: BinaryReader | Uint8Array, length?: number): Http;
1042
+ fromJSON(object: any): Http;
1043
+ toJSON(message: Http): unknown;
1044
+ fromPartial(object: Partial<Http>): Http;
1045
+ fromAmino(object: HttpAmino): Http;
1046
+ toAmino(message: Http): HttpAmino;
1047
+ fromAminoMsg(object: HttpAminoMsg): Http;
1048
+ fromProtoMsg(message: HttpProtoMsg): Http;
1049
+ toProto(message: Http): Uint8Array;
1050
+ toProtoMsg(message: Http): HttpProtoMsg;
1051
+ };
1052
+ export declare const HttpRule: {
1053
+ typeUrl: string;
1054
+ encode(message: HttpRule, writer?: BinaryWriter): BinaryWriter;
1055
+ decode(input: BinaryReader | Uint8Array, length?: number): HttpRule;
1056
+ fromJSON(object: any): HttpRule;
1057
+ toJSON(message: HttpRule): unknown;
1058
+ fromPartial(object: Partial<HttpRule>): HttpRule;
1059
+ fromAmino(object: HttpRuleAmino): HttpRule;
1060
+ toAmino(message: HttpRule): HttpRuleAmino;
1061
+ fromAminoMsg(object: HttpRuleAminoMsg): HttpRule;
1062
+ fromProtoMsg(message: HttpRuleProtoMsg): HttpRule;
1063
+ toProto(message: HttpRule): Uint8Array;
1064
+ toProtoMsg(message: HttpRule): HttpRuleProtoMsg;
1065
+ };
1066
+ export declare const CustomHttpPattern: {
1067
+ typeUrl: string;
1068
+ encode(message: CustomHttpPattern, writer?: BinaryWriter): BinaryWriter;
1069
+ decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern;
1070
+ fromJSON(object: any): CustomHttpPattern;
1071
+ toJSON(message: CustomHttpPattern): unknown;
1072
+ fromPartial(object: Partial<CustomHttpPattern>): CustomHttpPattern;
1073
+ fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern;
1074
+ toAmino(message: CustomHttpPattern): CustomHttpPatternAmino;
1075
+ fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern;
1076
+ fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern;
1077
+ toProto(message: CustomHttpPattern): Uint8Array;
1078
+ toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg;
1079
+ };