google-cloud-bigquery-analytics_hub-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1790 @@
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/analyticshub/v1/analyticshub_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module AnalyticsHub
26
+ module V1
27
+ module AnalyticsHubService
28
+ ##
29
+ # Client for the AnalyticsHubService service.
30
+ #
31
+ # The `AnalyticsHubService` API facilitates data sharing within and across
32
+ # organizations. It allows data providers to publish listings that reference
33
+ # shared datasets. With Analytics Hub, users can discover and search for
34
+ # listings that they have access to. Subscribers can view and subscribe to
35
+ # listings. When you subscribe to a listing, Analytics Hub creates a linked
36
+ # dataset in your project.
37
+ #
38
+ class Client
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :analytics_hub_service_stub
43
+
44
+ ##
45
+ # Configure the AnalyticsHubService Client class.
46
+ #
47
+ # See {::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all AnalyticsHubService clients
53
+ # ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "Bigquery", "AnalyticsHub", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.timeout = 60.0
74
+ default_config.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the AnalyticsHubService Client instance.
86
+ #
87
+ # The configuration is set to the derived mode, meaning that values can be changed,
88
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
+ # should be made on {Client.configure}.
90
+ #
91
+ # See {::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client::Configuration}
92
+ # for a description of the configuration fields.
93
+ #
94
+ # @yield [config] Configure the Client client.
95
+ # @yieldparam config [Client::Configuration]
96
+ #
97
+ # @return [Client::Configuration]
98
+ #
99
+ def configure
100
+ yield @config if block_given?
101
+ @config
102
+ end
103
+
104
+ ##
105
+ # Create a new AnalyticsHubService client object.
106
+ #
107
+ # @example
108
+ #
109
+ # # Create a client using the default configuration
110
+ # client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
111
+ #
112
+ # # Create a client using a custom configuration
113
+ # client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config|
114
+ # config.timeout = 10.0
115
+ # end
116
+ #
117
+ # @yield [config] Configure the AnalyticsHubService client.
118
+ # @yieldparam config [Client::Configuration]
119
+ #
120
+ def initialize
121
+ # These require statements are intentionally placed here to initialize
122
+ # the gRPC module only when it's required.
123
+ # See https://github.com/googleapis/toolkit/issues/446
124
+ require "gapic/grpc"
125
+ require "google/cloud/bigquery/analyticshub/v1/analyticshub_services_pb"
126
+
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
+ !@config.endpoint.split(".").first.include?("-")
139
+ credentials ||= Credentials.default scope: @config.scope,
140
+ enable_self_signed_jwt: enable_self_signed_jwt
141
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
142
+ credentials = Credentials.new credentials, scope: @config.scope
143
+ end
144
+ @quota_project_id = @config.quota_project
145
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
+
147
+ @analytics_hub_service_stub = ::Gapic::ServiceStub.new(
148
+ ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Stub,
149
+ credentials: credentials,
150
+ endpoint: @config.endpoint,
151
+ channel_args: @config.channel_args,
152
+ interceptors: @config.interceptors
153
+ )
154
+ end
155
+
156
+ # Service calls
157
+
158
+ ##
159
+ # Lists all data exchanges in a given project and location.
160
+ #
161
+ # @overload list_data_exchanges(request, options = nil)
162
+ # Pass arguments to `list_data_exchanges` via a request object, either of type
163
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest} or an equivalent Hash.
164
+ #
165
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest, ::Hash]
166
+ # A request object representing the call parameters. Required. To specify no
167
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
168
+ # @param options [::Gapic::CallOptions, ::Hash]
169
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
170
+ #
171
+ # @overload list_data_exchanges(parent: nil, page_size: nil, page_token: nil)
172
+ # Pass arguments to `list_data_exchanges` via keyword arguments. Note that at
173
+ # least one keyword argument is required. To specify no parameters, or to keep all
174
+ # the default parameter values, pass an empty Hash as a request object (see above).
175
+ #
176
+ # @param parent [::String]
177
+ # Required. The parent resource path of the data exchanges.
178
+ # e.g. `projects/myproject/locations/US`.
179
+ # @param page_size [::Integer]
180
+ # The maximum number of results to return in a single response page. Leverage
181
+ # the page tokens to iterate through the entire collection.
182
+ # @param page_token [::String]
183
+ # Page token, returned by a previous call, to request the next page of
184
+ # results.
185
+ #
186
+ # @yield [response, operation] Access the result along with the RPC operation
187
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>]
188
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
189
+ #
190
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>]
191
+ #
192
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
193
+ #
194
+ # @example Basic example
195
+ # require "google/cloud/bigquery/analytics_hub/v1"
196
+ #
197
+ # # Create a client object. The client can be reused for multiple calls.
198
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
199
+ #
200
+ # # Create a request. To set request fields, pass in keyword arguments.
201
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest.new
202
+ #
203
+ # # Call the list_data_exchanges method.
204
+ # result = client.list_data_exchanges request
205
+ #
206
+ # # The returned object is of type Gapic::PagedEnumerable. You can
207
+ # # iterate over all elements by calling #each, and the enumerable
208
+ # # will lazily make API calls to fetch subsequent pages. Other
209
+ # # methods are also available for managing paging directly.
210
+ # result.each do |response|
211
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
212
+ # p response
213
+ # end
214
+ #
215
+ def list_data_exchanges request, options = nil
216
+ raise ::ArgumentError, "request must be provided" if request.nil?
217
+
218
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest
219
+
220
+ # Converts hash and nil to an options object
221
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
222
+
223
+ # Customize the options with defaults
224
+ metadata = @config.rpcs.list_data_exchanges.metadata.to_h
225
+
226
+ # Set x-goog-api-client and x-goog-user-project headers
227
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
228
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
229
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
230
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
+
232
+ header_params = {}
233
+ if request.parent
234
+ header_params["parent"] = request.parent
235
+ end
236
+
237
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
238
+ metadata[:"x-goog-request-params"] ||= request_params_header
239
+
240
+ options.apply_defaults timeout: @config.rpcs.list_data_exchanges.timeout,
241
+ metadata: metadata,
242
+ retry_policy: @config.rpcs.list_data_exchanges.retry_policy
243
+
244
+ options.apply_defaults timeout: @config.timeout,
245
+ metadata: @config.metadata,
246
+ retry_policy: @config.retry_policy
247
+
248
+ @analytics_hub_service_stub.call_rpc :list_data_exchanges, request, options: options do |response, operation|
249
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_data_exchanges, request, response, operation, options
250
+ yield response, operation if block_given?
251
+ return response
252
+ end
253
+ rescue ::GRPC::BadStatus => e
254
+ raise ::Google::Cloud::Error.from_error(e)
255
+ end
256
+
257
+ ##
258
+ # Lists all data exchanges from projects in a given organization and
259
+ # location.
260
+ #
261
+ # @overload list_org_data_exchanges(request, options = nil)
262
+ # Pass arguments to `list_org_data_exchanges` via a request object, either of type
263
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest} or an equivalent Hash.
264
+ #
265
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest, ::Hash]
266
+ # A request object representing the call parameters. Required. To specify no
267
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
268
+ # @param options [::Gapic::CallOptions, ::Hash]
269
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
270
+ #
271
+ # @overload list_org_data_exchanges(organization: nil, page_size: nil, page_token: nil)
272
+ # Pass arguments to `list_org_data_exchanges` via keyword arguments. Note that at
273
+ # least one keyword argument is required. To specify no parameters, or to keep all
274
+ # the default parameter values, pass an empty Hash as a request object (see above).
275
+ #
276
+ # @param organization [::String]
277
+ # Required. The organization resource path of the projects containing DataExchanges.
278
+ # e.g. `organizations/myorg/locations/US`.
279
+ # @param page_size [::Integer]
280
+ # The maximum number of results to return in a single response page. Leverage
281
+ # the page tokens to iterate through the entire collection.
282
+ # @param page_token [::String]
283
+ # Page token, returned by a previous call, to request the next page of
284
+ # results.
285
+ #
286
+ # @yield [response, operation] Access the result along with the RPC operation
287
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>]
288
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
289
+ #
290
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>]
291
+ #
292
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
293
+ #
294
+ # @example Basic example
295
+ # require "google/cloud/bigquery/analytics_hub/v1"
296
+ #
297
+ # # Create a client object. The client can be reused for multiple calls.
298
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
299
+ #
300
+ # # Create a request. To set request fields, pass in keyword arguments.
301
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest.new
302
+ #
303
+ # # Call the list_org_data_exchanges method.
304
+ # result = client.list_org_data_exchanges request
305
+ #
306
+ # # The returned object is of type Gapic::PagedEnumerable. You can
307
+ # # iterate over all elements by calling #each, and the enumerable
308
+ # # will lazily make API calls to fetch subsequent pages. Other
309
+ # # methods are also available for managing paging directly.
310
+ # result.each do |response|
311
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
312
+ # p response
313
+ # end
314
+ #
315
+ def list_org_data_exchanges request, options = nil
316
+ raise ::ArgumentError, "request must be provided" if request.nil?
317
+
318
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest
319
+
320
+ # Converts hash and nil to an options object
321
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
322
+
323
+ # Customize the options with defaults
324
+ metadata = @config.rpcs.list_org_data_exchanges.metadata.to_h
325
+
326
+ # Set x-goog-api-client and x-goog-user-project headers
327
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
328
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
329
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
330
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
331
+
332
+ header_params = {}
333
+ if request.organization
334
+ header_params["organization"] = request.organization
335
+ end
336
+
337
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
338
+ metadata[:"x-goog-request-params"] ||= request_params_header
339
+
340
+ options.apply_defaults timeout: @config.rpcs.list_org_data_exchanges.timeout,
341
+ metadata: metadata,
342
+ retry_policy: @config.rpcs.list_org_data_exchanges.retry_policy
343
+
344
+ options.apply_defaults timeout: @config.timeout,
345
+ metadata: @config.metadata,
346
+ retry_policy: @config.retry_policy
347
+
348
+ @analytics_hub_service_stub.call_rpc :list_org_data_exchanges, request, options: options do |response, operation|
349
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_org_data_exchanges, request, response, operation, options
350
+ yield response, operation if block_given?
351
+ return response
352
+ end
353
+ rescue ::GRPC::BadStatus => e
354
+ raise ::Google::Cloud::Error.from_error(e)
355
+ end
356
+
357
+ ##
358
+ # Gets the details of a data exchange.
359
+ #
360
+ # @overload get_data_exchange(request, options = nil)
361
+ # Pass arguments to `get_data_exchange` via a request object, either of type
362
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest} or an equivalent Hash.
363
+ #
364
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest, ::Hash]
365
+ # A request object representing the call parameters. Required. To specify no
366
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
367
+ # @param options [::Gapic::CallOptions, ::Hash]
368
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
369
+ #
370
+ # @overload get_data_exchange(name: nil)
371
+ # Pass arguments to `get_data_exchange` via keyword arguments. Note that at
372
+ # least one keyword argument is required. To specify no parameters, or to keep all
373
+ # the default parameter values, pass an empty Hash as a request object (see above).
374
+ #
375
+ # @param name [::String]
376
+ # Required. The resource name of the data exchange.
377
+ # e.g. `projects/myproject/locations/US/dataExchanges/123`.
378
+ #
379
+ # @yield [response, operation] Access the result along with the RPC operation
380
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
381
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
382
+ #
383
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
384
+ #
385
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
386
+ #
387
+ # @example Basic example
388
+ # require "google/cloud/bigquery/analytics_hub/v1"
389
+ #
390
+ # # Create a client object. The client can be reused for multiple calls.
391
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
392
+ #
393
+ # # Create a request. To set request fields, pass in keyword arguments.
394
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest.new
395
+ #
396
+ # # Call the get_data_exchange method.
397
+ # result = client.get_data_exchange request
398
+ #
399
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
400
+ # p result
401
+ #
402
+ def get_data_exchange request, options = nil
403
+ raise ::ArgumentError, "request must be provided" if request.nil?
404
+
405
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest
406
+
407
+ # Converts hash and nil to an options object
408
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
409
+
410
+ # Customize the options with defaults
411
+ metadata = @config.rpcs.get_data_exchange.metadata.to_h
412
+
413
+ # Set x-goog-api-client and x-goog-user-project headers
414
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
415
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
416
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
417
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
418
+
419
+ header_params = {}
420
+ if request.name
421
+ header_params["name"] = request.name
422
+ end
423
+
424
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
425
+ metadata[:"x-goog-request-params"] ||= request_params_header
426
+
427
+ options.apply_defaults timeout: @config.rpcs.get_data_exchange.timeout,
428
+ metadata: metadata,
429
+ retry_policy: @config.rpcs.get_data_exchange.retry_policy
430
+
431
+ options.apply_defaults timeout: @config.timeout,
432
+ metadata: @config.metadata,
433
+ retry_policy: @config.retry_policy
434
+
435
+ @analytics_hub_service_stub.call_rpc :get_data_exchange, request, options: options do |response, operation|
436
+ yield response, operation if block_given?
437
+ return response
438
+ end
439
+ rescue ::GRPC::BadStatus => e
440
+ raise ::Google::Cloud::Error.from_error(e)
441
+ end
442
+
443
+ ##
444
+ # Creates a new data exchange.
445
+ #
446
+ # @overload create_data_exchange(request, options = nil)
447
+ # Pass arguments to `create_data_exchange` via a request object, either of type
448
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest} or an equivalent Hash.
449
+ #
450
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest, ::Hash]
451
+ # A request object representing the call parameters. Required. To specify no
452
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
453
+ # @param options [::Gapic::CallOptions, ::Hash]
454
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
455
+ #
456
+ # @overload create_data_exchange(parent: nil, data_exchange_id: nil, data_exchange: nil)
457
+ # Pass arguments to `create_data_exchange` via keyword arguments. Note that at
458
+ # least one keyword argument is required. To specify no parameters, or to keep all
459
+ # the default parameter values, pass an empty Hash as a request object (see above).
460
+ #
461
+ # @param parent [::String]
462
+ # Required. The parent resource path of the data exchange.
463
+ # e.g. `projects/myproject/locations/US`.
464
+ # @param data_exchange_id [::String]
465
+ # Required. The ID of the data exchange.
466
+ # Must contain only Unicode letters, numbers (0-9), underscores (_).
467
+ # Should not use characters that require URL-escaping, or characters
468
+ # outside of ASCII, spaces.
469
+ # Max length: 100 bytes.
470
+ # @param data_exchange [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange, ::Hash]
471
+ # Required. The data exchange to create.
472
+ #
473
+ # @yield [response, operation] Access the result along with the RPC operation
474
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
475
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
476
+ #
477
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
478
+ #
479
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
480
+ #
481
+ # @example Basic example
482
+ # require "google/cloud/bigquery/analytics_hub/v1"
483
+ #
484
+ # # Create a client object. The client can be reused for multiple calls.
485
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
486
+ #
487
+ # # Create a request. To set request fields, pass in keyword arguments.
488
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest.new
489
+ #
490
+ # # Call the create_data_exchange method.
491
+ # result = client.create_data_exchange request
492
+ #
493
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
494
+ # p result
495
+ #
496
+ def create_data_exchange request, options = nil
497
+ raise ::ArgumentError, "request must be provided" if request.nil?
498
+
499
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest
500
+
501
+ # Converts hash and nil to an options object
502
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
503
+
504
+ # Customize the options with defaults
505
+ metadata = @config.rpcs.create_data_exchange.metadata.to_h
506
+
507
+ # Set x-goog-api-client and x-goog-user-project headers
508
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
509
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
510
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
511
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
512
+
513
+ header_params = {}
514
+ if request.parent
515
+ header_params["parent"] = request.parent
516
+ end
517
+
518
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
519
+ metadata[:"x-goog-request-params"] ||= request_params_header
520
+
521
+ options.apply_defaults timeout: @config.rpcs.create_data_exchange.timeout,
522
+ metadata: metadata,
523
+ retry_policy: @config.rpcs.create_data_exchange.retry_policy
524
+
525
+ options.apply_defaults timeout: @config.timeout,
526
+ metadata: @config.metadata,
527
+ retry_policy: @config.retry_policy
528
+
529
+ @analytics_hub_service_stub.call_rpc :create_data_exchange, request, options: options do |response, operation|
530
+ yield response, operation if block_given?
531
+ return response
532
+ end
533
+ rescue ::GRPC::BadStatus => e
534
+ raise ::Google::Cloud::Error.from_error(e)
535
+ end
536
+
537
+ ##
538
+ # Updates an existing data exchange.
539
+ #
540
+ # @overload update_data_exchange(request, options = nil)
541
+ # Pass arguments to `update_data_exchange` via a request object, either of type
542
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest} or an equivalent Hash.
543
+ #
544
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest, ::Hash]
545
+ # A request object representing the call parameters. Required. To specify no
546
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
547
+ # @param options [::Gapic::CallOptions, ::Hash]
548
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
549
+ #
550
+ # @overload update_data_exchange(update_mask: nil, data_exchange: nil)
551
+ # Pass arguments to `update_data_exchange` via keyword arguments. Note that at
552
+ # least one keyword argument is required. To specify no parameters, or to keep all
553
+ # the default parameter values, pass an empty Hash as a request object (see above).
554
+ #
555
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
556
+ # Required. Field mask specifies the fields to update in the data exchange
557
+ # resource. The fields specified in the
558
+ # `updateMask` are relative to the resource and are not a full request.
559
+ # @param data_exchange [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange, ::Hash]
560
+ # Required. The data exchange to update.
561
+ #
562
+ # @yield [response, operation] Access the result along with the RPC operation
563
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
564
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
565
+ #
566
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange]
567
+ #
568
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
569
+ #
570
+ # @example Basic example
571
+ # require "google/cloud/bigquery/analytics_hub/v1"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest.new
578
+ #
579
+ # # Call the update_data_exchange method.
580
+ # result = client.update_data_exchange request
581
+ #
582
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
583
+ # p result
584
+ #
585
+ def update_data_exchange request, options = nil
586
+ raise ::ArgumentError, "request must be provided" if request.nil?
587
+
588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest
589
+
590
+ # Converts hash and nil to an options object
591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
592
+
593
+ # Customize the options with defaults
594
+ metadata = @config.rpcs.update_data_exchange.metadata.to_h
595
+
596
+ # Set x-goog-api-client and x-goog-user-project headers
597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
599
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
600
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
601
+
602
+ header_params = {}
603
+ if request.data_exchange&.name
604
+ header_params["data_exchange.name"] = request.data_exchange.name
605
+ end
606
+
607
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
608
+ metadata[:"x-goog-request-params"] ||= request_params_header
609
+
610
+ options.apply_defaults timeout: @config.rpcs.update_data_exchange.timeout,
611
+ metadata: metadata,
612
+ retry_policy: @config.rpcs.update_data_exchange.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @analytics_hub_service_stub.call_rpc :update_data_exchange, request, options: options do |response, operation|
619
+ yield response, operation if block_given?
620
+ return response
621
+ end
622
+ rescue ::GRPC::BadStatus => e
623
+ raise ::Google::Cloud::Error.from_error(e)
624
+ end
625
+
626
+ ##
627
+ # Deletes an existing data exchange.
628
+ #
629
+ # @overload delete_data_exchange(request, options = nil)
630
+ # Pass arguments to `delete_data_exchange` via a request object, either of type
631
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest, ::Hash]
634
+ # A request object representing the call parameters. Required. To specify no
635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
636
+ # @param options [::Gapic::CallOptions, ::Hash]
637
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
638
+ #
639
+ # @overload delete_data_exchange(name: nil)
640
+ # Pass arguments to `delete_data_exchange` via keyword arguments. Note that at
641
+ # least one keyword argument is required. To specify no parameters, or to keep all
642
+ # the default parameter values, pass an empty Hash as a request object (see above).
643
+ #
644
+ # @param name [::String]
645
+ # Required. The full name of the data exchange resource that you want to delete.
646
+ # For example, `projects/myproject/locations/US/dataExchanges/123`.
647
+ #
648
+ # @yield [response, operation] Access the result along with the RPC operation
649
+ # @yieldparam response [::Google::Protobuf::Empty]
650
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
651
+ #
652
+ # @return [::Google::Protobuf::Empty]
653
+ #
654
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
655
+ #
656
+ # @example Basic example
657
+ # require "google/cloud/bigquery/analytics_hub/v1"
658
+ #
659
+ # # Create a client object. The client can be reused for multiple calls.
660
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
661
+ #
662
+ # # Create a request. To set request fields, pass in keyword arguments.
663
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest.new
664
+ #
665
+ # # Call the delete_data_exchange method.
666
+ # result = client.delete_data_exchange request
667
+ #
668
+ # # The returned object is of type Google::Protobuf::Empty.
669
+ # p result
670
+ #
671
+ def delete_data_exchange request, options = nil
672
+ raise ::ArgumentError, "request must be provided" if request.nil?
673
+
674
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest
675
+
676
+ # Converts hash and nil to an options object
677
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
678
+
679
+ # Customize the options with defaults
680
+ metadata = @config.rpcs.delete_data_exchange.metadata.to_h
681
+
682
+ # Set x-goog-api-client and x-goog-user-project headers
683
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
684
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
685
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
686
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
687
+
688
+ header_params = {}
689
+ if request.name
690
+ header_params["name"] = request.name
691
+ end
692
+
693
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
694
+ metadata[:"x-goog-request-params"] ||= request_params_header
695
+
696
+ options.apply_defaults timeout: @config.rpcs.delete_data_exchange.timeout,
697
+ metadata: metadata,
698
+ retry_policy: @config.rpcs.delete_data_exchange.retry_policy
699
+
700
+ options.apply_defaults timeout: @config.timeout,
701
+ metadata: @config.metadata,
702
+ retry_policy: @config.retry_policy
703
+
704
+ @analytics_hub_service_stub.call_rpc :delete_data_exchange, request, options: options do |response, operation|
705
+ yield response, operation if block_given?
706
+ return response
707
+ end
708
+ rescue ::GRPC::BadStatus => e
709
+ raise ::Google::Cloud::Error.from_error(e)
710
+ end
711
+
712
+ ##
713
+ # Lists all listings in a given project and location.
714
+ #
715
+ # @overload list_listings(request, options = nil)
716
+ # Pass arguments to `list_listings` via a request object, either of type
717
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest} or an equivalent Hash.
718
+ #
719
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest, ::Hash]
720
+ # A request object representing the call parameters. Required. To specify no
721
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
722
+ # @param options [::Gapic::CallOptions, ::Hash]
723
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
724
+ #
725
+ # @overload list_listings(parent: nil, page_size: nil, page_token: nil)
726
+ # Pass arguments to `list_listings` via keyword arguments. Note that at
727
+ # least one keyword argument is required. To specify no parameters, or to keep all
728
+ # the default parameter values, pass an empty Hash as a request object (see above).
729
+ #
730
+ # @param parent [::String]
731
+ # Required. The parent resource path of the listing.
732
+ # e.g. `projects/myproject/locations/US/dataExchanges/123`.
733
+ # @param page_size [::Integer]
734
+ # The maximum number of results to return in a single response page. Leverage
735
+ # the page tokens to iterate through the entire collection.
736
+ # @param page_token [::String]
737
+ # Page token, returned by a previous call, to request the next page of
738
+ # results.
739
+ #
740
+ # @yield [response, operation] Access the result along with the RPC operation
741
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing>]
742
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
743
+ #
744
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing>]
745
+ #
746
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
747
+ #
748
+ # @example Basic example
749
+ # require "google/cloud/bigquery/analytics_hub/v1"
750
+ #
751
+ # # Create a client object. The client can be reused for multiple calls.
752
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
753
+ #
754
+ # # Create a request. To set request fields, pass in keyword arguments.
755
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest.new
756
+ #
757
+ # # Call the list_listings method.
758
+ # result = client.list_listings request
759
+ #
760
+ # # The returned object is of type Gapic::PagedEnumerable. You can
761
+ # # iterate over all elements by calling #each, and the enumerable
762
+ # # will lazily make API calls to fetch subsequent pages. Other
763
+ # # methods are also available for managing paging directly.
764
+ # result.each do |response|
765
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
766
+ # p response
767
+ # end
768
+ #
769
+ def list_listings request, options = nil
770
+ raise ::ArgumentError, "request must be provided" if request.nil?
771
+
772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest
773
+
774
+ # Converts hash and nil to an options object
775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
776
+
777
+ # Customize the options with defaults
778
+ metadata = @config.rpcs.list_listings.metadata.to_h
779
+
780
+ # Set x-goog-api-client and x-goog-user-project headers
781
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
783
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
784
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ header_params = {}
787
+ if request.parent
788
+ header_params["parent"] = request.parent
789
+ end
790
+
791
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
792
+ metadata[:"x-goog-request-params"] ||= request_params_header
793
+
794
+ options.apply_defaults timeout: @config.rpcs.list_listings.timeout,
795
+ metadata: metadata,
796
+ retry_policy: @config.rpcs.list_listings.retry_policy
797
+
798
+ options.apply_defaults timeout: @config.timeout,
799
+ metadata: @config.metadata,
800
+ retry_policy: @config.retry_policy
801
+
802
+ @analytics_hub_service_stub.call_rpc :list_listings, request, options: options do |response, operation|
803
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_listings, request, response, operation, options
804
+ yield response, operation if block_given?
805
+ return response
806
+ end
807
+ rescue ::GRPC::BadStatus => e
808
+ raise ::Google::Cloud::Error.from_error(e)
809
+ end
810
+
811
+ ##
812
+ # Gets the details of a listing.
813
+ #
814
+ # @overload get_listing(request, options = nil)
815
+ # Pass arguments to `get_listing` via a request object, either of type
816
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest} or an equivalent Hash.
817
+ #
818
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest, ::Hash]
819
+ # A request object representing the call parameters. Required. To specify no
820
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
821
+ # @param options [::Gapic::CallOptions, ::Hash]
822
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
823
+ #
824
+ # @overload get_listing(name: nil)
825
+ # Pass arguments to `get_listing` via keyword arguments. Note that at
826
+ # least one keyword argument is required. To specify no parameters, or to keep all
827
+ # the default parameter values, pass an empty Hash as a request object (see above).
828
+ #
829
+ # @param name [::String]
830
+ # Required. The resource name of the listing.
831
+ # e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
832
+ #
833
+ # @yield [response, operation] Access the result along with the RPC operation
834
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
835
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
836
+ #
837
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
838
+ #
839
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
840
+ #
841
+ # @example Basic example
842
+ # require "google/cloud/bigquery/analytics_hub/v1"
843
+ #
844
+ # # Create a client object. The client can be reused for multiple calls.
845
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
846
+ #
847
+ # # Create a request. To set request fields, pass in keyword arguments.
848
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest.new
849
+ #
850
+ # # Call the get_listing method.
851
+ # result = client.get_listing request
852
+ #
853
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
854
+ # p result
855
+ #
856
+ def get_listing request, options = nil
857
+ raise ::ArgumentError, "request must be provided" if request.nil?
858
+
859
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest
860
+
861
+ # Converts hash and nil to an options object
862
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
863
+
864
+ # Customize the options with defaults
865
+ metadata = @config.rpcs.get_listing.metadata.to_h
866
+
867
+ # Set x-goog-api-client and x-goog-user-project headers
868
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
869
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
870
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
871
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
+
873
+ header_params = {}
874
+ if request.name
875
+ header_params["name"] = request.name
876
+ end
877
+
878
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
879
+ metadata[:"x-goog-request-params"] ||= request_params_header
880
+
881
+ options.apply_defaults timeout: @config.rpcs.get_listing.timeout,
882
+ metadata: metadata,
883
+ retry_policy: @config.rpcs.get_listing.retry_policy
884
+
885
+ options.apply_defaults timeout: @config.timeout,
886
+ metadata: @config.metadata,
887
+ retry_policy: @config.retry_policy
888
+
889
+ @analytics_hub_service_stub.call_rpc :get_listing, request, options: options do |response, operation|
890
+ yield response, operation if block_given?
891
+ return response
892
+ end
893
+ rescue ::GRPC::BadStatus => e
894
+ raise ::Google::Cloud::Error.from_error(e)
895
+ end
896
+
897
+ ##
898
+ # Creates a new listing.
899
+ #
900
+ # @overload create_listing(request, options = nil)
901
+ # Pass arguments to `create_listing` via a request object, either of type
902
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest} or an equivalent Hash.
903
+ #
904
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest, ::Hash]
905
+ # A request object representing the call parameters. Required. To specify no
906
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
907
+ # @param options [::Gapic::CallOptions, ::Hash]
908
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
909
+ #
910
+ # @overload create_listing(parent: nil, listing_id: nil, listing: nil)
911
+ # Pass arguments to `create_listing` via keyword arguments. Note that at
912
+ # least one keyword argument is required. To specify no parameters, or to keep all
913
+ # the default parameter values, pass an empty Hash as a request object (see above).
914
+ #
915
+ # @param parent [::String]
916
+ # Required. The parent resource path of the listing.
917
+ # e.g. `projects/myproject/locations/US/dataExchanges/123`.
918
+ # @param listing_id [::String]
919
+ # Required. The ID of the listing to create.
920
+ # Must contain only Unicode letters, numbers (0-9), underscores (_).
921
+ # Should not use characters that require URL-escaping, or characters
922
+ # outside of ASCII, spaces.
923
+ # Max length: 100 bytes.
924
+ # @param listing [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing, ::Hash]
925
+ # Required. The listing to create.
926
+ #
927
+ # @yield [response, operation] Access the result along with the RPC operation
928
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
929
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
930
+ #
931
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
932
+ #
933
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
934
+ #
935
+ # @example Basic example
936
+ # require "google/cloud/bigquery/analytics_hub/v1"
937
+ #
938
+ # # Create a client object. The client can be reused for multiple calls.
939
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
940
+ #
941
+ # # Create a request. To set request fields, pass in keyword arguments.
942
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest.new
943
+ #
944
+ # # Call the create_listing method.
945
+ # result = client.create_listing request
946
+ #
947
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
948
+ # p result
949
+ #
950
+ def create_listing request, options = nil
951
+ raise ::ArgumentError, "request must be provided" if request.nil?
952
+
953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest
954
+
955
+ # Converts hash and nil to an options object
956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
957
+
958
+ # Customize the options with defaults
959
+ metadata = @config.rpcs.create_listing.metadata.to_h
960
+
961
+ # Set x-goog-api-client and x-goog-user-project headers
962
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
964
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
965
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
966
+
967
+ header_params = {}
968
+ if request.parent
969
+ header_params["parent"] = request.parent
970
+ end
971
+
972
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
973
+ metadata[:"x-goog-request-params"] ||= request_params_header
974
+
975
+ options.apply_defaults timeout: @config.rpcs.create_listing.timeout,
976
+ metadata: metadata,
977
+ retry_policy: @config.rpcs.create_listing.retry_policy
978
+
979
+ options.apply_defaults timeout: @config.timeout,
980
+ metadata: @config.metadata,
981
+ retry_policy: @config.retry_policy
982
+
983
+ @analytics_hub_service_stub.call_rpc :create_listing, request, options: options do |response, operation|
984
+ yield response, operation if block_given?
985
+ return response
986
+ end
987
+ rescue ::GRPC::BadStatus => e
988
+ raise ::Google::Cloud::Error.from_error(e)
989
+ end
990
+
991
+ ##
992
+ # Updates an existing listing.
993
+ #
994
+ # @overload update_listing(request, options = nil)
995
+ # Pass arguments to `update_listing` via a request object, either of type
996
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest} or an equivalent Hash.
997
+ #
998
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest, ::Hash]
999
+ # A request object representing the call parameters. Required. To specify no
1000
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1001
+ # @param options [::Gapic::CallOptions, ::Hash]
1002
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1003
+ #
1004
+ # @overload update_listing(update_mask: nil, listing: nil)
1005
+ # Pass arguments to `update_listing` via keyword arguments. Note that at
1006
+ # least one keyword argument is required. To specify no parameters, or to keep all
1007
+ # the default parameter values, pass an empty Hash as a request object (see above).
1008
+ #
1009
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1010
+ # Required. Field mask specifies the fields to update in the listing resource. The
1011
+ # fields specified in the `updateMask` are relative to the resource and are
1012
+ # not a full request.
1013
+ # @param listing [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing, ::Hash]
1014
+ # Required. The listing to update.
1015
+ #
1016
+ # @yield [response, operation] Access the result along with the RPC operation
1017
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
1018
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1019
+ #
1020
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing]
1021
+ #
1022
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1023
+ #
1024
+ # @example Basic example
1025
+ # require "google/cloud/bigquery/analytics_hub/v1"
1026
+ #
1027
+ # # Create a client object. The client can be reused for multiple calls.
1028
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1029
+ #
1030
+ # # Create a request. To set request fields, pass in keyword arguments.
1031
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest.new
1032
+ #
1033
+ # # Call the update_listing method.
1034
+ # result = client.update_listing request
1035
+ #
1036
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
1037
+ # p result
1038
+ #
1039
+ def update_listing request, options = nil
1040
+ raise ::ArgumentError, "request must be provided" if request.nil?
1041
+
1042
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest
1043
+
1044
+ # Converts hash and nil to an options object
1045
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1046
+
1047
+ # Customize the options with defaults
1048
+ metadata = @config.rpcs.update_listing.metadata.to_h
1049
+
1050
+ # Set x-goog-api-client and x-goog-user-project headers
1051
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1052
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1053
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1054
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1055
+
1056
+ header_params = {}
1057
+ if request.listing&.name
1058
+ header_params["listing.name"] = request.listing.name
1059
+ end
1060
+
1061
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1062
+ metadata[:"x-goog-request-params"] ||= request_params_header
1063
+
1064
+ options.apply_defaults timeout: @config.rpcs.update_listing.timeout,
1065
+ metadata: metadata,
1066
+ retry_policy: @config.rpcs.update_listing.retry_policy
1067
+
1068
+ options.apply_defaults timeout: @config.timeout,
1069
+ metadata: @config.metadata,
1070
+ retry_policy: @config.retry_policy
1071
+
1072
+ @analytics_hub_service_stub.call_rpc :update_listing, request, options: options do |response, operation|
1073
+ yield response, operation if block_given?
1074
+ return response
1075
+ end
1076
+ rescue ::GRPC::BadStatus => e
1077
+ raise ::Google::Cloud::Error.from_error(e)
1078
+ end
1079
+
1080
+ ##
1081
+ # Deletes a listing.
1082
+ #
1083
+ # @overload delete_listing(request, options = nil)
1084
+ # Pass arguments to `delete_listing` via a request object, either of type
1085
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest} or an equivalent Hash.
1086
+ #
1087
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest, ::Hash]
1088
+ # A request object representing the call parameters. Required. To specify no
1089
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1090
+ # @param options [::Gapic::CallOptions, ::Hash]
1091
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1092
+ #
1093
+ # @overload delete_listing(name: nil)
1094
+ # Pass arguments to `delete_listing` via keyword arguments. Note that at
1095
+ # least one keyword argument is required. To specify no parameters, or to keep all
1096
+ # the default parameter values, pass an empty Hash as a request object (see above).
1097
+ #
1098
+ # @param name [::String]
1099
+ # Required. Resource name of the listing to delete.
1100
+ # e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
1101
+ #
1102
+ # @yield [response, operation] Access the result along with the RPC operation
1103
+ # @yieldparam response [::Google::Protobuf::Empty]
1104
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1105
+ #
1106
+ # @return [::Google::Protobuf::Empty]
1107
+ #
1108
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1109
+ #
1110
+ # @example Basic example
1111
+ # require "google/cloud/bigquery/analytics_hub/v1"
1112
+ #
1113
+ # # Create a client object. The client can be reused for multiple calls.
1114
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1115
+ #
1116
+ # # Create a request. To set request fields, pass in keyword arguments.
1117
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest.new
1118
+ #
1119
+ # # Call the delete_listing method.
1120
+ # result = client.delete_listing request
1121
+ #
1122
+ # # The returned object is of type Google::Protobuf::Empty.
1123
+ # p result
1124
+ #
1125
+ def delete_listing request, options = nil
1126
+ raise ::ArgumentError, "request must be provided" if request.nil?
1127
+
1128
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest
1129
+
1130
+ # Converts hash and nil to an options object
1131
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1132
+
1133
+ # Customize the options with defaults
1134
+ metadata = @config.rpcs.delete_listing.metadata.to_h
1135
+
1136
+ # Set x-goog-api-client and x-goog-user-project headers
1137
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1138
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1139
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1140
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1141
+
1142
+ header_params = {}
1143
+ if request.name
1144
+ header_params["name"] = request.name
1145
+ end
1146
+
1147
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1148
+ metadata[:"x-goog-request-params"] ||= request_params_header
1149
+
1150
+ options.apply_defaults timeout: @config.rpcs.delete_listing.timeout,
1151
+ metadata: metadata,
1152
+ retry_policy: @config.rpcs.delete_listing.retry_policy
1153
+
1154
+ options.apply_defaults timeout: @config.timeout,
1155
+ metadata: @config.metadata,
1156
+ retry_policy: @config.retry_policy
1157
+
1158
+ @analytics_hub_service_stub.call_rpc :delete_listing, request, options: options do |response, operation|
1159
+ yield response, operation if block_given?
1160
+ return response
1161
+ end
1162
+ rescue ::GRPC::BadStatus => e
1163
+ raise ::Google::Cloud::Error.from_error(e)
1164
+ end
1165
+
1166
+ ##
1167
+ # Subscribes to a listing.
1168
+ #
1169
+ # Currently, with Analytics Hub, you can create listings that
1170
+ # reference only BigQuery datasets.
1171
+ # Upon subscription to a listing for a BigQuery dataset, Analytics Hub
1172
+ # creates a linked dataset in the subscriber's project.
1173
+ #
1174
+ # @overload subscribe_listing(request, options = nil)
1175
+ # Pass arguments to `subscribe_listing` via a request object, either of type
1176
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest} or an equivalent Hash.
1177
+ #
1178
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest, ::Hash]
1179
+ # A request object representing the call parameters. Required. To specify no
1180
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1181
+ # @param options [::Gapic::CallOptions, ::Hash]
1182
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1183
+ #
1184
+ # @overload subscribe_listing(destination_dataset: nil, name: nil)
1185
+ # Pass arguments to `subscribe_listing` via keyword arguments. Note that at
1186
+ # least one keyword argument is required. To specify no parameters, or to keep all
1187
+ # the default parameter values, pass an empty Hash as a request object (see above).
1188
+ #
1189
+ # @param destination_dataset [::Google::Cloud::Bigquery::AnalyticsHub::V1::DestinationDataset, ::Hash]
1190
+ # BigQuery destination dataset to create for the subscriber.
1191
+ # @param name [::String]
1192
+ # Required. Resource name of the listing that you want to subscribe to.
1193
+ # e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
1194
+ #
1195
+ # @yield [response, operation] Access the result along with the RPC operation
1196
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse]
1197
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1198
+ #
1199
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse]
1200
+ #
1201
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1202
+ #
1203
+ # @example Basic example
1204
+ # require "google/cloud/bigquery/analytics_hub/v1"
1205
+ #
1206
+ # # Create a client object. The client can be reused for multiple calls.
1207
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1208
+ #
1209
+ # # Create a request. To set request fields, pass in keyword arguments.
1210
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest.new
1211
+ #
1212
+ # # Call the subscribe_listing method.
1213
+ # result = client.subscribe_listing request
1214
+ #
1215
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse.
1216
+ # p result
1217
+ #
1218
+ def subscribe_listing request, options = nil
1219
+ raise ::ArgumentError, "request must be provided" if request.nil?
1220
+
1221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest
1222
+
1223
+ # Converts hash and nil to an options object
1224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1225
+
1226
+ # Customize the options with defaults
1227
+ metadata = @config.rpcs.subscribe_listing.metadata.to_h
1228
+
1229
+ # Set x-goog-api-client and x-goog-user-project headers
1230
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1232
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1233
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1234
+
1235
+ header_params = {}
1236
+ if request.name
1237
+ header_params["name"] = request.name
1238
+ end
1239
+
1240
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1241
+ metadata[:"x-goog-request-params"] ||= request_params_header
1242
+
1243
+ options.apply_defaults timeout: @config.rpcs.subscribe_listing.timeout,
1244
+ metadata: metadata,
1245
+ retry_policy: @config.rpcs.subscribe_listing.retry_policy
1246
+
1247
+ options.apply_defaults timeout: @config.timeout,
1248
+ metadata: @config.metadata,
1249
+ retry_policy: @config.retry_policy
1250
+
1251
+ @analytics_hub_service_stub.call_rpc :subscribe_listing, request, options: options do |response, operation|
1252
+ yield response, operation if block_given?
1253
+ return response
1254
+ end
1255
+ rescue ::GRPC::BadStatus => e
1256
+ raise ::Google::Cloud::Error.from_error(e)
1257
+ end
1258
+
1259
+ ##
1260
+ # Gets the IAM policy.
1261
+ #
1262
+ # @overload get_iam_policy(request, options = nil)
1263
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1264
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1265
+ #
1266
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1267
+ # A request object representing the call parameters. Required. To specify no
1268
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1269
+ # @param options [::Gapic::CallOptions, ::Hash]
1270
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1271
+ #
1272
+ # @overload get_iam_policy(resource: nil, options: nil)
1273
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1274
+ # least one keyword argument is required. To specify no parameters, or to keep all
1275
+ # the default parameter values, pass an empty Hash as a request object (see above).
1276
+ #
1277
+ # @param resource [::String]
1278
+ # REQUIRED: The resource for which the policy is being requested.
1279
+ # See the operation documentation for the appropriate value for this field.
1280
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1281
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1282
+ # `GetIamPolicy`.
1283
+ #
1284
+ # @yield [response, operation] Access the result along with the RPC operation
1285
+ # @yieldparam response [::Google::Iam::V1::Policy]
1286
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1287
+ #
1288
+ # @return [::Google::Iam::V1::Policy]
1289
+ #
1290
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1291
+ #
1292
+ # @example Basic example
1293
+ # require "google/cloud/bigquery/analytics_hub/v1"
1294
+ #
1295
+ # # Create a client object. The client can be reused for multiple calls.
1296
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1297
+ #
1298
+ # # Create a request. To set request fields, pass in keyword arguments.
1299
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1300
+ #
1301
+ # # Call the get_iam_policy method.
1302
+ # result = client.get_iam_policy request
1303
+ #
1304
+ # # The returned object is of type Google::Iam::V1::Policy.
1305
+ # p result
1306
+ #
1307
+ def get_iam_policy request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client and x-goog-user-project headers
1319
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1322
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1323
+
1324
+ header_params = {}
1325
+ if request.resource
1326
+ header_params["resource"] = request.resource
1327
+ end
1328
+
1329
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1330
+ metadata[:"x-goog-request-params"] ||= request_params_header
1331
+
1332
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1333
+ metadata: metadata,
1334
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1335
+
1336
+ options.apply_defaults timeout: @config.timeout,
1337
+ metadata: @config.metadata,
1338
+ retry_policy: @config.retry_policy
1339
+
1340
+ @analytics_hub_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1341
+ yield response, operation if block_given?
1342
+ return response
1343
+ end
1344
+ rescue ::GRPC::BadStatus => e
1345
+ raise ::Google::Cloud::Error.from_error(e)
1346
+ end
1347
+
1348
+ ##
1349
+ # Sets the IAM policy.
1350
+ #
1351
+ # @overload set_iam_policy(request, options = nil)
1352
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1353
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1354
+ #
1355
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1356
+ # A request object representing the call parameters. Required. To specify no
1357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1358
+ # @param options [::Gapic::CallOptions, ::Hash]
1359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1360
+ #
1361
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1362
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1363
+ # least one keyword argument is required. To specify no parameters, or to keep all
1364
+ # the default parameter values, pass an empty Hash as a request object (see above).
1365
+ #
1366
+ # @param resource [::String]
1367
+ # REQUIRED: The resource for which the policy is being specified.
1368
+ # See the operation documentation for the appropriate value for this field.
1369
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1370
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1371
+ # the policy is limited to a few 10s of KB. An empty policy is a
1372
+ # valid policy but certain Cloud Platform services (such as Projects)
1373
+ # might reject them.
1374
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1375
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1376
+ # the fields in the mask will be modified. If no mask is provided, the
1377
+ # following default mask is used:
1378
+ #
1379
+ # `paths: "bindings, etag"`
1380
+ #
1381
+ # @yield [response, operation] Access the result along with the RPC operation
1382
+ # @yieldparam response [::Google::Iam::V1::Policy]
1383
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1384
+ #
1385
+ # @return [::Google::Iam::V1::Policy]
1386
+ #
1387
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1388
+ #
1389
+ # @example Basic example
1390
+ # require "google/cloud/bigquery/analytics_hub/v1"
1391
+ #
1392
+ # # Create a client object. The client can be reused for multiple calls.
1393
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1394
+ #
1395
+ # # Create a request. To set request fields, pass in keyword arguments.
1396
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1397
+ #
1398
+ # # Call the set_iam_policy method.
1399
+ # result = client.set_iam_policy request
1400
+ #
1401
+ # # The returned object is of type Google::Iam::V1::Policy.
1402
+ # p result
1403
+ #
1404
+ def set_iam_policy request, options = nil
1405
+ raise ::ArgumentError, "request must be provided" if request.nil?
1406
+
1407
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1408
+
1409
+ # Converts hash and nil to an options object
1410
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1411
+
1412
+ # Customize the options with defaults
1413
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1414
+
1415
+ # Set x-goog-api-client and x-goog-user-project headers
1416
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1417
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1418
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1419
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1420
+
1421
+ header_params = {}
1422
+ if request.resource
1423
+ header_params["resource"] = request.resource
1424
+ end
1425
+
1426
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1427
+ metadata[:"x-goog-request-params"] ||= request_params_header
1428
+
1429
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1430
+ metadata: metadata,
1431
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1432
+
1433
+ options.apply_defaults timeout: @config.timeout,
1434
+ metadata: @config.metadata,
1435
+ retry_policy: @config.retry_policy
1436
+
1437
+ @analytics_hub_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1438
+ yield response, operation if block_given?
1439
+ return response
1440
+ end
1441
+ rescue ::GRPC::BadStatus => e
1442
+ raise ::Google::Cloud::Error.from_error(e)
1443
+ end
1444
+
1445
+ ##
1446
+ # Returns the permissions that a caller has.
1447
+ #
1448
+ # @overload test_iam_permissions(request, options = nil)
1449
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1450
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1451
+ #
1452
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1453
+ # A request object representing the call parameters. Required. To specify no
1454
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1455
+ # @param options [::Gapic::CallOptions, ::Hash]
1456
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1457
+ #
1458
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1459
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1460
+ # least one keyword argument is required. To specify no parameters, or to keep all
1461
+ # the default parameter values, pass an empty Hash as a request object (see above).
1462
+ #
1463
+ # @param resource [::String]
1464
+ # REQUIRED: The resource for which the policy detail is being requested.
1465
+ # See the operation documentation for the appropriate value for this field.
1466
+ # @param permissions [::Array<::String>]
1467
+ # The set of permissions to check for the `resource`. Permissions with
1468
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1469
+ # information see
1470
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1471
+ #
1472
+ # @yield [response, operation] Access the result along with the RPC operation
1473
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
1474
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1475
+ #
1476
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1477
+ #
1478
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1479
+ #
1480
+ # @example Basic example
1481
+ # require "google/cloud/bigquery/analytics_hub/v1"
1482
+ #
1483
+ # # Create a client object. The client can be reused for multiple calls.
1484
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
1485
+ #
1486
+ # # Create a request. To set request fields, pass in keyword arguments.
1487
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1488
+ #
1489
+ # # Call the test_iam_permissions method.
1490
+ # result = client.test_iam_permissions request
1491
+ #
1492
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1493
+ # p result
1494
+ #
1495
+ def test_iam_permissions request, options = nil
1496
+ raise ::ArgumentError, "request must be provided" if request.nil?
1497
+
1498
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1499
+
1500
+ # Converts hash and nil to an options object
1501
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1502
+
1503
+ # Customize the options with defaults
1504
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1505
+
1506
+ # Set x-goog-api-client and x-goog-user-project headers
1507
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1508
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1509
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
1510
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1511
+
1512
+ header_params = {}
1513
+ if request.resource
1514
+ header_params["resource"] = request.resource
1515
+ end
1516
+
1517
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1518
+ metadata[:"x-goog-request-params"] ||= request_params_header
1519
+
1520
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1521
+ metadata: metadata,
1522
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1523
+
1524
+ options.apply_defaults timeout: @config.timeout,
1525
+ metadata: @config.metadata,
1526
+ retry_policy: @config.retry_policy
1527
+
1528
+ @analytics_hub_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1529
+ yield response, operation if block_given?
1530
+ return response
1531
+ end
1532
+ rescue ::GRPC::BadStatus => e
1533
+ raise ::Google::Cloud::Error.from_error(e)
1534
+ end
1535
+
1536
+ ##
1537
+ # Configuration class for the AnalyticsHubService API.
1538
+ #
1539
+ # This class represents the configuration for AnalyticsHubService,
1540
+ # providing control over timeouts, retry behavior, logging, transport
1541
+ # parameters, and other low-level controls. Certain parameters can also be
1542
+ # applied individually to specific RPCs. See
1543
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client::Configuration::Rpcs}
1544
+ # for a list of RPCs that can be configured independently.
1545
+ #
1546
+ # Configuration can be applied globally to all clients, or to a single client
1547
+ # on construction.
1548
+ #
1549
+ # @example
1550
+ #
1551
+ # # Modify the global config, setting the timeout for
1552
+ # # list_data_exchanges to 20 seconds,
1553
+ # # and all remaining timeouts to 10 seconds.
1554
+ # ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.configure do |config|
1555
+ # config.timeout = 10.0
1556
+ # config.rpcs.list_data_exchanges.timeout = 20.0
1557
+ # end
1558
+ #
1559
+ # # Apply the above configuration only to a new client.
1560
+ # client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config|
1561
+ # config.timeout = 10.0
1562
+ # config.rpcs.list_data_exchanges.timeout = 20.0
1563
+ # end
1564
+ #
1565
+ # @!attribute [rw] endpoint
1566
+ # The hostname or hostname:port of the service endpoint.
1567
+ # Defaults to `"analyticshub.googleapis.com"`.
1568
+ # @return [::String]
1569
+ # @!attribute [rw] credentials
1570
+ # Credentials to send with calls. You may provide any of the following types:
1571
+ # * (`String`) The path to a service account key file in JSON format
1572
+ # * (`Hash`) A service account key as a Hash
1573
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1574
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1575
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1576
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1577
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1578
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1579
+ # * (`nil`) indicating no credentials
1580
+ # @return [::Object]
1581
+ # @!attribute [rw] scope
1582
+ # The OAuth scopes
1583
+ # @return [::Array<::String>]
1584
+ # @!attribute [rw] lib_name
1585
+ # The library name as recorded in instrumentation and logging
1586
+ # @return [::String]
1587
+ # @!attribute [rw] lib_version
1588
+ # The library version as recorded in instrumentation and logging
1589
+ # @return [::String]
1590
+ # @!attribute [rw] channel_args
1591
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1592
+ # `GRPC::Core::Channel` object is provided as the credential.
1593
+ # @return [::Hash]
1594
+ # @!attribute [rw] interceptors
1595
+ # An array of interceptors that are run before calls are executed.
1596
+ # @return [::Array<::GRPC::ClientInterceptor>]
1597
+ # @!attribute [rw] timeout
1598
+ # The call timeout in seconds.
1599
+ # @return [::Numeric]
1600
+ # @!attribute [rw] metadata
1601
+ # Additional gRPC headers to be sent with the call.
1602
+ # @return [::Hash{::Symbol=>::String}]
1603
+ # @!attribute [rw] retry_policy
1604
+ # The retry policy. The value is a hash with the following keys:
1605
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1606
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1607
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1608
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1609
+ # trigger a retry.
1610
+ # @return [::Hash]
1611
+ # @!attribute [rw] quota_project
1612
+ # A separate project against which to charge quota.
1613
+ # @return [::String]
1614
+ #
1615
+ class Configuration
1616
+ extend ::Gapic::Config
1617
+
1618
+ config_attr :endpoint, "analyticshub.googleapis.com", ::String
1619
+ config_attr :credentials, nil do |value|
1620
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1621
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1622
+ allowed.any? { |klass| klass === value }
1623
+ end
1624
+ config_attr :scope, nil, ::String, ::Array, nil
1625
+ config_attr :lib_name, nil, ::String, nil
1626
+ config_attr :lib_version, nil, ::String, nil
1627
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1628
+ config_attr :interceptors, nil, ::Array, nil
1629
+ config_attr :timeout, nil, ::Numeric, nil
1630
+ config_attr :metadata, nil, ::Hash, nil
1631
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1632
+ config_attr :quota_project, nil, ::String, nil
1633
+
1634
+ # @private
1635
+ def initialize parent_config = nil
1636
+ @parent_config = parent_config unless parent_config.nil?
1637
+
1638
+ yield self if block_given?
1639
+ end
1640
+
1641
+ ##
1642
+ # Configurations for individual RPCs
1643
+ # @return [Rpcs]
1644
+ #
1645
+ def rpcs
1646
+ @rpcs ||= begin
1647
+ parent_rpcs = nil
1648
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1649
+ Rpcs.new parent_rpcs
1650
+ end
1651
+ end
1652
+
1653
+ ##
1654
+ # Configuration RPC class for the AnalyticsHubService API.
1655
+ #
1656
+ # Includes fields providing the configuration for each RPC in this service.
1657
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1658
+ # the following configuration fields:
1659
+ #
1660
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1661
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1662
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1663
+ # include the following keys:
1664
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1665
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1666
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1667
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1668
+ # trigger a retry.
1669
+ #
1670
+ class Rpcs
1671
+ ##
1672
+ # RPC-specific configuration for `list_data_exchanges`
1673
+ # @return [::Gapic::Config::Method]
1674
+ #
1675
+ attr_reader :list_data_exchanges
1676
+ ##
1677
+ # RPC-specific configuration for `list_org_data_exchanges`
1678
+ # @return [::Gapic::Config::Method]
1679
+ #
1680
+ attr_reader :list_org_data_exchanges
1681
+ ##
1682
+ # RPC-specific configuration for `get_data_exchange`
1683
+ # @return [::Gapic::Config::Method]
1684
+ #
1685
+ attr_reader :get_data_exchange
1686
+ ##
1687
+ # RPC-specific configuration for `create_data_exchange`
1688
+ # @return [::Gapic::Config::Method]
1689
+ #
1690
+ attr_reader :create_data_exchange
1691
+ ##
1692
+ # RPC-specific configuration for `update_data_exchange`
1693
+ # @return [::Gapic::Config::Method]
1694
+ #
1695
+ attr_reader :update_data_exchange
1696
+ ##
1697
+ # RPC-specific configuration for `delete_data_exchange`
1698
+ # @return [::Gapic::Config::Method]
1699
+ #
1700
+ attr_reader :delete_data_exchange
1701
+ ##
1702
+ # RPC-specific configuration for `list_listings`
1703
+ # @return [::Gapic::Config::Method]
1704
+ #
1705
+ attr_reader :list_listings
1706
+ ##
1707
+ # RPC-specific configuration for `get_listing`
1708
+ # @return [::Gapic::Config::Method]
1709
+ #
1710
+ attr_reader :get_listing
1711
+ ##
1712
+ # RPC-specific configuration for `create_listing`
1713
+ # @return [::Gapic::Config::Method]
1714
+ #
1715
+ attr_reader :create_listing
1716
+ ##
1717
+ # RPC-specific configuration for `update_listing`
1718
+ # @return [::Gapic::Config::Method]
1719
+ #
1720
+ attr_reader :update_listing
1721
+ ##
1722
+ # RPC-specific configuration for `delete_listing`
1723
+ # @return [::Gapic::Config::Method]
1724
+ #
1725
+ attr_reader :delete_listing
1726
+ ##
1727
+ # RPC-specific configuration for `subscribe_listing`
1728
+ # @return [::Gapic::Config::Method]
1729
+ #
1730
+ attr_reader :subscribe_listing
1731
+ ##
1732
+ # RPC-specific configuration for `get_iam_policy`
1733
+ # @return [::Gapic::Config::Method]
1734
+ #
1735
+ attr_reader :get_iam_policy
1736
+ ##
1737
+ # RPC-specific configuration for `set_iam_policy`
1738
+ # @return [::Gapic::Config::Method]
1739
+ #
1740
+ attr_reader :set_iam_policy
1741
+ ##
1742
+ # RPC-specific configuration for `test_iam_permissions`
1743
+ # @return [::Gapic::Config::Method]
1744
+ #
1745
+ attr_reader :test_iam_permissions
1746
+
1747
+ # @private
1748
+ def initialize parent_rpcs = nil
1749
+ list_data_exchanges_config = parent_rpcs.list_data_exchanges if parent_rpcs.respond_to? :list_data_exchanges
1750
+ @list_data_exchanges = ::Gapic::Config::Method.new list_data_exchanges_config
1751
+ list_org_data_exchanges_config = parent_rpcs.list_org_data_exchanges if parent_rpcs.respond_to? :list_org_data_exchanges
1752
+ @list_org_data_exchanges = ::Gapic::Config::Method.new list_org_data_exchanges_config
1753
+ get_data_exchange_config = parent_rpcs.get_data_exchange if parent_rpcs.respond_to? :get_data_exchange
1754
+ @get_data_exchange = ::Gapic::Config::Method.new get_data_exchange_config
1755
+ create_data_exchange_config = parent_rpcs.create_data_exchange if parent_rpcs.respond_to? :create_data_exchange
1756
+ @create_data_exchange = ::Gapic::Config::Method.new create_data_exchange_config
1757
+ update_data_exchange_config = parent_rpcs.update_data_exchange if parent_rpcs.respond_to? :update_data_exchange
1758
+ @update_data_exchange = ::Gapic::Config::Method.new update_data_exchange_config
1759
+ delete_data_exchange_config = parent_rpcs.delete_data_exchange if parent_rpcs.respond_to? :delete_data_exchange
1760
+ @delete_data_exchange = ::Gapic::Config::Method.new delete_data_exchange_config
1761
+ list_listings_config = parent_rpcs.list_listings if parent_rpcs.respond_to? :list_listings
1762
+ @list_listings = ::Gapic::Config::Method.new list_listings_config
1763
+ get_listing_config = parent_rpcs.get_listing if parent_rpcs.respond_to? :get_listing
1764
+ @get_listing = ::Gapic::Config::Method.new get_listing_config
1765
+ create_listing_config = parent_rpcs.create_listing if parent_rpcs.respond_to? :create_listing
1766
+ @create_listing = ::Gapic::Config::Method.new create_listing_config
1767
+ update_listing_config = parent_rpcs.update_listing if parent_rpcs.respond_to? :update_listing
1768
+ @update_listing = ::Gapic::Config::Method.new update_listing_config
1769
+ delete_listing_config = parent_rpcs.delete_listing if parent_rpcs.respond_to? :delete_listing
1770
+ @delete_listing = ::Gapic::Config::Method.new delete_listing_config
1771
+ subscribe_listing_config = parent_rpcs.subscribe_listing if parent_rpcs.respond_to? :subscribe_listing
1772
+ @subscribe_listing = ::Gapic::Config::Method.new subscribe_listing_config
1773
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1774
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1775
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1776
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1777
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1778
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1779
+
1780
+ yield self if block_given?
1781
+ end
1782
+ end
1783
+ end
1784
+ end
1785
+ end
1786
+ end
1787
+ end
1788
+ end
1789
+ end
1790
+ end