google-cloud-bigquery-connection-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/bigquery/connection/v1"
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/bigquery/connection/v1/connection_service"
20
+ require "google/cloud/bigquery/connection/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module Connection
26
+ ##
27
+ # To load this package, including all its services, and instantiate a client:
28
+ #
29
+ # require "google/cloud/bigquery/connection/v1"
30
+ # client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new
31
+ #
32
+ module V1
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,90 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/bigquery/connection/v1/connection.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/iam/v1/iam_policy_pb'
11
+ require 'google/iam/v1/policy_pb'
12
+ require 'google/protobuf/empty_pb'
13
+ require 'google/protobuf/field_mask_pb'
14
+ require 'google/protobuf/wrappers_pb'
15
+ Google::Protobuf::DescriptorPool.generated_pool.build do
16
+ add_file("google/cloud/bigquery/connection/v1/connection.proto", :syntax => :proto3) do
17
+ add_message "google.cloud.bigquery.connection.v1.CreateConnectionRequest" do
18
+ optional :parent, :string, 1
19
+ optional :connection_id, :string, 2
20
+ optional :connection, :message, 3, "google.cloud.bigquery.connection.v1.Connection"
21
+ end
22
+ add_message "google.cloud.bigquery.connection.v1.GetConnectionRequest" do
23
+ optional :name, :string, 1
24
+ end
25
+ add_message "google.cloud.bigquery.connection.v1.ListConnectionsRequest" do
26
+ optional :parent, :string, 1
27
+ optional :page_size, :int32, 4
28
+ optional :page_token, :string, 3
29
+ end
30
+ add_message "google.cloud.bigquery.connection.v1.ListConnectionsResponse" do
31
+ optional :next_page_token, :string, 1
32
+ repeated :connections, :message, 2, "google.cloud.bigquery.connection.v1.Connection"
33
+ end
34
+ add_message "google.cloud.bigquery.connection.v1.UpdateConnectionRequest" do
35
+ optional :name, :string, 1
36
+ optional :connection, :message, 2, "google.cloud.bigquery.connection.v1.Connection"
37
+ optional :update_mask, :message, 3, "google.protobuf.FieldMask"
38
+ end
39
+ add_message "google.cloud.bigquery.connection.v1.DeleteConnectionRequest" do
40
+ optional :name, :string, 1
41
+ end
42
+ add_message "google.cloud.bigquery.connection.v1.Connection" do
43
+ optional :name, :string, 1
44
+ optional :friendly_name, :string, 2
45
+ optional :description, :string, 3
46
+ optional :creation_time, :int64, 5
47
+ optional :last_modified_time, :int64, 6
48
+ optional :has_credential, :bool, 7
49
+ oneof :properties do
50
+ optional :cloud_sql, :message, 4, "google.cloud.bigquery.connection.v1.CloudSqlProperties"
51
+ end
52
+ end
53
+ add_message "google.cloud.bigquery.connection.v1.CloudSqlProperties" do
54
+ optional :instance_id, :string, 1
55
+ optional :database, :string, 2
56
+ optional :type, :enum, 3, "google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType"
57
+ optional :credential, :message, 4, "google.cloud.bigquery.connection.v1.CloudSqlCredential"
58
+ end
59
+ add_enum "google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType" do
60
+ value :DATABASE_TYPE_UNSPECIFIED, 0
61
+ value :POSTGRES, 1
62
+ value :MYSQL, 2
63
+ end
64
+ add_message "google.cloud.bigquery.connection.v1.CloudSqlCredential" do
65
+ optional :username, :string, 1
66
+ optional :password, :string, 2
67
+ end
68
+ end
69
+ end
70
+
71
+ module Google
72
+ module Cloud
73
+ module Bigquery
74
+ module Connection
75
+ module V1
76
+ CreateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.CreateConnectionRequest").msgclass
77
+ GetConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.GetConnectionRequest").msgclass
78
+ ListConnectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.ListConnectionsRequest").msgclass
79
+ ListConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.ListConnectionsResponse").msgclass
80
+ UpdateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.UpdateConnectionRequest").msgclass
81
+ DeleteConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.DeleteConnectionRequest").msgclass
82
+ Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.Connection").msgclass
83
+ CloudSqlProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.CloudSqlProperties").msgclass
84
+ CloudSqlProperties::DatabaseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType").enummodule
85
+ CloudSqlCredential = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.connection.v1.CloudSqlCredential").msgclass
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/bigquery/connection/v1/version"
24
+
25
+ require "google/cloud/bigquery/connection/v1/connection_service/credentials"
26
+ require "google/cloud/bigquery/connection/v1/connection_service/paths"
27
+ require "google/cloud/bigquery/connection/v1/connection_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Bigquery
32
+ module Connection
33
+ module V1
34
+ ##
35
+ # Manages external data source connections and credentials.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/bigquery/connection/v1/connection_service"
40
+ # client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new
41
+ #
42
+ module ConnectionService
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "connection_service", "helpers.rb"
51
+ require "google/cloud/bigquery/connection/v1/connection_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,962 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/connection/v1/connection_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Bigquery
25
+ module Connection
26
+ module V1
27
+ module ConnectionService
28
+ ##
29
+ # Client for the ConnectionService service.
30
+ #
31
+ # Manages external data source connections and credentials.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :connection_service_stub
38
+
39
+ ##
40
+ # Configure the ConnectionService Client class.
41
+ #
42
+ # See {::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all ConnectionService clients:
48
+ #
49
+ # ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Bigquery", "Connection", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const&.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_connection.timeout = 60.0
70
+
71
+ default_config.rpcs.get_connection.timeout = 60.0
72
+ default_config.rpcs.get_connection.retry_policy = {
73
+ initial_delay: 0.1,
74
+ max_delay: 60.0,
75
+ multiplier: 1.3,
76
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
77
+ }
78
+
79
+ default_config.rpcs.list_connections.timeout = 60.0
80
+ default_config.rpcs.list_connections.retry_policy = {
81
+ initial_delay: 0.1,
82
+ max_delay: 60.0,
83
+ multiplier: 1.3,
84
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
85
+ }
86
+
87
+ default_config.rpcs.update_connection.timeout = 60.0
88
+
89
+ default_config.rpcs.delete_connection.timeout = 60.0
90
+ default_config.rpcs.delete_connection.retry_policy = {
91
+ initial_delay: 0.1,
92
+ max_delay: 60.0,
93
+ multiplier: 1.3,
94
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
95
+ }
96
+
97
+ default_config.rpcs.get_iam_policy.timeout = 60.0
98
+
99
+ default_config.rpcs.set_iam_policy.timeout = 60.0
100
+
101
+ default_config.rpcs.test_iam_permissions.timeout = 60.0
102
+
103
+ default_config
104
+ end
105
+ yield @configure if block_given?
106
+ @configure
107
+ end
108
+
109
+ ##
110
+ # Configure the ConnectionService Client instance.
111
+ #
112
+ # The configuration is set to the derived mode, meaning that values can be changed,
113
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
114
+ # should be made on {Client.configure}.
115
+ #
116
+ # See {::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client::Configuration}
117
+ # for a description of the configuration fields.
118
+ #
119
+ # @yield [config] Configure the Client client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ # @return [Client::Configuration]
123
+ #
124
+ def configure
125
+ yield @config if block_given?
126
+ @config
127
+ end
128
+
129
+ ##
130
+ # Create a new ConnectionService client object.
131
+ #
132
+ # ## Examples
133
+ #
134
+ # To create a new ConnectionService client with the default
135
+ # configuration:
136
+ #
137
+ # client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new
138
+ #
139
+ # To create a new ConnectionService client with a custom
140
+ # configuration:
141
+ #
142
+ # client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config|
143
+ # config.timeout = 10.0
144
+ # end
145
+ #
146
+ # @yield [config] Configure the ConnectionService client.
147
+ # @yieldparam config [Client::Configuration]
148
+ #
149
+ def initialize
150
+ # These require statements are intentionally placed here to initialize
151
+ # the gRPC module only when it's required.
152
+ # See https://github.com/googleapis/toolkit/issues/446
153
+ require "gapic/grpc"
154
+ require "google/cloud/bigquery/connection/v1/connection_services_pb"
155
+
156
+ # Create the configuration object
157
+ @config = Configuration.new Client.configure
158
+
159
+ # Yield the configuration if needed
160
+ yield @config if block_given?
161
+
162
+ # Create credentials
163
+ credentials = @config.credentials
164
+ credentials ||= Credentials.default scope: @config.scope
165
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
166
+ credentials = Credentials.new credentials, scope: @config.scope
167
+ end
168
+ @quota_project_id = @config.quota_project
169
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
170
+
171
+ @connection_service_stub = ::Gapic::ServiceStub.new(
172
+ ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Stub,
173
+ credentials: credentials,
174
+ endpoint: @config.endpoint,
175
+ channel_args: @config.channel_args,
176
+ interceptors: @config.interceptors
177
+ )
178
+ end
179
+
180
+ # Service calls
181
+
182
+ ##
183
+ # Creates a new connection.
184
+ #
185
+ # @overload create_connection(request, options = nil)
186
+ # Pass arguments to `create_connection` via a request object, either of type
187
+ # {::Google::Cloud::Bigquery::Connection::V1::CreateConnectionRequest} or an equivalent Hash.
188
+ #
189
+ # @param request [::Google::Cloud::Bigquery::Connection::V1::CreateConnectionRequest, ::Hash]
190
+ # A request object representing the call parameters. Required. To specify no
191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
192
+ # @param options [::Gapic::CallOptions, ::Hash]
193
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
194
+ #
195
+ # @overload create_connection(parent: nil, connection_id: nil, connection: nil)
196
+ # Pass arguments to `create_connection` via keyword arguments. Note that at
197
+ # least one keyword argument is required. To specify no parameters, or to keep all
198
+ # the default parameter values, pass an empty Hash as a request object (see above).
199
+ #
200
+ # @param parent [::String]
201
+ # Required. Parent resource name.
202
+ # Must be in the format `projects/{project_id}/locations/{location_id}`
203
+ # @param connection_id [::String]
204
+ # Optional. Connection id that should be assigned to the created connection.
205
+ # @param connection [::Google::Cloud::Bigquery::Connection::V1::Connection, ::Hash]
206
+ # Required. Connection to create.
207
+ #
208
+ # @yield [response, operation] Access the result along with the RPC operation
209
+ # @yieldparam response [::Google::Cloud::Bigquery::Connection::V1::Connection]
210
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
211
+ #
212
+ # @return [::Google::Cloud::Bigquery::Connection::V1::Connection]
213
+ #
214
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
215
+ #
216
+ def create_connection request, options = nil
217
+ raise ::ArgumentError, "request must be provided" if request.nil?
218
+
219
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Connection::V1::CreateConnectionRequest
220
+
221
+ # Converts hash and nil to an options object
222
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
223
+
224
+ # Customize the options with defaults
225
+ metadata = @config.rpcs.create_connection.metadata.to_h
226
+
227
+ # Set x-goog-api-client and x-goog-user-project headers
228
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
229
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
230
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
231
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
+
233
+ header_params = {
234
+ "parent" => request.parent
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.create_connection.timeout,
240
+ metadata: metadata,
241
+ retry_policy: @config.rpcs.create_connection.retry_policy
242
+ options.apply_defaults metadata: @config.metadata,
243
+ retry_policy: @config.retry_policy
244
+
245
+ @connection_service_stub.call_rpc :create_connection, request, options: options do |response, operation|
246
+ yield response, operation if block_given?
247
+ return response
248
+ end
249
+ rescue ::GRPC::BadStatus => e
250
+ raise ::Google::Cloud::Error.from_error(e)
251
+ end
252
+
253
+ ##
254
+ # Returns specified connection.
255
+ #
256
+ # @overload get_connection(request, options = nil)
257
+ # Pass arguments to `get_connection` via a request object, either of type
258
+ # {::Google::Cloud::Bigquery::Connection::V1::GetConnectionRequest} or an equivalent Hash.
259
+ #
260
+ # @param request [::Google::Cloud::Bigquery::Connection::V1::GetConnectionRequest, ::Hash]
261
+ # A request object representing the call parameters. Required. To specify no
262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
263
+ # @param options [::Gapic::CallOptions, ::Hash]
264
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
265
+ #
266
+ # @overload get_connection(name: nil)
267
+ # Pass arguments to `get_connection` via keyword arguments. Note that at
268
+ # least one keyword argument is required. To specify no parameters, or to keep all
269
+ # the default parameter values, pass an empty Hash as a request object (see above).
270
+ #
271
+ # @param name [::String]
272
+ # Required. Name of the requested connection, for example:
273
+ # `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
274
+ #
275
+ # @yield [response, operation] Access the result along with the RPC operation
276
+ # @yieldparam response [::Google::Cloud::Bigquery::Connection::V1::Connection]
277
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
278
+ #
279
+ # @return [::Google::Cloud::Bigquery::Connection::V1::Connection]
280
+ #
281
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
282
+ #
283
+ def get_connection request, options = nil
284
+ raise ::ArgumentError, "request must be provided" if request.nil?
285
+
286
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Connection::V1::GetConnectionRequest
287
+
288
+ # Converts hash and nil to an options object
289
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
290
+
291
+ # Customize the options with defaults
292
+ metadata = @config.rpcs.get_connection.metadata.to_h
293
+
294
+ # Set x-goog-api-client and x-goog-user-project headers
295
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
297
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
298
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ header_params = {
301
+ "name" => request.name
302
+ }
303
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
304
+ metadata[:"x-goog-request-params"] ||= request_params_header
305
+
306
+ options.apply_defaults timeout: @config.rpcs.get_connection.timeout,
307
+ metadata: metadata,
308
+ retry_policy: @config.rpcs.get_connection.retry_policy
309
+ options.apply_defaults metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @connection_service_stub.call_rpc :get_connection, request, options: options do |response, operation|
313
+ yield response, operation if block_given?
314
+ return response
315
+ end
316
+ rescue ::GRPC::BadStatus => e
317
+ raise ::Google::Cloud::Error.from_error(e)
318
+ end
319
+
320
+ ##
321
+ # Returns a list of connections in the given project.
322
+ #
323
+ # @overload list_connections(request, options = nil)
324
+ # Pass arguments to `list_connections` via a request object, either of type
325
+ # {::Google::Cloud::Bigquery::Connection::V1::ListConnectionsRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::Bigquery::Connection::V1::ListConnectionsRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
332
+ #
333
+ # @overload list_connections(parent: nil, page_size: nil, page_token: nil)
334
+ # Pass arguments to `list_connections` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param parent [::String]
339
+ # Required. Parent resource name.
340
+ # Must be in the form: `projects/{project_id}/locations/{location_id}`
341
+ # @param page_size [::Integer]
342
+ # Required. Page size.
343
+ # @param page_token [::String]
344
+ # Page token.
345
+ #
346
+ # @yield [response, operation] Access the result along with the RPC operation
347
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Connection::V1::Connection>]
348
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
349
+ #
350
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Connection::V1::Connection>]
351
+ #
352
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
353
+ #
354
+ def list_connections request, options = nil
355
+ raise ::ArgumentError, "request must be provided" if request.nil?
356
+
357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Connection::V1::ListConnectionsRequest
358
+
359
+ # Converts hash and nil to an options object
360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
361
+
362
+ # Customize the options with defaults
363
+ metadata = @config.rpcs.list_connections.metadata.to_h
364
+
365
+ # Set x-goog-api-client and x-goog-user-project headers
366
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
368
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
369
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
370
+
371
+ header_params = {
372
+ "parent" => request.parent
373
+ }
374
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
375
+ metadata[:"x-goog-request-params"] ||= request_params_header
376
+
377
+ options.apply_defaults timeout: @config.rpcs.list_connections.timeout,
378
+ metadata: metadata,
379
+ retry_policy: @config.rpcs.list_connections.retry_policy
380
+ options.apply_defaults metadata: @config.metadata,
381
+ retry_policy: @config.retry_policy
382
+
383
+ @connection_service_stub.call_rpc :list_connections, request, options: options do |response, operation|
384
+ response = ::Gapic::PagedEnumerable.new @connection_service_stub, :list_connections, request, response, operation, options
385
+ yield response, operation if block_given?
386
+ return response
387
+ end
388
+ rescue ::GRPC::BadStatus => e
389
+ raise ::Google::Cloud::Error.from_error(e)
390
+ end
391
+
392
+ ##
393
+ # Updates the specified connection. For security reasons, also resets
394
+ # credential if connection properties are in the update field mask.
395
+ #
396
+ # @overload update_connection(request, options = nil)
397
+ # Pass arguments to `update_connection` via a request object, either of type
398
+ # {::Google::Cloud::Bigquery::Connection::V1::UpdateConnectionRequest} or an equivalent Hash.
399
+ #
400
+ # @param request [::Google::Cloud::Bigquery::Connection::V1::UpdateConnectionRequest, ::Hash]
401
+ # A request object representing the call parameters. Required. To specify no
402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
403
+ # @param options [::Gapic::CallOptions, ::Hash]
404
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
405
+ #
406
+ # @overload update_connection(name: nil, connection: nil, update_mask: nil)
407
+ # Pass arguments to `update_connection` via keyword arguments. Note that at
408
+ # least one keyword argument is required. To specify no parameters, or to keep all
409
+ # the default parameter values, pass an empty Hash as a request object (see above).
410
+ #
411
+ # @param name [::String]
412
+ # Required. Name of the connection to update, for example:
413
+ # `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
414
+ # @param connection [::Google::Cloud::Bigquery::Connection::V1::Connection, ::Hash]
415
+ # Required. Connection containing the updated fields.
416
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
417
+ # Required. Update mask for the connection fields to be updated.
418
+ #
419
+ # @yield [response, operation] Access the result along with the RPC operation
420
+ # @yieldparam response [::Google::Cloud::Bigquery::Connection::V1::Connection]
421
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
422
+ #
423
+ # @return [::Google::Cloud::Bigquery::Connection::V1::Connection]
424
+ #
425
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
426
+ #
427
+ def update_connection request, options = nil
428
+ raise ::ArgumentError, "request must be provided" if request.nil?
429
+
430
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Connection::V1::UpdateConnectionRequest
431
+
432
+ # Converts hash and nil to an options object
433
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
434
+
435
+ # Customize the options with defaults
436
+ metadata = @config.rpcs.update_connection.metadata.to_h
437
+
438
+ # Set x-goog-api-client and x-goog-user-project headers
439
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
440
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
441
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
442
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
443
+
444
+ header_params = {
445
+ "name" => request.name
446
+ }
447
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
448
+ metadata[:"x-goog-request-params"] ||= request_params_header
449
+
450
+ options.apply_defaults timeout: @config.rpcs.update_connection.timeout,
451
+ metadata: metadata,
452
+ retry_policy: @config.rpcs.update_connection.retry_policy
453
+ options.apply_defaults metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @connection_service_stub.call_rpc :update_connection, request, options: options do |response, operation|
457
+ yield response, operation if block_given?
458
+ return response
459
+ end
460
+ rescue ::GRPC::BadStatus => e
461
+ raise ::Google::Cloud::Error.from_error(e)
462
+ end
463
+
464
+ ##
465
+ # Deletes connection and associated credential.
466
+ #
467
+ # @overload delete_connection(request, options = nil)
468
+ # Pass arguments to `delete_connection` via a request object, either of type
469
+ # {::Google::Cloud::Bigquery::Connection::V1::DeleteConnectionRequest} or an equivalent Hash.
470
+ #
471
+ # @param request [::Google::Cloud::Bigquery::Connection::V1::DeleteConnectionRequest, ::Hash]
472
+ # A request object representing the call parameters. Required. To specify no
473
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
474
+ # @param options [::Gapic::CallOptions, ::Hash]
475
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
476
+ #
477
+ # @overload delete_connection(name: nil)
478
+ # Pass arguments to `delete_connection` via keyword arguments. Note that at
479
+ # least one keyword argument is required. To specify no parameters, or to keep all
480
+ # the default parameter values, pass an empty Hash as a request object (see above).
481
+ #
482
+ # @param name [::String]
483
+ # Required. Name of the deleted connection, for example:
484
+ # `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
485
+ #
486
+ # @yield [response, operation] Access the result along with the RPC operation
487
+ # @yieldparam response [::Google::Protobuf::Empty]
488
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
489
+ #
490
+ # @return [::Google::Protobuf::Empty]
491
+ #
492
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
493
+ #
494
+ def delete_connection request, options = nil
495
+ raise ::ArgumentError, "request must be provided" if request.nil?
496
+
497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Connection::V1::DeleteConnectionRequest
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.delete_connection.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::Connection::V1::VERSION
509
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
510
+
511
+ header_params = {
512
+ "name" => request.name
513
+ }
514
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
515
+ metadata[:"x-goog-request-params"] ||= request_params_header
516
+
517
+ options.apply_defaults timeout: @config.rpcs.delete_connection.timeout,
518
+ metadata: metadata,
519
+ retry_policy: @config.rpcs.delete_connection.retry_policy
520
+ options.apply_defaults metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @connection_service_stub.call_rpc :delete_connection, request, options: options do |response, operation|
524
+ yield response, operation if block_given?
525
+ return response
526
+ end
527
+ rescue ::GRPC::BadStatus => e
528
+ raise ::Google::Cloud::Error.from_error(e)
529
+ end
530
+
531
+ ##
532
+ # Gets the access control policy for a resource.
533
+ # Returns an empty policy if the resource exists and does not have a policy
534
+ # set.
535
+ #
536
+ # @overload get_iam_policy(request, options = nil)
537
+ # Pass arguments to `get_iam_policy` via a request object, either of type
538
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
539
+ #
540
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
541
+ # A request object representing the call parameters. Required. To specify no
542
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
543
+ # @param options [::Gapic::CallOptions, ::Hash]
544
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
545
+ #
546
+ # @overload get_iam_policy(resource: nil, options: nil)
547
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
548
+ # least one keyword argument is required. To specify no parameters, or to keep all
549
+ # the default parameter values, pass an empty Hash as a request object (see above).
550
+ #
551
+ # @param resource [::String]
552
+ # REQUIRED: The resource for which the policy is being requested.
553
+ # See the operation documentation for the appropriate value for this field.
554
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
555
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
556
+ # `GetIamPolicy`. This field is only used by Cloud IAM.
557
+ #
558
+ # @yield [response, operation] Access the result along with the RPC operation
559
+ # @yieldparam response [::Google::Iam::V1::Policy]
560
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
561
+ #
562
+ # @return [::Google::Iam::V1::Policy]
563
+ #
564
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
565
+ #
566
+ def get_iam_policy request, options = nil
567
+ raise ::ArgumentError, "request must be provided" if request.nil?
568
+
569
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
570
+
571
+ # Converts hash and nil to an options object
572
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
573
+
574
+ # Customize the options with defaults
575
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
576
+
577
+ # Set x-goog-api-client and x-goog-user-project headers
578
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
580
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
581
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
+
583
+ header_params = {
584
+ "resource" => request.resource
585
+ }
586
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
587
+ metadata[:"x-goog-request-params"] ||= request_params_header
588
+
589
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
590
+ metadata: metadata,
591
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
592
+ options.apply_defaults metadata: @config.metadata,
593
+ retry_policy: @config.retry_policy
594
+
595
+ @connection_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
596
+ yield response, operation if block_given?
597
+ return response
598
+ end
599
+ rescue ::GRPC::BadStatus => e
600
+ raise ::Google::Cloud::Error.from_error(e)
601
+ end
602
+
603
+ ##
604
+ # Sets the access control policy on the specified resource. Replaces any
605
+ # existing policy.
606
+ #
607
+ # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
608
+ #
609
+ # @overload set_iam_policy(request, options = nil)
610
+ # Pass arguments to `set_iam_policy` via a request object, either of type
611
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
612
+ #
613
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
614
+ # A request object representing the call parameters. Required. To specify no
615
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
616
+ # @param options [::Gapic::CallOptions, ::Hash]
617
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
618
+ #
619
+ # @overload set_iam_policy(resource: nil, policy: nil)
620
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
621
+ # least one keyword argument is required. To specify no parameters, or to keep all
622
+ # the default parameter values, pass an empty Hash as a request object (see above).
623
+ #
624
+ # @param resource [::String]
625
+ # REQUIRED: The resource for which the policy is being specified.
626
+ # See the operation documentation for the appropriate value for this field.
627
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
628
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
629
+ # the policy is limited to a few 10s of KB. An empty policy is a
630
+ # valid policy but certain Cloud Platform services (such as Projects)
631
+ # might reject them.
632
+ #
633
+ # @yield [response, operation] Access the result along with the RPC operation
634
+ # @yieldparam response [::Google::Iam::V1::Policy]
635
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
636
+ #
637
+ # @return [::Google::Iam::V1::Policy]
638
+ #
639
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
640
+ #
641
+ def set_iam_policy request, options = nil
642
+ raise ::ArgumentError, "request must be provided" if request.nil?
643
+
644
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
645
+
646
+ # Converts hash and nil to an options object
647
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
648
+
649
+ # Customize the options with defaults
650
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
651
+
652
+ # Set x-goog-api-client and x-goog-user-project headers
653
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
654
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
655
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
656
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
+
658
+ header_params = {
659
+ "resource" => request.resource
660
+ }
661
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
662
+ metadata[:"x-goog-request-params"] ||= request_params_header
663
+
664
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
665
+ metadata: metadata,
666
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
667
+ options.apply_defaults metadata: @config.metadata,
668
+ retry_policy: @config.retry_policy
669
+
670
+ @connection_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
671
+ yield response, operation if block_given?
672
+ return response
673
+ end
674
+ rescue ::GRPC::BadStatus => e
675
+ raise ::Google::Cloud::Error.from_error(e)
676
+ end
677
+
678
+ ##
679
+ # Returns permissions that a caller has on the specified resource.
680
+ # If the resource does not exist, this will return an empty set of
681
+ # permissions, not a `NOT_FOUND` error.
682
+ #
683
+ # Note: This operation is designed to be used for building permission-aware
684
+ # UIs and command-line tools, not for authorization checking. This operation
685
+ # may "fail open" without warning.
686
+ #
687
+ # @overload test_iam_permissions(request, options = nil)
688
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
689
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
690
+ #
691
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
692
+ # A request object representing the call parameters. Required. To specify no
693
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
694
+ # @param options [::Gapic::CallOptions, ::Hash]
695
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
696
+ #
697
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
698
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
699
+ # least one keyword argument is required. To specify no parameters, or to keep all
700
+ # the default parameter values, pass an empty Hash as a request object (see above).
701
+ #
702
+ # @param resource [::String]
703
+ # REQUIRED: The resource for which the policy detail is being requested.
704
+ # See the operation documentation for the appropriate value for this field.
705
+ # @param permissions [::Array<::String>]
706
+ # The set of permissions to check for the `resource`. Permissions with
707
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
708
+ # information see
709
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
710
+ #
711
+ # @yield [response, operation] Access the result along with the RPC operation
712
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
713
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
714
+ #
715
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
716
+ #
717
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
718
+ #
719
+ def test_iam_permissions request, options = nil
720
+ raise ::ArgumentError, "request must be provided" if request.nil?
721
+
722
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
723
+
724
+ # Converts hash and nil to an options object
725
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
726
+
727
+ # Customize the options with defaults
728
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
729
+
730
+ # Set x-goog-api-client and x-goog-user-project headers
731
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
732
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
733
+ gapic_version: ::Google::Cloud::Bigquery::Connection::V1::VERSION
734
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
735
+
736
+ header_params = {
737
+ "resource" => request.resource
738
+ }
739
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
740
+ metadata[:"x-goog-request-params"] ||= request_params_header
741
+
742
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
743
+ metadata: metadata,
744
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
745
+ options.apply_defaults metadata: @config.metadata,
746
+ retry_policy: @config.retry_policy
747
+
748
+ @connection_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
749
+ yield response, operation if block_given?
750
+ return response
751
+ end
752
+ rescue ::GRPC::BadStatus => e
753
+ raise ::Google::Cloud::Error.from_error(e)
754
+ end
755
+
756
+ ##
757
+ # Configuration class for the ConnectionService API.
758
+ #
759
+ # This class represents the configuration for ConnectionService,
760
+ # providing control over timeouts, retry behavior, logging, transport
761
+ # parameters, and other low-level controls. Certain parameters can also be
762
+ # applied individually to specific RPCs. See
763
+ # {::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client::Configuration::Rpcs}
764
+ # for a list of RPCs that can be configured independently.
765
+ #
766
+ # Configuration can be applied globally to all clients, or to a single client
767
+ # on construction.
768
+ #
769
+ # # Examples
770
+ #
771
+ # To modify the global config, setting the timeout for create_connection
772
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
773
+ #
774
+ # ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.configure do |config|
775
+ # config.timeout = 10.0
776
+ # config.rpcs.create_connection.timeout = 20.0
777
+ # end
778
+ #
779
+ # To apply the above configuration only to a new client:
780
+ #
781
+ # client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config|
782
+ # config.timeout = 10.0
783
+ # config.rpcs.create_connection.timeout = 20.0
784
+ # end
785
+ #
786
+ # @!attribute [rw] endpoint
787
+ # The hostname or hostname:port of the service endpoint.
788
+ # Defaults to `"bigqueryconnection.googleapis.com"`.
789
+ # @return [::String]
790
+ # @!attribute [rw] credentials
791
+ # Credentials to send with calls. You may provide any of the following types:
792
+ # * (`String`) The path to a service account key file in JSON format
793
+ # * (`Hash`) A service account key as a Hash
794
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
795
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
796
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
797
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
798
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
799
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
800
+ # * (`nil`) indicating no credentials
801
+ # @return [::Object]
802
+ # @!attribute [rw] scope
803
+ # The OAuth scopes
804
+ # @return [::Array<::String>]
805
+ # @!attribute [rw] lib_name
806
+ # The library name as recorded in instrumentation and logging
807
+ # @return [::String]
808
+ # @!attribute [rw] lib_version
809
+ # The library version as recorded in instrumentation and logging
810
+ # @return [::String]
811
+ # @!attribute [rw] channel_args
812
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
813
+ # `GRPC::Core::Channel` object is provided as the credential.
814
+ # @return [::Hash]
815
+ # @!attribute [rw] interceptors
816
+ # An array of interceptors that are run before calls are executed.
817
+ # @return [::Array<::GRPC::ClientInterceptor>]
818
+ # @!attribute [rw] timeout
819
+ # The call timeout in seconds.
820
+ # @return [::Numeric]
821
+ # @!attribute [rw] metadata
822
+ # Additional gRPC headers to be sent with the call.
823
+ # @return [::Hash{::Symbol=>::String}]
824
+ # @!attribute [rw] retry_policy
825
+ # The retry policy. The value is a hash with the following keys:
826
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
827
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
828
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
829
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
830
+ # trigger a retry.
831
+ # @return [::Hash]
832
+ # @!attribute [rw] quota_project
833
+ # A separate project against which to charge quota.
834
+ # @return [::String]
835
+ #
836
+ class Configuration
837
+ extend ::Gapic::Config
838
+
839
+ config_attr :endpoint, "bigqueryconnection.googleapis.com", ::String
840
+ config_attr :credentials, nil do |value|
841
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
842
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
843
+ allowed.any? { |klass| klass === value }
844
+ end
845
+ config_attr :scope, nil, ::String, ::Array, nil
846
+ config_attr :lib_name, nil, ::String, nil
847
+ config_attr :lib_version, nil, ::String, nil
848
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
849
+ config_attr :interceptors, nil, ::Array, nil
850
+ config_attr :timeout, nil, ::Numeric, nil
851
+ config_attr :metadata, nil, ::Hash, nil
852
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
853
+ config_attr :quota_project, nil, ::String, nil
854
+
855
+ # @private
856
+ def initialize parent_config = nil
857
+ @parent_config = parent_config unless parent_config.nil?
858
+
859
+ yield self if block_given?
860
+ end
861
+
862
+ ##
863
+ # Configurations for individual RPCs
864
+ # @return [Rpcs]
865
+ #
866
+ def rpcs
867
+ @rpcs ||= begin
868
+ parent_rpcs = nil
869
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
870
+ Rpcs.new parent_rpcs
871
+ end
872
+ end
873
+
874
+ ##
875
+ # Configuration RPC class for the ConnectionService API.
876
+ #
877
+ # Includes fields providing the configuration for each RPC in this service.
878
+ # Each configuration object is of type `Gapic::Config::Method` and includes
879
+ # the following configuration fields:
880
+ #
881
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
882
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
883
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
884
+ # include the following keys:
885
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
886
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
887
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
888
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
889
+ # trigger a retry.
890
+ #
891
+ class Rpcs
892
+ ##
893
+ # RPC-specific configuration for `create_connection`
894
+ # @return [::Gapic::Config::Method]
895
+ #
896
+ attr_reader :create_connection
897
+ ##
898
+ # RPC-specific configuration for `get_connection`
899
+ # @return [::Gapic::Config::Method]
900
+ #
901
+ attr_reader :get_connection
902
+ ##
903
+ # RPC-specific configuration for `list_connections`
904
+ # @return [::Gapic::Config::Method]
905
+ #
906
+ attr_reader :list_connections
907
+ ##
908
+ # RPC-specific configuration for `update_connection`
909
+ # @return [::Gapic::Config::Method]
910
+ #
911
+ attr_reader :update_connection
912
+ ##
913
+ # RPC-specific configuration for `delete_connection`
914
+ # @return [::Gapic::Config::Method]
915
+ #
916
+ attr_reader :delete_connection
917
+ ##
918
+ # RPC-specific configuration for `get_iam_policy`
919
+ # @return [::Gapic::Config::Method]
920
+ #
921
+ attr_reader :get_iam_policy
922
+ ##
923
+ # RPC-specific configuration for `set_iam_policy`
924
+ # @return [::Gapic::Config::Method]
925
+ #
926
+ attr_reader :set_iam_policy
927
+ ##
928
+ # RPC-specific configuration for `test_iam_permissions`
929
+ # @return [::Gapic::Config::Method]
930
+ #
931
+ attr_reader :test_iam_permissions
932
+
933
+ # @private
934
+ def initialize parent_rpcs = nil
935
+ create_connection_config = parent_rpcs&.create_connection if parent_rpcs&.respond_to? :create_connection
936
+ @create_connection = ::Gapic::Config::Method.new create_connection_config
937
+ get_connection_config = parent_rpcs&.get_connection if parent_rpcs&.respond_to? :get_connection
938
+ @get_connection = ::Gapic::Config::Method.new get_connection_config
939
+ list_connections_config = parent_rpcs&.list_connections if parent_rpcs&.respond_to? :list_connections
940
+ @list_connections = ::Gapic::Config::Method.new list_connections_config
941
+ update_connection_config = parent_rpcs&.update_connection if parent_rpcs&.respond_to? :update_connection
942
+ @update_connection = ::Gapic::Config::Method.new update_connection_config
943
+ delete_connection_config = parent_rpcs&.delete_connection if parent_rpcs&.respond_to? :delete_connection
944
+ @delete_connection = ::Gapic::Config::Method.new delete_connection_config
945
+ get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
946
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
947
+ set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
948
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
949
+ test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
950
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
951
+
952
+ yield self if block_given?
953
+ end
954
+ end
955
+ end
956
+ end
957
+ end
958
+ end
959
+ end
960
+ end
961
+ end
962
+ end