google-cloud-resource_settings-v1 0.1.0 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4a8cf4f0019a54f850ff4d416598467f5f9f8eb19d2824c8ba354b71154c16a
4
- data.tar.gz: 2fcffd1aeeb5352ba8b37b8f0eead5489ae20f4269634300d55b457e7041b463
3
+ metadata.gz: 0a45502cd027564b1abc9a4277f7f771be7f2bd1856c6795ebf7c07b4391af7f
4
+ data.tar.gz: d1e53914b690e500f0159d093490ffa6365c7a3dd27c5b9731ae78f03a9463f5
5
5
  SHA512:
6
- metadata.gz: 79da9601c3f3bd638526d05804aefabaec678db3258ab6df5e2a3acdd7b69879fb64f416112d325febd63346f245c23b44e331f0a5b816ce9b9e799759255260
7
- data.tar.gz: 23f8b7219e6f6da52205f42f8418f25a48c7fe21b9ced1015bbe41047abd8dde2b784fce4c65e4710b006ab9daab95793741d149e6a005ab6c8f923be526de50
6
+ metadata.gz: 93d1929fb1b0c1d61dd9cb12948c4a75a6c29832f41ae324fc378f8f80b94db3b24b7cba5bad05ad3eb15bd17c16c06afa9755e1347a8a8920c372d0d938e330
7
+ data.tar.gz: fa6af759eb6701e72662ee40e7e84653e7f31b5af62fe8c41e57ca62efc201324ed59ada2cf7920b2409ffdd4e16ab9c5196bb2766d592f0262838e967392fc7
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-resource_settings-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Credentials}):
68
68
 
69
- 1. `RESOURCE_SETTINGS_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `RESOURCE_SETTINGS_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `RESOURCE_SETTINGS_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `RESOURCE_SETTINGS_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/resource_settings/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/resource_settings/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/resource_settings/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/resource_settings/v1"
34
34
 
35
35
  client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::ResourceSettings::V1::ListSettingsRequest.new # (request fields as keyword arguments...)
37
37
  response = client.list_settings request
