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