google-cloud-developer_connect-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/developer_connect/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/developer_connect/v1/developer_connect/client.rb +1932 -0
  7. data/lib/google/cloud/developer_connect/v1/developer_connect/credentials.rb +47 -0
  8. data/lib/google/cloud/developer_connect/v1/developer_connect/operations.rb +809 -0
  9. data/lib/google/cloud/developer_connect/v1/developer_connect/paths.rb +109 -0
  10. data/lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb +1815 -0
  11. data/lib/google/cloud/developer_connect/v1/developer_connect/rest/operations.rb +902 -0
  12. data/lib/google/cloud/developer_connect/v1/developer_connect/rest/service_stub.rb +900 -0
  13. data/lib/google/cloud/developer_connect/v1/developer_connect/rest.rb +54 -0
  14. data/lib/google/cloud/developer_connect/v1/developer_connect.rb +56 -0
  15. data/lib/google/cloud/developer_connect/v1/rest.rb +38 -0
  16. data/lib/google/cloud/developer_connect/v1/version.rb +7 -2
  17. data/lib/google/cloud/developer_connect/v1.rb +45 -0
  18. data/lib/google/cloud/developerconnect/v1/developer_connect_pb.rb +85 -0
  19. data/lib/google/cloud/developerconnect/v1/developer_connect_services_pb.rb +79 -0
  20. data/lib/google-cloud-developer_connect-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +399 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/field_info.rb +65 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +222 -0
  27. data/proto_docs/google/cloud/developerconnect/v1/developer_connect.rb +708 -0
  28. data/proto_docs/google/longrunning/operations.rb +164 -0
  29. data/proto_docs/google/protobuf/any.rb +145 -0
  30. data/proto_docs/google/protobuf/duration.rb +98 -0
  31. data/proto_docs/google/protobuf/empty.rb +34 -0
  32. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  34. data/proto_docs/google/rpc/status.rb +48 -0
  35. metadata +95 -10
