google-cloud-bigquery-data_policies-v1 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,587 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/bigquery/datapolicies/v1/datapolicy_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Bigquery
24
+ module DataPolicies
25
+ module V1
26
+ module DataPolicyService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the DataPolicyService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, credentials:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ numeric_enums: true,
41
+ raise_faraday_errors: false
42
+ end
43
+
44
+ ##
45
+ # Baseline implementation for the create_data_policy REST call
46
+ #
47
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::CreateDataPolicyRequest]
48
+ # A request object representing the call parameters. Required.
49
+ # @param options [::Gapic::CallOptions]
50
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
51
+ #
52
+ # @yield [result, operation] Access the result along with the TransportOperation object
53
+ # @yieldparam result [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
54
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
55
+ #
56
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
57
+ # A result object deserialized from the server's reply
58
+ def create_data_policy request_pb, options = nil
59
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
60
+
61
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_data_policy_request request_pb
62
+ query_string_params = if query_string_params.any?
63
+ query_string_params.to_h { |p| p.split("=", 2) }
64
+ else
65
+ {}
66
+ end
67
+
68
+ response = @client_stub.make_http_request(
69
+ verb,
70
+ uri: uri,
71
+ body: body || "",
72
+ params: query_string_params,
73
+ options: options
74
+ )
75
+ operation = ::Gapic::Rest::TransportOperation.new response
76
+ result = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy.decode_json response.body, ignore_unknown_fields: true
77
+
78
+ yield result, operation if block_given?
79
+ result
80
+ end
81
+
82
+ ##
83
+ # Baseline implementation for the update_data_policy REST call
84
+ #
85
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::UpdateDataPolicyRequest]
86
+ # A request object representing the call parameters. Required.
87
+ # @param options [::Gapic::CallOptions]
88
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
89
+ #
90
+ # @yield [result, operation] Access the result along with the TransportOperation object
91
+ # @yieldparam result [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
92
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
93
+ #
94
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
95
+ # A result object deserialized from the server's reply
96
+ def update_data_policy request_pb, options = nil
97
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
98
+
99
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_data_policy_request request_pb
100
+ query_string_params = if query_string_params.any?
101
+ query_string_params.to_h { |p| p.split("=", 2) }
102
+ else
103
+ {}
104
+ end
105
+
106
+ response = @client_stub.make_http_request(
107
+ verb,
108
+ uri: uri,
109
+ body: body || "",
110
+ params: query_string_params,
111
+ options: options
112
+ )
113
+ operation = ::Gapic::Rest::TransportOperation.new response
114
+ result = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy.decode_json response.body, ignore_unknown_fields: true
115
+
116
+ yield result, operation if block_given?
117
+ result
118
+ end
119
+
120
+ ##
121
+ # Baseline implementation for the rename_data_policy REST call
122
+ #
123
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::RenameDataPolicyRequest]
124
+ # A request object representing the call parameters. Required.
125
+ # @param options [::Gapic::CallOptions]
126
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
+ #
128
+ # @yield [result, operation] Access the result along with the TransportOperation object
129
+ # @yieldparam result [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
130
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
131
+ #
132
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
133
+ # A result object deserialized from the server's reply
134
+ def rename_data_policy request_pb, options = nil
135
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
136
+
137
+ verb, uri, query_string_params, body = ServiceStub.transcode_rename_data_policy_request request_pb
138
+ query_string_params = if query_string_params.any?
139
+ query_string_params.to_h { |p| p.split("=", 2) }
140
+ else
141
+ {}
142
+ end
143
+
144
+ response = @client_stub.make_http_request(
145
+ verb,
146
+ uri: uri,
147
+ body: body || "",
148
+ params: query_string_params,
149
+ options: options
150
+ )
151
+ operation = ::Gapic::Rest::TransportOperation.new response
152
+ result = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy.decode_json response.body, ignore_unknown_fields: true
153
+
154
+ yield result, operation if block_given?
155
+ result
156
+ end
157
+
158
+ ##
159
+ # Baseline implementation for the delete_data_policy REST call
160
+ #
161
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::DeleteDataPolicyRequest]
162
+ # A request object representing the call parameters. Required.
163
+ # @param options [::Gapic::CallOptions]
164
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
165
+ #
166
+ # @yield [result, operation] Access the result along with the TransportOperation object
167
+ # @yieldparam result [::Google::Protobuf::Empty]
168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
169
+ #
170
+ # @return [::Google::Protobuf::Empty]
171
+ # A result object deserialized from the server's reply
172
+ def delete_data_policy request_pb, options = nil
173
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
174
+
175
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_policy_request request_pb
176
+ query_string_params = if query_string_params.any?
177
+ query_string_params.to_h { |p| p.split("=", 2) }
178
+ else
179
+ {}
180
+ end
181
+
182
+ response = @client_stub.make_http_request(
183
+ verb,
184
+ uri: uri,
185
+ body: body || "",
186
+ params: query_string_params,
187
+ options: options
188
+ )
189
+ operation = ::Gapic::Rest::TransportOperation.new response
190
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
191
+
192
+ yield result, operation if block_given?
193
+ result
194
+ end
195
+
196
+ ##
197
+ # Baseline implementation for the get_data_policy REST call
198
+ #
199
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::GetDataPolicyRequest]
200
+ # A request object representing the call parameters. Required.
201
+ # @param options [::Gapic::CallOptions]
202
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203
+ #
204
+ # @yield [result, operation] Access the result along with the TransportOperation object
205
+ # @yieldparam result [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
206
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
207
+ #
208
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy]
209
+ # A result object deserialized from the server's reply
210
+ def get_data_policy request_pb, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
212
+
213
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_data_policy_request request_pb
214
+ query_string_params = if query_string_params.any?
215
+ query_string_params.to_h { |p| p.split("=", 2) }
216
+ else
217
+ {}
218
+ end
219
+
220
+ response = @client_stub.make_http_request(
221
+ verb,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ options: options
226
+ )
227
+ operation = ::Gapic::Rest::TransportOperation.new response
228
+ result = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicy.decode_json response.body, ignore_unknown_fields: true
229
+
230
+ yield result, operation if block_given?
231
+ result
232
+ end
233
+
234
+ ##
235
+ # Baseline implementation for the list_data_policies REST call
236
+ #
237
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::ListDataPoliciesRequest]
238
+ # A request object representing the call parameters. Required.
239
+ # @param options [::Gapic::CallOptions]
240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
241
+ #
242
+ # @yield [result, operation] Access the result along with the TransportOperation object
243
+ # @yieldparam result [::Google::Cloud::Bigquery::DataPolicies::V1::ListDataPoliciesResponse]
244
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
245
+ #
246
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1::ListDataPoliciesResponse]
247
+ # A result object deserialized from the server's reply
248
+ def list_data_policies request_pb, options = nil
249
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
250
+
251
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_data_policies_request request_pb
252
+ query_string_params = if query_string_params.any?
253
+ query_string_params.to_h { |p| p.split("=", 2) }
254
+ else
255
+ {}
256
+ end
257
+
258
+ response = @client_stub.make_http_request(
259
+ verb,
260
+ uri: uri,
261
+ body: body || "",
262
+ params: query_string_params,
263
+ options: options
264
+ )
265
+ operation = ::Gapic::Rest::TransportOperation.new response
266
+ result = ::Google::Cloud::Bigquery::DataPolicies::V1::ListDataPoliciesResponse.decode_json response.body, ignore_unknown_fields: true
267
+
268
+ yield result, operation if block_given?
269
+ result
270
+ end
271
+
272
+ ##
273
+ # Baseline implementation for the get_iam_policy REST call
274
+ #
275
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
276
+ # A request object representing the call parameters. Required.
277
+ # @param options [::Gapic::CallOptions]
278
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
279
+ #
280
+ # @yield [result, operation] Access the result along with the TransportOperation object
281
+ # @yieldparam result [::Google::Iam::V1::Policy]
282
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
283
+ #
284
+ # @return [::Google::Iam::V1::Policy]
285
+ # A result object deserialized from the server's reply
286
+ def get_iam_policy request_pb, options = nil
287
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
288
+
289
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
290
+ query_string_params = if query_string_params.any?
291
+ query_string_params.to_h { |p| p.split("=", 2) }
292
+ else
293
+ {}
294
+ end
295
+
296
+ response = @client_stub.make_http_request(
297
+ verb,
298
+ uri: uri,
299
+ body: body || "",
300
+ params: query_string_params,
301
+ options: options
302
+ )
303
+ operation = ::Gapic::Rest::TransportOperation.new response
304
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
305
+
306
+ yield result, operation if block_given?
307
+ result
308
+ end
309
+
310
+ ##
311
+ # Baseline implementation for the set_iam_policy REST call
312
+ #
313
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
314
+ # A request object representing the call parameters. Required.
315
+ # @param options [::Gapic::CallOptions]
316
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
317
+ #
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Iam::V1::Policy]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Iam::V1::Policy]
323
+ # A result object deserialized from the server's reply
324
+ def set_iam_policy request_pb, options = nil
325
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
326
+
327
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
328
+ query_string_params = if query_string_params.any?
329
+ query_string_params.to_h { |p| p.split("=", 2) }
330
+ else
331
+ {}
332
+ end
333
+
334
+ response = @client_stub.make_http_request(
335
+ verb,
336
+ uri: uri,
337
+ body: body || "",
338
+ params: query_string_params,
339
+ options: options
340
+ )
341
+ operation = ::Gapic::Rest::TransportOperation.new response
342
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
343
+
344
+ yield result, operation if block_given?
345
+ result
346
+ end
347
+
348
+ ##
349
+ # Baseline implementation for the test_iam_permissions REST call
350
+ #
351
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
352
+ # A request object representing the call parameters. Required.
353
+ # @param options [::Gapic::CallOptions]
354
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
355
+ #
356
+ # @yield [result, operation] Access the result along with the TransportOperation object
357
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
359
+ #
360
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
361
+ # A result object deserialized from the server's reply
362
+ def test_iam_permissions request_pb, options = nil
363
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
364
+
365
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
366
+ query_string_params = if query_string_params.any?
367
+ query_string_params.to_h { |p| p.split("=", 2) }
368
+ else
369
+ {}
370
+ end
371
+
372
+ response = @client_stub.make_http_request(
373
+ verb,
374
+ uri: uri,
375
+ body: body || "",
376
+ params: query_string_params,
377
+ options: options
378
+ )
379
+ operation = ::Gapic::Rest::TransportOperation.new response
380
+ result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
381
+
382
+ yield result, operation if block_given?
383
+ result
384
+ end
385
+
386
+ ##
387
+ # @private
388
+ #
389
+ # GRPC transcoding helper method for the create_data_policy REST call
390
+ #
391
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::CreateDataPolicyRequest]
392
+ # A request object representing the call parameters. Required.
393
+ # @return [Array(String, [String, nil], Hash{String => String})]
394
+ # Uri, Body, Query string parameters
395
+ def self.transcode_create_data_policy_request request_pb
396
+ transcoder = Gapic::Rest::GrpcTranscoder.new
397
+ .with_bindings(
398
+ uri_method: :post,
399
+ uri_template: "/v1/{parent}/dataPolicies",
400
+ body: "data_policy",
401
+ matches: [
402
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
403
+ ]
404
+ )
405
+ transcoder.transcode request_pb
406
+ end
407
+
408
+ ##
409
+ # @private
410
+ #
411
+ # GRPC transcoding helper method for the update_data_policy REST call
412
+ #
413
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::UpdateDataPolicyRequest]
414
+ # A request object representing the call parameters. Required.
415
+ # @return [Array(String, [String, nil], Hash{String => String})]
416
+ # Uri, Body, Query string parameters
417
+ def self.transcode_update_data_policy_request request_pb
418
+ transcoder = Gapic::Rest::GrpcTranscoder.new
419
+ .with_bindings(
420
+ uri_method: :patch,
421
+ uri_template: "/v1/{data_policy.name}",
422
+ body: "data_policy",
423
+ matches: [
424
+ ["data_policy.name", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
425
+ ]
426
+ )
427
+ transcoder.transcode request_pb
428
+ end
429
+
430
+ ##
431
+ # @private
432
+ #
433
+ # GRPC transcoding helper method for the rename_data_policy REST call
434
+ #
435
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::RenameDataPolicyRequest]
436
+ # A request object representing the call parameters. Required.
437
+ # @return [Array(String, [String, nil], Hash{String => String})]
438
+ # Uri, Body, Query string parameters
439
+ def self.transcode_rename_data_policy_request request_pb
440
+ transcoder = Gapic::Rest::GrpcTranscoder.new
441
+ .with_bindings(
442
+ uri_method: :post,
443
+ uri_template: "/v1/{name}:rename",
444
+ body: "*",
445
+ matches: [
446
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
447
+ ]
448
+ )
449
+ transcoder.transcode request_pb
450
+ end
451
+
452
+ ##
453
+ # @private
454
+ #
455
+ # GRPC transcoding helper method for the delete_data_policy REST call
456
+ #
457
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::DeleteDataPolicyRequest]
458
+ # A request object representing the call parameters. Required.
459
+ # @return [Array(String, [String, nil], Hash{String => String})]
460
+ # Uri, Body, Query string parameters
461
+ def self.transcode_delete_data_policy_request request_pb
462
+ transcoder = Gapic::Rest::GrpcTranscoder.new
463
+ .with_bindings(
464
+ uri_method: :delete,
465
+ uri_template: "/v1/{name}",
466
+ matches: [
467
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
468
+ ]
469
+ )
470
+ transcoder.transcode request_pb
471
+ end
472
+
473
+ ##
474
+ # @private
475
+ #
476
+ # GRPC transcoding helper method for the get_data_policy REST call
477
+ #
478
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::GetDataPolicyRequest]
479
+ # A request object representing the call parameters. Required.
480
+ # @return [Array(String, [String, nil], Hash{String => String})]
481
+ # Uri, Body, Query string parameters
482
+ def self.transcode_get_data_policy_request request_pb
483
+ transcoder = Gapic::Rest::GrpcTranscoder.new
484
+ .with_bindings(
485
+ uri_method: :get,
486
+ uri_template: "/v1/{name}",
487
+ matches: [
488
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
489
+ ]
490
+ )
491
+ transcoder.transcode request_pb
492
+ end
493
+
494
+ ##
495
+ # @private
496
+ #
497
+ # GRPC transcoding helper method for the list_data_policies REST call
498
+ #
499
+ # @param request_pb [::Google::Cloud::Bigquery::DataPolicies::V1::ListDataPoliciesRequest]
500
+ # A request object representing the call parameters. Required.
501
+ # @return [Array(String, [String, nil], Hash{String => String})]
502
+ # Uri, Body, Query string parameters
503
+ def self.transcode_list_data_policies_request request_pb
504
+ transcoder = Gapic::Rest::GrpcTranscoder.new
505
+ .with_bindings(
506
+ uri_method: :get,
507
+ uri_template: "/v1/{parent}/dataPolicies",
508
+ matches: [
509
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
510
+ ]
511
+ )
512
+ transcoder.transcode request_pb
513
+ end
514
+
515
+ ##
516
+ # @private
517
+ #
518
+ # GRPC transcoding helper method for the get_iam_policy REST call
519
+ #
520
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
521
+ # A request object representing the call parameters. Required.
522
+ # @return [Array(String, [String, nil], Hash{String => String})]
523
+ # Uri, Body, Query string parameters
524
+ def self.transcode_get_iam_policy_request request_pb
525
+ transcoder = Gapic::Rest::GrpcTranscoder.new
526
+ .with_bindings(
527
+ uri_method: :post,
528
+ uri_template: "/v1/{resource}:getIamPolicy",
529
+ body: "*",
530
+ matches: [
531
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
532
+ ]
533
+ )
534
+ transcoder.transcode request_pb
535
+ end
536
+
537
+ ##
538
+ # @private
539
+ #
540
+ # GRPC transcoding helper method for the set_iam_policy REST call
541
+ #
542
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
543
+ # A request object representing the call parameters. Required.
544
+ # @return [Array(String, [String, nil], Hash{String => String})]
545
+ # Uri, Body, Query string parameters
546
+ def self.transcode_set_iam_policy_request request_pb
547
+ transcoder = Gapic::Rest::GrpcTranscoder.new
548
+ .with_bindings(
549
+ uri_method: :post,
550
+ uri_template: "/v1/{resource}:setIamPolicy",
551
+ body: "*",
552
+ matches: [
553
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
554
+ ]
555
+ )
556
+ transcoder.transcode request_pb
557
+ end
558
+
559
+ ##
560
+ # @private
561
+ #
562
+ # GRPC transcoding helper method for the test_iam_permissions REST call
563
+ #
564
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
565
+ # A request object representing the call parameters. Required.
566
+ # @return [Array(String, [String, nil], Hash{String => String})]
567
+ # Uri, Body, Query string parameters
568
+ def self.transcode_test_iam_permissions_request request_pb
569
+ transcoder = Gapic::Rest::GrpcTranscoder.new
570
+ .with_bindings(
571
+ uri_method: :post,
572
+ uri_template: "/v1/{resource}:testIamPermissions",
573
+ body: "*",
574
+ matches: [
575
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/dataPolicies/[^/]+/?$}, false]
576
+ ]
577
+ )
578
+ transcoder.transcode request_pb
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/bigquery/data_policies/v1/version"
24
+
25
+ require "google/cloud/bigquery/data_policies/v1/data_policy_service/credentials"
26
+ require "google/cloud/bigquery/data_policies/v1/data_policy_service/paths"
27
+ require "google/cloud/bigquery/data_policies/v1/data_policy_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Bigquery
32
+ module DataPolicies
33
+ module V1
34
+ ##
35
+ # Data Policy Service provides APIs for managing the label-policy bindings.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/bigquery/data_policies/v1/data_policy_service/rest"
40
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Rest::Client.new
41
+ #
42
+ module DataPolicyService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
54
+ require "google/cloud/bigquery/data_policies/v1/data_policy_service/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/bigquery/data_policies/v1/version"
25
25
  require "google/cloud/bigquery/data_policies/v1/data_policy_service/credentials"
26
26
  require "google/cloud/bigquery/data_policies/v1/data_policy_service/paths"
27
27
  require "google/cloud/bigquery/data_policies/v1/data_policy_service/client"
28
+ require "google/cloud/bigquery/data_policies/v1/data_policy_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -39,6 +40,11 @@ module Google
39
40
  # require "google/cloud/bigquery/data_policies/v1/data_policy_service"
40
41
  # client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Client.new
41
42
  #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/bigquery/data_policies/v1/data_policy_service/rest"
46
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Rest::Client.new
47
+ #
42
48
  module DataPolicyService
43
49
  end
44
50
  end