google-cloud-maintenance-api-v1 0.a → 0.1.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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/maintenance/api/v1/bindings_override.rb +77 -0
  6. data/lib/google/cloud/maintenance/api/v1/maintenance/client.rb +712 -0
  7. data/lib/google/cloud/maintenance/api/v1/maintenance/credentials.rb +49 -0
  8. data/lib/google/cloud/maintenance/api/v1/maintenance/paths.rb +71 -0
  9. data/lib/google/cloud/maintenance/api/v1/maintenance/rest/client.rb +656 -0
  10. data/lib/google/cloud/maintenance/api/v1/maintenance/rest/service_stub.rb +266 -0
  11. data/lib/google/cloud/maintenance/api/v1/maintenance/rest.rb +55 -0
  12. data/lib/google/cloud/maintenance/api/v1/maintenance.rb +57 -0
  13. data/lib/google/cloud/maintenance/api/v1/maintenance_service_pb.rb +66 -0
  14. data/lib/google/cloud/maintenance/api/v1/maintenance_service_services_pb.rb +51 -0
  15. data/lib/google/cloud/maintenance/api/v1/rest.rb +40 -0
  16. data/lib/google/cloud/maintenance/api/v1/version.rb +7 -2
  17. data/lib/google/cloud/maintenance/api/v1.rb +47 -0
  18. data/lib/google-cloud-maintenance-api-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/client.rb +473 -0
  21. data/proto_docs/google/api/field_behavior.rb +85 -0
  22. data/proto_docs/google/api/field_info.rb +88 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +227 -0
  25. data/proto_docs/google/cloud/maintenance/api/v1/maintenance_service.rb +411 -0
  26. data/proto_docs/google/protobuf/any.rb +145 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  29. metadata +81 -9