@@ -0,0 +1,1815 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/developerconnect/v1/developer_connect_pb"
21
+ require "google/cloud/developer_connect/v1/developer_connect/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DeveloperConnect
27
+ module V1
28
+ module DeveloperConnect
29
+ module Rest
30
+ ##
31
+ # REST client for the DeveloperConnect service.
32
+ #
33
+ # Service describing handlers for resources
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "developerconnect.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :developer_connect_stub
46
+
47
+ ##
48
+ # Configure the DeveloperConnect Client class.
49
+ #
50
+ # See {::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all DeveloperConnect clients
56
+ # ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "DeveloperConnect", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.rpcs.list_connections.timeout = 60.0
77
+ default_config.rpcs.list_connections.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.get_connection.timeout = 60.0
82
+ default_config.rpcs.get_connection.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.create_connection.timeout = 60.0
87
+ default_config.rpcs.create_connection.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.update_connection.timeout = 60.0
92
+ default_config.rpcs.update_connection.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.delete_connection.timeout = 60.0
97
+ default_config.rpcs.delete_connection.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.create_git_repository_link.timeout = 60.0
102
+ default_config.rpcs.create_git_repository_link.retry_policy = {
103
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
104
+ }
105
+
106
+ default_config.rpcs.delete_git_repository_link.timeout = 60.0
107
+ default_config.rpcs.delete_git_repository_link.retry_policy = {
108
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
109
+ }
110
+
111
+ default_config.rpcs.get_git_repository_link.timeout = 60.0
112
+ default_config.rpcs.get_git_repository_link.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
114
+ }
115
+
116
+ default_config.rpcs.fetch_read_write_token.timeout = 60.0
117
+ default_config.rpcs.fetch_read_write_token.retry_policy = {
118
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
119
+ }
120
+
121
+ default_config.rpcs.fetch_read_token.timeout = 60.0
122
+ default_config.rpcs.fetch_read_token.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config.rpcs.fetch_linkable_git_repositories.timeout = 60.0
127
+ default_config.rpcs.fetch_linkable_git_repositories.retry_policy = {
128
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
129
+ }
130
+
131
+ default_config.rpcs.fetch_git_hub_installations.timeout = 60.0
132
+ default_config.rpcs.fetch_git_hub_installations.retry_policy = {
133
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
134
+ }
135
+
136
+ default_config
137
+ end
138
+ yield @configure if block_given?
139
+ @configure
140
+ end
141
+
142
+ ##
143
+ # Configure the DeveloperConnect Client instance.
144
+ #
145
+ # The configuration is set to the derived mode, meaning that values can be changed,
146
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
147
+ # should be made on {Client.configure}.
148
+ #
149
+ # See {::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client::Configuration}
150
+ # for a description of the configuration fields.
151
+ #
152
+ # @yield [config] Configure the Client client.
153
+ # @yieldparam config [Client::Configuration]
154
+ #
155
+ # @return [Client::Configuration]
156
+ #
157
+ def configure
158
+ yield @config if block_given?
159
+ @config
160
+ end
161
+
162
+ ##
163
+ # The effective universe domain
164
+ #
165
+ # @return [String]
166
+ #
167
+ def universe_domain
168
+ @developer_connect_stub.universe_domain
169
+ end
170
+
171
+ ##
172
+ # Create a new DeveloperConnect REST client object.
173
+ #
174
+ # @example
175
+ #
176
+ # # Create a client using the default configuration
177
+ # client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
178
+ #
179
+ # # Create a client using a custom configuration
180
+ # client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new do |config|
181
+ # config.timeout = 10.0
182
+ # end
183
+ #
184
+ # @yield [config] Configure the DeveloperConnect client.
185
+ # @yieldparam config [Client::Configuration]
186
+ #
187
+ def initialize
188
+ # Create the configuration object
189
+ @config = Configuration.new Client.configure
190
+
191
+ # Yield the configuration if needed
192
+ yield @config if block_given?
193
+
194
+ # Create credentials
195
+ credentials = @config.credentials
196
+ # Use self-signed JWT if the endpoint is unchanged from default,
197
+ # but only if the default endpoint does not have a region prefix.
198
+ enable_self_signed_jwt = @config.endpoint.nil? ||
199
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
200
+ !@config.endpoint.split(".").first.include?("-"))
201
+ credentials ||= Credentials.default scope: @config.scope,
202
+ enable_self_signed_jwt: enable_self_signed_jwt
203
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
204
+ credentials = Credentials.new credentials, scope: @config.scope
205
+ end
206
+
207
+ @quota_project_id = @config.quota_project
208
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
209
+
210
+ @operations_client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Operations.new do |config|
211
+ config.credentials = credentials
212
+ config.quota_project = @quota_project_id
213
+ config.endpoint = @config.endpoint
214
+ config.universe_domain = @config.universe_domain
215
+ end
216
+
217
+ @developer_connect_stub = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::ServiceStub.new(
218
+ endpoint: @config.endpoint,
219
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
220
+ universe_domain: @config.universe_domain,
221
+ credentials: credentials
222
+ )
223
+
224
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
225
+ config.credentials = credentials
226
+ config.quota_project = @quota_project_id
227
+ config.endpoint = @developer_connect_stub.endpoint
228
+ config.universe_domain = @developer_connect_stub.universe_domain
229
+ config.bindings_override = @config.bindings_override
230
+ end
231
+ end
232
+
233
+ ##
234
+ # Get the associated client for long-running operations.
235
+ #
236
+ # @return [::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Operations]
237
+ #
238
+ attr_reader :operations_client
239
+
240
+ ##
241
+ # Get the associated client for mix-in of the Locations.
242
+ #
243
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
244
+ #
245
+ attr_reader :location_client
246
+
247
+ # Service calls
248
+
249
+ ##
250
+ # Lists Connections in a given project and location.
251
+ #
252
+ # @overload list_connections(request, options = nil)
253
+ # Pass arguments to `list_connections` via a request object, either of type
254
+ # {::Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest} or an equivalent Hash.
255
+ #
256
+ # @param request [::Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest, ::Hash]
257
+ # A request object representing the call parameters. Required. To specify no
258
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
259
+ # @param options [::Gapic::CallOptions, ::Hash]
260
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
261
+ #
262
+ # @overload list_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
263
+ # Pass arguments to `list_connections` via keyword arguments. Note that at
264
+ # least one keyword argument is required. To specify no parameters, or to keep all
265
+ # the default parameter values, pass an empty Hash as a request object (see above).
266
+ #
267
+ # @param parent [::String]
268
+ # Required. Parent value for ListConnectionsRequest
269
+ # @param page_size [::Integer]
270
+ # Optional. Requested page size. Server may return fewer items than
271
+ # requested. If unspecified, server will pick an appropriate default.
272
+ # @param page_token [::String]
273
+ # Optional. A token identifying a page of results the server should return.
274
+ # @param filter [::String]
275
+ # Optional. Filtering results
276
+ # @param order_by [::String]
277
+ # Optional. Hint for how to order the results
278
+ # @yield [result, operation] Access the result along with the TransportOperation object
279
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse]
280
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
281
+ #
282
+ # @return [::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
285
+ #
286
+ # @example Basic example
287
+ # require "google/cloud/developer_connect/v1"
288
+ #
289
+ # # Create a client object. The client can be reused for multiple calls.
290
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
291
+ #
292
+ # # Create a request. To set request fields, pass in keyword arguments.
293
+ # request = Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest.new
294
+ #
295
+ # # Call the list_connections method.
296
+ # result = client.list_connections request
297
+ #
298
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
299
+ # # over elements, and API calls will be issued to fetch pages as needed.
300
+ # result.each do |item|
301
+ # # Each element is of type ::Google::Cloud::DeveloperConnect::V1::Connection.
302
+ # p item
303
+ # end
304
+ #
305
+ def list_connections request, options = nil
306
+ raise ::ArgumentError, "request must be provided" if request.nil?
307
+
308
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest
309
+
310
+ # Converts hash and nil to an options object
311
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
312
+
313
+ # Customize the options with defaults
314
+ call_metadata = @config.rpcs.list_connections.metadata.to_h
315
+
316
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
317
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
318
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
319
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
320
+ transports_version_send: [:rest]
321
+
322
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
323
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ options.apply_defaults timeout: @config.rpcs.list_connections.timeout,
326
+ metadata: call_metadata,
327
+ retry_policy: @config.rpcs.list_connections.retry_policy
328
+
329
+ options.apply_defaults timeout: @config.timeout,
330
+ metadata: @config.metadata,
331
+ retry_policy: @config.retry_policy
332
+
333
+ @developer_connect_stub.list_connections request, options do |result, operation|
334
+ yield result, operation if block_given?
335
+ return result
336
+ end
337
+ rescue ::Gapic::Rest::Error => e
338
+ raise ::Google::Cloud::Error.from_error(e)
339
+ end
340
+
341
+ ##
342
+ # Gets details of a single Connection.
343
+ #
344
+ # @overload get_connection(request, options = nil)
345
+ # Pass arguments to `get_connection` via a request object, either of type
346
+ # {::Google::Cloud::DeveloperConnect::V1::GetConnectionRequest} or an equivalent Hash.
347
+ #
348
+ # @param request [::Google::Cloud::DeveloperConnect::V1::GetConnectionRequest, ::Hash]
349
+ # A request object representing the call parameters. Required. To specify no
350
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
351
+ # @param options [::Gapic::CallOptions, ::Hash]
352
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
353
+ #
354
+ # @overload get_connection(name: nil)
355
+ # Pass arguments to `get_connection` via keyword arguments. Note that at
356
+ # least one keyword argument is required. To specify no parameters, or to keep all
357
+ # the default parameter values, pass an empty Hash as a request object (see above).
358
+ #
359
+ # @param name [::String]
360
+ # Required. Name of the resource
361
+ # @yield [result, operation] Access the result along with the TransportOperation object
362
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::Connection]
363
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
364
+ #
365
+ # @return [::Google::Cloud::DeveloperConnect::V1::Connection]
366
+ #
367
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
368
+ #
369
+ # @example Basic example
370
+ # require "google/cloud/developer_connect/v1"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::DeveloperConnect::V1::GetConnectionRequest.new
377
+ #
378
+ # # Call the get_connection method.
379
+ # result = client.get_connection request
380
+ #
381
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::Connection.
382
+ # p result
383
+ #
384
+ def get_connection request, options = nil
385
+ raise ::ArgumentError, "request must be provided" if request.nil?
386
+
387
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::GetConnectionRequest
388
+
389
+ # Converts hash and nil to an options object
390
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
391
+
392
+ # Customize the options with defaults
393
+ call_metadata = @config.rpcs.get_connection.metadata.to_h
394
+
395
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
396
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
397
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
398
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
399
+ transports_version_send: [:rest]
400
+
401
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
402
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
403
+
404
+ options.apply_defaults timeout: @config.rpcs.get_connection.timeout,
405
+ metadata: call_metadata,
406
+ retry_policy: @config.rpcs.get_connection.retry_policy
407
+
408
+ options.apply_defaults timeout: @config.timeout,
409
+ metadata: @config.metadata,
410
+ retry_policy: @config.retry_policy
411
+
412
+ @developer_connect_stub.get_connection request, options do |result, operation|
413
+ yield result, operation if block_given?
414
+ return result
415
+ end
416
+ rescue ::Gapic::Rest::Error => e
417
+ raise ::Google::Cloud::Error.from_error(e)
418
+ end
419
+
420
+ ##
421
+ # Creates a new Connection in a given project and location.
422
+ #
423
+ # @overload create_connection(request, options = nil)
424
+ # Pass arguments to `create_connection` via a request object, either of type
425
+ # {::Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest} or an equivalent Hash.
426
+ #
427
+ # @param request [::Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest, ::Hash]
428
+ # A request object representing the call parameters. Required. To specify no
429
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
430
+ # @param options [::Gapic::CallOptions, ::Hash]
431
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
432
+ #
433
+ # @overload create_connection(parent: nil, connection_id: nil, connection: nil, request_id: nil, validate_only: nil)
434
+ # Pass arguments to `create_connection` via keyword arguments. Note that at
435
+ # least one keyword argument is required. To specify no parameters, or to keep all
436
+ # the default parameter values, pass an empty Hash as a request object (see above).
437
+ #
438
+ # @param parent [::String]
439
+ # Required. Value for parent.
440
+ # @param connection_id [::String]
441
+ # Required. Id of the requesting object
442
+ # If auto-generating Id server-side, remove this field and
443
+ # connection_id from the method_signature of Create RPC
444
+ # @param connection [::Google::Cloud::DeveloperConnect::V1::Connection, ::Hash]
445
+ # Required. The resource being created
446
+ # @param request_id [::String]
447
+ # Optional. An optional request ID to identify requests. Specify a unique
448
+ # request ID so that if you must retry your request, the server will know to
449
+ # ignore the request if it has already been completed. The server will
450
+ # guarantee that for at least 60 minutes since the first request.
451
+ #
452
+ # For example, consider a situation where you make an initial request and the
453
+ # request times out. If you make the request again with the same request
454
+ # ID, the server can check if original operation with the same request ID
455
+ # was received, and if so, will ignore the second request. This prevents
456
+ # clients from accidentally creating duplicate commitments.
457
+ #
458
+ # The request ID must be a valid UUID with the exception that zero UUID is
459
+ # not supported (00000000-0000-0000-0000-000000000000).
460
+ # @param validate_only [::Boolean]
461
+ # Optional. If set, validate the request, but do not actually post it.
462
+ # @yield [result, operation] Access the result along with the TransportOperation object
463
+ # @yieldparam result [::Gapic::Operation]
464
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
465
+ #
466
+ # @return [::Gapic::Operation]
467
+ #
468
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
469
+ #
470
+ # @example Basic example
471
+ # require "google/cloud/developer_connect/v1"
472
+ #
473
+ # # Create a client object. The client can be reused for multiple calls.
474
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
475
+ #
476
+ # # Create a request. To set request fields, pass in keyword arguments.
477
+ # request = Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest.new
478
+ #
479
+ # # Call the create_connection method.
480
+ # result = client.create_connection request
481
+ #
482
+ # # The returned object is of type Gapic::Operation. You can use it to
483
+ # # check the status of an operation, cancel it, or wait for results.
484
+ # # Here is how to wait for a response.
485
+ # result.wait_until_done! timeout: 60
486
+ # if result.response?
487
+ # p result.response
488
+ # else
489
+ # puts "No response received."
490
+ # end
491
+ #
492
+ def create_connection request, options = nil
493
+ raise ::ArgumentError, "request must be provided" if request.nil?
494
+
495
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest
496
+
497
+ # Converts hash and nil to an options object
498
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
499
+
500
+ # Customize the options with defaults
501
+ call_metadata = @config.rpcs.create_connection.metadata.to_h
502
+
503
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
504
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
505
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
506
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
507
+ transports_version_send: [:rest]
508
+
509
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
510
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
+
512
+ options.apply_defaults timeout: @config.rpcs.create_connection.timeout,
513
+ metadata: call_metadata,
514
+ retry_policy: @config.rpcs.create_connection.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @developer_connect_stub.create_connection request, options do |result, operation|
521
+ result = ::Gapic::Operation.new result, @operations_client, options: options
522
+ yield result, operation if block_given?
523
+ return result
524
+ end
525
+ rescue ::Gapic::Rest::Error => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # Updates the parameters of a single Connection.
531
+ #
532
+ # @overload update_connection(request, options = nil)
533
+ # Pass arguments to `update_connection` via a request object, either of type
534
+ # {::Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
541
+ #
542
+ # @overload update_connection(update_mask: nil, connection: nil, request_id: nil, allow_missing: nil, validate_only: nil)
543
+ # Pass arguments to `update_connection` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
548
+ # Required. Field mask is used to specify the fields to be overwritten in the
549
+ # Connection resource by the update.
550
+ # The fields specified in the update_mask are relative to the resource, not
551
+ # the full request. A field will be overwritten if it is in the mask. If the
552
+ # user does not provide a mask then all fields will be overwritten.
553
+ # @param connection [::Google::Cloud::DeveloperConnect::V1::Connection, ::Hash]
554
+ # Required. The resource being updated
555
+ # @param request_id [::String]
556
+ # Optional. An optional request ID to identify requests. Specify a unique
557
+ # request ID so that if you must retry your request, the server will know to
558
+ # ignore the request if it has already been completed. The server will
559
+ # guarantee that for at least 60 minutes since the first request.
560
+ #
561
+ # For example, consider a situation where you make an initial request and the
562
+ # request times out. If you make the request again with the same request
563
+ # ID, the server can check if original operation with the same request ID
564
+ # was received, and if so, will ignore the second request. This prevents
565
+ # clients from accidentally creating duplicate commitments.
566
+ #
567
+ # The request ID must be a valid UUID with the exception that zero UUID is
568
+ # not supported (00000000-0000-0000-0000-000000000000).
569
+ # @param allow_missing [::Boolean]
570
+ # Optional. If set to true, and the connection is not found a new connection
571
+ # will be created. In this situation `update_mask` is ignored.
572
+ # The creation will succeed only if the input connection has all the
573
+ # necessary information (e.g a github_config with both user_oauth_token and
574
+ # installation_id properties).
575
+ # @param validate_only [::Boolean]
576
+ # Optional. If set, validate the request, but do not actually post it.
577
+ # @yield [result, operation] Access the result along with the TransportOperation object
578
+ # @yieldparam result [::Gapic::Operation]
579
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
580
+ #
581
+ # @return [::Gapic::Operation]
582
+ #
583
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
584
+ #
585
+ # @example Basic example
586
+ # require "google/cloud/developer_connect/v1"
587
+ #
588
+ # # Create a client object. The client can be reused for multiple calls.
589
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
590
+ #
591
+ # # Create a request. To set request fields, pass in keyword arguments.
592
+ # request = Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest.new
593
+ #
594
+ # # Call the update_connection method.
595
+ # result = client.update_connection request
596
+ #
597
+ # # The returned object is of type Gapic::Operation. You can use it to
598
+ # # check the status of an operation, cancel it, or wait for results.
599
+ # # Here is how to wait for a response.
600
+ # result.wait_until_done! timeout: 60
601
+ # if result.response?
602
+ # p result.response
603
+ # else
604
+ # puts "No response received."
605
+ # end
606
+ #
607
+ def update_connection request, options = nil
608
+ raise ::ArgumentError, "request must be provided" if request.nil?
609
+
610
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest
611
+
612
+ # Converts hash and nil to an options object
613
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
614
+
615
+ # Customize the options with defaults
616
+ call_metadata = @config.rpcs.update_connection.metadata.to_h
617
+
618
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
619
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
620
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
621
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
622
+ transports_version_send: [:rest]
623
+
624
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
625
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
626
+
627
+ options.apply_defaults timeout: @config.rpcs.update_connection.timeout,
628
+ metadata: call_metadata,
629
+ retry_policy: @config.rpcs.update_connection.retry_policy
630
+
631
+ options.apply_defaults timeout: @config.timeout,
632
+ metadata: @config.metadata,
633
+ retry_policy: @config.retry_policy
634
+
635
+ @developer_connect_stub.update_connection request, options do |result, operation|
636
+ result = ::Gapic::Operation.new result, @operations_client, options: options
637
+ yield result, operation if block_given?
638
+ return result
639
+ end
640
+ rescue ::Gapic::Rest::Error => e
641
+ raise ::Google::Cloud::Error.from_error(e)
642
+ end
643
+
644
+ ##
645
+ # Deletes a single Connection.
646
+ #
647
+ # @overload delete_connection(request, options = nil)
648
+ # Pass arguments to `delete_connection` via a request object, either of type
649
+ # {::Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest} or an equivalent Hash.
650
+ #
651
+ # @param request [::Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest, ::Hash]
652
+ # A request object representing the call parameters. Required. To specify no
653
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
654
+ # @param options [::Gapic::CallOptions, ::Hash]
655
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
656
+ #
657
+ # @overload delete_connection(name: nil, request_id: nil, validate_only: nil, etag: nil)
658
+ # Pass arguments to `delete_connection` via keyword arguments. Note that at
659
+ # least one keyword argument is required. To specify no parameters, or to keep all
660
+ # the default parameter values, pass an empty Hash as a request object (see above).
661
+ #
662
+ # @param name [::String]
663
+ # Required. Name of the resource
664
+ # @param request_id [::String]
665
+ # Optional. An optional request ID to identify requests. Specify a unique
666
+ # request ID so that if you must retry your request, the server will know to
667
+ # ignore the request if it has already been completed. The server will
668
+ # guarantee that for at least 60 minutes after the first request.
669
+ #
670
+ # For example, consider a situation where you make an initial request and the
671
+ # request times out. If you make the request again with the same request
672
+ # ID, the server can check if original operation with the same request ID
673
+ # was received, and if so, will ignore the second request. This prevents
674
+ # clients from accidentally creating duplicate commitments.
675
+ #
676
+ # The request ID must be a valid UUID with the exception that zero UUID is
677
+ # not supported (00000000-0000-0000-0000-000000000000).
678
+ # @param validate_only [::Boolean]
679
+ # Optional. If set, validate the request, but do not actually post it.
680
+ # @param etag [::String]
681
+ # Optional. The current etag of the Connection.
682
+ # If an etag is provided and does not match the current etag of the
683
+ # Connection, deletion will be blocked and an ABORTED error will be returned.
684
+ # @yield [result, operation] Access the result along with the TransportOperation object
685
+ # @yieldparam result [::Gapic::Operation]
686
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
687
+ #
688
+ # @return [::Gapic::Operation]
689
+ #
690
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
691
+ #
692
+ # @example Basic example
693
+ # require "google/cloud/developer_connect/v1"
694
+ #
695
+ # # Create a client object. The client can be reused for multiple calls.
696
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
697
+ #
698
+ # # Create a request. To set request fields, pass in keyword arguments.
699
+ # request = Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest.new
700
+ #
701
+ # # Call the delete_connection method.
702
+ # result = client.delete_connection request
703
+ #
704
+ # # The returned object is of type Gapic::Operation. You can use it to
705
+ # # check the status of an operation, cancel it, or wait for results.
706
+ # # Here is how to wait for a response.
707
+ # result.wait_until_done! timeout: 60
708
+ # if result.response?
709
+ # p result.response
710
+ # else
711
+ # puts "No response received."
712
+ # end
713
+ #
714
+ def delete_connection request, options = nil
715
+ raise ::ArgumentError, "request must be provided" if request.nil?
716
+
717
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest
718
+
719
+ # Converts hash and nil to an options object
720
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
721
+
722
+ # Customize the options with defaults
723
+ call_metadata = @config.rpcs.delete_connection.metadata.to_h
724
+
725
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
726
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
727
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
728
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
729
+ transports_version_send: [:rest]
730
+
731
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
732
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
733
+
734
+ options.apply_defaults timeout: @config.rpcs.delete_connection.timeout,
735
+ metadata: call_metadata,
736
+ retry_policy: @config.rpcs.delete_connection.retry_policy
737
+
738
+ options.apply_defaults timeout: @config.timeout,
739
+ metadata: @config.metadata,
740
+ retry_policy: @config.retry_policy
741
+
742
+ @developer_connect_stub.delete_connection request, options do |result, operation|
743
+ result = ::Gapic::Operation.new result, @operations_client, options: options
744
+ yield result, operation if block_given?
745
+ return result
746
+ end
747
+ rescue ::Gapic::Rest::Error => e
748
+ raise ::Google::Cloud::Error.from_error(e)
749
+ end
750
+
751
+ ##
752
+ # Creates a GitRepositoryLink. Upon linking a Git Repository, Developer
753
+ # Connect will configure the Git Repository to send webhook events to
754
+ # Developer Connect. Connections that use Firebase GitHub Application will
755
+ # have events forwarded to the Firebase service. All other Connections will
756
+ # have events forwarded to Cloud Build.
757
+ #
758
+ # @overload create_git_repository_link(request, options = nil)
759
+ # Pass arguments to `create_git_repository_link` via a request object, either of type
760
+ # {::Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest} or an equivalent Hash.
761
+ #
762
+ # @param request [::Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest, ::Hash]
763
+ # A request object representing the call parameters. Required. To specify no
764
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
765
+ # @param options [::Gapic::CallOptions, ::Hash]
766
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
767
+ #
768
+ # @overload create_git_repository_link(parent: nil, git_repository_link: nil, git_repository_link_id: nil, request_id: nil, validate_only: nil)
769
+ # Pass arguments to `create_git_repository_link` via keyword arguments. Note that at
770
+ # least one keyword argument is required. To specify no parameters, or to keep all
771
+ # the default parameter values, pass an empty Hash as a request object (see above).
772
+ #
773
+ # @param parent [::String]
774
+ # Required. Value for parent.
775
+ # @param git_repository_link [::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink, ::Hash]
776
+ # Required. The resource being created
777
+ # @param git_repository_link_id [::String]
778
+ # Required. The ID to use for the repository, which will become the final
779
+ # component of the repository's resource name. This ID should be unique in
780
+ # the connection. Allows alphanumeric characters and any of
781
+ # -._~%!$&'()*+,;=@.
782
+ # @param request_id [::String]
783
+ # Optional. An optional request ID to identify requests. Specify a unique
784
+ # request ID so that if you must retry your request, the server will know to
785
+ # ignore the request if it has already been completed. The server will
786
+ # guarantee that for at least 60 minutes since the first request.
787
+ #
788
+ # For example, consider a situation where you make an initial request and the
789
+ # request times out. If you make the request again with the same request
790
+ # ID, the server can check if original operation with the same request ID
791
+ # was received, and if so, will ignore the second request. This prevents
792
+ # clients from accidentally creating duplicate commitments.
793
+ #
794
+ # The request ID must be a valid UUID with the exception that zero UUID is
795
+ # not supported (00000000-0000-0000-0000-000000000000).
796
+ # @param validate_only [::Boolean]
797
+ # Optional. If set, validate the request, but do not actually post it.
798
+ # @yield [result, operation] Access the result along with the TransportOperation object
799
+ # @yieldparam result [::Gapic::Operation]
800
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
801
+ #
802
+ # @return [::Gapic::Operation]
803
+ #
804
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
805
+ #
806
+ # @example Basic example
807
+ # require "google/cloud/developer_connect/v1"
808
+ #
809
+ # # Create a client object. The client can be reused for multiple calls.
810
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
811
+ #
812
+ # # Create a request. To set request fields, pass in keyword arguments.
813
+ # request = Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest.new
814
+ #
815
+ # # Call the create_git_repository_link method.
816
+ # result = client.create_git_repository_link request
817
+ #
818
+ # # The returned object is of type Gapic::Operation. You can use it to
819
+ # # check the status of an operation, cancel it, or wait for results.
820
+ # # Here is how to wait for a response.
821
+ # result.wait_until_done! timeout: 60
822
+ # if result.response?
823
+ # p result.response
824
+ # else
825
+ # puts "No response received."
826
+ # end
827
+ #
828
+ def create_git_repository_link request, options = nil
829
+ raise ::ArgumentError, "request must be provided" if request.nil?
830
+
831
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest
832
+
833
+ # Converts hash and nil to an options object
834
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
835
+
836
+ # Customize the options with defaults
837
+ call_metadata = @config.rpcs.create_git_repository_link.metadata.to_h
838
+
839
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
840
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
841
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
842
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
843
+ transports_version_send: [:rest]
844
+
845
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
846
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
847
+
848
+ options.apply_defaults timeout: @config.rpcs.create_git_repository_link.timeout,
849
+ metadata: call_metadata,
850
+ retry_policy: @config.rpcs.create_git_repository_link.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @developer_connect_stub.create_git_repository_link request, options do |result, operation|
857
+ result = ::Gapic::Operation.new result, @operations_client, options: options
858
+ yield result, operation if block_given?
859
+ return result
860
+ end
861
+ rescue ::Gapic::Rest::Error => e
862
+ raise ::Google::Cloud::Error.from_error(e)
863
+ end
864
+
865
+ ##
866
+ # Deletes a single GitRepositoryLink.
867
+ #
868
+ # @overload delete_git_repository_link(request, options = nil)
869
+ # Pass arguments to `delete_git_repository_link` via a request object, either of type
870
+ # {::Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest} or an equivalent Hash.
871
+ #
872
+ # @param request [::Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest, ::Hash]
873
+ # A request object representing the call parameters. Required. To specify no
874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
875
+ # @param options [::Gapic::CallOptions, ::Hash]
876
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
877
+ #
878
+ # @overload delete_git_repository_link(name: nil, request_id: nil, validate_only: nil, etag: nil)
879
+ # Pass arguments to `delete_git_repository_link` via keyword arguments. Note that at
880
+ # least one keyword argument is required. To specify no parameters, or to keep all
881
+ # the default parameter values, pass an empty Hash as a request object (see above).
882
+ #
883
+ # @param name [::String]
884
+ # Required. Name of the resource
885
+ # @param request_id [::String]
886
+ # Optional. An optional request ID to identify requests. Specify a unique
887
+ # request ID so that if you must retry your request, the server will know to
888
+ # ignore the request if it has already been completed. The server will
889
+ # guarantee that for at least 60 minutes after the first request.
890
+ #
891
+ # For example, consider a situation where you make an initial request and the
892
+ # request times out. If you make the request again with the same request
893
+ # ID, the server can check if original operation with the same request ID
894
+ # was received, and if so, will ignore the second request. This prevents
895
+ # clients from accidentally creating duplicate commitments.
896
+ #
897
+ # The request ID must be a valid UUID with the exception that zero UUID is
898
+ # not supported (00000000-0000-0000-0000-000000000000).
899
+ # @param validate_only [::Boolean]
900
+ # Optional. If set, validate the request, but do not actually post it.
901
+ # @param etag [::String]
902
+ # Optional. This checksum is computed by the server based on the value of
903
+ # other fields, and may be sent on update and delete requests to ensure the
904
+ # client has an up-to-date value before proceeding.
905
+ # @yield [result, operation] Access the result along with the TransportOperation object
906
+ # @yieldparam result [::Gapic::Operation]
907
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
908
+ #
909
+ # @return [::Gapic::Operation]
910
+ #
911
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
912
+ #
913
+ # @example Basic example
914
+ # require "google/cloud/developer_connect/v1"
915
+ #
916
+ # # Create a client object. The client can be reused for multiple calls.
917
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
918
+ #
919
+ # # Create a request. To set request fields, pass in keyword arguments.
920
+ # request = Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest.new
921
+ #
922
+ # # Call the delete_git_repository_link method.
923
+ # result = client.delete_git_repository_link request
924
+ #
925
+ # # The returned object is of type Gapic::Operation. You can use it to
926
+ # # check the status of an operation, cancel it, or wait for results.
927
+ # # Here is how to wait for a response.
928
+ # result.wait_until_done! timeout: 60
929
+ # if result.response?
930
+ # p result.response
931
+ # else
932
+ # puts "No response received."
933
+ # end
934
+ #
935
+ def delete_git_repository_link request, options = nil
936
+ raise ::ArgumentError, "request must be provided" if request.nil?
937
+
938
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest
939
+
940
+ # Converts hash and nil to an options object
941
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
942
+
943
+ # Customize the options with defaults
944
+ call_metadata = @config.rpcs.delete_git_repository_link.metadata.to_h
945
+
946
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
947
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
948
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
949
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
950
+ transports_version_send: [:rest]
951
+
952
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
953
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
954
+
955
+ options.apply_defaults timeout: @config.rpcs.delete_git_repository_link.timeout,
956
+ metadata: call_metadata,
957
+ retry_policy: @config.rpcs.delete_git_repository_link.retry_policy
958
+
959
+ options.apply_defaults timeout: @config.timeout,
960
+ metadata: @config.metadata,
961
+ retry_policy: @config.retry_policy
962
+
963
+ @developer_connect_stub.delete_git_repository_link request, options do |result, operation|
964
+ result = ::Gapic::Operation.new result, @operations_client, options: options
965
+ yield result, operation if block_given?
966
+ return result
967
+ end
968
+ rescue ::Gapic::Rest::Error => e
969
+ raise ::Google::Cloud::Error.from_error(e)
970
+ end
971
+
972
+ ##
973
+ # Lists GitRepositoryLinks in a given project, location, and connection.
974
+ #
975
+ # @overload list_git_repository_links(request, options = nil)
976
+ # Pass arguments to `list_git_repository_links` via a request object, either of type
977
+ # {::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest} or an equivalent Hash.
978
+ #
979
+ # @param request [::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest, ::Hash]
980
+ # A request object representing the call parameters. Required. To specify no
981
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
982
+ # @param options [::Gapic::CallOptions, ::Hash]
983
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
984
+ #
985
+ # @overload list_git_repository_links(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
986
+ # Pass arguments to `list_git_repository_links` via keyword arguments. Note that at
987
+ # least one keyword argument is required. To specify no parameters, or to keep all
988
+ # the default parameter values, pass an empty Hash as a request object (see above).
989
+ #
990
+ # @param parent [::String]
991
+ # Required. Parent value for ListGitRepositoryLinksRequest
992
+ # @param page_size [::Integer]
993
+ # Optional. Requested page size. Server may return fewer items than
994
+ # requested. If unspecified, server will pick an appropriate default.
995
+ # @param page_token [::String]
996
+ # Optional. A token identifying a page of results the server should return.
997
+ # @param filter [::String]
998
+ # Optional. Filtering results
999
+ # @param order_by [::String]
1000
+ # Optional. Hint for how to order the results
1001
+ # @yield [result, operation] Access the result along with the TransportOperation object
1002
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse]
1003
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1004
+ #
1005
+ # @return [::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse]
1006
+ #
1007
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1008
+ #
1009
+ # @example Basic example
1010
+ # require "google/cloud/developer_connect/v1"
1011
+ #
1012
+ # # Create a client object. The client can be reused for multiple calls.
1013
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1014
+ #
1015
+ # # Create a request. To set request fields, pass in keyword arguments.
1016
+ # request = Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest.new
1017
+ #
1018
+ # # Call the list_git_repository_links method.
1019
+ # result = client.list_git_repository_links request
1020
+ #
1021
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1022
+ # # over elements, and API calls will be issued to fetch pages as needed.
1023
+ # result.each do |item|
1024
+ # # Each element is of type ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink.
1025
+ # p item
1026
+ # end
1027
+ #
1028
+ def list_git_repository_links request, options = nil
1029
+ raise ::ArgumentError, "request must be provided" if request.nil?
1030
+
1031
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest
1032
+
1033
+ # Converts hash and nil to an options object
1034
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1035
+
1036
+ # Customize the options with defaults
1037
+ call_metadata = @config.rpcs.list_git_repository_links.metadata.to_h
1038
+
1039
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1040
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1041
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1042
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1043
+ transports_version_send: [:rest]
1044
+
1045
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1046
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1047
+
1048
+ options.apply_defaults timeout: @config.rpcs.list_git_repository_links.timeout,
1049
+ metadata: call_metadata,
1050
+ retry_policy: @config.rpcs.list_git_repository_links.retry_policy
1051
+
1052
+ options.apply_defaults timeout: @config.timeout,
1053
+ metadata: @config.metadata,
1054
+ retry_policy: @config.retry_policy
1055
+
1056
+ @developer_connect_stub.list_git_repository_links request, options do |result, operation|
1057
+ yield result, operation if block_given?
1058
+ return result
1059
+ end
1060
+ rescue ::Gapic::Rest::Error => e
1061
+ raise ::Google::Cloud::Error.from_error(e)
1062
+ end
1063
+
1064
+ ##
1065
+ # Gets details of a single GitRepositoryLink.
1066
+ #
1067
+ # @overload get_git_repository_link(request, options = nil)
1068
+ # Pass arguments to `get_git_repository_link` via a request object, either of type
1069
+ # {::Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest} or an equivalent Hash.
1070
+ #
1071
+ # @param request [::Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest, ::Hash]
1072
+ # A request object representing the call parameters. Required. To specify no
1073
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1074
+ # @param options [::Gapic::CallOptions, ::Hash]
1075
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1076
+ #
1077
+ # @overload get_git_repository_link(name: nil)
1078
+ # Pass arguments to `get_git_repository_link` via keyword arguments. Note that at
1079
+ # least one keyword argument is required. To specify no parameters, or to keep all
1080
+ # the default parameter values, pass an empty Hash as a request object (see above).
1081
+ #
1082
+ # @param name [::String]
1083
+ # Required. Name of the resource
1084
+ # @yield [result, operation] Access the result along with the TransportOperation object
1085
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink]
1086
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1087
+ #
1088
+ # @return [::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink]
1089
+ #
1090
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1091
+ #
1092
+ # @example Basic example
1093
+ # require "google/cloud/developer_connect/v1"
1094
+ #
1095
+ # # Create a client object. The client can be reused for multiple calls.
1096
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1097
+ #
1098
+ # # Create a request. To set request fields, pass in keyword arguments.
1099
+ # request = Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest.new
1100
+ #
1101
+ # # Call the get_git_repository_link method.
1102
+ # result = client.get_git_repository_link request
1103
+ #
1104
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::GitRepositoryLink.
1105
+ # p result
1106
+ #
1107
+ def get_git_repository_link request, options = nil
1108
+ raise ::ArgumentError, "request must be provided" if request.nil?
1109
+
1110
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest
1111
+
1112
+ # Converts hash and nil to an options object
1113
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1114
+
1115
+ # Customize the options with defaults
1116
+ call_metadata = @config.rpcs.get_git_repository_link.metadata.to_h
1117
+
1118
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1119
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1120
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1121
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1122
+ transports_version_send: [:rest]
1123
+
1124
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1125
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1126
+
1127
+ options.apply_defaults timeout: @config.rpcs.get_git_repository_link.timeout,
1128
+ metadata: call_metadata,
1129
+ retry_policy: @config.rpcs.get_git_repository_link.retry_policy
1130
+
1131
+ options.apply_defaults timeout: @config.timeout,
1132
+ metadata: @config.metadata,
1133
+ retry_policy: @config.retry_policy
1134
+
1135
+ @developer_connect_stub.get_git_repository_link request, options do |result, operation|
1136
+ yield result, operation if block_given?
1137
+ return result
1138
+ end
1139
+ rescue ::Gapic::Rest::Error => e
1140
+ raise ::Google::Cloud::Error.from_error(e)
1141
+ end
1142
+
1143
+ ##
1144
+ # Fetches read/write token of a given gitRepositoryLink.
1145
+ #
1146
+ # @overload fetch_read_write_token(request, options = nil)
1147
+ # Pass arguments to `fetch_read_write_token` via a request object, either of type
1148
+ # {::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest} or an equivalent Hash.
1149
+ #
1150
+ # @param request [::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest, ::Hash]
1151
+ # A request object representing the call parameters. Required. To specify no
1152
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1153
+ # @param options [::Gapic::CallOptions, ::Hash]
1154
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1155
+ #
1156
+ # @overload fetch_read_write_token(git_repository_link: nil)
1157
+ # Pass arguments to `fetch_read_write_token` via keyword arguments. Note that at
1158
+ # least one keyword argument is required. To specify no parameters, or to keep all
1159
+ # the default parameter values, pass an empty Hash as a request object (see above).
1160
+ #
1161
+ # @param git_repository_link [::String]
1162
+ # Required. The resource name of the gitRepositoryLink in the format
1163
+ # `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
1164
+ # @yield [result, operation] Access the result along with the TransportOperation object
1165
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse]
1166
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1167
+ #
1168
+ # @return [::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse]
1169
+ #
1170
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1171
+ #
1172
+ # @example Basic example
1173
+ # require "google/cloud/developer_connect/v1"
1174
+ #
1175
+ # # Create a client object. The client can be reused for multiple calls.
1176
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1177
+ #
1178
+ # # Create a request. To set request fields, pass in keyword arguments.
1179
+ # request = Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest.new
1180
+ #
1181
+ # # Call the fetch_read_write_token method.
1182
+ # result = client.fetch_read_write_token request
1183
+ #
1184
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse.
1185
+ # p result
1186
+ #
1187
+ def fetch_read_write_token request, options = nil
1188
+ raise ::ArgumentError, "request must be provided" if request.nil?
1189
+
1190
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest
1191
+
1192
+ # Converts hash and nil to an options object
1193
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1194
+
1195
+ # Customize the options with defaults
1196
+ call_metadata = @config.rpcs.fetch_read_write_token.metadata.to_h
1197
+
1198
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1199
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1200
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1201
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1202
+ transports_version_send: [:rest]
1203
+
1204
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1205
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1206
+
1207
+ options.apply_defaults timeout: @config.rpcs.fetch_read_write_token.timeout,
1208
+ metadata: call_metadata,
1209
+ retry_policy: @config.rpcs.fetch_read_write_token.retry_policy
1210
+
1211
+ options.apply_defaults timeout: @config.timeout,
1212
+ metadata: @config.metadata,
1213
+ retry_policy: @config.retry_policy
1214
+
1215
+ @developer_connect_stub.fetch_read_write_token request, options do |result, operation|
1216
+ yield result, operation if block_given?
1217
+ return result
1218
+ end
1219
+ rescue ::Gapic::Rest::Error => e
1220
+ raise ::Google::Cloud::Error.from_error(e)
1221
+ end
1222
+
1223
+ ##
1224
+ # Fetches read token of a given gitRepositoryLink.
1225
+ #
1226
+ # @overload fetch_read_token(request, options = nil)
1227
+ # Pass arguments to `fetch_read_token` via a request object, either of type
1228
+ # {::Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest} or an equivalent Hash.
1229
+ #
1230
+ # @param request [::Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest, ::Hash]
1231
+ # A request object representing the call parameters. Required. To specify no
1232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1233
+ # @param options [::Gapic::CallOptions, ::Hash]
1234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1235
+ #
1236
+ # @overload fetch_read_token(git_repository_link: nil)
1237
+ # Pass arguments to `fetch_read_token` via keyword arguments. Note that at
1238
+ # least one keyword argument is required. To specify no parameters, or to keep all
1239
+ # the default parameter values, pass an empty Hash as a request object (see above).
1240
+ #
1241
+ # @param git_repository_link [::String]
1242
+ # Required. The resource name of the gitRepositoryLink in the format
1243
+ # `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
1244
+ # @yield [result, operation] Access the result along with the TransportOperation object
1245
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse]
1246
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1247
+ #
1248
+ # @return [::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse]
1249
+ #
1250
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1251
+ #
1252
+ # @example Basic example
1253
+ # require "google/cloud/developer_connect/v1"
1254
+ #
1255
+ # # Create a client object. The client can be reused for multiple calls.
1256
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1257
+ #
1258
+ # # Create a request. To set request fields, pass in keyword arguments.
1259
+ # request = Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest.new
1260
+ #
1261
+ # # Call the fetch_read_token method.
1262
+ # result = client.fetch_read_token request
1263
+ #
1264
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse.
1265
+ # p result
1266
+ #
1267
+ def fetch_read_token request, options = nil
1268
+ raise ::ArgumentError, "request must be provided" if request.nil?
1269
+
1270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest
1271
+
1272
+ # Converts hash and nil to an options object
1273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1274
+
1275
+ # Customize the options with defaults
1276
+ call_metadata = @config.rpcs.fetch_read_token.metadata.to_h
1277
+
1278
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1281
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1282
+ transports_version_send: [:rest]
1283
+
1284
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1285
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1286
+
1287
+ options.apply_defaults timeout: @config.rpcs.fetch_read_token.timeout,
1288
+ metadata: call_metadata,
1289
+ retry_policy: @config.rpcs.fetch_read_token.retry_policy
1290
+
1291
+ options.apply_defaults timeout: @config.timeout,
1292
+ metadata: @config.metadata,
1293
+ retry_policy: @config.retry_policy
1294
+
1295
+ @developer_connect_stub.fetch_read_token request, options do |result, operation|
1296
+ yield result, operation if block_given?
1297
+ return result
1298
+ end
1299
+ rescue ::Gapic::Rest::Error => e
1300
+ raise ::Google::Cloud::Error.from_error(e)
1301
+ end
1302
+
1303
+ ##
1304
+ # FetchLinkableGitRepositories returns a list of git repositories from an SCM
1305
+ # that are available to be added to a Connection.
1306
+ #
1307
+ # @overload fetch_linkable_git_repositories(request, options = nil)
1308
+ # Pass arguments to `fetch_linkable_git_repositories` via a request object, either of type
1309
+ # {::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest} or an equivalent Hash.
1310
+ #
1311
+ # @param request [::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest, ::Hash]
1312
+ # A request object representing the call parameters. Required. To specify no
1313
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1314
+ # @param options [::Gapic::CallOptions, ::Hash]
1315
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1316
+ #
1317
+ # @overload fetch_linkable_git_repositories(connection: nil, page_size: nil, page_token: nil)
1318
+ # Pass arguments to `fetch_linkable_git_repositories` via keyword arguments. Note that at
1319
+ # least one keyword argument is required. To specify no parameters, or to keep all
1320
+ # the default parameter values, pass an empty Hash as a request object (see above).
1321
+ #
1322
+ # @param connection [::String]
1323
+ # Required. The name of the Connection.
1324
+ # Format: `projects/*/locations/*/connections/*`.
1325
+ # @param page_size [::Integer]
1326
+ # Optional. Number of results to return in the list. Defaults to 20.
1327
+ # @param page_token [::String]
1328
+ # Optional. Page start.
1329
+ # @yield [result, operation] Access the result along with the TransportOperation object
1330
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>]
1331
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1332
+ #
1333
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>]
1334
+ #
1335
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1336
+ #
1337
+ # @example Basic example
1338
+ # require "google/cloud/developer_connect/v1"
1339
+ #
1340
+ # # Create a client object. The client can be reused for multiple calls.
1341
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1342
+ #
1343
+ # # Create a request. To set request fields, pass in keyword arguments.
1344
+ # request = Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest.new
1345
+ #
1346
+ # # Call the fetch_linkable_git_repositories method.
1347
+ # result = client.fetch_linkable_git_repositories request
1348
+ #
1349
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1350
+ # # over elements, and API calls will be issued to fetch pages as needed.
1351
+ # result.each do |item|
1352
+ # # Each element is of type ::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository.
1353
+ # p item
1354
+ # end
1355
+ #
1356
+ def fetch_linkable_git_repositories request, options = nil
1357
+ raise ::ArgumentError, "request must be provided" if request.nil?
1358
+
1359
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest
1360
+
1361
+ # Converts hash and nil to an options object
1362
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1363
+
1364
+ # Customize the options with defaults
1365
+ call_metadata = @config.rpcs.fetch_linkable_git_repositories.metadata.to_h
1366
+
1367
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1368
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1369
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1370
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1371
+ transports_version_send: [:rest]
1372
+
1373
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1374
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1375
+
1376
+ options.apply_defaults timeout: @config.rpcs.fetch_linkable_git_repositories.timeout,
1377
+ metadata: call_metadata,
1378
+ retry_policy: @config.rpcs.fetch_linkable_git_repositories.retry_policy
1379
+
1380
+ options.apply_defaults timeout: @config.timeout,
1381
+ metadata: @config.metadata,
1382
+ retry_policy: @config.retry_policy
1383
+
1384
+ @developer_connect_stub.fetch_linkable_git_repositories request, options do |result, operation|
1385
+ result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :fetch_linkable_git_repositories, "linkable_git_repositories", request, result, options
1386
+ yield result, operation if block_given?
1387
+ return result
1388
+ end
1389
+ rescue ::Gapic::Rest::Error => e
1390
+ raise ::Google::Cloud::Error.from_error(e)
1391
+ end
1392
+
1393
+ ##
1394
+ # FetchGitHubInstallations returns the list of GitHub Installations that
1395
+ # are available to be added to a Connection.
1396
+ # For github.com, only installations accessible to the authorizer token
1397
+ # are returned. For GitHub Enterprise, all installations are returned.
1398
+ #
1399
+ # @overload fetch_git_hub_installations(request, options = nil)
1400
+ # Pass arguments to `fetch_git_hub_installations` via a request object, either of type
1401
+ # {::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest} or an equivalent Hash.
1402
+ #
1403
+ # @param request [::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest, ::Hash]
1404
+ # A request object representing the call parameters. Required. To specify no
1405
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1406
+ # @param options [::Gapic::CallOptions, ::Hash]
1407
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1408
+ #
1409
+ # @overload fetch_git_hub_installations(connection: nil)
1410
+ # Pass arguments to `fetch_git_hub_installations` via keyword arguments. Note that at
1411
+ # least one keyword argument is required. To specify no parameters, or to keep all
1412
+ # the default parameter values, pass an empty Hash as a request object (see above).
1413
+ #
1414
+ # @param connection [::String]
1415
+ # Required. The resource name of the connection in the format
1416
+ # `projects/*/locations/*/connections/*`.
1417
+ # @yield [result, operation] Access the result along with the TransportOperation object
1418
+ # @yieldparam result [::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse]
1419
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1420
+ #
1421
+ # @return [::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse]
1422
+ #
1423
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1424
+ #
1425
+ # @example Basic example
1426
+ # require "google/cloud/developer_connect/v1"
1427
+ #
1428
+ # # Create a client object. The client can be reused for multiple calls.
1429
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1430
+ #
1431
+ # # Create a request. To set request fields, pass in keyword arguments.
1432
+ # request = Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest.new
1433
+ #
1434
+ # # Call the fetch_git_hub_installations method.
1435
+ # result = client.fetch_git_hub_installations request
1436
+ #
1437
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse.
1438
+ # p result
1439
+ #
1440
+ def fetch_git_hub_installations request, options = nil
1441
+ raise ::ArgumentError, "request must be provided" if request.nil?
1442
+
1443
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest
1444
+
1445
+ # Converts hash and nil to an options object
1446
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1447
+
1448
+ # Customize the options with defaults
1449
+ call_metadata = @config.rpcs.fetch_git_hub_installations.metadata.to_h
1450
+
1451
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1452
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1453
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1454
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1455
+ transports_version_send: [:rest]
1456
+
1457
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1458
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1459
+
1460
+ options.apply_defaults timeout: @config.rpcs.fetch_git_hub_installations.timeout,
1461
+ metadata: call_metadata,
1462
+ retry_policy: @config.rpcs.fetch_git_hub_installations.retry_policy
1463
+
1464
+ options.apply_defaults timeout: @config.timeout,
1465
+ metadata: @config.metadata,
1466
+ retry_policy: @config.retry_policy
1467
+
1468
+ @developer_connect_stub.fetch_git_hub_installations request, options do |result, operation|
1469
+ yield result, operation if block_given?
1470
+ return result
1471
+ end
1472
+ rescue ::Gapic::Rest::Error => e
1473
+ raise ::Google::Cloud::Error.from_error(e)
1474
+ end
1475
+
1476
+ ##
1477
+ # Fetch the list of branches or tags for a given repository.
1478
+ #
1479
+ # @overload fetch_git_refs(request, options = nil)
1480
+ # Pass arguments to `fetch_git_refs` via a request object, either of type
1481
+ # {::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest} or an equivalent Hash.
1482
+ #
1483
+ # @param request [::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest, ::Hash]
1484
+ # A request object representing the call parameters. Required. To specify no
1485
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1486
+ # @param options [::Gapic::CallOptions, ::Hash]
1487
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1488
+ #
1489
+ # @overload fetch_git_refs(git_repository_link: nil, ref_type: nil, page_size: nil, page_token: nil)
1490
+ # Pass arguments to `fetch_git_refs` via keyword arguments. Note that at
1491
+ # least one keyword argument is required. To specify no parameters, or to keep all
1492
+ # the default parameter values, pass an empty Hash as a request object (see above).
1493
+ #
1494
+ # @param git_repository_link [::String]
1495
+ # Required. The resource name of GitRepositoryLink in the format
1496
+ # `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
1497
+ # @param ref_type [::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest::RefType]
1498
+ # Required. Type of refs to fetch.
1499
+ # @param page_size [::Integer]
1500
+ # Optional. Number of results to return in the list. Default to 20.
1501
+ # @param page_token [::String]
1502
+ # Optional. Page start.
1503
+ # @yield [result, operation] Access the result along with the TransportOperation object
1504
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String>]
1505
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1506
+ #
1507
+ # @return [::Gapic::Rest::PagedEnumerable<::String>]
1508
+ #
1509
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1510
+ #
1511
+ # @example Basic example
1512
+ # require "google/cloud/developer_connect/v1"
1513
+ #
1514
+ # # Create a client object. The client can be reused for multiple calls.
1515
+ # client = Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new
1516
+ #
1517
+ # # Create a request. To set request fields, pass in keyword arguments.
1518
+ # request = Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest.new
1519
+ #
1520
+ # # Call the fetch_git_refs method.
1521
+ # result = client.fetch_git_refs request
1522
+ #
1523
+ # # The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse.
1524
+ # p result
1525
+ #
1526
+ def fetch_git_refs request, options = nil
1527
+ raise ::ArgumentError, "request must be provided" if request.nil?
1528
+
1529
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest
1530
+
1531
+ # Converts hash and nil to an options object
1532
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1533
+
1534
+ # Customize the options with defaults
1535
+ call_metadata = @config.rpcs.fetch_git_refs.metadata.to_h
1536
+
1537
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1538
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1539
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1540
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
1541
+ transports_version_send: [:rest]
1542
+
1543
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1544
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1545
+
1546
+ options.apply_defaults timeout: @config.rpcs.fetch_git_refs.timeout,
1547
+ metadata: call_metadata,
1548
+ retry_policy: @config.rpcs.fetch_git_refs.retry_policy
1549
+
1550
+ options.apply_defaults timeout: @config.timeout,
1551
+ metadata: @config.metadata,
1552
+ retry_policy: @config.retry_policy
1553
+
1554
+ @developer_connect_stub.fetch_git_refs request, options do |result, operation|
1555
+ result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :fetch_git_refs, "ref_names", request, result, options
1556
+ yield result, operation if block_given?
1557
+ return result
1558
+ end
1559
+ rescue ::Gapic::Rest::Error => e
1560
+ raise ::Google::Cloud::Error.from_error(e)
1561
+ end
1562
+
1563
+ ##
1564
+ # Configuration class for the DeveloperConnect REST API.
1565
+ #
1566
+ # This class represents the configuration for DeveloperConnect REST,
1567
+ # providing control over timeouts, retry behavior, logging, transport
1568
+ # parameters, and other low-level controls. Certain parameters can also be
1569
+ # applied individually to specific RPCs. See
1570
+ # {::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client::Configuration::Rpcs}
1571
+ # for a list of RPCs that can be configured independently.
1572
+ #
1573
+ # Configuration can be applied globally to all clients, or to a single client
1574
+ # on construction.
1575
+ #
1576
+ # @example
1577
+ #
1578
+ # # Modify the global config, setting the timeout for
1579
+ # # list_connections to 20 seconds,
1580
+ # # and all remaining timeouts to 10 seconds.
1581
+ # ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.configure do |config|
1582
+ # config.timeout = 10.0
1583
+ # config.rpcs.list_connections.timeout = 20.0
1584
+ # end
1585
+ #
1586
+ # # Apply the above configuration only to a new client.
1587
+ # client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.new do |config|
1588
+ # config.timeout = 10.0
1589
+ # config.rpcs.list_connections.timeout = 20.0
1590
+ # end
1591
+ #
1592
+ # @!attribute [rw] endpoint
1593
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1594
+ # nil, indicating to use the default endpoint in the current universe domain.
1595
+ # @return [::String,nil]
1596
+ # @!attribute [rw] credentials
1597
+ # Credentials to send with calls. You may provide any of the following types:
1598
+ # * (`String`) The path to a service account key file in JSON format
1599
+ # * (`Hash`) A service account key as a Hash
1600
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1601
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1602
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1603
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1604
+ # * (`nil`) indicating no credentials
1605
+ # @return [::Object]
1606
+ # @!attribute [rw] scope
1607
+ # The OAuth scopes
1608
+ # @return [::Array<::String>]
1609
+ # @!attribute [rw] lib_name
1610
+ # The library name as recorded in instrumentation and logging
1611
+ # @return [::String]
1612
+ # @!attribute [rw] lib_version
1613
+ # The library version as recorded in instrumentation and logging
1614
+ # @return [::String]
1615
+ # @!attribute [rw] timeout
1616
+ # The call timeout in seconds.
1617
+ # @return [::Numeric]
1618
+ # @!attribute [rw] metadata
1619
+ # Additional headers to be sent with the call.
1620
+ # @return [::Hash{::Symbol=>::String}]
1621
+ # @!attribute [rw] retry_policy
1622
+ # The retry policy. The value is a hash with the following keys:
1623
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1624
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1625
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1626
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1627
+ # trigger a retry.
1628
+ # @return [::Hash]
1629
+ # @!attribute [rw] quota_project
1630
+ # A separate project against which to charge quota.
1631
+ # @return [::String]
1632
+ # @!attribute [rw] universe_domain
1633
+ # The universe domain within which to make requests. This determines the
1634
+ # default endpoint URL. The default value of nil uses the environment
1635
+ # universe (usually the default "googleapis.com" universe).
1636
+ # @return [::String,nil]
1637
+ #
1638
+ class Configuration
1639
+ extend ::Gapic::Config
1640
+
1641
+ # @private
1642
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1643
+ DEFAULT_ENDPOINT = "developerconnect.googleapis.com"
1644
+
1645
+ config_attr :endpoint, nil, ::String, nil
1646
+ config_attr :credentials, nil do |value|
1647
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1648
+ allowed.any? { |klass| klass === value }
1649
+ end
1650
+ config_attr :scope, nil, ::String, ::Array, nil
1651
+ config_attr :lib_name, nil, ::String, nil
1652
+ config_attr :lib_version, nil, ::String, nil
1653
+ config_attr :timeout, nil, ::Numeric, nil
1654
+ config_attr :metadata, nil, ::Hash, nil
1655
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1656
+ config_attr :quota_project, nil, ::String, nil
1657
+ config_attr :universe_domain, nil, ::String, nil
1658
+
1659
+ # @private
1660
+ # Overrides for http bindings for the RPCs of this service
1661
+ # are only used when this service is used as mixin, and only
1662
+ # by the host service.
1663
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1664
+ config_attr :bindings_override, {}, ::Hash, nil
1665
+
1666
+ # @private
1667
+ def initialize parent_config = nil
1668
+ @parent_config = parent_config unless parent_config.nil?
1669
+
1670
+ yield self if block_given?
1671
+ end
1672
+
1673
+ ##
1674
+ # Configurations for individual RPCs
1675
+ # @return [Rpcs]
1676
+ #
1677
+ def rpcs
1678
+ @rpcs ||= begin
1679
+ parent_rpcs = nil
1680
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1681
+ Rpcs.new parent_rpcs
1682
+ end
1683
+ end
1684
+
1685
+ ##
1686
+ # Configuration RPC class for the DeveloperConnect API.
1687
+ #
1688
+ # Includes fields providing the configuration for each RPC in this service.
1689
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1690
+ # the following configuration fields:
1691
+ #
1692
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1693
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1694
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1695
+ # include the following keys:
1696
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1697
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1698
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1699
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1700
+ # trigger a retry.
1701
+ #
1702
+ class Rpcs
1703
+ ##
1704
+ # RPC-specific configuration for `list_connections`
1705
+ # @return [::Gapic::Config::Method]
1706
+ #
1707
+ attr_reader :list_connections
1708
+ ##
1709
+ # RPC-specific configuration for `get_connection`
1710
+ # @return [::Gapic::Config::Method]
1711
+ #
1712
+ attr_reader :get_connection
1713
+ ##
1714
+ # RPC-specific configuration for `create_connection`
1715
+ # @return [::Gapic::Config::Method]
1716
+ #
1717
+ attr_reader :create_connection
1718
+ ##
1719
+ # RPC-specific configuration for `update_connection`
1720
+ # @return [::Gapic::Config::Method]
1721
+ #
1722
+ attr_reader :update_connection
1723
+ ##
1724
+ # RPC-specific configuration for `delete_connection`
1725
+ # @return [::Gapic::Config::Method]
1726
+ #
1727
+ attr_reader :delete_connection
1728
+ ##
1729
+ # RPC-specific configuration for `create_git_repository_link`
1730
+ # @return [::Gapic::Config::Method]
1731
+ #
1732
+ attr_reader :create_git_repository_link
1733
+ ##
1734
+ # RPC-specific configuration for `delete_git_repository_link`
1735
+ # @return [::Gapic::Config::Method]
1736
+ #
1737
+ attr_reader :delete_git_repository_link
1738
+ ##
1739
+ # RPC-specific configuration for `list_git_repository_links`
1740
+ # @return [::Gapic::Config::Method]
1741
+ #
1742
+ attr_reader :list_git_repository_links
1743
+ ##
1744
+ # RPC-specific configuration for `get_git_repository_link`
1745
+ # @return [::Gapic::Config::Method]
1746
+ #
1747
+ attr_reader :get_git_repository_link
1748
+ ##
1749
+ # RPC-specific configuration for `fetch_read_write_token`
1750
+ # @return [::Gapic::Config::Method]
1751
+ #
1752
+ attr_reader :fetch_read_write_token
1753
+ ##
1754
+ # RPC-specific configuration for `fetch_read_token`
1755
+ # @return [::Gapic::Config::Method]
1756
+ #
1757
+ attr_reader :fetch_read_token
1758
+ ##
1759
+ # RPC-specific configuration for `fetch_linkable_git_repositories`
1760
+ # @return [::Gapic::Config::Method]
1761
+ #
1762
+ attr_reader :fetch_linkable_git_repositories
1763
+ ##
1764
+ # RPC-specific configuration for `fetch_git_hub_installations`
1765
+ # @return [::Gapic::Config::Method]
1766
+ #
1767
+ attr_reader :fetch_git_hub_installations
1768
+ ##
1769
+ # RPC-specific configuration for `fetch_git_refs`
1770
+ # @return [::Gapic::Config::Method]
1771
+ #
1772
+ attr_reader :fetch_git_refs
1773
+
1774
+ # @private
1775
+ def initialize parent_rpcs = nil
1776
+ list_connections_config = parent_rpcs.list_connections if parent_rpcs.respond_to? :list_connections
1777
+ @list_connections = ::Gapic::Config::Method.new list_connections_config
1778
+ get_connection_config = parent_rpcs.get_connection if parent_rpcs.respond_to? :get_connection
1779
+ @get_connection = ::Gapic::Config::Method.new get_connection_config
1780
+ create_connection_config = parent_rpcs.create_connection if parent_rpcs.respond_to? :create_connection
1781
+ @create_connection = ::Gapic::Config::Method.new create_connection_config
1782
+ update_connection_config = parent_rpcs.update_connection if parent_rpcs.respond_to? :update_connection
1783
+ @update_connection = ::Gapic::Config::Method.new update_connection_config
1784
+ delete_connection_config = parent_rpcs.delete_connection if parent_rpcs.respond_to? :delete_connection
1785
+ @delete_connection = ::Gapic::Config::Method.new delete_connection_config
1786
+ create_git_repository_link_config = parent_rpcs.create_git_repository_link if parent_rpcs.respond_to? :create_git_repository_link
1787
+ @create_git_repository_link = ::Gapic::Config::Method.new create_git_repository_link_config
1788
+ delete_git_repository_link_config = parent_rpcs.delete_git_repository_link if parent_rpcs.respond_to? :delete_git_repository_link
1789
+ @delete_git_repository_link = ::Gapic::Config::Method.new delete_git_repository_link_config
1790
+ list_git_repository_links_config = parent_rpcs.list_git_repository_links if parent_rpcs.respond_to? :list_git_repository_links
1791
+ @list_git_repository_links = ::Gapic::Config::Method.new list_git_repository_links_config
1792
+ get_git_repository_link_config = parent_rpcs.get_git_repository_link if parent_rpcs.respond_to? :get_git_repository_link
1793
+ @get_git_repository_link = ::Gapic::Config::Method.new get_git_repository_link_config
1794
+ fetch_read_write_token_config = parent_rpcs.fetch_read_write_token if parent_rpcs.respond_to? :fetch_read_write_token
1795
+ @fetch_read_write_token = ::Gapic::Config::Method.new fetch_read_write_token_config
1796
+ fetch_read_token_config = parent_rpcs.fetch_read_token if parent_rpcs.respond_to? :fetch_read_token
1797
+ @fetch_read_token = ::Gapic::Config::Method.new fetch_read_token_config
1798
+ fetch_linkable_git_repositories_config = parent_rpcs.fetch_linkable_git_repositories if parent_rpcs.respond_to? :fetch_linkable_git_repositories
1799
+ @fetch_linkable_git_repositories = ::Gapic::Config::Method.new fetch_linkable_git_repositories_config
1800
+ fetch_git_hub_installations_config = parent_rpcs.fetch_git_hub_installations if parent_rpcs.respond_to? :fetch_git_hub_installations
1801
+ @fetch_git_hub_installations = ::Gapic::Config::Method.new fetch_git_hub_installations_config
1802
+ fetch_git_refs_config = parent_rpcs.fetch_git_refs if parent_rpcs.respond_to? :fetch_git_refs
1803
+ @fetch_git_refs = ::Gapic::Config::Method.new fetch_git_refs_config
1804
+
1805
+ yield self if block_given?
1806
+ end
1807
+ end
1808
+ end
1809
+ end
1810
+ end
1811
+ end
1812
+ end
1813
+ end
1814
+ end
1815
+ end