google-cloud-backupdr-v1 1.5.0 → 1.7.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.
@@ -0,0 +1,489 @@
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/backupdr/v1/protection_summary_pb"
21
+ require "google/cloud/backupdr/v1/backup_dr_protection_summary/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module BackupDR
28
+ module V1
29
+ module BackupDrProtectionSummary
30
+ module Rest
31
+ ##
32
+ # REST client for the BackupDrProtectionSummary service.
33
+ #
34
+ # The Protection Summary service.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :backup_dr_protection_summary_stub
47
+
48
+ ##
49
+ # Configure the BackupDrProtectionSummary Client class.
50
+ #
51
+ # See {::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all BackupDrProtectionSummary clients
57
+ # ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::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", "BackupDR", "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.rpcs.list_resource_backup_configs.timeout = 60.0
78
+ default_config.rpcs.list_resource_backup_configs.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the BackupDrProtectionSummary Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @backup_dr_protection_summary_stub.universe_domain
115
+ end
116
+
117
+ ##
118
+ # Create a new BackupDrProtectionSummary REST client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the BackupDrProtectionSummary client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
147
+ credentials ||= Credentials.default scope: @config.scope,
148
+ enable_self_signed_jwt: enable_self_signed_jwt
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
150
+ credentials = Credentials.new credentials, scope: @config.scope
151
+ end
152
+
153
+ @quota_project_id = @config.quota_project
154
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
155
+
156
+ @backup_dr_protection_summary_stub = ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials,
161
+ logger: @config.logger
162
+ )
163
+
164
+ @backup_dr_protection_summary_stub.logger(stub: true)&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+
174
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @backup_dr_protection_summary_stub.endpoint
178
+ config.universe_domain = @backup_dr_protection_summary_stub.universe_domain
179
+ config.bindings_override = @config.bindings_override
180
+ config.logger = @backup_dr_protection_summary_stub.logger if config.respond_to? :logger=
181
+ end
182
+
183
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @backup_dr_protection_summary_stub.endpoint
187
+ config.universe_domain = @backup_dr_protection_summary_stub.universe_domain
188
+ config.bindings_override = @config.bindings_override
189
+ config.logger = @backup_dr_protection_summary_stub.logger if config.respond_to? :logger=
190
+ end
191
+ end
192
+
193
+ ##
194
+ # Get the associated client for mix-in of the Locations.
195
+ #
196
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
197
+ #
198
+ attr_reader :location_client
199
+
200
+ ##
201
+ # Get the associated client for mix-in of the IAMPolicy.
202
+ #
203
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
204
+ #
205
+ attr_reader :iam_policy_client
206
+
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @backup_dr_protection_summary_stub.logger
214
+ end
215
+
216
+ # Service calls
217
+
218
+ ##
219
+ # Lists ResourceBackupConfigs.
220
+ #
221
+ # @overload list_resource_backup_configs(request, options = nil)
222
+ # Pass arguments to `list_resource_backup_configs` via a request object, either of type
223
+ # {::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest} or an equivalent Hash.
224
+ #
225
+ # @param request [::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest, ::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_resource_backup_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
232
+ # Pass arguments to `list_resource_backup_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. The project and location for which to retrieve resource backup
238
+ # configs. Format: 'projects/\\{project_id}/locations/\\{location}'. In Google
239
+ # Cloud Backup and DR, locations map to Google Cloud regions, for example
240
+ # **us-central1**.
241
+ # @param page_size [::Integer]
242
+ # Optional. Requested page size. Server may return fewer items than
243
+ # requested. If unspecified, server will use 100 as default. Maximum value is
244
+ # 500 and values above 500 will be coerced to 500.
245
+ # @param page_token [::String]
246
+ # Optional. A token identifying a page of results the server should return.
247
+ # @param filter [::String]
248
+ # Optional. Filtering results.
249
+ # @param order_by [::String]
250
+ # Optional. Hint for how to order the results.
251
+ # @yield [result, operation] Access the result along with the TransportOperation object
252
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ResourceBackupConfig>]
253
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
254
+ #
255
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ResourceBackupConfig>]
256
+ #
257
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
258
+ #
259
+ # @example Basic example
260
+ # require "google/cloud/backupdr/v1"
261
+ #
262
+ # # Create a client object. The client can be reused for multiple calls.
263
+ # client = Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.new
264
+ #
265
+ # # Create a request. To set request fields, pass in keyword arguments.
266
+ # request = Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest.new
267
+ #
268
+ # # Call the list_resource_backup_configs method.
269
+ # result = client.list_resource_backup_configs request
270
+ #
271
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
272
+ # # over elements, and API calls will be issued to fetch pages as needed.
273
+ # result.each do |item|
274
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::ResourceBackupConfig.
275
+ # p item
276
+ # end
277
+ #
278
+ def list_resource_backup_configs request, options = nil
279
+ raise ::ArgumentError, "request must be provided" if request.nil?
280
+
281
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest
282
+
283
+ # Converts hash and nil to an options object
284
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
285
+
286
+ # Customize the options with defaults
287
+ call_metadata = @config.rpcs.list_resource_backup_configs.metadata.to_h
288
+
289
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
290
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
291
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
292
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
293
+ transports_version_send: [:rest]
294
+
295
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
296
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
297
+
298
+ options.apply_defaults timeout: @config.rpcs.list_resource_backup_configs.timeout,
299
+ metadata: call_metadata,
300
+ retry_policy: @config.rpcs.list_resource_backup_configs.retry_policy
301
+
302
+ options.apply_defaults timeout: @config.timeout,
303
+ metadata: @config.metadata,
304
+ retry_policy: @config.retry_policy
305
+
306
+ @backup_dr_protection_summary_stub.list_resource_backup_configs request, options do |result, operation|
307
+ result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_protection_summary_stub, :list_resource_backup_configs, "resource_backup_configs", request, result, options
308
+ yield result, operation if block_given?
309
+ throw :response, result
310
+ end
311
+ rescue ::Gapic::Rest::Error => e
312
+ raise ::Google::Cloud::Error.from_error(e)
313
+ end
314
+
315
+ ##
316
+ # Configuration class for the BackupDrProtectionSummary REST API.
317
+ #
318
+ # This class represents the configuration for BackupDrProtectionSummary REST,
319
+ # providing control over timeouts, retry behavior, logging, transport
320
+ # parameters, and other low-level controls. Certain parameters can also be
321
+ # applied individually to specific RPCs. See
322
+ # {::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client::Configuration::Rpcs}
323
+ # for a list of RPCs that can be configured independently.
324
+ #
325
+ # Configuration can be applied globally to all clients, or to a single client
326
+ # on construction.
327
+ #
328
+ # @example
329
+ #
330
+ # # Modify the global config, setting the timeout for
331
+ # # list_resource_backup_configs to 20 seconds,
332
+ # # and all remaining timeouts to 10 seconds.
333
+ # ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.configure do |config|
334
+ # config.timeout = 10.0
335
+ # config.rpcs.list_resource_backup_configs.timeout = 20.0
336
+ # end
337
+ #
338
+ # # Apply the above configuration only to a new client.
339
+ # client = ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.new do |config|
340
+ # config.timeout = 10.0
341
+ # config.rpcs.list_resource_backup_configs.timeout = 20.0
342
+ # end
343
+ #
344
+ # @!attribute [rw] endpoint
345
+ # A custom service endpoint, as a hostname or hostname:port. The default is
346
+ # nil, indicating to use the default endpoint in the current universe domain.
347
+ # @return [::String,nil]
348
+ # @!attribute [rw] credentials
349
+ # Credentials to send with calls. You may provide any of the following types:
350
+ # * (`String`) The path to a service account key file in JSON format
351
+ # * (`Hash`) A service account key as a Hash
352
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
353
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
354
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
355
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
356
+ # * (`nil`) indicating no credentials
357
+ #
358
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
359
+ # external source for authentication to Google Cloud, you must validate it before
360
+ # providing it to a Google API client library. Providing an unvalidated credential
361
+ # configuration to Google APIs can compromise the security of your systems and data.
362
+ # For more information, refer to [Validate credential configurations from external
363
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
364
+ # @return [::Object]
365
+ # @!attribute [rw] scope
366
+ # The OAuth scopes
367
+ # @return [::Array<::String>]
368
+ # @!attribute [rw] lib_name
369
+ # The library name as recorded in instrumentation and logging
370
+ # @return [::String]
371
+ # @!attribute [rw] lib_version
372
+ # The library version as recorded in instrumentation and logging
373
+ # @return [::String]
374
+ # @!attribute [rw] timeout
375
+ # The call timeout in seconds.
376
+ # @return [::Numeric]
377
+ # @!attribute [rw] metadata
378
+ # Additional headers to be sent with the call.
379
+ # @return [::Hash{::Symbol=>::String}]
380
+ # @!attribute [rw] retry_policy
381
+ # The retry policy. The value is a hash with the following keys:
382
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
383
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
384
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
385
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
386
+ # trigger a retry.
387
+ # @return [::Hash]
388
+ # @!attribute [rw] quota_project
389
+ # A separate project against which to charge quota.
390
+ # @return [::String]
391
+ # @!attribute [rw] universe_domain
392
+ # The universe domain within which to make requests. This determines the
393
+ # default endpoint URL. The default value of nil uses the environment
394
+ # universe (usually the default "googleapis.com" universe).
395
+ # @return [::String,nil]
396
+ # @!attribute [rw] logger
397
+ # A custom logger to use for request/response debug logging, or the value
398
+ # `:default` (the default) to construct a default logger, or `nil` to
399
+ # explicitly disable logging.
400
+ # @return [::Logger,:default,nil]
401
+ #
402
+ class Configuration
403
+ extend ::Gapic::Config
404
+
405
+ # @private
406
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
407
+ DEFAULT_ENDPOINT = "backupdr.googleapis.com"
408
+
409
+ config_attr :endpoint, nil, ::String, nil
410
+ config_attr :credentials, nil do |value|
411
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
412
+ allowed.any? { |klass| klass === value }
413
+ end
414
+ config_attr :scope, nil, ::String, ::Array, nil
415
+ config_attr :lib_name, nil, ::String, nil
416
+ config_attr :lib_version, nil, ::String, nil
417
+ config_attr :timeout, nil, ::Numeric, nil
418
+ config_attr :metadata, nil, ::Hash, nil
419
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
420
+ config_attr :quota_project, nil, ::String, nil
421
+ config_attr :universe_domain, nil, ::String, nil
422
+
423
+ # @private
424
+ # Overrides for http bindings for the RPCs of this service
425
+ # are only used when this service is used as mixin, and only
426
+ # by the host service.
427
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
428
+ config_attr :bindings_override, {}, ::Hash, nil
429
+ config_attr :logger, :default, ::Logger, nil, :default
430
+
431
+ # @private
432
+ def initialize parent_config = nil
433
+ @parent_config = parent_config unless parent_config.nil?
434
+
435
+ yield self if block_given?
436
+ end
437
+
438
+ ##
439
+ # Configurations for individual RPCs
440
+ # @return [Rpcs]
441
+ #
442
+ def rpcs
443
+ @rpcs ||= begin
444
+ parent_rpcs = nil
445
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
446
+ Rpcs.new parent_rpcs
447
+ end
448
+ end
449
+
450
+ ##
451
+ # Configuration RPC class for the BackupDrProtectionSummary API.
452
+ #
453
+ # Includes fields providing the configuration for each RPC in this service.
454
+ # Each configuration object is of type `Gapic::Config::Method` and includes
455
+ # the following configuration fields:
456
+ #
457
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
458
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
459
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
460
+ # include the following keys:
461
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
462
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
463
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
464
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
465
+ # trigger a retry.
466
+ #
467
+ class Rpcs
468
+ ##
469
+ # RPC-specific configuration for `list_resource_backup_configs`
470
+ # @return [::Gapic::Config::Method]
471
+ #
472
+ attr_reader :list_resource_backup_configs
473
+
474
+ # @private
475
+ def initialize parent_rpcs = nil
476
+ list_resource_backup_configs_config = parent_rpcs.list_resource_backup_configs if parent_rpcs.respond_to? :list_resource_backup_configs
477
+ @list_resource_backup_configs = ::Gapic::Config::Method.new list_resource_backup_configs_config
478
+
479
+ yield self if block_given?
480
+ end
481
+ end
482
+ end
483
+ end
484
+ end
485
+ end
486
+ end
487
+ end
488
+ end
489
+ end
@@ -0,0 +1,142 @@
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/backupdr/v1/protection_summary_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module BackupDR
24
+ module V1
25
+ module BackupDrProtectionSummary
26
+ module Rest
27
+ ##
28
+ # REST service stub for the BackupDrProtectionSummary service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the list_resource_backup_configs REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsResponse]
89
+ # A result object deserialized from the server's reply
90
+ def list_resource_backup_configs request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_backup_configs_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_resource_backup_configs",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the list_resource_backup_configs REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::BackupDR::V1::ListResourceBackupConfigsRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_list_resource_backup_configs_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :get,
129
+ uri_template: "/v1/{parent}/resourceBackupConfigs",
130
+ matches: [
131
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
132
+ ]
133
+ )
134
+ transcoder.transcode request_pb
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,53 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/backupdr/v1/version"
24
+ require "google/cloud/backupdr/v1/bindings_override"
25
+
26
+ require "google/cloud/backupdr/v1/backup_dr_protection_summary/credentials"
27
+ require "google/cloud/backupdr/v1/backup_dr_protection_summary/paths"
28
+ require "google/cloud/backupdr/v1/backup_dr_protection_summary/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module BackupDR
33
+ module V1
34
+ ##
35
+ # The Protection Summary service.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/backupdr/v1/backup_dr_protection_summary/rest"
40
+ # client = ::Google::Cloud::BackupDR::V1::BackupDrProtectionSummary::Rest::Client.new
41
+ #
42
+ module BackupDrProtectionSummary
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/backupdr/v1/backup_dr_protection_summary/rest/helpers" if ::File.file? helper_path