google-cloud-developer_connect-v1 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/developer_connect/v1/developer_connect/client.rb +1087 -0
  3. data/lib/google/cloud/developer_connect/v1/developer_connect/paths.rb +40 -0
  4. data/lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb +1017 -0
  5. data/lib/google/cloud/developer_connect/v1/developer_connect/rest/service_stub.rb +613 -0
  6. data/lib/google/cloud/developer_connect/v1/rest.rb +1 -0
  7. data/lib/google/cloud/developer_connect/v1/version.rb +1 -1
  8. data/lib/google/cloud/developer_connect/v1.rb +1 -0
  9. data/lib/google/cloud/developerconnect/v1/developer_connect_pb.rb +22 -1
  10. data/lib/google/cloud/developerconnect/v1/developer_connect_services_pb.rb +20 -0
  11. data/lib/google/cloud/developerconnect/v1/insights_config_pb.rb +69 -0
  12. data/lib/google/cloud/developerconnect/v1/insights_config_service/client.rb +956 -0
  13. data/lib/google/cloud/developerconnect/v1/insights_config_service/credentials.rb +47 -0
  14. data/lib/google/cloud/developerconnect/v1/insights_config_service/operations.rb +813 -0
  15. data/lib/google/cloud/developerconnect/v1/insights_config_service/paths.rb +69 -0
  16. data/lib/google/cloud/developerconnect/v1/insights_config_service/rest/client.rb +903 -0
  17. data/lib/google/cloud/developerconnect/v1/insights_config_service/rest/operations.rb +914 -0
  18. data/lib/google/cloud/developerconnect/v1/insights_config_service/rest/service_stub.rb +388 -0
  19. data/lib/google/cloud/developerconnect/v1/insights_config_service/rest.rb +62 -0
  20. data/lib/google/cloud/developerconnect/v1/insights_config_service.rb +64 -0
  21. data/lib/google/cloud/developerconnect/v1/insights_config_services_pb.rb +61 -0
  22. data/proto_docs/google/cloud/developerconnect/v1/developer_connect.rb +515 -8
  23. data/proto_docs/google/cloud/developerconnect/v1/insights_config.rb +353 -0
  24. metadata +23 -23