@@ -0,0 +1,656 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/maintenance/api/v1/maintenance_service_pb"
21
+ require "google/cloud/maintenance/api/v1/maintenance/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Maintenance
27
+ module Api
28
+ module V1
29
+ module Maintenance
30
+ module Rest
31
+ ##
32
+ # REST client for the Maintenance service.
33
+ #
34
+ # Unified Maintenance service
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "maintenance.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :maintenance_stub
47
+
48
+ ##
49
+ # Configure the Maintenance Client class.
50
+ #
51
+ # See {::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all Maintenance clients
57
+ # ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "Maintenance", "Api", "V1"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the Maintenance Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @maintenance_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new Maintenance REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the Maintenance client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @maintenance_stub = ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::ServiceStub.new(
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
155
+ credentials: credentials,
156
+ logger: @config.logger
157
+ )
158
+
159
+ @maintenance_stub.logger(stub: true)&.info do |entry|
160
+ entry.set_system_name
161
+ entry.set_service
162
+ entry.message = "Created client for #{entry.service}"
163
+ entry.set_credentials_fields credentials
164
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
165
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
166
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
167
+ end
168
+
169
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
+ config.credentials = credentials
171
+ config.quota_project = @quota_project_id
172
+ config.endpoint = @maintenance_stub.endpoint
173
+ config.universe_domain = @maintenance_stub.universe_domain
174
+ config.bindings_override = @config.bindings_override
175
+ config.logger = @maintenance_stub.logger if config.respond_to? :logger=
176
+ end
177
+ end
178
+
179
+ ##
180
+ # Get the associated client for mix-in of the Locations.
181
+ #
182
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
183
+ #
184
+ attr_reader :location_client
185
+
186
+ ##
187
+ # The logger used for request/response debug logging.
188
+ #
189
+ # @return [Logger]
190
+ #
191
+ def logger
192
+ @maintenance_stub.logger
193
+ end
194
+
195
+ # Service calls
196
+
197
+ ##
198
+ # Retrieves the statistics of a specific maintenance.
199
+ #
200
+ # @overload summarize_maintenances(request, options = nil)
201
+ # Pass arguments to `summarize_maintenances` via a request object, either of type
202
+ # {::Google::Cloud::Maintenance::Api::V1::SummarizeMaintenancesRequest} or an equivalent Hash.
203
+ #
204
+ # @param request [::Google::Cloud::Maintenance::Api::V1::SummarizeMaintenancesRequest, ::Hash]
205
+ # A request object representing the call parameters. Required. To specify no
206
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
207
+ # @param options [::Gapic::CallOptions, ::Hash]
208
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
209
+ #
210
+ # @overload summarize_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
211
+ # Pass arguments to `summarize_maintenances` via keyword arguments. Note that at
212
+ # least one keyword argument is required. To specify no parameters, or to keep all
213
+ # the default parameter values, pass an empty Hash as a request object (see above).
214
+ #
215
+ # @param parent [::String]
216
+ # Required. The parent of the resource maintenance.
217
+ # eg. `projects/123/locations/*`
218
+ # @param page_size [::Integer]
219
+ # The maximum number of resource maintenances to send per page. The default
220
+ # page size is 20 and the maximum is 1000.
221
+ # @param page_token [::String]
222
+ # The page token: If the next_page_token from a previous response
223
+ # is provided, this request will send the subsequent page.
224
+ # @param filter [::String]
225
+ # Filter the list as specified in https://google.aip.dev/160.
226
+ # Supported fields include:
227
+ # - `maintenance.maintenanceName`
228
+ # Examples:
229
+ # - `maintenance.maintenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1"`
230
+ # @param order_by [::String]
231
+ # Order results as specified in https://google.aip.dev/132.
232
+ # @yield [result, operation] Access the result along with the TransportOperation object
233
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary>]
234
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
235
+ #
236
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary>]
237
+ #
238
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
239
+ #
240
+ # @example Basic example
241
+ # require "google/cloud/maintenance/api/v1"
242
+ #
243
+ # # Create a client object. The client can be reused for multiple calls.
244
+ # client = Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new
245
+ #
246
+ # # Create a request. To set request fields, pass in keyword arguments.
247
+ # request = Google::Cloud::Maintenance::Api::V1::SummarizeMaintenancesRequest.new
248
+ #
249
+ # # Call the summarize_maintenances method.
250
+ # result = client.summarize_maintenances request
251
+ #
252
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
253
+ # # over elements, and API calls will be issued to fetch pages as needed.
254
+ # result.each do |item|
255
+ # # Each element is of type ::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary.
256
+ # p item
257
+ # end
258
+ #
259
+ def summarize_maintenances request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Maintenance::Api::V1::SummarizeMaintenancesRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ call_metadata = @config.rpcs.summarize_maintenances.metadata.to_h
269
+
270
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
271
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::Maintenance::Api::V1::VERSION,
274
+ transports_version_send: [:rest]
275
+
276
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
277
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
278
+
279
+ options.apply_defaults timeout: @config.rpcs.summarize_maintenances.timeout,
280
+ metadata: call_metadata,
281
+ retry_policy: @config.rpcs.summarize_maintenances.retry_policy
282
+
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata,
285
+ retry_policy: @config.retry_policy
286
+
287
+ @maintenance_stub.summarize_maintenances request, options do |result, operation|
288
+ result = ::Gapic::Rest::PagedEnumerable.new @maintenance_stub, :summarize_maintenances, "maintenances", request, result, options
289
+ yield result, operation if block_given?
290
+ throw :response, result
291
+ end
292
+ rescue ::Gapic::Rest::Error => e
293
+ raise ::Google::Cloud::Error.from_error(e)
294
+ end
295
+
296
+ ##
297
+ # Retrieve a collection of resource maintenances.
298
+ #
299
+ # @overload list_resource_maintenances(request, options = nil)
300
+ # Pass arguments to `list_resource_maintenances` via a request object, either of type
301
+ # {::Google::Cloud::Maintenance::Api::V1::ListResourceMaintenancesRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Maintenance::Api::V1::ListResourceMaintenancesRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ #
309
+ # @overload list_resource_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
310
+ # Pass arguments to `list_resource_maintenances` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param parent [::String]
315
+ # Required. The parent of the resource maintenance.
316
+ # @param page_size [::Integer]
317
+ # The maximum number of resource maintenances to send per page.
318
+ # @param page_token [::String]
319
+ # The page token: If the next_page_token from a previous response
320
+ # is provided, this request will send the subsequent page.
321
+ # @param filter [::String]
322
+ # Filter the list as specified in https://google.aip.dev/160.
323
+ # @param order_by [::String]
324
+ # Order results as specified in https://google.aip.dev/132.
325
+ # @yield [result, operation] Access the result along with the TransportOperation object
326
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance>]
327
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
328
+ #
329
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance>]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
332
+ #
333
+ # @example Basic example
334
+ # require "google/cloud/maintenance/api/v1"
335
+ #
336
+ # # Create a client object. The client can be reused for multiple calls.
337
+ # client = Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new
338
+ #
339
+ # # Create a request. To set request fields, pass in keyword arguments.
340
+ # request = Google::Cloud::Maintenance::Api::V1::ListResourceMaintenancesRequest.new
341
+ #
342
+ # # Call the list_resource_maintenances method.
343
+ # result = client.list_resource_maintenances request
344
+ #
345
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
346
+ # # over elements, and API calls will be issued to fetch pages as needed.
347
+ # result.each do |item|
348
+ # # Each element is of type ::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance.
349
+ # p item
350
+ # end
351
+ #
352
+ def list_resource_maintenances request, options = nil
353
+ raise ::ArgumentError, "request must be provided" if request.nil?
354
+
355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Maintenance::Api::V1::ListResourceMaintenancesRequest
356
+
357
+ # Converts hash and nil to an options object
358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
359
+
360
+ # Customize the options with defaults
361
+ call_metadata = @config.rpcs.list_resource_maintenances.metadata.to_h
362
+
363
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
364
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
366
+ gapic_version: ::Google::Cloud::Maintenance::Api::V1::VERSION,
367
+ transports_version_send: [:rest]
368
+
369
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
370
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
+
372
+ options.apply_defaults timeout: @config.rpcs.list_resource_maintenances.timeout,
373
+ metadata: call_metadata,
374
+ retry_policy: @config.rpcs.list_resource_maintenances.retry_policy
375
+
376
+ options.apply_defaults timeout: @config.timeout,
377
+ metadata: @config.metadata,
378
+ retry_policy: @config.retry_policy
379
+
380
+ @maintenance_stub.list_resource_maintenances request, options do |result, operation|
381
+ result = ::Gapic::Rest::PagedEnumerable.new @maintenance_stub, :list_resource_maintenances, "resource_maintenances", request, result, options
382
+ yield result, operation if block_given?
383
+ throw :response, result
384
+ end
385
+ rescue ::Gapic::Rest::Error => e
386
+ raise ::Google::Cloud::Error.from_error(e)
387
+ end
388
+
389
+ ##
390
+ # Retrieve a single resource maintenance.
391
+ #
392
+ # @overload get_resource_maintenance(request, options = nil)
393
+ # Pass arguments to `get_resource_maintenance` via a request object, either of type
394
+ # {::Google::Cloud::Maintenance::Api::V1::GetResourceMaintenanceRequest} or an equivalent Hash.
395
+ #
396
+ # @param request [::Google::Cloud::Maintenance::Api::V1::GetResourceMaintenanceRequest, ::Hash]
397
+ # A request object representing the call parameters. Required. To specify no
398
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
399
+ # @param options [::Gapic::CallOptions, ::Hash]
400
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
401
+ #
402
+ # @overload get_resource_maintenance(name: nil)
403
+ # Pass arguments to `get_resource_maintenance` via keyword arguments. Note that at
404
+ # least one keyword argument is required. To specify no parameters, or to keep all
405
+ # the default parameter values, pass an empty Hash as a request object (see above).
406
+ #
407
+ # @param name [::String]
408
+ # Required. The resource name of the resource within a service.
409
+ # @yield [result, operation] Access the result along with the TransportOperation object
410
+ # @yieldparam result [::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance]
411
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
412
+ #
413
+ # @return [::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance]
414
+ #
415
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
416
+ #
417
+ # @example Basic example
418
+ # require "google/cloud/maintenance/api/v1"
419
+ #
420
+ # # Create a client object. The client can be reused for multiple calls.
421
+ # client = Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new
422
+ #
423
+ # # Create a request. To set request fields, pass in keyword arguments.
424
+ # request = Google::Cloud::Maintenance::Api::V1::GetResourceMaintenanceRequest.new
425
+ #
426
+ # # Call the get_resource_maintenance method.
427
+ # result = client.get_resource_maintenance request
428
+ #
429
+ # # The returned object is of type Google::Cloud::Maintenance::Api::V1::ResourceMaintenance.
430
+ # p result
431
+ #
432
+ def get_resource_maintenance request, options = nil
433
+ raise ::ArgumentError, "request must be provided" if request.nil?
434
+
435
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Maintenance::Api::V1::GetResourceMaintenanceRequest
436
+
437
+ # Converts hash and nil to an options object
438
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
439
+
440
+ # Customize the options with defaults
441
+ call_metadata = @config.rpcs.get_resource_maintenance.metadata.to_h
442
+
443
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
444
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
445
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
446
+ gapic_version: ::Google::Cloud::Maintenance::Api::V1::VERSION,
447
+ transports_version_send: [:rest]
448
+
449
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
450
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
451
+
452
+ options.apply_defaults timeout: @config.rpcs.get_resource_maintenance.timeout,
453
+ metadata: call_metadata,
454
+ retry_policy: @config.rpcs.get_resource_maintenance.retry_policy
455
+
456
+ options.apply_defaults timeout: @config.timeout,
457
+ metadata: @config.metadata,
458
+ retry_policy: @config.retry_policy
459
+
460
+ @maintenance_stub.get_resource_maintenance request, options do |result, operation|
461
+ yield result, operation if block_given?
462
+ end
463
+ rescue ::Gapic::Rest::Error => e
464
+ raise ::Google::Cloud::Error.from_error(e)
465
+ end
466
+
467
+ ##
468
+ # Configuration class for the Maintenance REST API.
469
+ #
470
+ # This class represents the configuration for Maintenance REST,
471
+ # providing control over timeouts, retry behavior, logging, transport
472
+ # parameters, and other low-level controls. Certain parameters can also be
473
+ # applied individually to specific RPCs. See
474
+ # {::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client::Configuration::Rpcs}
475
+ # for a list of RPCs that can be configured independently.
476
+ #
477
+ # Configuration can be applied globally to all clients, or to a single client
478
+ # on construction.
479
+ #
480
+ # @example
481
+ #
482
+ # # Modify the global config, setting the timeout for
483
+ # # summarize_maintenances to 20 seconds,
484
+ # # and all remaining timeouts to 10 seconds.
485
+ # ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.configure do |config|
486
+ # config.timeout = 10.0
487
+ # config.rpcs.summarize_maintenances.timeout = 20.0
488
+ # end
489
+ #
490
+ # # Apply the above configuration only to a new client.
491
+ # client = ::Google::Cloud::Maintenance::Api::V1::Maintenance::Rest::Client.new do |config|
492
+ # config.timeout = 10.0
493
+ # config.rpcs.summarize_maintenances.timeout = 20.0
494
+ # end
495
+ #
496
+ # @!attribute [rw] endpoint
497
+ # A custom service endpoint, as a hostname or hostname:port. The default is
498
+ # nil, indicating to use the default endpoint in the current universe domain.
499
+ # @return [::String,nil]
500
+ # @!attribute [rw] credentials
501
+ # Credentials to send with calls. You may provide any of the following types:
502
+ # * (`String`) The path to a service account key file in JSON format
503
+ # * (`Hash`) A service account key as a Hash
504
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
505
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
506
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
507
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
508
+ # * (`nil`) indicating no credentials
509
+ #
510
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
511
+ # external source for authentication to Google Cloud, you must validate it before
512
+ # providing it to a Google API client library. Providing an unvalidated credential
513
+ # configuration to Google APIs can compromise the security of your systems and data.
514
+ # For more information, refer to [Validate credential configurations from external
515
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
516
+ # @return [::Object]
517
+ # @!attribute [rw] scope
518
+ # The OAuth scopes
519
+ # @return [::Array<::String>]
520
+ # @!attribute [rw] lib_name
521
+ # The library name as recorded in instrumentation and logging
522
+ # @return [::String]
523
+ # @!attribute [rw] lib_version
524
+ # The library version as recorded in instrumentation and logging
525
+ # @return [::String]
526
+ # @!attribute [rw] timeout
527
+ # The call timeout in seconds.
528
+ # @return [::Numeric]
529
+ # @!attribute [rw] metadata
530
+ # Additional headers to be sent with the call.
531
+ # @return [::Hash{::Symbol=>::String}]
532
+ # @!attribute [rw] retry_policy
533
+ # The retry policy. The value is a hash with the following keys:
534
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
535
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
536
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
537
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
538
+ # trigger a retry.
539
+ # @return [::Hash]
540
+ # @!attribute [rw] quota_project
541
+ # A separate project against which to charge quota.
542
+ # @return [::String]
543
+ # @!attribute [rw] universe_domain
544
+ # The universe domain within which to make requests. This determines the
545
+ # default endpoint URL. The default value of nil uses the environment
546
+ # universe (usually the default "googleapis.com" universe).
547
+ # @return [::String,nil]
548
+ # @!attribute [rw] logger
549
+ # A custom logger to use for request/response debug logging, or the value
550
+ # `:default` (the default) to construct a default logger, or `nil` to
551
+ # explicitly disable logging.
552
+ # @return [::Logger,:default,nil]
553
+ #
554
+ class Configuration
555
+ extend ::Gapic::Config
556
+
557
+ # @private
558
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
559
+ DEFAULT_ENDPOINT = "maintenance.googleapis.com"
560
+
561
+ config_attr :endpoint, nil, ::String, nil
562
+ config_attr :credentials, nil do |value|
563
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
564
+ allowed.any? { |klass| klass === value }
565
+ end
566
+ config_attr :scope, nil, ::String, ::Array, nil
567
+ config_attr :lib_name, nil, ::String, nil
568
+ config_attr :lib_version, nil, ::String, nil
569
+ config_attr :timeout, nil, ::Numeric, nil
570
+ config_attr :metadata, nil, ::Hash, nil
571
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
572
+ config_attr :quota_project, nil, ::String, nil
573
+ config_attr :universe_domain, nil, ::String, nil
574
+
575
+ # @private
576
+ # Overrides for http bindings for the RPCs of this service
577
+ # are only used when this service is used as mixin, and only
578
+ # by the host service.
579
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
580
+ config_attr :bindings_override, {}, ::Hash, nil
581
+ config_attr :logger, :default, ::Logger, nil, :default
582
+
583
+ # @private
584
+ def initialize parent_config = nil
585
+ @parent_config = parent_config unless parent_config.nil?
586
+
587
+ yield self if block_given?
588
+ end
589
+
590
+ ##
591
+ # Configurations for individual RPCs
592
+ # @return [Rpcs]
593
+ #
594
+ def rpcs
595
+ @rpcs ||= begin
596
+ parent_rpcs = nil
597
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
598
+ Rpcs.new parent_rpcs
599
+ end
600
+ end
601
+
602
+ ##
603
+ # Configuration RPC class for the Maintenance API.
604
+ #
605
+ # Includes fields providing the configuration for each RPC in this service.
606
+ # Each configuration object is of type `Gapic::Config::Method` and includes
607
+ # the following configuration fields:
608
+ #
609
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
610
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
611
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
612
+ # include the following keys:
613
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
614
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
615
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
616
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
617
+ # trigger a retry.
618
+ #
619
+ class Rpcs
620
+ ##
621
+ # RPC-specific configuration for `summarize_maintenances`
622
+ # @return [::Gapic::Config::Method]
623
+ #
624
+ attr_reader :summarize_maintenances
625
+ ##
626
+ # RPC-specific configuration for `list_resource_maintenances`
627
+ # @return [::Gapic::Config::Method]
628
+ #
629
+ attr_reader :list_resource_maintenances
630
+ ##
631
+ # RPC-specific configuration for `get_resource_maintenance`
632
+ # @return [::Gapic::Config::Method]
633
+ #
634
+ attr_reader :get_resource_maintenance
635
+
636
+ # @private
637
+ def initialize parent_rpcs = nil
638
+ summarize_maintenances_config = parent_rpcs.summarize_maintenances if parent_rpcs.respond_to? :summarize_maintenances
639
+ @summarize_maintenances = ::Gapic::Config::Method.new summarize_maintenances_config
640
+ list_resource_maintenances_config = parent_rpcs.list_resource_maintenances if parent_rpcs.respond_to? :list_resource_maintenances
641
+ @list_resource_maintenances = ::Gapic::Config::Method.new list_resource_maintenances_config
642
+ get_resource_maintenance_config = parent_rpcs.get_resource_maintenance if parent_rpcs.respond_to? :get_resource_maintenance
643
+ @get_resource_maintenance = ::Gapic::Config::Method.new get_resource_maintenance_config
644
+
645
+ yield self if block_given?
646
+ end
647
+ end
648
+ end
649
+ end
650
+ end
651
+ end
652
+ end
653
+ end
654
+ end
655
+ end
656
+ end