38
38
  ```
39
39
 
@@ -52,13 +52,12 @@ module Google
52
52
  # See {::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client::Configuration}
53
53
  # for a description of the configuration fields.
54
54
  #
55
- # ## Example
55
+ # @example
56
56
  #
57
- # To modify the configuration for all ResourceSettingsService clients:
58
- #
59
- # ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.configure do |config|
60
- # config.timeout = 10.0
61
- # end
57
+ # # Modify the configuration for all ResourceSettingsService clients
58
+ # ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
62
61
  #
63
62
  # @yield [config] Configure the Client client.
64
63
  # @yieldparam config [Client::Configuration]
@@ -78,10 +77,17 @@ module Google
78
77
 
79
78
  default_config.rpcs.list_settings.timeout = 60.0
80
79
  default_config.rpcs.list_settings.retry_policy = {
81
- initial_delay: 1.0,
82
- max_delay: 10.0,
83
- multiplier: 1.3,
84
- retry_codes: [14, 4]
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
81
+ }
82
+
83
+ default_config.rpcs.get_setting.timeout = 60.0
84
+ default_config.rpcs.get_setting.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
86
+ }
87
+
88
+ default_config.rpcs.update_setting.timeout = 60.0
89
+ default_config.rpcs.update_setting.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
85
91
  }
86
92
 
87
93
  default_config
@@ -113,19 +119,15 @@ module Google
113
119
  ##
114
120
  # Create a new ResourceSettingsService client object.
115
121
  #
116
- # ## Examples
122
+ # @example
117
123
  #
118
- # To create a new ResourceSettingsService client with the default
119
- # configuration:
124
+ # # Create a client using the default configuration
125
+ # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
120
126
  #
121
- # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
122
- #
123
- # To create a new ResourceSettingsService client with a custom
124
- # configuration:
125
- #
126
- # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config|
127
- # config.timeout = 10.0
128
- # end
127
+ # # Create a client using a custom configuration
128
+ # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config|
129
+ # config.timeout = 10.0
130
+ # end
129
131
  #
130
132
  # @yield [config] Configure the ResourceSettingsService client.
131
133
  # @yieldparam config [Client::Configuration]
@@ -145,14 +147,13 @@ module Google
145
147
 
146
148
  # Create credentials
147
149
  credentials = @config.credentials
148
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
150
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
151
  # but only if the default endpoint does not have a region prefix.
150
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
151
- @config.endpoint == Client.configure.endpoint &&
152
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
152
153
  !@config.endpoint.split(".").first.include?("-")
153
154
  credentials ||= Credentials.default scope: @config.scope,
154
155
  enable_self_signed_jwt: enable_self_signed_jwt
155
- if credentials.is_a?(String) || credentials.is_a?(Hash)
156
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
157
  credentials = Credentials.new credentials, scope: @config.scope
157
158
  end
158
159
  @quota_project_id = @config.quota_project
@@ -210,6 +211,27 @@ module Google
210
211
  #
211
212
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
212
213
  #
214
+ # @example Basic example
215
+ # require "google/cloud/resource_settings/v1"
216
+ #
217
+ # # Create a client object. The client can be reused for multiple calls.
218
+ # client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
219
+ #
220
+ # # Create a request. To set request fields, pass in keyword arguments.
221
+ # request = Google::Cloud::ResourceSettings::V1::ListSettingsRequest.new
222
+ #
223
+ # # Call the list_settings method.
224
+ # result = client.list_settings request
225
+ #
226
+ # # The returned object is of type Gapic::PagedEnumerable. You can
227
+ # # iterate over all elements by calling #each, and the enumerable
228
+ # # will lazily make API calls to fetch subsequent pages. Other
229
+ # # methods are also available for managing paging directly.
230
+ # result.each do |response|
231
+ # # Each element is of type ::Google::Cloud::ResourceSettings::V1::Setting.
232
+ # p response
233
+ # end
234
+ #
213
235
  def list_settings request, options = nil
214
236
  raise ::ArgumentError, "request must be provided" if request.nil?
215
237
 
@@ -227,16 +249,20 @@ module Google
227
249
  gapic_version: ::Google::Cloud::ResourceSettings::V1::VERSION
228
250
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
251
 
230
- header_params = {
231
- "parent" => request.parent
232
- }
252
+ header_params = {}
253
+ if request.parent
254
+ header_params["parent"] = request.parent
255
+ end
256
+
233
257
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
234
258
  metadata[:"x-goog-request-params"] ||= request_params_header
235
259
 
236
260
  options.apply_defaults timeout: @config.rpcs.list_settings.timeout,
237
261
  metadata: metadata,
238
262
  retry_policy: @config.rpcs.list_settings.retry_policy
239
- options.apply_defaults metadata: @config.metadata,
263
+
264
+ options.apply_defaults timeout: @config.timeout,
265
+ metadata: @config.metadata,
240
266
  retry_policy: @config.retry_policy
241
267
 
242
268
  @resource_settings_service_stub.call_rpc :list_settings, request, options: options do |response, operation|
@@ -283,6 +309,21 @@ module Google
283
309
  #
284
310
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
311
  #
312
+ # @example Basic example
313
+ # require "google/cloud/resource_settings/v1"
314
+ #
315
+ # # Create a client object. The client can be reused for multiple calls.
316
+ # client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
317
+ #
318
+ # # Create a request. To set request fields, pass in keyword arguments.
319
+ # request = Google::Cloud::ResourceSettings::V1::GetSettingRequest.new
320
+ #
321
+ # # Call the get_setting method.
322
+ # result = client.get_setting request
323
+ #
324
+ # # The returned object is of type Google::Cloud::ResourceSettings::V1::Setting.
325
+ # p result
326
+ #
286
327
  def get_setting request, options = nil
287
328
  raise ::ArgumentError, "request must be provided" if request.nil?
288
329
 
@@ -300,16 +341,20 @@ module Google
300
341
  gapic_version: ::Google::Cloud::ResourceSettings::V1::VERSION
301
342
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
302
343
 
303
- header_params = {
304
- "name" => request.name
305
- }
344
+ header_params = {}
345
+ if request.name
346
+ header_params["name"] = request.name
347
+ end
348
+
306
349
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
307
350
  metadata[:"x-goog-request-params"] ||= request_params_header
308
351
 
309
352
  options.apply_defaults timeout: @config.rpcs.get_setting.timeout,
310
353
  metadata: metadata,
311
354
  retry_policy: @config.rpcs.get_setting.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
355
+
356
+ options.apply_defaults timeout: @config.timeout,
357
+ metadata: @config.metadata,
313
358
  retry_policy: @config.retry_policy
314
359
 
315
360
  @resource_settings_service_stub.call_rpc :get_setting, request, options: options do |response, operation|
@@ -364,6 +409,21 @@ module Google
364
409
  #
365
410
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
411
  #
412
+ # @example Basic example
413
+ # require "google/cloud/resource_settings/v1"
414
+ #
415
+ # # Create a client object. The client can be reused for multiple calls.
416
+ # client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new
417
+ #
418
+ # # Create a request. To set request fields, pass in keyword arguments.
419
+ # request = Google::Cloud::ResourceSettings::V1::UpdateSettingRequest.new
420
+ #
421
+ # # Call the update_setting method.
422
+ # result = client.update_setting request
423
+ #
424
+ # # The returned object is of type Google::Cloud::ResourceSettings::V1::Setting.
425
+ # p result
426
+ #
367
427
  def update_setting request, options = nil
368
428
  raise ::ArgumentError, "request must be provided" if request.nil?
369
429
 
@@ -381,16 +441,20 @@ module Google
381
441
  gapic_version: ::Google::Cloud::ResourceSettings::V1::VERSION
382
442
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
443
 
384
- header_params = {
385
- "setting.name" => request.setting.name
386
- }
444
+ header_params = {}
445
+ if request.setting&.name
446
+ header_params["setting.name"] = request.setting.name
447
+ end
448
+
387
449
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
450
  metadata[:"x-goog-request-params"] ||= request_params_header
389
451
 
390
452
  options.apply_defaults timeout: @config.rpcs.update_setting.timeout,
391
453
  metadata: metadata,
392
454
  retry_policy: @config.rpcs.update_setting.retry_policy
393
- options.apply_defaults metadata: @config.metadata,
455
+
456
+ options.apply_defaults timeout: @config.timeout,
457
+ metadata: @config.metadata,
394
458
  retry_policy: @config.retry_policy
395
459
 
396
460
  @resource_settings_service_stub.call_rpc :update_setting, request, options: options do |response, operation|
@@ -414,22 +478,21 @@ module Google
414
478
  # Configuration can be applied globally to all clients, or to a single client
415
479
  # on construction.
416
480
  #
417
- # # Examples
418
- #
419
- # To modify the global config, setting the timeout for list_settings
420
- # to 20 seconds, and all remaining timeouts to 10 seconds:
421
- #
422
- # ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.configure do |config|
423
- # config.timeout = 10.0
424
- # config.rpcs.list_settings.timeout = 20.0
425
- # end
426
- #
427
- # To apply the above configuration only to a new client:
428
- #
429
- # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config|
430
- # config.timeout = 10.0
431
- # config.rpcs.list_settings.timeout = 20.0
432
- # end
481
+ # @example
482
+ #
483
+ # # Modify the global config, setting the timeout for
484
+ # # list_settings to 20 seconds,
485
+ # # and all remaining timeouts to 10 seconds.
486
+ # ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.configure do |config|
487
+ # config.timeout = 10.0
488
+ # config.rpcs.list_settings.timeout = 20.0
489
+ # end
490
+ #
491
+ # # Apply the above configuration only to a new client.
492
+ # client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config|
493
+ # config.timeout = 10.0
494
+ # config.rpcs.list_settings.timeout = 20.0
495
+ # end
433
496
  #
434
497
  # @!attribute [rw] endpoint
435
498
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ResourceSettings
23
23
  module V1
24
- VERSION = "0.1.0"
24
+ VERSION = "0.1.4"
25
25
  end
26
26
  end
27
27
  end
@@ -1,12 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/resourcesettings/v1/resource_settings.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
9
7
  require 'google/api/resource_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/cloud/resourcesettings/v1/resource_settings.proto", :syntax => :proto3) do
12
12
  add_message "google.cloud.resourcesettings.v1.Setting" do
@@ -38,7 +38,7 @@ module Google
38
38
  # `google.rpc.Code.INVALID_ARGUMENT` if the request is malformed.
39
39
  class Service
40
40
 
41
- include GRPC::GenericService
41
+ include ::GRPC::GenericService
42
42
 
43
43
  self.marshal_class_method = :encode
44
44
  self.unmarshal_class_method = :decode
@@ -60,6 +60,12 @@ module Google
60
60
  # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-resource_settings-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-23 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a