@@ -0,0 +1,903 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/insights_config_pb"
21
+ require "google/cloud/developerconnect/v1/insights_config_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Developerconnect
27
+ module V1
28
+ module InsightsConfigService
29
+ module Rest
30
+ ##
31
+ # REST client for the InsightsConfigService service.
32
+ #
33
+ # Creates and manages InsightsConfigs.
34
+ #
35
+ # The InsightsConfig resource is the core configuration object to capture
36
+ # events from your Software Development Lifecycle. It acts as the central hub
37
+ # for managing how Developer connect understands your application, its runtime
38
+ # environments, and the artifacts deployed within them.
39
+ # A user can create an InsightsConfig, list previously-requested
40
+ # InsightsConfigs or get InsightsConfigs by their ID to determine the status of
41
+ # the InsightsConfig.
42
+ #
43
+ class Client
44
+ # @private
45
+ API_VERSION = ""
46
+
47
+ # @private
48
+ DEFAULT_ENDPOINT_TEMPLATE = "developerconnect.$UNIVERSE_DOMAIN$"
49
+
50
+ include Paths
51
+
52
+ # @private
53
+ attr_reader :insights_config_service_stub
54
+
55
+ ##
56
+ # Configure the InsightsConfigService Client class.
57
+ #
58
+ # See {::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client::Configuration}
59
+ # for a description of the configuration fields.
60
+ #
61
+ # @example
62
+ #
63
+ # # Modify the configuration for all InsightsConfigService clients
64
+ # ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.configure do |config|
65
+ # config.timeout = 10.0
66
+ # end
67
+ #
68
+ # @yield [config] Configure the Client client.
69
+ # @yieldparam config [Client::Configuration]
70
+ #
71
+ # @return [Client::Configuration]
72
+ #
73
+ def self.configure
74
+ @configure ||= begin
75
+ namespace = ["Google", "Cloud", "Developerconnect", "V1"]
76
+ parent_config = while namespace.any?
77
+ parent_name = namespace.join "::"
78
+ parent_const = const_get parent_name
79
+ break parent_const.configure if parent_const.respond_to? :configure
80
+ namespace.pop
81
+ end
82
+ default_config = Client::Configuration.new parent_config
83
+
84
+ default_config
85
+ end
86
+ yield @configure if block_given?
87
+ @configure
88
+ end
89
+
90
+ ##
91
+ # Configure the InsightsConfigService Client instance.
92
+ #
93
+ # The configuration is set to the derived mode, meaning that values can be changed,
94
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
95
+ # should be made on {Client.configure}.
96
+ #
97
+ # See {::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client::Configuration}
98
+ # for a description of the configuration fields.
99
+ #
100
+ # @yield [config] Configure the Client client.
101
+ # @yieldparam config [Client::Configuration]
102
+ #
103
+ # @return [Client::Configuration]
104
+ #
105
+ def configure
106
+ yield @config if block_given?
107
+ @config
108
+ end
109
+
110
+ ##
111
+ # The effective universe domain
112
+ #
113
+ # @return [String]
114
+ #
115
+ def universe_domain
116
+ @insights_config_service_stub.universe_domain
117
+ end
118
+
119
+ ##
120
+ # Create a new InsightsConfigService REST client object.
121
+ #
122
+ # @example
123
+ #
124
+ # # Create a client using the default configuration
125
+ # client = ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
126
+ #
127
+ # # Create a client using a custom configuration
128
+ # client = ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new do |config|
129
+ # config.timeout = 10.0
130
+ # end
131
+ #
132
+ # @yield [config] Configure the InsightsConfigService client.
133
+ # @yieldparam config [Client::Configuration]
134
+ #
135
+ def initialize
136
+ # Create the configuration object
137
+ @config = Configuration.new Client.configure
138
+
139
+ # Yield the configuration if needed
140
+ yield @config if block_given?
141
+
142
+ # Create credentials
143
+ credentials = @config.credentials
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
145
+ # but only if the default endpoint does not have a region prefix.
146
+ enable_self_signed_jwt = @config.endpoint.nil? ||
147
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-"))
149
+ credentials ||= Credentials.default scope: @config.scope,
150
+ enable_self_signed_jwt: enable_self_signed_jwt
151
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
152
+ credentials = Credentials.new credentials, scope: @config.scope
153
+ end
154
+
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
163
+ end
164
+
165
+ @insights_config_service_stub = ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::ServiceStub.new(
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
169
+ credentials: credentials,
170
+ logger: @config.logger
171
+ )
172
+
173
+ @insights_config_service_stub.logger(stub: true)&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+
183
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @insights_config_service_stub.endpoint
187
+ config.universe_domain = @insights_config_service_stub.universe_domain
188
+ config.bindings_override = @config.bindings_override
189
+ config.logger = @insights_config_service_stub.logger if config.respond_to? :logger=
190
+ end
191
+ end
192
+
193
+ ##
194
+ # Get the associated client for long-running operations.
195
+ #
196
+ # @return [::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Operations]
197
+ #
198
+ attr_reader :operations_client
199
+
200
+ ##
201
+ # Get the associated client for mix-in of the Locations.
202
+ #
203
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
204
+ #
205
+ attr_reader :location_client
206
+
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @insights_config_service_stub.logger
214
+ end
215
+
216
+ # Service calls
217
+
218
+ ##
219
+ # Lists InsightsConfigs in a given project and location.
220
+ #
221
+ # @overload list_insights_configs(request, options = nil)
222
+ # Pass arguments to `list_insights_configs` via a request object, either of type
223
+ # {::Google::Cloud::Developerconnect::V1::ListInsightsConfigsRequest} or an equivalent Hash.
224
+ #
225
+ # @param request [::Google::Cloud::Developerconnect::V1::ListInsightsConfigsRequest, ::Hash]
226
+ # A request object representing the call parameters. Required. To specify no
227
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
228
+ # @param options [::Gapic::CallOptions, ::Hash]
229
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
230
+ #
231
+ # @overload list_insights_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
232
+ # Pass arguments to `list_insights_configs` via keyword arguments. Note that at
233
+ # least one keyword argument is required. To specify no parameters, or to keep all
234
+ # the default parameter values, pass an empty Hash as a request object (see above).
235
+ #
236
+ # @param parent [::String]
237
+ # Required. Parent value for ListInsightsConfigsRequest.
238
+ # @param page_size [::Integer]
239
+ # Optional. Requested page size. Server may return fewer items than
240
+ # requested. If unspecified, server will pick an appropriate default.
241
+ # @param page_token [::String]
242
+ # Optional. A token identifying a page of results the server should return.
243
+ # @param filter [::String]
244
+ # Optional. Filtering results. See https://google.aip.dev/160 for more
245
+ # details. Filter string, adhering to the rules in
246
+ # https://google.aip.dev/160. List only InsightsConfigs matching the filter.
247
+ # If filter is empty, all InsightsConfigs are listed.
248
+ # @param order_by [::String]
249
+ # Optional. Hint for how to order the results.
250
+ # @yield [result, operation] Access the result along with the TransportOperation object
251
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>]
252
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
253
+ #
254
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>]
255
+ #
256
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
257
+ #
258
+ # @example Basic example
259
+ # require "google/cloud/developer_connect/v1"
260
+ #
261
+ # # Create a client object. The client can be reused for multiple calls.
262
+ # client = Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
263
+ #
264
+ # # Create a request. To set request fields, pass in keyword arguments.
265
+ # request = Google::Cloud::Developerconnect::V1::ListInsightsConfigsRequest.new
266
+ #
267
+ # # Call the list_insights_configs method.
268
+ # result = client.list_insights_configs request
269
+ #
270
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
271
+ # # over elements, and API calls will be issued to fetch pages as needed.
272
+ # result.each do |item|
273
+ # # Each element is of type ::Google::Cloud::Developerconnect::V1::InsightsConfig.
274
+ # p item
275
+ # end
276
+ #
277
+ def list_insights_configs request, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request.nil?
279
+
280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Developerconnect::V1::ListInsightsConfigsRequest
281
+
282
+ # Converts hash and nil to an options object
283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
284
+
285
+ # Customize the options with defaults
286
+ call_metadata = @config.rpcs.list_insights_configs.metadata.to_h
287
+
288
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
289
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
291
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
292
+ transports_version_send: [:rest]
293
+
294
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
295
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
+
297
+ options.apply_defaults timeout: @config.rpcs.list_insights_configs.timeout,
298
+ metadata: call_metadata,
299
+ retry_policy: @config.rpcs.list_insights_configs.retry_policy
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
303
+ retry_policy: @config.retry_policy
304
+
305
+ @insights_config_service_stub.list_insights_configs request, options do |result, operation|
306
+ result = ::Gapic::Rest::PagedEnumerable.new @insights_config_service_stub, :list_insights_configs, "insights_configs", request, result, options
307
+ yield result, operation if block_given?
308
+ throw :response, result
309
+ end
310
+ rescue ::Gapic::Rest::Error => e
311
+ raise ::Google::Cloud::Error.from_error(e)
312
+ end
313
+
314
+ ##
315
+ # Creates a new InsightsConfig in a given project and location.
316
+ #
317
+ # @overload create_insights_config(request, options = nil)
318
+ # Pass arguments to `create_insights_config` via a request object, either of type
319
+ # {::Google::Cloud::Developerconnect::V1::CreateInsightsConfigRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [::Google::Cloud::Developerconnect::V1::CreateInsightsConfigRequest, ::Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [::Gapic::CallOptions, ::Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
326
+ #
327
+ # @overload create_insights_config(parent: nil, insights_config_id: nil, insights_config: nil, validate_only: nil)
328
+ # Pass arguments to `create_insights_config` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param parent [::String]
333
+ # Required. Value for parent.
334
+ # @param insights_config_id [::String]
335
+ # Required. ID of the requesting InsightsConfig.
336
+ # @param insights_config [::Google::Cloud::Developerconnect::V1::InsightsConfig, ::Hash]
337
+ # Required. The resource being created.
338
+ # @param validate_only [::Boolean]
339
+ # Optional. If set, validate the request, but do not actually post it.
340
+ # @yield [result, operation] Access the result along with the TransportOperation object
341
+ # @yieldparam result [::Gapic::Operation]
342
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
343
+ #
344
+ # @return [::Gapic::Operation]
345
+ #
346
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
347
+ #
348
+ # @example Basic example
349
+ # require "google/cloud/developer_connect/v1"
350
+ #
351
+ # # Create a client object. The client can be reused for multiple calls.
352
+ # client = Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
353
+ #
354
+ # # Create a request. To set request fields, pass in keyword arguments.
355
+ # request = Google::Cloud::Developerconnect::V1::CreateInsightsConfigRequest.new
356
+ #
357
+ # # Call the create_insights_config method.
358
+ # result = client.create_insights_config request
359
+ #
360
+ # # The returned object is of type Gapic::Operation. You can use it to
361
+ # # check the status of an operation, cancel it, or wait for results.
362
+ # # Here is how to wait for a response.
363
+ # result.wait_until_done! timeout: 60
364
+ # if result.response?
365
+ # p result.response
366
+ # else
367
+ # puts "No response received."
368
+ # end
369
+ #
370
+ def create_insights_config request, options = nil
371
+ raise ::ArgumentError, "request must be provided" if request.nil?
372
+
373
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Developerconnect::V1::CreateInsightsConfigRequest
374
+
375
+ # Converts hash and nil to an options object
376
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
377
+
378
+ # Customize the options with defaults
379
+ call_metadata = @config.rpcs.create_insights_config.metadata.to_h
380
+
381
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
382
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
383
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
384
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
385
+ transports_version_send: [:rest]
386
+
387
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
388
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
389
+
390
+ options.apply_defaults timeout: @config.rpcs.create_insights_config.timeout,
391
+ metadata: call_metadata,
392
+ retry_policy: @config.rpcs.create_insights_config.retry_policy
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
396
+ retry_policy: @config.retry_policy
397
+
398
+ @insights_config_service_stub.create_insights_config request, options do |result, operation|
399
+ result = ::Gapic::Operation.new result, @operations_client, options: options
400
+ yield result, operation if block_given?
401
+ throw :response, result
402
+ end
403
+ rescue ::Gapic::Rest::Error => e
404
+ raise ::Google::Cloud::Error.from_error(e)
405
+ end
406
+
407
+ ##
408
+ # Gets details of a single Insight.
409
+ #
410
+ # @overload get_insights_config(request, options = nil)
411
+ # Pass arguments to `get_insights_config` via a request object, either of type
412
+ # {::Google::Cloud::Developerconnect::V1::GetInsightsConfigRequest} or an equivalent Hash.
413
+ #
414
+ # @param request [::Google::Cloud::Developerconnect::V1::GetInsightsConfigRequest, ::Hash]
415
+ # A request object representing the call parameters. Required. To specify no
416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
417
+ # @param options [::Gapic::CallOptions, ::Hash]
418
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
419
+ #
420
+ # @overload get_insights_config(name: nil)
421
+ # Pass arguments to `get_insights_config` via keyword arguments. Note that at
422
+ # least one keyword argument is required. To specify no parameters, or to keep all
423
+ # the default parameter values, pass an empty Hash as a request object (see above).
424
+ #
425
+ # @param name [::String]
426
+ # Required. Name of the resource.
427
+ # @yield [result, operation] Access the result along with the TransportOperation object
428
+ # @yieldparam result [::Google::Cloud::Developerconnect::V1::InsightsConfig]
429
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
430
+ #
431
+ # @return [::Google::Cloud::Developerconnect::V1::InsightsConfig]
432
+ #
433
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
434
+ #
435
+ # @example Basic example
436
+ # require "google/cloud/developer_connect/v1"
437
+ #
438
+ # # Create a client object. The client can be reused for multiple calls.
439
+ # client = Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
440
+ #
441
+ # # Create a request. To set request fields, pass in keyword arguments.
442
+ # request = Google::Cloud::Developerconnect::V1::GetInsightsConfigRequest.new
443
+ #
444
+ # # Call the get_insights_config method.
445
+ # result = client.get_insights_config request
446
+ #
447
+ # # The returned object is of type Google::Cloud::Developerconnect::V1::InsightsConfig.
448
+ # p result
449
+ #
450
+ def get_insights_config request, options = nil
451
+ raise ::ArgumentError, "request must be provided" if request.nil?
452
+
453
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Developerconnect::V1::GetInsightsConfigRequest
454
+
455
+ # Converts hash and nil to an options object
456
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
457
+
458
+ # Customize the options with defaults
459
+ call_metadata = @config.rpcs.get_insights_config.metadata.to_h
460
+
461
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
462
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
463
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
464
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
465
+ transports_version_send: [:rest]
466
+
467
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
468
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
469
+
470
+ options.apply_defaults timeout: @config.rpcs.get_insights_config.timeout,
471
+ metadata: call_metadata,
472
+ retry_policy: @config.rpcs.get_insights_config.retry_policy
473
+
474
+ options.apply_defaults timeout: @config.timeout,
475
+ metadata: @config.metadata,
476
+ retry_policy: @config.retry_policy
477
+
478
+ @insights_config_service_stub.get_insights_config request, options do |result, operation|
479
+ yield result, operation if block_given?
480
+ end
481
+ rescue ::Gapic::Rest::Error => e
482
+ raise ::Google::Cloud::Error.from_error(e)
483
+ end
484
+
485
+ ##
486
+ # Updates the parameters of a single InsightsConfig.
487
+ #
488
+ # @overload update_insights_config(request, options = nil)
489
+ # Pass arguments to `update_insights_config` via a request object, either of type
490
+ # {::Google::Cloud::Developerconnect::V1::UpdateInsightsConfigRequest} or an equivalent Hash.
491
+ #
492
+ # @param request [::Google::Cloud::Developerconnect::V1::UpdateInsightsConfigRequest, ::Hash]
493
+ # A request object representing the call parameters. Required. To specify no
494
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
495
+ # @param options [::Gapic::CallOptions, ::Hash]
496
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
497
+ #
498
+ # @overload update_insights_config(insights_config: nil, request_id: nil, allow_missing: nil, validate_only: nil)
499
+ # Pass arguments to `update_insights_config` via keyword arguments. Note that at
500
+ # least one keyword argument is required. To specify no parameters, or to keep all
501
+ # the default parameter values, pass an empty Hash as a request object (see above).
502
+ #
503
+ # @param insights_config [::Google::Cloud::Developerconnect::V1::InsightsConfig, ::Hash]
504
+ # Required. The resource being updated.
505
+ # @param request_id [::String]
506
+ # Optional. An optional request ID to identify requests. Specify a unique
507
+ # request ID so that if you must retry your request, the server will know to
508
+ # ignore the request if it has already been completed. The server will
509
+ # guarantee that for at least 60 minutes after the first request.
510
+ #
511
+ # For example, consider a situation where you make an initial request and the
512
+ # request times out. If you make the request again with the same request
513
+ # ID, the server can check if original operation with the same request ID
514
+ # was received, and if so, will ignore the second request. This prevents
515
+ # clients from accidentally creating duplicate commitments.
516
+ #
517
+ # The request ID must be a valid UUID with the exception that zero UUID is
518
+ # not supported (00000000-0000-0000-0000-000000000000).
519
+ # @param allow_missing [::Boolean]
520
+ # Optional. If set to true, and the insightsConfig is not found a new
521
+ # insightsConfig will be created. In this situation `update_mask` is ignored.
522
+ # The creation will succeed only if the input insightsConfig has all the
523
+ # necessary information (e.g a github_config with both user_oauth_token and
524
+ # installation_id properties).
525
+ # @param validate_only [::Boolean]
526
+ # Optional. If set, validate the request, but do not actually post it.
527
+ # @yield [result, operation] Access the result along with the TransportOperation object
528
+ # @yieldparam result [::Gapic::Operation]
529
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
530
+ #
531
+ # @return [::Gapic::Operation]
532
+ #
533
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
534
+ #
535
+ # @example Basic example
536
+ # require "google/cloud/developer_connect/v1"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Cloud::Developerconnect::V1::UpdateInsightsConfigRequest.new
543
+ #
544
+ # # Call the update_insights_config method.
545
+ # result = client.update_insights_config request
546
+ #
547
+ # # The returned object is of type Gapic::Operation. You can use it to
548
+ # # check the status of an operation, cancel it, or wait for results.
549
+ # # Here is how to wait for a response.
550
+ # result.wait_until_done! timeout: 60
551
+ # if result.response?
552
+ # p result.response
553
+ # else
554
+ # puts "No response received."
555
+ # end
556
+ #
557
+ def update_insights_config request, options = nil
558
+ raise ::ArgumentError, "request must be provided" if request.nil?
559
+
560
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Developerconnect::V1::UpdateInsightsConfigRequest
561
+
562
+ # Converts hash and nil to an options object
563
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
564
+
565
+ # Customize the options with defaults
566
+ call_metadata = @config.rpcs.update_insights_config.metadata.to_h
567
+
568
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
569
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
570
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
571
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
572
+ transports_version_send: [:rest]
573
+
574
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
575
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
576
+
577
+ options.apply_defaults timeout: @config.rpcs.update_insights_config.timeout,
578
+ metadata: call_metadata,
579
+ retry_policy: @config.rpcs.update_insights_config.retry_policy
580
+
581
+ options.apply_defaults timeout: @config.timeout,
582
+ metadata: @config.metadata,
583
+ retry_policy: @config.retry_policy
584
+
585
+ @insights_config_service_stub.update_insights_config request, options do |result, operation|
586
+ result = ::Gapic::Operation.new result, @operations_client, options: options
587
+ yield result, operation if block_given?
588
+ throw :response, result
589
+ end
590
+ rescue ::Gapic::Rest::Error => e
591
+ raise ::Google::Cloud::Error.from_error(e)
592
+ end
593
+
594
+ ##
595
+ # Delete a single Insight.
596
+ #
597
+ # @overload delete_insights_config(request, options = nil)
598
+ # Pass arguments to `delete_insights_config` via a request object, either of type
599
+ # {::Google::Cloud::Developerconnect::V1::DeleteInsightsConfigRequest} or an equivalent Hash.
600
+ #
601
+ # @param request [::Google::Cloud::Developerconnect::V1::DeleteInsightsConfigRequest, ::Hash]
602
+ # A request object representing the call parameters. Required. To specify no
603
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
604
+ # @param options [::Gapic::CallOptions, ::Hash]
605
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
606
+ #
607
+ # @overload delete_insights_config(name: nil, request_id: nil, validate_only: nil, etag: nil)
608
+ # Pass arguments to `delete_insights_config` via keyword arguments. Note that at
609
+ # least one keyword argument is required. To specify no parameters, or to keep all
610
+ # the default parameter values, pass an empty Hash as a request object (see above).
611
+ #
612
+ # @param name [::String]
613
+ # Required. Value for parent.
614
+ # @param request_id [::String]
615
+ # Optional. An optional request ID to identify requests. Specify a unique
616
+ # request ID so that if you must retry your request, the server will know to
617
+ # ignore the request if it has already been completed. The server will
618
+ # guarantee that for at least 60 minutes after the first request.
619
+ #
620
+ # For example, consider a situation where you make an initial request and the
621
+ # request times out. If you make the request again with the same request
622
+ # ID, the server can check if original operation with the same request ID
623
+ # was received, and if so, will ignore the second request. This prevents
624
+ # clients from accidentally creating duplicate commitments.
625
+ #
626
+ # The request ID must be a valid UUID with the exception that zero UUID is
627
+ # not supported (00000000-0000-0000-0000-000000000000).
628
+ # @param validate_only [::Boolean]
629
+ # Optional. If set, validate the request, but do not actually post it.
630
+ # @param etag [::String]
631
+ # Optional. This checksum is computed by the server based on the value of
632
+ # other fields, and may be sent on update and delete requests to ensure the
633
+ # client has an up-to-date value before proceeding.
634
+ # @yield [result, operation] Access the result along with the TransportOperation object
635
+ # @yieldparam result [::Gapic::Operation]
636
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
637
+ #
638
+ # @return [::Gapic::Operation]
639
+ #
640
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
641
+ #
642
+ # @example Basic example
643
+ # require "google/cloud/developer_connect/v1"
644
+ #
645
+ # # Create a client object. The client can be reused for multiple calls.
646
+ # client = Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new
647
+ #
648
+ # # Create a request. To set request fields, pass in keyword arguments.
649
+ # request = Google::Cloud::Developerconnect::V1::DeleteInsightsConfigRequest.new
650
+ #
651
+ # # Call the delete_insights_config method.
652
+ # result = client.delete_insights_config request
653
+ #
654
+ # # The returned object is of type Gapic::Operation. You can use it to
655
+ # # check the status of an operation, cancel it, or wait for results.
656
+ # # Here is how to wait for a response.
657
+ # result.wait_until_done! timeout: 60
658
+ # if result.response?
659
+ # p result.response
660
+ # else
661
+ # puts "No response received."
662
+ # end
663
+ #
664
+ def delete_insights_config request, options = nil
665
+ raise ::ArgumentError, "request must be provided" if request.nil?
666
+
667
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Developerconnect::V1::DeleteInsightsConfigRequest
668
+
669
+ # Converts hash and nil to an options object
670
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
671
+
672
+ # Customize the options with defaults
673
+ call_metadata = @config.rpcs.delete_insights_config.metadata.to_h
674
+
675
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
676
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
677
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
678
+ gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
679
+ transports_version_send: [:rest]
680
+
681
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
682
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
683
+
684
+ options.apply_defaults timeout: @config.rpcs.delete_insights_config.timeout,
685
+ metadata: call_metadata,
686
+ retry_policy: @config.rpcs.delete_insights_config.retry_policy
687
+
688
+ options.apply_defaults timeout: @config.timeout,
689
+ metadata: @config.metadata,
690
+ retry_policy: @config.retry_policy
691
+
692
+ @insights_config_service_stub.delete_insights_config request, options do |result, operation|
693
+ result = ::Gapic::Operation.new result, @operations_client, options: options
694
+ yield result, operation if block_given?
695
+ throw :response, result
696
+ end
697
+ rescue ::Gapic::Rest::Error => e
698
+ raise ::Google::Cloud::Error.from_error(e)
699
+ end
700
+
701
+ ##
702
+ # Configuration class for the InsightsConfigService REST API.
703
+ #
704
+ # This class represents the configuration for InsightsConfigService REST,
705
+ # providing control over timeouts, retry behavior, logging, transport
706
+ # parameters, and other low-level controls. Certain parameters can also be
707
+ # applied individually to specific RPCs. See
708
+ # {::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client::Configuration::Rpcs}
709
+ # for a list of RPCs that can be configured independently.
710
+ #
711
+ # Configuration can be applied globally to all clients, or to a single client
712
+ # on construction.
713
+ #
714
+ # @example
715
+ #
716
+ # # Modify the global config, setting the timeout for
717
+ # # list_insights_configs to 20 seconds,
718
+ # # and all remaining timeouts to 10 seconds.
719
+ # ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.configure do |config|
720
+ # config.timeout = 10.0
721
+ # config.rpcs.list_insights_configs.timeout = 20.0
722
+ # end
723
+ #
724
+ # # Apply the above configuration only to a new client.
725
+ # client = ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.new do |config|
726
+ # config.timeout = 10.0
727
+ # config.rpcs.list_insights_configs.timeout = 20.0
728
+ # end
729
+ #
730
+ # @!attribute [rw] endpoint
731
+ # A custom service endpoint, as a hostname or hostname:port. The default is
732
+ # nil, indicating to use the default endpoint in the current universe domain.
733
+ # @return [::String,nil]
734
+ # @!attribute [rw] credentials
735
+ # Credentials to send with calls. You may provide any of the following types:
736
+ # * (`String`) The path to a service account key file in JSON format
737
+ # * (`Hash`) A service account key as a Hash
738
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
739
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
740
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
741
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
742
+ # * (`nil`) indicating no credentials
743
+ #
744
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
745
+ # external source for authentication to Google Cloud, you must validate it before
746
+ # providing it to a Google API client library. Providing an unvalidated credential
747
+ # configuration to Google APIs can compromise the security of your systems and data.
748
+ # For more information, refer to [Validate credential configurations from external
749
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
750
+ # @return [::Object]
751
+ # @!attribute [rw] scope
752
+ # The OAuth scopes
753
+ # @return [::Array<::String>]
754
+ # @!attribute [rw] lib_name
755
+ # The library name as recorded in instrumentation and logging
756
+ # @return [::String]
757
+ # @!attribute [rw] lib_version
758
+ # The library version as recorded in instrumentation and logging
759
+ # @return [::String]
760
+ # @!attribute [rw] timeout
761
+ # The call timeout in seconds.
762
+ # @return [::Numeric]
763
+ # @!attribute [rw] metadata
764
+ # Additional headers to be sent with the call.
765
+ # @return [::Hash{::Symbol=>::String}]
766
+ # @!attribute [rw] retry_policy
767
+ # The retry policy. The value is a hash with the following keys:
768
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
769
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
770
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
771
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
772
+ # trigger a retry.
773
+ # @return [::Hash]
774
+ # @!attribute [rw] quota_project
775
+ # A separate project against which to charge quota.
776
+ # @return [::String]
777
+ # @!attribute [rw] universe_domain
778
+ # The universe domain within which to make requests. This determines the
779
+ # default endpoint URL. The default value of nil uses the environment
780
+ # universe (usually the default "googleapis.com" universe).
781
+ # @return [::String,nil]
782
+ # @!attribute [rw] logger
783
+ # A custom logger to use for request/response debug logging, or the value
784
+ # `:default` (the default) to construct a default logger, or `nil` to
785
+ # explicitly disable logging.
786
+ # @return [::Logger,:default,nil]
787
+ #
788
+ class Configuration
789
+ extend ::Gapic::Config
790
+
791
+ # @private
792
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
793
+ DEFAULT_ENDPOINT = "developerconnect.googleapis.com"
794
+
795
+ config_attr :endpoint, nil, ::String, nil
796
+ config_attr :credentials, nil do |value|
797
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
798
+ allowed.any? { |klass| klass === value }
799
+ end
800
+ config_attr :scope, nil, ::String, ::Array, nil
801
+ config_attr :lib_name, nil, ::String, nil
802
+ config_attr :lib_version, nil, ::String, nil
803
+ config_attr :timeout, nil, ::Numeric, nil
804
+ config_attr :metadata, nil, ::Hash, nil
805
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
806
+ config_attr :quota_project, nil, ::String, nil
807
+ config_attr :universe_domain, nil, ::String, nil
808
+
809
+ # @private
810
+ # Overrides for http bindings for the RPCs of this service
811
+ # are only used when this service is used as mixin, and only
812
+ # by the host service.
813
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
814
+ config_attr :bindings_override, {}, ::Hash, nil
815
+ config_attr :logger, :default, ::Logger, nil, :default
816
+
817
+ # @private
818
+ def initialize parent_config = nil
819
+ @parent_config = parent_config unless parent_config.nil?
820
+
821
+ yield self if block_given?
822
+ end
823
+
824
+ ##
825
+ # Configurations for individual RPCs
826
+ # @return [Rpcs]
827
+ #
828
+ def rpcs
829
+ @rpcs ||= begin
830
+ parent_rpcs = nil
831
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
832
+ Rpcs.new parent_rpcs
833
+ end
834
+ end
835
+
836
+ ##
837
+ # Configuration RPC class for the InsightsConfigService API.
838
+ #
839
+ # Includes fields providing the configuration for each RPC in this service.
840
+ # Each configuration object is of type `Gapic::Config::Method` and includes
841
+ # the following configuration fields:
842
+ #
843
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
844
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
845
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
846
+ # include the following keys:
847
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
848
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
849
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
850
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
851
+ # trigger a retry.
852
+ #
853
+ class Rpcs
854
+ ##
855
+ # RPC-specific configuration for `list_insights_configs`
856
+ # @return [::Gapic::Config::Method]
857
+ #
858
+ attr_reader :list_insights_configs
859
+ ##
860
+ # RPC-specific configuration for `create_insights_config`
861
+ # @return [::Gapic::Config::Method]
862
+ #
863
+ attr_reader :create_insights_config
864
+ ##
865
+ # RPC-specific configuration for `get_insights_config`
866
+ # @return [::Gapic::Config::Method]
867
+ #
868
+ attr_reader :get_insights_config
869
+ ##
870
+ # RPC-specific configuration for `update_insights_config`
871
+ # @return [::Gapic::Config::Method]
872
+ #
873
+ attr_reader :update_insights_config
874
+ ##
875
+ # RPC-specific configuration for `delete_insights_config`
876
+ # @return [::Gapic::Config::Method]
877
+ #
878
+ attr_reader :delete_insights_config
879
+
880
+ # @private
881
+ def initialize parent_rpcs = nil
882
+ list_insights_configs_config = parent_rpcs.list_insights_configs if parent_rpcs.respond_to? :list_insights_configs
883
+ @list_insights_configs = ::Gapic::Config::Method.new list_insights_configs_config
884
+ create_insights_config_config = parent_rpcs.create_insights_config if parent_rpcs.respond_to? :create_insights_config
885
+ @create_insights_config = ::Gapic::Config::Method.new create_insights_config_config
886
+ get_insights_config_config = parent_rpcs.get_insights_config if parent_rpcs.respond_to? :get_insights_config
887
+ @get_insights_config = ::Gapic::Config::Method.new get_insights_config_config
888
+ update_insights_config_config = parent_rpcs.update_insights_config if parent_rpcs.respond_to? :update_insights_config
889
+ @update_insights_config = ::Gapic::Config::Method.new update_insights_config_config
890
+ delete_insights_config_config = parent_rpcs.delete_insights_config if parent_rpcs.respond_to? :delete_insights_config
891
+ @delete_insights_config = ::Gapic::Config::Method.new delete_insights_config_config
892
+
893
+ yield self if block_given?
894
+ end
895
+ end
896
+ end
897
+ end
898
+ end
899
+ end
900
+ end
901
+ end
902
+ end
903
+ end