google-cloud-bigquery-data_exchange-v1beta1 0.1.0

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