google-cloud-bigquery-data_policies-v1beta1 0.a → 0.1.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.
@@ -0,0 +1,1128 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/errors"
20
+ require "google/cloud/bigquery/datapolicies/v1beta1/datapolicy_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module DataPolicies
26
+ module V1beta1
27
+ module DataPolicyService
28
+ ##
29
+ # Client for the DataPolicyService service.
30
+ #
31
+ # Data Policy Service provides APIs for managing the label-policy bindings.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :data_policy_service_stub
38
+
39
+ ##
40
+ # Configure the DataPolicyService Client class.
41
+ #
42
+ # See {::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all DataPolicyService clients
48
+ # ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Bigquery", "DataPolicies", "V1beta1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_data_policy.timeout = 60.0
69
+ default_config.rpcs.create_data_policy.retry_policy = {
70
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
71
+ }
72
+
73
+ default_config.rpcs.update_data_policy.timeout = 60.0
74
+ default_config.rpcs.update_data_policy.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.delete_data_policy.timeout = 60.0
79
+ default_config.rpcs.delete_data_policy.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.get_data_policy.timeout = 60.0
84
+ default_config.rpcs.get_data_policy.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.list_data_policies.timeout = 60.0
89
+ default_config.rpcs.list_data_policies.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.get_iam_policy.timeout = 60.0
94
+ default_config.rpcs.get_iam_policy.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.set_iam_policy.timeout = 60.0
99
+ default_config.rpcs.set_iam_policy.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.test_iam_permissions.timeout = 60.0
104
+ default_config.rpcs.test_iam_permissions.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config
109
+ end
110
+ yield @configure if block_given?
111
+ @configure
112
+ end
113
+
114
+ ##
115
+ # Configure the DataPolicyService Client instance.
116
+ #
117
+ # The configuration is set to the derived mode, meaning that values can be changed,
118
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
119
+ # should be made on {Client.configure}.
120
+ #
121
+ # See {::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client::Configuration}
122
+ # for a description of the configuration fields.
123
+ #
124
+ # @yield [config] Configure the Client client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ # @return [Client::Configuration]
128
+ #
129
+ def configure
130
+ yield @config if block_given?
131
+ @config
132
+ end
133
+
134
+ ##
135
+ # Create a new DataPolicyService client object.
136
+ #
137
+ # @example
138
+ #
139
+ # # Create a client using the default configuration
140
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
141
+ #
142
+ # # Create a client using a custom configuration
143
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new do |config|
144
+ # config.timeout = 10.0
145
+ # end
146
+ #
147
+ # @yield [config] Configure the DataPolicyService client.
148
+ # @yieldparam config [Client::Configuration]
149
+ #
150
+ def initialize
151
+ # These require statements are intentionally placed here to initialize
152
+ # the gRPC module only when it's required.
153
+ # See https://github.com/googleapis/toolkit/issues/446
154
+ require "gapic/grpc"
155
+ require "google/cloud/bigquery/datapolicies/v1beta1/datapolicy_services_pb"
156
+
157
+ # Create the configuration object
158
+ @config = Configuration.new Client.configure
159
+
160
+ # Yield the configuration if needed
161
+ yield @config if block_given?
162
+
163
+ # Create credentials
164
+ credentials = @config.credentials
165
+ # Use self-signed JWT if the endpoint is unchanged from default,
166
+ # but only if the default endpoint does not have a region prefix.
167
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
168
+ !@config.endpoint.split(".").first.include?("-")
169
+ credentials ||= Credentials.default scope: @config.scope,
170
+ enable_self_signed_jwt: enable_self_signed_jwt
171
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
172
+ credentials = Credentials.new credentials, scope: @config.scope
173
+ end
174
+ @quota_project_id = @config.quota_project
175
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
176
+
177
+ @data_policy_service_stub = ::Gapic::ServiceStub.new(
178
+ ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Stub,
179
+ credentials: credentials,
180
+ endpoint: @config.endpoint,
181
+ channel_args: @config.channel_args,
182
+ interceptors: @config.interceptors
183
+ )
184
+ end
185
+
186
+ # Service calls
187
+
188
+ ##
189
+ # Creates a new data policy under a project with the given `dataPolicyId`
190
+ # (used as the display name), policy tag, and data policy type.
191
+ #
192
+ # @overload create_data_policy(request, options = nil)
193
+ # Pass arguments to `create_data_policy` via a request object, either of type
194
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest} or an equivalent Hash.
195
+ #
196
+ # @param request [::Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest, ::Hash]
197
+ # A request object representing the call parameters. Required. To specify no
198
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
199
+ # @param options [::Gapic::CallOptions, ::Hash]
200
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
201
+ #
202
+ # @overload create_data_policy(parent: nil, data_policy: nil)
203
+ # Pass arguments to `create_data_policy` via keyword arguments. Note that at
204
+ # least one keyword argument is required. To specify no parameters, or to keep all
205
+ # the default parameter values, pass an empty Hash as a request object (see above).
206
+ #
207
+ # @param parent [::String]
208
+ # Required. Resource name of the project that the data policy will belong to. The
209
+ # format is `projects/{project_number}/locations/{location_id}`.
210
+ # @param data_policy [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy, ::Hash]
211
+ # Required. The data policy to create. The `name` field does not need to be
212
+ # provided for the data policy creation.
213
+ #
214
+ # @yield [response, operation] Access the result along with the RPC operation
215
+ # @yieldparam response [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
216
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
217
+ #
218
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
219
+ #
220
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
221
+ #
222
+ # @example Basic example
223
+ # require "google/cloud/bigquery/data_policies/v1beta1"
224
+ #
225
+ # # Create a client object. The client can be reused for multiple calls.
226
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
227
+ #
228
+ # # Create a request. To set request fields, pass in keyword arguments.
229
+ # request = Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest.new
230
+ #
231
+ # # Call the create_data_policy method.
232
+ # result = client.create_data_policy request
233
+ #
234
+ # # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy.
235
+ # p result
236
+ #
237
+ def create_data_policy request, options = nil
238
+ raise ::ArgumentError, "request must be provided" if request.nil?
239
+
240
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest
241
+
242
+ # Converts hash and nil to an options object
243
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
244
+
245
+ # Customize the options with defaults
246
+ metadata = @config.rpcs.create_data_policy.metadata.to_h
247
+
248
+ # Set x-goog-api-client and x-goog-user-project headers
249
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
250
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
251
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
252
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
+
254
+ header_params = {}
255
+ if request.parent
256
+ header_params["parent"] = request.parent
257
+ end
258
+
259
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
260
+ metadata[:"x-goog-request-params"] ||= request_params_header
261
+
262
+ options.apply_defaults timeout: @config.rpcs.create_data_policy.timeout,
263
+ metadata: metadata,
264
+ retry_policy: @config.rpcs.create_data_policy.retry_policy
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
268
+ retry_policy: @config.retry_policy
269
+
270
+ @data_policy_service_stub.call_rpc :create_data_policy, request, options: options do |response, operation|
271
+ yield response, operation if block_given?
272
+ return response
273
+ end
274
+ rescue ::GRPC::BadStatus => e
275
+ raise ::Google::Cloud::Error.from_error(e)
276
+ end
277
+
278
+ ##
279
+ # Updates the metadata for an existing data policy. The target data policy
280
+ # can be specified by the resource name.
281
+ #
282
+ # @overload update_data_policy(request, options = nil)
283
+ # Pass arguments to `update_data_policy` via a request object, either of type
284
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest} or an equivalent Hash.
285
+ #
286
+ # @param request [::Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest, ::Hash]
287
+ # A request object representing the call parameters. Required. To specify no
288
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
289
+ # @param options [::Gapic::CallOptions, ::Hash]
290
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
291
+ #
292
+ # @overload update_data_policy(data_policy: nil, update_mask: nil)
293
+ # Pass arguments to `update_data_policy` via keyword arguments. Note that at
294
+ # least one keyword argument is required. To specify no parameters, or to keep all
295
+ # the default parameter values, pass an empty Hash as a request object (see above).
296
+ #
297
+ # @param data_policy [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy, ::Hash]
298
+ # Required. Update the data policy's metadata.
299
+ #
300
+ # The target data policy is determined by the `name` field.
301
+ # Other fields are updated to the specified values based on the field masks.
302
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
303
+ # The update mask applies to the resource. For the `FieldMask` definition,
304
+ # see
305
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
306
+ # If not set, defaults to all of the fields that are allowed to update.
307
+ #
308
+ # Updates to the `name` and `dataPolicyId` fields are not allowed.
309
+ #
310
+ # @yield [response, operation] Access the result along with the RPC operation
311
+ # @yieldparam response [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
312
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
313
+ #
314
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
315
+ #
316
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
317
+ #
318
+ # @example Basic example
319
+ # require "google/cloud/bigquery/data_policies/v1beta1"
320
+ #
321
+ # # Create a client object. The client can be reused for multiple calls.
322
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
323
+ #
324
+ # # Create a request. To set request fields, pass in keyword arguments.
325
+ # request = Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest.new
326
+ #
327
+ # # Call the update_data_policy method.
328
+ # result = client.update_data_policy request
329
+ #
330
+ # # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy.
331
+ # p result
332
+ #
333
+ def update_data_policy request, options = nil
334
+ raise ::ArgumentError, "request must be provided" if request.nil?
335
+
336
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest
337
+
338
+ # Converts hash and nil to an options object
339
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
340
+
341
+ # Customize the options with defaults
342
+ metadata = @config.rpcs.update_data_policy.metadata.to_h
343
+
344
+ # Set x-goog-api-client and x-goog-user-project headers
345
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
346
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
347
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
348
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
349
+
350
+ header_params = {}
351
+ if request.data_policy&.name
352
+ header_params["data_policy.name"] = request.data_policy.name
353
+ end
354
+
355
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
356
+ metadata[:"x-goog-request-params"] ||= request_params_header
357
+
358
+ options.apply_defaults timeout: @config.rpcs.update_data_policy.timeout,
359
+ metadata: metadata,
360
+ retry_policy: @config.rpcs.update_data_policy.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @data_policy_service_stub.call_rpc :update_data_policy, request, options: options do |response, operation|
367
+ yield response, operation if block_given?
368
+ return response
369
+ end
370
+ rescue ::GRPC::BadStatus => e
371
+ raise ::Google::Cloud::Error.from_error(e)
372
+ end
373
+
374
+ ##
375
+ # Deletes the data policy specified by its resource name.
376
+ #
377
+ # @overload delete_data_policy(request, options = nil)
378
+ # Pass arguments to `delete_data_policy` via a request object, either of type
379
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest} or an equivalent Hash.
380
+ #
381
+ # @param request [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest, ::Hash]
382
+ # A request object representing the call parameters. Required. To specify no
383
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
384
+ # @param options [::Gapic::CallOptions, ::Hash]
385
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
386
+ #
387
+ # @overload delete_data_policy(name: nil)
388
+ # Pass arguments to `delete_data_policy` via keyword arguments. Note that at
389
+ # least one keyword argument is required. To specify no parameters, or to keep all
390
+ # the default parameter values, pass an empty Hash as a request object (see above).
391
+ #
392
+ # @param name [::String]
393
+ # Required. Resource name of the data policy to delete. Format is
394
+ # `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
395
+ #
396
+ # @yield [response, operation] Access the result along with the RPC operation
397
+ # @yieldparam response [::Google::Protobuf::Empty]
398
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
399
+ #
400
+ # @return [::Google::Protobuf::Empty]
401
+ #
402
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/cloud/bigquery/data_policies/v1beta1"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest.new
412
+ #
413
+ # # Call the delete_data_policy method.
414
+ # result = client.delete_data_policy request
415
+ #
416
+ # # The returned object is of type Google::Protobuf::Empty.
417
+ # p result
418
+ #
419
+ def delete_data_policy request, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request.nil?
421
+
422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest
423
+
424
+ # Converts hash and nil to an options object
425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
+
427
+ # Customize the options with defaults
428
+ metadata = @config.rpcs.delete_data_policy.metadata.to_h
429
+
430
+ # Set x-goog-api-client and x-goog-user-project headers
431
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
433
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
434
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
435
+
436
+ header_params = {}
437
+ if request.name
438
+ header_params["name"] = request.name
439
+ end
440
+
441
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
442
+ metadata[:"x-goog-request-params"] ||= request_params_header
443
+
444
+ options.apply_defaults timeout: @config.rpcs.delete_data_policy.timeout,
445
+ metadata: metadata,
446
+ retry_policy: @config.rpcs.delete_data_policy.retry_policy
447
+
448
+ options.apply_defaults timeout: @config.timeout,
449
+ metadata: @config.metadata,
450
+ retry_policy: @config.retry_policy
451
+
452
+ @data_policy_service_stub.call_rpc :delete_data_policy, request, options: options do |response, operation|
453
+ yield response, operation if block_given?
454
+ return response
455
+ end
456
+ rescue ::GRPC::BadStatus => e
457
+ raise ::Google::Cloud::Error.from_error(e)
458
+ end
459
+
460
+ ##
461
+ # Gets the data policy specified by its resource name.
462
+ #
463
+ # @overload get_data_policy(request, options = nil)
464
+ # Pass arguments to `get_data_policy` via a request object, either of type
465
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest} or an equivalent Hash.
466
+ #
467
+ # @param request [::Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest, ::Hash]
468
+ # A request object representing the call parameters. Required. To specify no
469
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
470
+ # @param options [::Gapic::CallOptions, ::Hash]
471
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
472
+ #
473
+ # @overload get_data_policy(name: nil)
474
+ # Pass arguments to `get_data_policy` via keyword arguments. Note that at
475
+ # least one keyword argument is required. To specify no parameters, or to keep all
476
+ # the default parameter values, pass an empty Hash as a request object (see above).
477
+ #
478
+ # @param name [::String]
479
+ # Required. Resource name of the requested data policy. Format is
480
+ # `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
481
+ #
482
+ # @yield [response, operation] Access the result along with the RPC operation
483
+ # @yieldparam response [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
484
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
485
+ #
486
+ # @return [::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy]
487
+ #
488
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
489
+ #
490
+ # @example Basic example
491
+ # require "google/cloud/bigquery/data_policies/v1beta1"
492
+ #
493
+ # # Create a client object. The client can be reused for multiple calls.
494
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
495
+ #
496
+ # # Create a request. To set request fields, pass in keyword arguments.
497
+ # request = Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest.new
498
+ #
499
+ # # Call the get_data_policy method.
500
+ # result = client.get_data_policy request
501
+ #
502
+ # # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy.
503
+ # p result
504
+ #
505
+ def get_data_policy request, options = nil
506
+ raise ::ArgumentError, "request must be provided" if request.nil?
507
+
508
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest
509
+
510
+ # Converts hash and nil to an options object
511
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
512
+
513
+ # Customize the options with defaults
514
+ metadata = @config.rpcs.get_data_policy.metadata.to_h
515
+
516
+ # Set x-goog-api-client and x-goog-user-project headers
517
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
518
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
519
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
520
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
521
+
522
+ header_params = {}
523
+ if request.name
524
+ header_params["name"] = request.name
525
+ end
526
+
527
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
528
+ metadata[:"x-goog-request-params"] ||= request_params_header
529
+
530
+ options.apply_defaults timeout: @config.rpcs.get_data_policy.timeout,
531
+ metadata: metadata,
532
+ retry_policy: @config.rpcs.get_data_policy.retry_policy
533
+
534
+ options.apply_defaults timeout: @config.timeout,
535
+ metadata: @config.metadata,
536
+ retry_policy: @config.retry_policy
537
+
538
+ @data_policy_service_stub.call_rpc :get_data_policy, request, options: options do |response, operation|
539
+ yield response, operation if block_given?
540
+ return response
541
+ end
542
+ rescue ::GRPC::BadStatus => e
543
+ raise ::Google::Cloud::Error.from_error(e)
544
+ end
545
+
546
+ ##
547
+ # List all of the data policies in the specified parent project.
548
+ #
549
+ # @overload list_data_policies(request, options = nil)
550
+ # Pass arguments to `list_data_policies` via a request object, either of type
551
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest} or an equivalent Hash.
552
+ #
553
+ # @param request [::Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest, ::Hash]
554
+ # A request object representing the call parameters. Required. To specify no
555
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
556
+ # @param options [::Gapic::CallOptions, ::Hash]
557
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
558
+ #
559
+ # @overload list_data_policies(parent: nil, page_size: nil, page_token: nil)
560
+ # Pass arguments to `list_data_policies` via keyword arguments. Note that at
561
+ # least one keyword argument is required. To specify no parameters, or to keep all
562
+ # the default parameter values, pass an empty Hash as a request object (see above).
563
+ #
564
+ # @param parent [::String]
565
+ # Required. Resource name of the project for which to list data policies. Format is
566
+ # `projects/{project_number}/locations/{location_id}`.
567
+ # @param page_size [::Integer]
568
+ # The maximum number of data policies to return. Must be a value between 1
569
+ # and 1000.
570
+ # If not set, defaults to 50.
571
+ # @param page_token [::String]
572
+ # The `nextPageToken` value returned from a previous list request, if any. If
573
+ # not set, defaults to an empty string.
574
+ #
575
+ # @yield [response, operation] Access the result along with the RPC operation
576
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy>]
577
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
578
+ #
579
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy>]
580
+ #
581
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
582
+ #
583
+ # @example Basic example
584
+ # require "google/cloud/bigquery/data_policies/v1beta1"
585
+ #
586
+ # # Create a client object. The client can be reused for multiple calls.
587
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
588
+ #
589
+ # # Create a request. To set request fields, pass in keyword arguments.
590
+ # request = Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest.new
591
+ #
592
+ # # Call the list_data_policies method.
593
+ # result = client.list_data_policies request
594
+ #
595
+ # # The returned object is of type Gapic::PagedEnumerable. You can
596
+ # # iterate over all elements by calling #each, and the enumerable
597
+ # # will lazily make API calls to fetch subsequent pages. Other
598
+ # # methods are also available for managing paging directly.
599
+ # result.each do |response|
600
+ # # Each element is of type ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy.
601
+ # p response
602
+ # end
603
+ #
604
+ def list_data_policies request, options = nil
605
+ raise ::ArgumentError, "request must be provided" if request.nil?
606
+
607
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest
608
+
609
+ # Converts hash and nil to an options object
610
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
611
+
612
+ # Customize the options with defaults
613
+ metadata = @config.rpcs.list_data_policies.metadata.to_h
614
+
615
+ # Set x-goog-api-client and x-goog-user-project headers
616
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
617
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
618
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
619
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
620
+
621
+ header_params = {}
622
+ if request.parent
623
+ header_params["parent"] = request.parent
624
+ end
625
+
626
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
627
+ metadata[:"x-goog-request-params"] ||= request_params_header
628
+
629
+ options.apply_defaults timeout: @config.rpcs.list_data_policies.timeout,
630
+ metadata: metadata,
631
+ retry_policy: @config.rpcs.list_data_policies.retry_policy
632
+
633
+ options.apply_defaults timeout: @config.timeout,
634
+ metadata: @config.metadata,
635
+ retry_policy: @config.retry_policy
636
+
637
+ @data_policy_service_stub.call_rpc :list_data_policies, request, options: options do |response, operation|
638
+ response = ::Gapic::PagedEnumerable.new @data_policy_service_stub, :list_data_policies, request, response, operation, options
639
+ yield response, operation if block_given?
640
+ return response
641
+ end
642
+ rescue ::GRPC::BadStatus => e
643
+ raise ::Google::Cloud::Error.from_error(e)
644
+ end
645
+
646
+ ##
647
+ # Gets the IAM policy for the specified data policy.
648
+ #
649
+ # @overload get_iam_policy(request, options = nil)
650
+ # Pass arguments to `get_iam_policy` via a request object, either of type
651
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
652
+ #
653
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
654
+ # A request object representing the call parameters. Required. To specify no
655
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
656
+ # @param options [::Gapic::CallOptions, ::Hash]
657
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
658
+ #
659
+ # @overload get_iam_policy(resource: nil, options: nil)
660
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
661
+ # least one keyword argument is required. To specify no parameters, or to keep all
662
+ # the default parameter values, pass an empty Hash as a request object (see above).
663
+ #
664
+ # @param resource [::String]
665
+ # REQUIRED: The resource for which the policy is being requested.
666
+ # See the operation documentation for the appropriate value for this field.
667
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
668
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
669
+ # `GetIamPolicy`.
670
+ #
671
+ # @yield [response, operation] Access the result along with the RPC operation
672
+ # @yieldparam response [::Google::Iam::V1::Policy]
673
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
674
+ #
675
+ # @return [::Google::Iam::V1::Policy]
676
+ #
677
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
678
+ #
679
+ # @example Basic example
680
+ # require "google/cloud/bigquery/data_policies/v1beta1"
681
+ #
682
+ # # Create a client object. The client can be reused for multiple calls.
683
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
684
+ #
685
+ # # Create a request. To set request fields, pass in keyword arguments.
686
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
687
+ #
688
+ # # Call the get_iam_policy method.
689
+ # result = client.get_iam_policy request
690
+ #
691
+ # # The returned object is of type Google::Iam::V1::Policy.
692
+ # p result
693
+ #
694
+ def get_iam_policy request, options = nil
695
+ raise ::ArgumentError, "request must be provided" if request.nil?
696
+
697
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
698
+
699
+ # Converts hash and nil to an options object
700
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
701
+
702
+ # Customize the options with defaults
703
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
704
+
705
+ # Set x-goog-api-client and x-goog-user-project headers
706
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
707
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
708
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
709
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
710
+
711
+ header_params = {}
712
+ if request.resource
713
+ header_params["resource"] = request.resource
714
+ end
715
+
716
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
717
+ metadata[:"x-goog-request-params"] ||= request_params_header
718
+
719
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
720
+ metadata: metadata,
721
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
722
+
723
+ options.apply_defaults timeout: @config.timeout,
724
+ metadata: @config.metadata,
725
+ retry_policy: @config.retry_policy
726
+
727
+ @data_policy_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
728
+ yield response, operation if block_given?
729
+ return response
730
+ end
731
+ rescue ::GRPC::BadStatus => e
732
+ raise ::Google::Cloud::Error.from_error(e)
733
+ end
734
+
735
+ ##
736
+ # Sets the IAM policy for the specified data policy.
737
+ #
738
+ # @overload set_iam_policy(request, options = nil)
739
+ # Pass arguments to `set_iam_policy` via a request object, either of type
740
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
741
+ #
742
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
743
+ # A request object representing the call parameters. Required. To specify no
744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
745
+ # @param options [::Gapic::CallOptions, ::Hash]
746
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
747
+ #
748
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
749
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
750
+ # least one keyword argument is required. To specify no parameters, or to keep all
751
+ # the default parameter values, pass an empty Hash as a request object (see above).
752
+ #
753
+ # @param resource [::String]
754
+ # REQUIRED: The resource for which the policy is being specified.
755
+ # See the operation documentation for the appropriate value for this field.
756
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
757
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
758
+ # the policy is limited to a few 10s of KB. An empty policy is a
759
+ # valid policy but certain Cloud Platform services (such as Projects)
760
+ # might reject them.
761
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
762
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
763
+ # the fields in the mask will be modified. If no mask is provided, the
764
+ # following default mask is used:
765
+ #
766
+ # `paths: "bindings, etag"`
767
+ #
768
+ # @yield [response, operation] Access the result along with the RPC operation
769
+ # @yieldparam response [::Google::Iam::V1::Policy]
770
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
771
+ #
772
+ # @return [::Google::Iam::V1::Policy]
773
+ #
774
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
775
+ #
776
+ # @example Basic example
777
+ # require "google/cloud/bigquery/data_policies/v1beta1"
778
+ #
779
+ # # Create a client object. The client can be reused for multiple calls.
780
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
781
+ #
782
+ # # Create a request. To set request fields, pass in keyword arguments.
783
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
784
+ #
785
+ # # Call the set_iam_policy method.
786
+ # result = client.set_iam_policy request
787
+ #
788
+ # # The returned object is of type Google::Iam::V1::Policy.
789
+ # p result
790
+ #
791
+ def set_iam_policy request, options = nil
792
+ raise ::ArgumentError, "request must be provided" if request.nil?
793
+
794
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
795
+
796
+ # Converts hash and nil to an options object
797
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
798
+
799
+ # Customize the options with defaults
800
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
801
+
802
+ # Set x-goog-api-client and x-goog-user-project headers
803
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
804
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
805
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
806
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
807
+
808
+ header_params = {}
809
+ if request.resource
810
+ header_params["resource"] = request.resource
811
+ end
812
+
813
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
814
+ metadata[:"x-goog-request-params"] ||= request_params_header
815
+
816
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
817
+ metadata: metadata,
818
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
819
+
820
+ options.apply_defaults timeout: @config.timeout,
821
+ metadata: @config.metadata,
822
+ retry_policy: @config.retry_policy
823
+
824
+ @data_policy_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
825
+ yield response, operation if block_given?
826
+ return response
827
+ end
828
+ rescue ::GRPC::BadStatus => e
829
+ raise ::Google::Cloud::Error.from_error(e)
830
+ end
831
+
832
+ ##
833
+ # Returns the caller's permission on the specified data policy resource.
834
+ #
835
+ # @overload test_iam_permissions(request, options = nil)
836
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
837
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
838
+ #
839
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
840
+ # A request object representing the call parameters. Required. To specify no
841
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
842
+ # @param options [::Gapic::CallOptions, ::Hash]
843
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
844
+ #
845
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
846
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
847
+ # least one keyword argument is required. To specify no parameters, or to keep all
848
+ # the default parameter values, pass an empty Hash as a request object (see above).
849
+ #
850
+ # @param resource [::String]
851
+ # REQUIRED: The resource for which the policy detail is being requested.
852
+ # See the operation documentation for the appropriate value for this field.
853
+ # @param permissions [::Array<::String>]
854
+ # The set of permissions to check for the `resource`. Permissions with
855
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
856
+ # information see
857
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
858
+ #
859
+ # @yield [response, operation] Access the result along with the RPC operation
860
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
861
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
862
+ #
863
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
864
+ #
865
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
866
+ #
867
+ # @example Basic example
868
+ # require "google/cloud/bigquery/data_policies/v1beta1"
869
+ #
870
+ # # Create a client object. The client can be reused for multiple calls.
871
+ # client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new
872
+ #
873
+ # # Create a request. To set request fields, pass in keyword arguments.
874
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
875
+ #
876
+ # # Call the test_iam_permissions method.
877
+ # result = client.test_iam_permissions request
878
+ #
879
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
880
+ # p result
881
+ #
882
+ def test_iam_permissions request, options = nil
883
+ raise ::ArgumentError, "request must be provided" if request.nil?
884
+
885
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
886
+
887
+ # Converts hash and nil to an options object
888
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
889
+
890
+ # Customize the options with defaults
891
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
892
+
893
+ # Set x-goog-api-client and x-goog-user-project headers
894
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
895
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
896
+ gapic_version: ::Google::Cloud::Bigquery::DataPolicies::V1beta1::VERSION
897
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
898
+
899
+ header_params = {}
900
+ if request.resource
901
+ header_params["resource"] = request.resource
902
+ end
903
+
904
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
905
+ metadata[:"x-goog-request-params"] ||= request_params_header
906
+
907
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
908
+ metadata: metadata,
909
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
910
+
911
+ options.apply_defaults timeout: @config.timeout,
912
+ metadata: @config.metadata,
913
+ retry_policy: @config.retry_policy
914
+
915
+ @data_policy_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
916
+ yield response, operation if block_given?
917
+ return response
918
+ end
919
+ rescue ::GRPC::BadStatus => e
920
+ raise ::Google::Cloud::Error.from_error(e)
921
+ end
922
+
923
+ ##
924
+ # Configuration class for the DataPolicyService API.
925
+ #
926
+ # This class represents the configuration for DataPolicyService,
927
+ # providing control over timeouts, retry behavior, logging, transport
928
+ # parameters, and other low-level controls. Certain parameters can also be
929
+ # applied individually to specific RPCs. See
930
+ # {::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client::Configuration::Rpcs}
931
+ # for a list of RPCs that can be configured independently.
932
+ #
933
+ # Configuration can be applied globally to all clients, or to a single client
934
+ # on construction.
935
+ #
936
+ # @example
937
+ #
938
+ # # Modify the global config, setting the timeout for
939
+ # # create_data_policy to 20 seconds,
940
+ # # and all remaining timeouts to 10 seconds.
941
+ # ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.configure do |config|
942
+ # config.timeout = 10.0
943
+ # config.rpcs.create_data_policy.timeout = 20.0
944
+ # end
945
+ #
946
+ # # Apply the above configuration only to a new client.
947
+ # client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new do |config|
948
+ # config.timeout = 10.0
949
+ # config.rpcs.create_data_policy.timeout = 20.0
950
+ # end
951
+ #
952
+ # @!attribute [rw] endpoint
953
+ # The hostname or hostname:port of the service endpoint.
954
+ # Defaults to `"bigquerydatapolicy.googleapis.com"`.
955
+ # @return [::String]
956
+ # @!attribute [rw] credentials
957
+ # Credentials to send with calls. You may provide any of the following types:
958
+ # * (`String`) The path to a service account key file in JSON format
959
+ # * (`Hash`) A service account key as a Hash
960
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
961
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
962
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
963
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
964
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
965
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
966
+ # * (`nil`) indicating no credentials
967
+ # @return [::Object]
968
+ # @!attribute [rw] scope
969
+ # The OAuth scopes
970
+ # @return [::Array<::String>]
971
+ # @!attribute [rw] lib_name
972
+ # The library name as recorded in instrumentation and logging
973
+ # @return [::String]
974
+ # @!attribute [rw] lib_version
975
+ # The library version as recorded in instrumentation and logging
976
+ # @return [::String]
977
+ # @!attribute [rw] channel_args
978
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
979
+ # `GRPC::Core::Channel` object is provided as the credential.
980
+ # @return [::Hash]
981
+ # @!attribute [rw] interceptors
982
+ # An array of interceptors that are run before calls are executed.
983
+ # @return [::Array<::GRPC::ClientInterceptor>]
984
+ # @!attribute [rw] timeout
985
+ # The call timeout in seconds.
986
+ # @return [::Numeric]
987
+ # @!attribute [rw] metadata
988
+ # Additional gRPC headers to be sent with the call.
989
+ # @return [::Hash{::Symbol=>::String}]
990
+ # @!attribute [rw] retry_policy
991
+ # The retry policy. The value is a hash with the following keys:
992
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
993
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
994
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
995
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
996
+ # trigger a retry.
997
+ # @return [::Hash]
998
+ # @!attribute [rw] quota_project
999
+ # A separate project against which to charge quota.
1000
+ # @return [::String]
1001
+ #
1002
+ class Configuration
1003
+ extend ::Gapic::Config
1004
+
1005
+ config_attr :endpoint, "bigquerydatapolicy.googleapis.com", ::String
1006
+ config_attr :credentials, nil do |value|
1007
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1008
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1009
+ allowed.any? { |klass| klass === value }
1010
+ end
1011
+ config_attr :scope, nil, ::String, ::Array, nil
1012
+ config_attr :lib_name, nil, ::String, nil
1013
+ config_attr :lib_version, nil, ::String, nil
1014
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1015
+ config_attr :interceptors, nil, ::Array, nil
1016
+ config_attr :timeout, nil, ::Numeric, nil
1017
+ config_attr :metadata, nil, ::Hash, nil
1018
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1019
+ config_attr :quota_project, nil, ::String, nil
1020
+
1021
+ # @private
1022
+ def initialize parent_config = nil
1023
+ @parent_config = parent_config unless parent_config.nil?
1024
+
1025
+ yield self if block_given?
1026
+ end
1027
+
1028
+ ##
1029
+ # Configurations for individual RPCs
1030
+ # @return [Rpcs]
1031
+ #
1032
+ def rpcs
1033
+ @rpcs ||= begin
1034
+ parent_rpcs = nil
1035
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1036
+ Rpcs.new parent_rpcs
1037
+ end
1038
+ end
1039
+
1040
+ ##
1041
+ # Configuration RPC class for the DataPolicyService API.
1042
+ #
1043
+ # Includes fields providing the configuration for each RPC in this service.
1044
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1045
+ # the following configuration fields:
1046
+ #
1047
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1048
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1049
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1050
+ # include the following keys:
1051
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1052
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1053
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1054
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1055
+ # trigger a retry.
1056
+ #
1057
+ class Rpcs
1058
+ ##
1059
+ # RPC-specific configuration for `create_data_policy`
1060
+ # @return [::Gapic::Config::Method]
1061
+ #
1062
+ attr_reader :create_data_policy
1063
+ ##
1064
+ # RPC-specific configuration for `update_data_policy`
1065
+ # @return [::Gapic::Config::Method]
1066
+ #
1067
+ attr_reader :update_data_policy
1068
+ ##
1069
+ # RPC-specific configuration for `delete_data_policy`
1070
+ # @return [::Gapic::Config::Method]
1071
+ #
1072
+ attr_reader :delete_data_policy
1073
+ ##
1074
+ # RPC-specific configuration for `get_data_policy`
1075
+ # @return [::Gapic::Config::Method]
1076
+ #
1077
+ attr_reader :get_data_policy
1078
+ ##
1079
+ # RPC-specific configuration for `list_data_policies`
1080
+ # @return [::Gapic::Config::Method]
1081
+ #
1082
+ attr_reader :list_data_policies
1083
+ ##
1084
+ # RPC-specific configuration for `get_iam_policy`
1085
+ # @return [::Gapic::Config::Method]
1086
+ #
1087
+ attr_reader :get_iam_policy
1088
+ ##
1089
+ # RPC-specific configuration for `set_iam_policy`
1090
+ # @return [::Gapic::Config::Method]
1091
+ #
1092
+ attr_reader :set_iam_policy
1093
+ ##
1094
+ # RPC-specific configuration for `test_iam_permissions`
1095
+ # @return [::Gapic::Config::Method]
1096
+ #
1097
+ attr_reader :test_iam_permissions
1098
+
1099
+ # @private
1100
+ def initialize parent_rpcs = nil
1101
+ create_data_policy_config = parent_rpcs.create_data_policy if parent_rpcs.respond_to? :create_data_policy
1102
+ @create_data_policy = ::Gapic::Config::Method.new create_data_policy_config
1103
+ update_data_policy_config = parent_rpcs.update_data_policy if parent_rpcs.respond_to? :update_data_policy
1104
+ @update_data_policy = ::Gapic::Config::Method.new update_data_policy_config
1105
+ delete_data_policy_config = parent_rpcs.delete_data_policy if parent_rpcs.respond_to? :delete_data_policy
1106
+ @delete_data_policy = ::Gapic::Config::Method.new delete_data_policy_config
1107
+ get_data_policy_config = parent_rpcs.get_data_policy if parent_rpcs.respond_to? :get_data_policy
1108
+ @get_data_policy = ::Gapic::Config::Method.new get_data_policy_config
1109
+ list_data_policies_config = parent_rpcs.list_data_policies if parent_rpcs.respond_to? :list_data_policies
1110
+ @list_data_policies = ::Gapic::Config::Method.new list_data_policies_config
1111
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1112
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1113
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1114
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1115
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1116
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1117
+
1118
+ yield self if block_given?
1119
+ end
1120
+ end
1121
+ end
1122
+ end
1123
+ end
1124
+ end
1125
+ end
1126
+ end
1127
+ end
1128
+ end