googleapis-common-protos-types 1.5.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/google/api/annotations_pb.rb +60 -2
- data/lib/google/api/auth_pb.rb +264 -34
- data/lib/google/api/backend_pb.rb +212 -22
- data/lib/google/api/billing_pb.rb +104 -8
- data/lib/google/api/client_pb.rb +422 -77
- data/lib/google/api/config_change_pb.rb +111 -17
- data/lib/google/api/consumer_pb.rb +109 -16
- data/lib/google/api/context_pb.rb +117 -11
- data/lib/google/api/control_pb.rb +71 -4
- data/lib/google/api/distribution_pb.rb +242 -39
- data/lib/google/api/documentation_pb.rb +195 -19
- data/lib/google/api/endpoint_pb.rb +100 -7
- data/lib/google/api/error_reason_pb.rb +597 -31
- data/lib/google/api/field_behavior_pb.rb +117 -11
- data/lib/google/api/http_pb.rb +406 -23
- data/lib/google/api/httpbody_pb.rb +109 -6
- data/lib/google/api/label_pb.rb +75 -11
- data/lib/google/api/launch_stage_pb.rb +99 -11
- data/lib/google/api/log_pb.rb +82 -7
- data/lib/google/api/logging_pb.rb +108 -9
- data/lib/google/api/metric_pb.rb +297 -38
- data/lib/google/api/monitored_resource_pb.rb +159 -17
- data/lib/google/api/monitoring_pb.rb +134 -9
- data/lib/google/api/policy_pb.rb +129 -0
- data/lib/google/api/quota_pb.rb +211 -21
- data/lib/google/api/resource_pb.rb +265 -23
- data/lib/google/api/routing_pb.rb +488 -8
- data/lib/google/api/service_pb.rb +239 -29
- data/lib/google/api/source_info_pb.rb +59 -4
- data/lib/google/api/system_parameter_pb.rb +123 -13
- data/lib/google/api/usage_pb.rb +123 -11
- data/lib/google/api/visibility_pb.rb +140 -8
- data/lib/google/logging/type/http_request_pb.rb +123 -18
- data/lib/google/logging/type/log_severity_pb.rb +98 -12
- data/lib/google/longrunning/operations_pb.rb +277 -37
- data/lib/google/rpc/code_pb.rb +213 -20
- data/lib/google/rpc/context/attribute_context_pb.rb +402 -0
- data/lib/google/rpc/context/audit_context_pb.rb +95 -0
- data/lib/google/rpc/error_details_pb.rb +313 -56
- data/lib/google/rpc/http_pb.rb +91 -17
- data/lib/google/rpc/status_pb.rb +77 -6
- data/lib/google/type/calendar_period_pb.rb +83 -11
- data/lib/google/type/color_pb.rb +202 -7
- data/lib/google/type/date_pb.rb +79 -6
- data/lib/google/type/datetime_pb.rb +132 -18
- data/lib/google/type/dayofweek_pb.rb +77 -11
- data/lib/google/type/decimal_pb.rb +122 -4
- data/lib/google/type/expr_pb.rb +100 -7
- data/lib/google/type/fraction_pb.rb +60 -5
- data/lib/google/type/interval_pb.rb +74 -5
- data/lib/google/type/latlng_pb.rb +64 -5
- data/lib/google/type/localized_text_pb.rb +63 -5
- data/lib/google/type/money_pb.rb +69 -6
- data/lib/google/type/month_pb.rb +92 -16
- data/lib/google/type/phone_number_pb.rb +140 -12
- data/lib/google/type/postal_address_pb.rb +161 -14
- data/lib/google/type/quaternion_pb.rb +121 -7
- data/lib/google/type/timeofday_pb.rb +71 -7
- data/lib/googleapis/common/protos/types/version.rb +1 -1
- metadata +8 -5
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/api/routing.proto
|
3
4
|
|
@@ -5,16 +6,31 @@ require 'google/protobuf'
|
|
5
6
|
|
6
7
|
require 'google/protobuf/descriptor_pb'
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
|
10
|
+
descriptor_data = "\n\x18google/api/routing.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto\"G\n\x0bRoutingRule\x12\x38\n\x12routing_parameters\x18\x02 \x03(\x0b\x32\x1c.google.api.RoutingParameter\"8\n\x10RoutingParameter\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x15\n\rpath_template\x18\x02 \x01(\t:K\n\x07routing\x12\x1e.google.protobuf.MethodOptions\x18\xb1\xca\xbc\" \x01(\x0b\x32\x17.google.api.RoutingRuleBj\n\x0e\x63om.google.apiB\x0cRoutingProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3"
|
11
|
+
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
|
14
|
+
begin
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
16
|
+
rescue TypeError => e
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
20
|
+
parsed.clear_dependency
|
21
|
+
serialized = parsed.class.encode(parsed)
|
22
|
+
file = pool.add_serialized_file(serialized)
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
24
|
+
imports = [
|
25
|
+
]
|
26
|
+
imports.each do |type_name, expected_filename|
|
27
|
+
import_file = pool.lookup(type_name).file_descriptor
|
28
|
+
if import_file.name != expected_filename
|
29
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
16
30
|
end
|
17
31
|
end
|
32
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
33
|
+
warn "This will become an error in the next major version."
|
18
34
|
end
|
19
35
|
|
20
36
|
module Google
|
@@ -23,3 +39,467 @@ module Google
|
|
23
39
|
RoutingParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.RoutingParameter").msgclass
|
24
40
|
end
|
25
41
|
end
|
42
|
+
|
43
|
+
#### Source proto file: google/api/routing.proto ####
|
44
|
+
#
|
45
|
+
# // Copyright 2023 Google LLC
|
46
|
+
# //
|
47
|
+
# // Licensed under the Apache License, Version 2.0 (the "License");
|
48
|
+
# // you may not use this file except in compliance with the License.
|
49
|
+
# // You may obtain a copy of the License at
|
50
|
+
# //
|
51
|
+
# // http://www.apache.org/licenses/LICENSE-2.0
|
52
|
+
# //
|
53
|
+
# // Unless required by applicable law or agreed to in writing, software
|
54
|
+
# // distributed under the License is distributed on an "AS IS" BASIS,
|
55
|
+
# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
56
|
+
# // See the License for the specific language governing permissions and
|
57
|
+
# // limitations under the License.
|
58
|
+
#
|
59
|
+
# syntax = "proto3";
|
60
|
+
#
|
61
|
+
# package google.api;
|
62
|
+
#
|
63
|
+
# import "google/protobuf/descriptor.proto";
|
64
|
+
#
|
65
|
+
# option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
|
66
|
+
# option java_multiple_files = true;
|
67
|
+
# option java_outer_classname = "RoutingProto";
|
68
|
+
# option java_package = "com.google.api";
|
69
|
+
# option objc_class_prefix = "GAPI";
|
70
|
+
#
|
71
|
+
# extend google.protobuf.MethodOptions {
|
72
|
+
# // See RoutingRule.
|
73
|
+
# google.api.RoutingRule routing = 72295729;
|
74
|
+
# }
|
75
|
+
#
|
76
|
+
# // Specifies the routing information that should be sent along with the request
|
77
|
+
# // in the form of routing header.
|
78
|
+
# // **NOTE:** All service configuration rules follow the "last one wins" order.
|
79
|
+
# //
|
80
|
+
# // The examples below will apply to an RPC which has the following request type:
|
81
|
+
# //
|
82
|
+
# // Message Definition:
|
83
|
+
# //
|
84
|
+
# // message Request {
|
85
|
+
# // // The name of the Table
|
86
|
+
# // // Values can be of the following formats:
|
87
|
+
# // // - `projects/<project>/tables/<table>`
|
88
|
+
# // // - `projects/<project>/instances/<instance>/tables/<table>`
|
89
|
+
# // // - `region/<region>/zones/<zone>/tables/<table>`
|
90
|
+
# // string table_name = 1;
|
91
|
+
# //
|
92
|
+
# // // This value specifies routing for replication.
|
93
|
+
# // // It can be in the following formats:
|
94
|
+
# // // - `profiles/<profile_id>`
|
95
|
+
# // // - a legacy `profile_id` that can be any string
|
96
|
+
# // string app_profile_id = 2;
|
97
|
+
# // }
|
98
|
+
# //
|
99
|
+
# // Example message:
|
100
|
+
# //
|
101
|
+
# // {
|
102
|
+
# // table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
|
103
|
+
# // app_profile_id: profiles/prof_qux
|
104
|
+
# // }
|
105
|
+
# //
|
106
|
+
# // The routing header consists of one or multiple key-value pairs. Every key
|
107
|
+
# // and value must be percent-encoded, and joined together in the format of
|
108
|
+
# // `key1=value1&key2=value2`.
|
109
|
+
# // In the examples below I am skipping the percent-encoding for readablity.
|
110
|
+
# //
|
111
|
+
# // Example 1
|
112
|
+
# //
|
113
|
+
# // Extracting a field from the request to put into the routing header
|
114
|
+
# // unchanged, with the key equal to the field name.
|
115
|
+
# //
|
116
|
+
# // annotation:
|
117
|
+
# //
|
118
|
+
# // option (google.api.routing) = {
|
119
|
+
# // // Take the `app_profile_id`.
|
120
|
+
# // routing_parameters {
|
121
|
+
# // field: "app_profile_id"
|
122
|
+
# // }
|
123
|
+
# // };
|
124
|
+
# //
|
125
|
+
# // result:
|
126
|
+
# //
|
127
|
+
# // x-goog-request-params: app_profile_id=profiles/prof_qux
|
128
|
+
# //
|
129
|
+
# // Example 2
|
130
|
+
# //
|
131
|
+
# // Extracting a field from the request to put into the routing header
|
132
|
+
# // unchanged, with the key different from the field name.
|
133
|
+
# //
|
134
|
+
# // annotation:
|
135
|
+
# //
|
136
|
+
# // option (google.api.routing) = {
|
137
|
+
# // // Take the `app_profile_id`, but name it `routing_id` in the header.
|
138
|
+
# // routing_parameters {
|
139
|
+
# // field: "app_profile_id"
|
140
|
+
# // path_template: "{routing_id=**}"
|
141
|
+
# // }
|
142
|
+
# // };
|
143
|
+
# //
|
144
|
+
# // result:
|
145
|
+
# //
|
146
|
+
# // x-goog-request-params: routing_id=profiles/prof_qux
|
147
|
+
# //
|
148
|
+
# // Example 3
|
149
|
+
# //
|
150
|
+
# // Extracting a field from the request to put into the routing
|
151
|
+
# // header, while matching a path template syntax on the field's value.
|
152
|
+
# //
|
153
|
+
# // NB: it is more useful to send nothing than to send garbage for the purpose
|
154
|
+
# // of dynamic routing, since garbage pollutes cache. Thus the matching.
|
155
|
+
# //
|
156
|
+
# // Sub-example 3a
|
157
|
+
# //
|
158
|
+
# // The field matches the template.
|
159
|
+
# //
|
160
|
+
# // annotation:
|
161
|
+
# //
|
162
|
+
# // option (google.api.routing) = {
|
163
|
+
# // // Take the `table_name`, if it's well-formed (with project-based
|
164
|
+
# // // syntax).
|
165
|
+
# // routing_parameters {
|
166
|
+
# // field: "table_name"
|
167
|
+
# // path_template: "{table_name=projects/*/instances/*/**}"
|
168
|
+
# // }
|
169
|
+
# // };
|
170
|
+
# //
|
171
|
+
# // result:
|
172
|
+
# //
|
173
|
+
# // x-goog-request-params:
|
174
|
+
# // table_name=projects/proj_foo/instances/instance_bar/table/table_baz
|
175
|
+
# //
|
176
|
+
# // Sub-example 3b
|
177
|
+
# //
|
178
|
+
# // The field does not match the template.
|
179
|
+
# //
|
180
|
+
# // annotation:
|
181
|
+
# //
|
182
|
+
# // option (google.api.routing) = {
|
183
|
+
# // // Take the `table_name`, if it's well-formed (with region-based
|
184
|
+
# // // syntax).
|
185
|
+
# // routing_parameters {
|
186
|
+
# // field: "table_name"
|
187
|
+
# // path_template: "{table_name=regions/*/zones/*/**}"
|
188
|
+
# // }
|
189
|
+
# // };
|
190
|
+
# //
|
191
|
+
# // result:
|
192
|
+
# //
|
193
|
+
# // <no routing header will be sent>
|
194
|
+
# //
|
195
|
+
# // Sub-example 3c
|
196
|
+
# //
|
197
|
+
# // Multiple alternative conflictingly named path templates are
|
198
|
+
# // specified. The one that matches is used to construct the header.
|
199
|
+
# //
|
200
|
+
# // annotation:
|
201
|
+
# //
|
202
|
+
# // option (google.api.routing) = {
|
203
|
+
# // // Take the `table_name`, if it's well-formed, whether
|
204
|
+
# // // using the region- or projects-based syntax.
|
205
|
+
# //
|
206
|
+
# // routing_parameters {
|
207
|
+
# // field: "table_name"
|
208
|
+
# // path_template: "{table_name=regions/*/zones/*/**}"
|
209
|
+
# // }
|
210
|
+
# // routing_parameters {
|
211
|
+
# // field: "table_name"
|
212
|
+
# // path_template: "{table_name=projects/*/instances/*/**}"
|
213
|
+
# // }
|
214
|
+
# // };
|
215
|
+
# //
|
216
|
+
# // result:
|
217
|
+
# //
|
218
|
+
# // x-goog-request-params:
|
219
|
+
# // table_name=projects/proj_foo/instances/instance_bar/table/table_baz
|
220
|
+
# //
|
221
|
+
# // Example 4
|
222
|
+
# //
|
223
|
+
# // Extracting a single routing header key-value pair by matching a
|
224
|
+
# // template syntax on (a part of) a single request field.
|
225
|
+
# //
|
226
|
+
# // annotation:
|
227
|
+
# //
|
228
|
+
# // option (google.api.routing) = {
|
229
|
+
# // // Take just the project id from the `table_name` field.
|
230
|
+
# // routing_parameters {
|
231
|
+
# // field: "table_name"
|
232
|
+
# // path_template: "{routing_id=projects/*}/**"
|
233
|
+
# // }
|
234
|
+
# // };
|
235
|
+
# //
|
236
|
+
# // result:
|
237
|
+
# //
|
238
|
+
# // x-goog-request-params: routing_id=projects/proj_foo
|
239
|
+
# //
|
240
|
+
# // Example 5
|
241
|
+
# //
|
242
|
+
# // Extracting a single routing header key-value pair by matching
|
243
|
+
# // several conflictingly named path templates on (parts of) a single request
|
244
|
+
# // field. The last template to match "wins" the conflict.
|
245
|
+
# //
|
246
|
+
# // annotation:
|
247
|
+
# //
|
248
|
+
# // option (google.api.routing) = {
|
249
|
+
# // // If the `table_name` does not have instances information,
|
250
|
+
# // // take just the project id for routing.
|
251
|
+
# // // Otherwise take project + instance.
|
252
|
+
# //
|
253
|
+
# // routing_parameters {
|
254
|
+
# // field: "table_name"
|
255
|
+
# // path_template: "{routing_id=projects/*}/**"
|
256
|
+
# // }
|
257
|
+
# // routing_parameters {
|
258
|
+
# // field: "table_name"
|
259
|
+
# // path_template: "{routing_id=projects/*/instances/*}/**"
|
260
|
+
# // }
|
261
|
+
# // };
|
262
|
+
# //
|
263
|
+
# // result:
|
264
|
+
# //
|
265
|
+
# // x-goog-request-params:
|
266
|
+
# // routing_id=projects/proj_foo/instances/instance_bar
|
267
|
+
# //
|
268
|
+
# // Example 6
|
269
|
+
# //
|
270
|
+
# // Extracting multiple routing header key-value pairs by matching
|
271
|
+
# // several non-conflicting path templates on (parts of) a single request field.
|
272
|
+
# //
|
273
|
+
# // Sub-example 6a
|
274
|
+
# //
|
275
|
+
# // Make the templates strict, so that if the `table_name` does not
|
276
|
+
# // have an instance information, nothing is sent.
|
277
|
+
# //
|
278
|
+
# // annotation:
|
279
|
+
# //
|
280
|
+
# // option (google.api.routing) = {
|
281
|
+
# // // The routing code needs two keys instead of one composite
|
282
|
+
# // // but works only for the tables with the "project-instance" name
|
283
|
+
# // // syntax.
|
284
|
+
# //
|
285
|
+
# // routing_parameters {
|
286
|
+
# // field: "table_name"
|
287
|
+
# // path_template: "{project_id=projects/*}/instances/*/**"
|
288
|
+
# // }
|
289
|
+
# // routing_parameters {
|
290
|
+
# // field: "table_name"
|
291
|
+
# // path_template: "projects/*/{instance_id=instances/*}/**"
|
292
|
+
# // }
|
293
|
+
# // };
|
294
|
+
# //
|
295
|
+
# // result:
|
296
|
+
# //
|
297
|
+
# // x-goog-request-params:
|
298
|
+
# // project_id=projects/proj_foo&instance_id=instances/instance_bar
|
299
|
+
# //
|
300
|
+
# // Sub-example 6b
|
301
|
+
# //
|
302
|
+
# // Make the templates loose, so that if the `table_name` does not
|
303
|
+
# // have an instance information, just the project id part is sent.
|
304
|
+
# //
|
305
|
+
# // annotation:
|
306
|
+
# //
|
307
|
+
# // option (google.api.routing) = {
|
308
|
+
# // // The routing code wants two keys instead of one composite
|
309
|
+
# // // but will work with just the `project_id` for tables without
|
310
|
+
# // // an instance in the `table_name`.
|
311
|
+
# //
|
312
|
+
# // routing_parameters {
|
313
|
+
# // field: "table_name"
|
314
|
+
# // path_template: "{project_id=projects/*}/**"
|
315
|
+
# // }
|
316
|
+
# // routing_parameters {
|
317
|
+
# // field: "table_name"
|
318
|
+
# // path_template: "projects/*/{instance_id=instances/*}/**"
|
319
|
+
# // }
|
320
|
+
# // };
|
321
|
+
# //
|
322
|
+
# // result (is the same as 6a for our example message because it has the instance
|
323
|
+
# // information):
|
324
|
+
# //
|
325
|
+
# // x-goog-request-params:
|
326
|
+
# // project_id=projects/proj_foo&instance_id=instances/instance_bar
|
327
|
+
# //
|
328
|
+
# // Example 7
|
329
|
+
# //
|
330
|
+
# // Extracting multiple routing header key-value pairs by matching
|
331
|
+
# // several path templates on multiple request fields.
|
332
|
+
# //
|
333
|
+
# // NB: note that here there is no way to specify sending nothing if one of the
|
334
|
+
# // fields does not match its template. E.g. if the `table_name` is in the wrong
|
335
|
+
# // format, the `project_id` will not be sent, but the `routing_id` will be.
|
336
|
+
# // The backend routing code has to be aware of that and be prepared to not
|
337
|
+
# // receive a full complement of keys if it expects multiple.
|
338
|
+
# //
|
339
|
+
# // annotation:
|
340
|
+
# //
|
341
|
+
# // option (google.api.routing) = {
|
342
|
+
# // // The routing needs both `project_id` and `routing_id`
|
343
|
+
# // // (from the `app_profile_id` field) for routing.
|
344
|
+
# //
|
345
|
+
# // routing_parameters {
|
346
|
+
# // field: "table_name"
|
347
|
+
# // path_template: "{project_id=projects/*}/**"
|
348
|
+
# // }
|
349
|
+
# // routing_parameters {
|
350
|
+
# // field: "app_profile_id"
|
351
|
+
# // path_template: "{routing_id=**}"
|
352
|
+
# // }
|
353
|
+
# // };
|
354
|
+
# //
|
355
|
+
# // result:
|
356
|
+
# //
|
357
|
+
# // x-goog-request-params:
|
358
|
+
# // project_id=projects/proj_foo&routing_id=profiles/prof_qux
|
359
|
+
# //
|
360
|
+
# // Example 8
|
361
|
+
# //
|
362
|
+
# // Extracting a single routing header key-value pair by matching
|
363
|
+
# // several conflictingly named path templates on several request fields. The
|
364
|
+
# // last template to match "wins" the conflict.
|
365
|
+
# //
|
366
|
+
# // annotation:
|
367
|
+
# //
|
368
|
+
# // option (google.api.routing) = {
|
369
|
+
# // // The `routing_id` can be a project id or a region id depending on
|
370
|
+
# // // the table name format, but only if the `app_profile_id` is not set.
|
371
|
+
# // // If `app_profile_id` is set it should be used instead.
|
372
|
+
# //
|
373
|
+
# // routing_parameters {
|
374
|
+
# // field: "table_name"
|
375
|
+
# // path_template: "{routing_id=projects/*}/**"
|
376
|
+
# // }
|
377
|
+
# // routing_parameters {
|
378
|
+
# // field: "table_name"
|
379
|
+
# // path_template: "{routing_id=regions/*}/**"
|
380
|
+
# // }
|
381
|
+
# // routing_parameters {
|
382
|
+
# // field: "app_profile_id"
|
383
|
+
# // path_template: "{routing_id=**}"
|
384
|
+
# // }
|
385
|
+
# // };
|
386
|
+
# //
|
387
|
+
# // result:
|
388
|
+
# //
|
389
|
+
# // x-goog-request-params: routing_id=profiles/prof_qux
|
390
|
+
# //
|
391
|
+
# // Example 9
|
392
|
+
# //
|
393
|
+
# // Bringing it all together.
|
394
|
+
# //
|
395
|
+
# // annotation:
|
396
|
+
# //
|
397
|
+
# // option (google.api.routing) = {
|
398
|
+
# // // For routing both `table_location` and a `routing_id` are needed.
|
399
|
+
# // //
|
400
|
+
# // // table_location can be either an instance id or a region+zone id.
|
401
|
+
# // //
|
402
|
+
# // // For `routing_id`, take the value of `app_profile_id`
|
403
|
+
# // // - If it's in the format `profiles/<profile_id>`, send
|
404
|
+
# // // just the `<profile_id>` part.
|
405
|
+
# // // - If it's any other literal, send it as is.
|
406
|
+
# // // If the `app_profile_id` is empty, and the `table_name` starts with
|
407
|
+
# // // the project_id, send that instead.
|
408
|
+
# //
|
409
|
+
# // routing_parameters {
|
410
|
+
# // field: "table_name"
|
411
|
+
# // path_template: "projects/*/{table_location=instances/*}/tables/*"
|
412
|
+
# // }
|
413
|
+
# // routing_parameters {
|
414
|
+
# // field: "table_name"
|
415
|
+
# // path_template: "{table_location=regions/*/zones/*}/tables/*"
|
416
|
+
# // }
|
417
|
+
# // routing_parameters {
|
418
|
+
# // field: "table_name"
|
419
|
+
# // path_template: "{routing_id=projects/*}/**"
|
420
|
+
# // }
|
421
|
+
# // routing_parameters {
|
422
|
+
# // field: "app_profile_id"
|
423
|
+
# // path_template: "{routing_id=**}"
|
424
|
+
# // }
|
425
|
+
# // routing_parameters {
|
426
|
+
# // field: "app_profile_id"
|
427
|
+
# // path_template: "profiles/{routing_id=*}"
|
428
|
+
# // }
|
429
|
+
# // };
|
430
|
+
# //
|
431
|
+
# // result:
|
432
|
+
# //
|
433
|
+
# // x-goog-request-params:
|
434
|
+
# // table_location=instances/instance_bar&routing_id=prof_qux
|
435
|
+
# message RoutingRule {
|
436
|
+
# // A collection of Routing Parameter specifications.
|
437
|
+
# // **NOTE:** If multiple Routing Parameters describe the same key
|
438
|
+
# // (via the `path_template` field or via the `field` field when
|
439
|
+
# // `path_template` is not provided), "last one wins" rule
|
440
|
+
# // determines which Parameter gets used.
|
441
|
+
# // See the examples for more details.
|
442
|
+
# repeated RoutingParameter routing_parameters = 2;
|
443
|
+
# }
|
444
|
+
#
|
445
|
+
# // A projection from an input message to the GRPC or REST header.
|
446
|
+
# message RoutingParameter {
|
447
|
+
# // A request field to extract the header key-value pair from.
|
448
|
+
# string field = 1;
|
449
|
+
#
|
450
|
+
# // A pattern matching the key-value field. Optional.
|
451
|
+
# // If not specified, the whole field specified in the `field` field will be
|
452
|
+
# // taken as value, and its name used as key. If specified, it MUST contain
|
453
|
+
# // exactly one named segment (along with any number of unnamed segments) The
|
454
|
+
# // pattern will be matched over the field specified in the `field` field, then
|
455
|
+
# // if the match is successful:
|
456
|
+
# // - the name of the single named segment will be used as a header name,
|
457
|
+
# // - the match value of the segment will be used as a header value;
|
458
|
+
# // if the match is NOT successful, nothing will be sent.
|
459
|
+
# //
|
460
|
+
# // Example:
|
461
|
+
# //
|
462
|
+
# // -- This is a field in the request message
|
463
|
+
# // | that the header value will be extracted from.
|
464
|
+
# // |
|
465
|
+
# // | -- This is the key name in the
|
466
|
+
# // | | routing header.
|
467
|
+
# // V |
|
468
|
+
# // field: "table_name" v
|
469
|
+
# // path_template: "projects/*/{table_location=instances/*}/tables/*"
|
470
|
+
# // ^ ^
|
471
|
+
# // | |
|
472
|
+
# // In the {} brackets is the pattern that -- |
|
473
|
+
# // specifies what to extract from the |
|
474
|
+
# // field as a value to be sent. |
|
475
|
+
# // |
|
476
|
+
# // The string in the field must match the whole pattern --
|
477
|
+
# // before brackets, inside brackets, after brackets.
|
478
|
+
# //
|
479
|
+
# // When looking at this specific example, we can see that:
|
480
|
+
# // - A key-value pair with the key `table_location`
|
481
|
+
# // and the value matching `instances/*` should be added
|
482
|
+
# // to the x-goog-request-params routing header.
|
483
|
+
# // - The value is extracted from the request message's `table_name` field
|
484
|
+
# // if it matches the full pattern specified:
|
485
|
+
# // `projects/*/instances/*/tables/*`.
|
486
|
+
# //
|
487
|
+
# // **NB:** If the `path_template` field is not provided, the key name is
|
488
|
+
# // equal to the field name, and the whole field should be sent as a value.
|
489
|
+
# // This makes the pattern for the field and the value functionally equivalent
|
490
|
+
# // to `**`, and the configuration
|
491
|
+
# //
|
492
|
+
# // {
|
493
|
+
# // field: "table_name"
|
494
|
+
# // }
|
495
|
+
# //
|
496
|
+
# // is a functionally equivalent shorthand to:
|
497
|
+
# //
|
498
|
+
# // {
|
499
|
+
# // field: "table_name"
|
500
|
+
# // path_template: "{table_name=**}"
|
501
|
+
# // }
|
502
|
+
# //
|
503
|
+
# // See Example 1 for more details.
|
504
|
+
# string path_template = 2;
|
505
|
+
# }
|