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