google-cloud-resource_manager-v3 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/resource_manager/v3/folders/client.rb +75 -67
  5. data/lib/google/cloud/resource_manager/v3/folders/operations.rb +14 -16
  6. data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +1281 -0
  7. data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +793 -0
  8. data/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +698 -0
  9. data/lib/google/cloud/resource_manager/v3/folders/rest.rb +55 -0
  10. data/lib/google/cloud/resource_manager/v3/folders.rb +7 -1
  11. data/lib/google/cloud/resource_manager/v3/organizations/client.rb +16 -16
  12. data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +704 -0
  13. data/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +344 -0
  14. data/lib/google/cloud/resource_manager/v3/organizations/rest.rb +52 -0
  15. data/lib/google/cloud/resource_manager/v3/organizations.rb +7 -1
  16. data/lib/google/cloud/resource_manager/v3/projects/client.rb +72 -71
  17. data/lib/google/cloud/resource_manager/v3/projects/operations.rb +14 -16
  18. data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +1304 -0
  19. data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +793 -0
  20. data/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +698 -0
  21. data/lib/google/cloud/resource_manager/v3/projects/rest.rb +53 -0
  22. data/lib/google/cloud/resource_manager/v3/projects.rb +7 -1
  23. data/lib/google/cloud/resource_manager/v3/rest.rb +43 -0
  24. data/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +127 -31
  25. data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +14 -16
  26. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +606 -0
  27. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +793 -0
  28. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +279 -0
  29. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb +54 -0
  30. data/lib/google/cloud/resource_manager/v3/tag_bindings.rb +8 -2
  31. data/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +640 -0
  32. data/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb +52 -0
  33. data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +768 -0
  34. data/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb +64 -0
  35. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +533 -0
  36. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +793 -0
  37. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +226 -0
  38. data/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb +57 -0
  39. data/lib/google/cloud/resource_manager/v3/tag_holds.rb +60 -0
  40. data/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +127 -40
  41. data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +14 -16
  42. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +1012 -0
  43. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +793 -0
  44. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +578 -0
  45. data/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb +53 -0
  46. data/lib/google/cloud/resource_manager/v3/tag_keys.rb +7 -1
  47. data/lib/google/cloud/resource_manager/v3/tag_values/client.rb +139 -47
  48. data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +14 -16
  49. data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +1013 -0
  50. data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +793 -0
  51. data/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +578 -0
  52. data/lib/google/cloud/resource_manager/v3/tag_values/rest.rb +53 -0
  53. data/lib/google/cloud/resource_manager/v3/tag_values.rb +7 -1
  54. data/lib/google/cloud/resource_manager/v3/version.rb +1 -1
  55. data/lib/google/cloud/resource_manager/v3.rb +8 -2
  56. data/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb +23 -17
  57. data/lib/google/cloud/resourcemanager/v3/organizations_pb.rb +0 -1
  58. data/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb +16 -13
  59. data/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb +22 -0
  60. data/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb +7 -5
  61. data/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb +63 -0
  62. data/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb +54 -0
  63. data/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb +11 -0
  64. data/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb +6 -2
  65. data/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb +4 -0
  66. data/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb +7 -4
  67. data/proto_docs/google/api/client.rb +372 -0
  68. data/proto_docs/google/api/launch_stage.rb +71 -0
  69. data/proto_docs/google/cloud/resourcemanager/v3/folders.rb +25 -19
  70. data/proto_docs/google/cloud/resourcemanager/v3/organizations.rb +13 -11
  71. data/proto_docs/google/cloud/resourcemanager/v3/projects.rb +32 -30
  72. data/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb +101 -15
  73. data/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb +161 -0
  74. data/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb +81 -23
  75. data/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb +52 -29
  76. data/proto_docs/google/iam/v1/policy.rb +8 -4
  77. data/proto_docs/google/protobuf/empty.rb +0 -2
  78. data/proto_docs/google/rpc/status.rb +4 -2
  79. metadata +46 -8
@@ -0,0 +1,1013 @@
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/resourcemanager/v3/tag_values_pb"
21
+ require "google/cloud/resource_manager/v3/tag_values/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ResourceManager
26
+ module V3
27
+ module TagValues
28
+ module Rest
29
+ ##
30
+ # REST client for the TagValues service.
31
+ #
32
+ # Allow users to create and manage tag values.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :tag_values_stub
39
+
40
+ ##
41
+ # Configure the TagValues Client class.
42
+ #
43
+ # See {::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all TagValues clients
49
+ # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "ResourceManager", "V3"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.list_tag_values.timeout = 60.0
70
+ default_config.rpcs.list_tag_values.retry_policy = {
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
72
+ }
73
+
74
+ default_config.rpcs.get_tag_value.timeout = 60.0
75
+ default_config.rpcs.get_tag_value.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.create_tag_value.timeout = 60.0
80
+
81
+ default_config.rpcs.update_tag_value.timeout = 60.0
82
+
83
+ default_config.rpcs.delete_tag_value.timeout = 60.0
84
+
85
+ default_config.rpcs.get_iam_policy.timeout = 60.0
86
+ default_config.rpcs.get_iam_policy.retry_policy = {
87
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
88
+ }
89
+
90
+ default_config.rpcs.set_iam_policy.timeout = 60.0
91
+
92
+ default_config
93
+ end
94
+ yield @configure if block_given?
95
+ @configure
96
+ end
97
+
98
+ ##
99
+ # Configure the TagValues Client instance.
100
+ #
101
+ # The configuration is set to the derived mode, meaning that values can be changed,
102
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
103
+ # should be made on {Client.configure}.
104
+ #
105
+ # See {::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration}
106
+ # for a description of the configuration fields.
107
+ #
108
+ # @yield [config] Configure the Client client.
109
+ # @yieldparam config [Client::Configuration]
110
+ #
111
+ # @return [Client::Configuration]
112
+ #
113
+ def configure
114
+ yield @config if block_given?
115
+ @config
116
+ end
117
+
118
+ ##
119
+ # Create a new TagValues REST client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the TagValues client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint == Client.configure.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
+ @operations_client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Operations.new do |config|
157
+ config.credentials = credentials
158
+ config.quota_project = @quota_project_id
159
+ config.endpoint = @config.endpoint
160
+ end
161
+
162
+ @tag_values_stub = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
163
+ end
164
+
165
+ ##
166
+ # Get the associated client for long-running operations.
167
+ #
168
+ # @return [::Google::Cloud::ResourceManager::V3::TagValues::Rest::Operations]
169
+ #
170
+ attr_reader :operations_client
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # Lists all TagValues for a specific TagKey.
176
+ #
177
+ # @overload list_tag_values(request, options = nil)
178
+ # Pass arguments to `list_tag_values` via a request object, either of type
179
+ # {::Google::Cloud::ResourceManager::V3::ListTagValuesRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [::Gapic::CallOptions, ::Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
186
+ #
187
+ # @overload list_tag_values(parent: nil, page_size: nil, page_token: nil)
188
+ # Pass arguments to `list_tag_values` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param parent [::String]
193
+ # Required.
194
+ # @param page_size [::Integer]
195
+ # Optional. The maximum number of TagValues to return in the response. The
196
+ # server allows a maximum of 300 TagValues to return. If unspecified, the
197
+ # server will use 100 as the default.
198
+ # @param page_token [::String]
199
+ # Optional. A pagination token returned from a previous call to
200
+ # `ListTagValues` that indicates where this listing should continue from.
201
+ # @yield [result, operation] Access the result along with the TransportOperation object
202
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>]
203
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
204
+ #
205
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>]
206
+ #
207
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
208
+ def list_tag_values request, options = nil
209
+ raise ::ArgumentError, "request must be provided" if request.nil?
210
+
211
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest
212
+
213
+ # Converts hash and nil to an options object
214
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
215
+
216
+ # Customize the options with defaults
217
+ call_metadata = @config.rpcs.list_tag_values.metadata.to_h
218
+
219
+ # Set x-goog-api-client and x-goog-user-project headers
220
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
221
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
222
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
223
+ transports_version_send: [:rest]
224
+
225
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
+
227
+ options.apply_defaults timeout: @config.rpcs.list_tag_values.timeout,
228
+ metadata: call_metadata,
229
+ retry_policy: @config.rpcs.list_tag_values.retry_policy
230
+
231
+ options.apply_defaults timeout: @config.timeout,
232
+ metadata: @config.metadata,
233
+ retry_policy: @config.retry_policy
234
+
235
+ @tag_values_stub.list_tag_values request, options do |result, operation|
236
+ result = ::Gapic::Rest::PagedEnumerable.new @tag_values_stub, :list_tag_values, "tag_values", request, result, options
237
+ yield result, operation if block_given?
238
+ return result
239
+ end
240
+ rescue ::Gapic::Rest::Error => e
241
+ raise ::Google::Cloud::Error.from_error(e)
242
+ end
243
+
244
+ ##
245
+ # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the
246
+ # value does not exist or the user does not have permission to view it.
247
+ #
248
+ # @overload get_tag_value(request, options = nil)
249
+ # Pass arguments to `get_tag_value` via a request object, either of type
250
+ # {::Google::Cloud::ResourceManager::V3::GetTagValueRequest} or an equivalent Hash.
251
+ #
252
+ # @param request [::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Hash]
253
+ # A request object representing the call parameters. Required. To specify no
254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
255
+ # @param options [::Gapic::CallOptions, ::Hash]
256
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
257
+ #
258
+ # @overload get_tag_value(name: nil)
259
+ # Pass arguments to `get_tag_value` via keyword arguments. Note that at
260
+ # least one keyword argument is required. To specify no parameters, or to keep all
261
+ # the default parameter values, pass an empty Hash as a request object (see above).
262
+ #
263
+ # @param name [::String]
264
+ # Required. Resource name for TagValue to be fetched in the format
265
+ # `tagValues/456`.
266
+ # @yield [result, operation] Access the result along with the TransportOperation object
267
+ # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue]
268
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
269
+ #
270
+ # @return [::Google::Cloud::ResourceManager::V3::TagValue]
271
+ #
272
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
273
+ def get_tag_value request, options = nil
274
+ raise ::ArgumentError, "request must be provided" if request.nil?
275
+
276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagValueRequest
277
+
278
+ # Converts hash and nil to an options object
279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
280
+
281
+ # Customize the options with defaults
282
+ call_metadata = @config.rpcs.get_tag_value.metadata.to_h
283
+
284
+ # Set x-goog-api-client and x-goog-user-project headers
285
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
287
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
288
+ transports_version_send: [:rest]
289
+
290
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
291
+
292
+ options.apply_defaults timeout: @config.rpcs.get_tag_value.timeout,
293
+ metadata: call_metadata,
294
+ retry_policy: @config.rpcs.get_tag_value.retry_policy
295
+
296
+ options.apply_defaults timeout: @config.timeout,
297
+ metadata: @config.metadata,
298
+ retry_policy: @config.retry_policy
299
+
300
+ @tag_values_stub.get_tag_value request, options do |result, operation|
301
+ yield result, operation if block_given?
302
+ return result
303
+ end
304
+ rescue ::Gapic::Rest::Error => e
305
+ raise ::Google::Cloud::Error.from_error(e)
306
+ end
307
+
308
+ ##
309
+ # Retrieves a TagValue by its namespaced name.
310
+ # This method will return `PERMISSION_DENIED` if the value does not exist
311
+ # or the user does not have permission to view it.
312
+ #
313
+ # @overload get_namespaced_tag_value(request, options = nil)
314
+ # Pass arguments to `get_namespaced_tag_value` via a request object, either of type
315
+ # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest} or an equivalent Hash.
316
+ #
317
+ # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Hash]
318
+ # A request object representing the call parameters. Required. To specify no
319
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
320
+ # @param options [::Gapic::CallOptions, ::Hash]
321
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
322
+ #
323
+ # @overload get_namespaced_tag_value(name: nil)
324
+ # Pass arguments to `get_namespaced_tag_value` via keyword arguments. Note that at
325
+ # least one keyword argument is required. To specify no parameters, or to keep all
326
+ # the default parameter values, pass an empty Hash as a request object (see above).
327
+ #
328
+ # @param name [::String]
329
+ # Required. A namespaced tag value name in the following format:
330
+ #
331
+ # `{parentId}/{tagKeyShort}/{tagValueShort}`
332
+ #
333
+ # Examples:
334
+ # - `42/foo/abc` for a value with short name "abc" under the key with short
335
+ # name "foo" under the organization with ID 42
336
+ # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with
337
+ # short name "bar" under the project with ID "r2-d2"
338
+ # @yield [result, operation] Access the result along with the TransportOperation object
339
+ # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue]
340
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
341
+ #
342
+ # @return [::Google::Cloud::ResourceManager::V3::TagValue]
343
+ #
344
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
345
+ def get_namespaced_tag_value request, options = nil
346
+ raise ::ArgumentError, "request must be provided" if request.nil?
347
+
348
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest
349
+
350
+ # Converts hash and nil to an options object
351
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
352
+
353
+ # Customize the options with defaults
354
+ call_metadata = @config.rpcs.get_namespaced_tag_value.metadata.to_h
355
+
356
+ # Set x-goog-api-client and x-goog-user-project headers
357
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
359
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
360
+ transports_version_send: [:rest]
361
+
362
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
+
364
+ options.apply_defaults timeout: @config.rpcs.get_namespaced_tag_value.timeout,
365
+ metadata: call_metadata,
366
+ retry_policy: @config.rpcs.get_namespaced_tag_value.retry_policy
367
+
368
+ options.apply_defaults timeout: @config.timeout,
369
+ metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @tag_values_stub.get_namespaced_tag_value request, options do |result, operation|
373
+ yield result, operation if block_given?
374
+ return result
375
+ end
376
+ rescue ::Gapic::Rest::Error => e
377
+ raise ::Google::Cloud::Error.from_error(e)
378
+ end
379
+
380
+ ##
381
+ # Creates a TagValue as a child of the specified TagKey. If a another
382
+ # request with the same parameters is sent while the original request is in
383
+ # process the second request will receive an error. A maximum of 1000
384
+ # TagValues can exist under a TagKey at any given time.
385
+ #
386
+ # @overload create_tag_value(request, options = nil)
387
+ # Pass arguments to `create_tag_value` via a request object, either of type
388
+ # {::Google::Cloud::ResourceManager::V3::CreateTagValueRequest} or an equivalent Hash.
389
+ #
390
+ # @param request [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Hash]
391
+ # A request object representing the call parameters. Required. To specify no
392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
393
+ # @param options [::Gapic::CallOptions, ::Hash]
394
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
395
+ #
396
+ # @overload create_tag_value(tag_value: nil, validate_only: nil)
397
+ # Pass arguments to `create_tag_value` via keyword arguments. Note that at
398
+ # least one keyword argument is required. To specify no parameters, or to keep all
399
+ # the default parameter values, pass an empty Hash as a request object (see above).
400
+ #
401
+ # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash]
402
+ # Required. The TagValue to be created. Only fields `short_name`,
403
+ # `description`, and `parent` are considered during the creation request.
404
+ # @param validate_only [::Boolean]
405
+ # Optional. Set as true to perform the validations necessary for creating the
406
+ # resource, but not actually perform the action.
407
+ # @yield [result, operation] Access the result along with the TransportOperation object
408
+ # @yieldparam result [::Gapic::Operation]
409
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
410
+ #
411
+ # @return [::Gapic::Operation]
412
+ #
413
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ def create_tag_value request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ call_metadata = @config.rpcs.create_tag_value.metadata.to_h
424
+
425
+ # Set x-goog-api-client and x-goog-user-project headers
426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
429
+ transports_version_send: [:rest]
430
+
431
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
432
+
433
+ options.apply_defaults timeout: @config.rpcs.create_tag_value.timeout,
434
+ metadata: call_metadata,
435
+ retry_policy: @config.rpcs.create_tag_value.retry_policy
436
+
437
+ options.apply_defaults timeout: @config.timeout,
438
+ metadata: @config.metadata,
439
+ retry_policy: @config.retry_policy
440
+
441
+ @tag_values_stub.create_tag_value request, options do |result, operation|
442
+ result = ::Gapic::Operation.new result, @operations_client, options: options
443
+ yield result, operation if block_given?
444
+ return result
445
+ end
446
+ rescue ::Gapic::Rest::Error => e
447
+ raise ::Google::Cloud::Error.from_error(e)
448
+ end
449
+
450
+ ##
451
+ # Updates the attributes of the TagValue resource.
452
+ #
453
+ # @overload update_tag_value(request, options = nil)
454
+ # Pass arguments to `update_tag_value` via a request object, either of type
455
+ # {::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Hash]
458
+ # A request object representing the call parameters. Required. To specify no
459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
460
+ # @param options [::Gapic::CallOptions, ::Hash]
461
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
462
+ #
463
+ # @overload update_tag_value(tag_value: nil, update_mask: nil, validate_only: nil)
464
+ # Pass arguments to `update_tag_value` via keyword arguments. Note that at
465
+ # least one keyword argument is required. To specify no parameters, or to keep all
466
+ # the default parameter values, pass an empty Hash as a request object (see above).
467
+ #
468
+ # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash]
469
+ # Required. The new definition of the TagValue. Only fields `description` and
470
+ # `etag` fields can be updated by this request. If the `etag` field is
471
+ # nonempty, it must match the `etag` field of the existing ControlGroup.
472
+ # Otherwise, `ABORTED` will be returned.
473
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
474
+ # Optional. Fields to be updated.
475
+ # @param validate_only [::Boolean]
476
+ # Optional. True to perform validations necessary for updating the resource,
477
+ # but not actually perform the action.
478
+ # @yield [result, operation] Access the result along with the TransportOperation object
479
+ # @yieldparam result [::Gapic::Operation]
480
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
481
+ #
482
+ # @return [::Gapic::Operation]
483
+ #
484
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
485
+ def update_tag_value request, options = nil
486
+ raise ::ArgumentError, "request must be provided" if request.nil?
487
+
488
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest
489
+
490
+ # Converts hash and nil to an options object
491
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
492
+
493
+ # Customize the options with defaults
494
+ call_metadata = @config.rpcs.update_tag_value.metadata.to_h
495
+
496
+ # Set x-goog-api-client and x-goog-user-project headers
497
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
498
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
499
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
500
+ transports_version_send: [:rest]
501
+
502
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
+
504
+ options.apply_defaults timeout: @config.rpcs.update_tag_value.timeout,
505
+ metadata: call_metadata,
506
+ retry_policy: @config.rpcs.update_tag_value.retry_policy
507
+
508
+ options.apply_defaults timeout: @config.timeout,
509
+ metadata: @config.metadata,
510
+ retry_policy: @config.retry_policy
511
+
512
+ @tag_values_stub.update_tag_value request, options do |result, operation|
513
+ result = ::Gapic::Operation.new result, @operations_client, options: options
514
+ yield result, operation if block_given?
515
+ return result
516
+ end
517
+ rescue ::Gapic::Rest::Error => e
518
+ raise ::Google::Cloud::Error.from_error(e)
519
+ end
520
+
521
+ ##
522
+ # Deletes a TagValue. The TagValue cannot have any bindings when it is
523
+ # deleted.
524
+ #
525
+ # @overload delete_tag_value(request, options = nil)
526
+ # Pass arguments to `delete_tag_value` via a request object, either of type
527
+ # {::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest} or an equivalent Hash.
528
+ #
529
+ # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Hash]
530
+ # A request object representing the call parameters. Required. To specify no
531
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
532
+ # @param options [::Gapic::CallOptions, ::Hash]
533
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
534
+ #
535
+ # @overload delete_tag_value(name: nil, validate_only: nil, etag: nil)
536
+ # Pass arguments to `delete_tag_value` via keyword arguments. Note that at
537
+ # least one keyword argument is required. To specify no parameters, or to keep all
538
+ # the default parameter values, pass an empty Hash as a request object (see above).
539
+ #
540
+ # @param name [::String]
541
+ # Required. Resource name for TagValue to be deleted in the format
542
+ # tagValues/456.
543
+ # @param validate_only [::Boolean]
544
+ # Optional. Set as true to perform the validations necessary for deletion,
545
+ # but not actually perform the action.
546
+ # @param etag [::String]
547
+ # Optional. The etag known to the client for the expected state of the
548
+ # TagValue. This is to be used for optimistic concurrency.
549
+ # @yield [result, operation] Access the result along with the TransportOperation object
550
+ # @yieldparam result [::Gapic::Operation]
551
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
552
+ #
553
+ # @return [::Gapic::Operation]
554
+ #
555
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
556
+ def delete_tag_value request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ call_metadata = @config.rpcs.delete_tag_value.metadata.to_h
566
+
567
+ # Set x-goog-api-client and x-goog-user-project headers
568
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
571
+ transports_version_send: [:rest]
572
+
573
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
574
+
575
+ options.apply_defaults timeout: @config.rpcs.delete_tag_value.timeout,
576
+ metadata: call_metadata,
577
+ retry_policy: @config.rpcs.delete_tag_value.retry_policy
578
+
579
+ options.apply_defaults timeout: @config.timeout,
580
+ metadata: @config.metadata,
581
+ retry_policy: @config.retry_policy
582
+
583
+ @tag_values_stub.delete_tag_value request, options do |result, operation|
584
+ result = ::Gapic::Operation.new result, @operations_client, options: options
585
+ yield result, operation if block_given?
586
+ return result
587
+ end
588
+ rescue ::Gapic::Rest::Error => e
589
+ raise ::Google::Cloud::Error.from_error(e)
590
+ end
591
+
592
+ ##
593
+ # Gets the access control policy for a TagValue. The returned policy may be
594
+ # empty if no such policy or resource exists. The `resource` field should
595
+ # be the TagValue's resource name. For example: `tagValues/1234`.
596
+ # The caller must have the
597
+ # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on
598
+ # the identified TagValue to get the access control policy.
599
+ #
600
+ # @overload get_iam_policy(request, options = nil)
601
+ # Pass arguments to `get_iam_policy` via a request object, either of type
602
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
603
+ #
604
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
605
+ # A request object representing the call parameters. Required. To specify no
606
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
607
+ # @param options [::Gapic::CallOptions, ::Hash]
608
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
609
+ #
610
+ # @overload get_iam_policy(resource: nil, options: nil)
611
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
612
+ # least one keyword argument is required. To specify no parameters, or to keep all
613
+ # the default parameter values, pass an empty Hash as a request object (see above).
614
+ #
615
+ # @param resource [::String]
616
+ # REQUIRED: The resource for which the policy is being requested.
617
+ # See the operation documentation for the appropriate value for this field.
618
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
619
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
620
+ # `GetIamPolicy`.
621
+ # @yield [result, operation] Access the result along with the TransportOperation object
622
+ # @yieldparam result [::Google::Iam::V1::Policy]
623
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
624
+ #
625
+ # @return [::Google::Iam::V1::Policy]
626
+ #
627
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
628
+ def get_iam_policy request, options = nil
629
+ raise ::ArgumentError, "request must be provided" if request.nil?
630
+
631
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
632
+
633
+ # Converts hash and nil to an options object
634
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
635
+
636
+ # Customize the options with defaults
637
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
638
+
639
+ # Set x-goog-api-client and x-goog-user-project headers
640
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
641
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
642
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
643
+ transports_version_send: [:rest]
644
+
645
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
646
+
647
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
648
+ metadata: call_metadata,
649
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
650
+
651
+ options.apply_defaults timeout: @config.timeout,
652
+ metadata: @config.metadata,
653
+ retry_policy: @config.retry_policy
654
+
655
+ @tag_values_stub.get_iam_policy request, options do |result, operation|
656
+ yield result, operation if block_given?
657
+ return result
658
+ end
659
+ rescue ::Gapic::Rest::Error => e
660
+ raise ::Google::Cloud::Error.from_error(e)
661
+ end
662
+
663
+ ##
664
+ # Sets the access control policy on a TagValue, replacing any existing
665
+ # policy. The `resource` field should be the TagValue's resource name.
666
+ # For example: `tagValues/1234`.
667
+ # The caller must have `resourcemanager.tagValues.setIamPolicy` permission
668
+ # on the identified tagValue.
669
+ #
670
+ # @overload set_iam_policy(request, options = nil)
671
+ # Pass arguments to `set_iam_policy` via a request object, either of type
672
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
673
+ #
674
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
675
+ # A request object representing the call parameters. Required. To specify no
676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
677
+ # @param options [::Gapic::CallOptions, ::Hash]
678
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
679
+ #
680
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
681
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
682
+ # least one keyword argument is required. To specify no parameters, or to keep all
683
+ # the default parameter values, pass an empty Hash as a request object (see above).
684
+ #
685
+ # @param resource [::String]
686
+ # REQUIRED: The resource for which the policy is being specified.
687
+ # See the operation documentation for the appropriate value for this field.
688
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
689
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
690
+ # the policy is limited to a few 10s of KB. An empty policy is a
691
+ # valid policy but certain Cloud Platform services (such as Projects)
692
+ # might reject them.
693
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
694
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
695
+ # the fields in the mask will be modified. If no mask is provided, the
696
+ # following default mask is used:
697
+ #
698
+ # `paths: "bindings, etag"`
699
+ # @yield [result, operation] Access the result along with the TransportOperation object
700
+ # @yieldparam result [::Google::Iam::V1::Policy]
701
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
702
+ #
703
+ # @return [::Google::Iam::V1::Policy]
704
+ #
705
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
706
+ def set_iam_policy request, options = nil
707
+ raise ::ArgumentError, "request must be provided" if request.nil?
708
+
709
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
710
+
711
+ # Converts hash and nil to an options object
712
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
713
+
714
+ # Customize the options with defaults
715
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
716
+
717
+ # Set x-goog-api-client and x-goog-user-project headers
718
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
719
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
720
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
721
+ transports_version_send: [:rest]
722
+
723
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
724
+
725
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
726
+ metadata: call_metadata,
727
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
728
+
729
+ options.apply_defaults timeout: @config.timeout,
730
+ metadata: @config.metadata,
731
+ retry_policy: @config.retry_policy
732
+
733
+ @tag_values_stub.set_iam_policy request, options do |result, operation|
734
+ yield result, operation if block_given?
735
+ return result
736
+ end
737
+ rescue ::Gapic::Rest::Error => e
738
+ raise ::Google::Cloud::Error.from_error(e)
739
+ end
740
+
741
+ ##
742
+ # Returns permissions that a caller has on the specified TagValue.
743
+ # The `resource` field should be the TagValue's resource name. For example:
744
+ # `tagValues/1234`.
745
+ #
746
+ # There are no permissions required for making this API call.
747
+ #
748
+ # @overload test_iam_permissions(request, options = nil)
749
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
750
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
751
+ #
752
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
753
+ # A request object representing the call parameters. Required. To specify no
754
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
755
+ # @param options [::Gapic::CallOptions, ::Hash]
756
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
757
+ #
758
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
759
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
760
+ # least one keyword argument is required. To specify no parameters, or to keep all
761
+ # the default parameter values, pass an empty Hash as a request object (see above).
762
+ #
763
+ # @param resource [::String]
764
+ # REQUIRED: The resource for which the policy detail is being requested.
765
+ # See the operation documentation for the appropriate value for this field.
766
+ # @param permissions [::Array<::String>]
767
+ # The set of permissions to check for the `resource`. Permissions with
768
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
769
+ # information see
770
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
771
+ # @yield [result, operation] Access the result along with the TransportOperation object
772
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
773
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
774
+ #
775
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
776
+ #
777
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
778
+ def test_iam_permissions request, options = nil
779
+ raise ::ArgumentError, "request must be provided" if request.nil?
780
+
781
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
782
+
783
+ # Converts hash and nil to an options object
784
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
785
+
786
+ # Customize the options with defaults
787
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
788
+
789
+ # Set x-goog-api-client and x-goog-user-project headers
790
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
791
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
792
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
793
+ transports_version_send: [:rest]
794
+
795
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
796
+
797
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
798
+ metadata: call_metadata,
799
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
800
+
801
+ options.apply_defaults timeout: @config.timeout,
802
+ metadata: @config.metadata,
803
+ retry_policy: @config.retry_policy
804
+
805
+ @tag_values_stub.test_iam_permissions request, options do |result, operation|
806
+ yield result, operation if block_given?
807
+ return result
808
+ end
809
+ rescue ::Gapic::Rest::Error => e
810
+ raise ::Google::Cloud::Error.from_error(e)
811
+ end
812
+
813
+ ##
814
+ # Configuration class for the TagValues REST API.
815
+ #
816
+ # This class represents the configuration for TagValues REST,
817
+ # providing control over timeouts, retry behavior, logging, transport
818
+ # parameters, and other low-level controls. Certain parameters can also be
819
+ # applied individually to specific RPCs. See
820
+ # {::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration::Rpcs}
821
+ # for a list of RPCs that can be configured independently.
822
+ #
823
+ # Configuration can be applied globally to all clients, or to a single client
824
+ # on construction.
825
+ #
826
+ # @example
827
+ #
828
+ # # Modify the global config, setting the timeout for
829
+ # # list_tag_values to 20 seconds,
830
+ # # and all remaining timeouts to 10 seconds.
831
+ # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config|
832
+ # config.timeout = 10.0
833
+ # config.rpcs.list_tag_values.timeout = 20.0
834
+ # end
835
+ #
836
+ # # Apply the above configuration only to a new client.
837
+ # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config|
838
+ # config.timeout = 10.0
839
+ # config.rpcs.list_tag_values.timeout = 20.0
840
+ # end
841
+ #
842
+ # @!attribute [rw] endpoint
843
+ # The hostname or hostname:port of the service endpoint.
844
+ # Defaults to `"cloudresourcemanager.googleapis.com"`.
845
+ # @return [::String]
846
+ # @!attribute [rw] credentials
847
+ # Credentials to send with calls. You may provide any of the following types:
848
+ # * (`String`) The path to a service account key file in JSON format
849
+ # * (`Hash`) A service account key as a Hash
850
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
851
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
852
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
853
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
854
+ # * (`nil`) indicating no credentials
855
+ # @return [::Object]
856
+ # @!attribute [rw] scope
857
+ # The OAuth scopes
858
+ # @return [::Array<::String>]
859
+ # @!attribute [rw] lib_name
860
+ # The library name as recorded in instrumentation and logging
861
+ # @return [::String]
862
+ # @!attribute [rw] lib_version
863
+ # The library version as recorded in instrumentation and logging
864
+ # @return [::String]
865
+ # @!attribute [rw] timeout
866
+ # The call timeout in seconds.
867
+ # @return [::Numeric]
868
+ # @!attribute [rw] metadata
869
+ # Additional headers to be sent with the call.
870
+ # @return [::Hash{::Symbol=>::String}]
871
+ # @!attribute [rw] retry_policy
872
+ # The retry policy. The value is a hash with the following keys:
873
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
874
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
875
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
876
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
877
+ # trigger a retry.
878
+ # @return [::Hash]
879
+ # @!attribute [rw] quota_project
880
+ # A separate project against which to charge quota.
881
+ # @return [::String]
882
+ #
883
+ class Configuration
884
+ extend ::Gapic::Config
885
+
886
+ config_attr :endpoint, "cloudresourcemanager.googleapis.com", ::String
887
+ config_attr :credentials, nil do |value|
888
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
889
+ allowed.any? { |klass| klass === value }
890
+ end
891
+ config_attr :scope, nil, ::String, ::Array, nil
892
+ config_attr :lib_name, nil, ::String, nil
893
+ config_attr :lib_version, nil, ::String, nil
894
+ config_attr :timeout, nil, ::Numeric, nil
895
+ config_attr :metadata, nil, ::Hash, nil
896
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
897
+ config_attr :quota_project, nil, ::String, nil
898
+
899
+ # @private
900
+ def initialize parent_config = nil
901
+ @parent_config = parent_config unless parent_config.nil?
902
+
903
+ yield self if block_given?
904
+ end
905
+
906
+ ##
907
+ # Configurations for individual RPCs
908
+ # @return [Rpcs]
909
+ #
910
+ def rpcs
911
+ @rpcs ||= begin
912
+ parent_rpcs = nil
913
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
914
+ Rpcs.new parent_rpcs
915
+ end
916
+ end
917
+
918
+ ##
919
+ # Configuration RPC class for the TagValues API.
920
+ #
921
+ # Includes fields providing the configuration for each RPC in this service.
922
+ # Each configuration object is of type `Gapic::Config::Method` and includes
923
+ # the following configuration fields:
924
+ #
925
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
926
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
927
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
928
+ # include the following keys:
929
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
930
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
931
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
932
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
933
+ # trigger a retry.
934
+ #
935
+ class Rpcs
936
+ ##
937
+ # RPC-specific configuration for `list_tag_values`
938
+ # @return [::Gapic::Config::Method]
939
+ #
940
+ attr_reader :list_tag_values
941
+ ##
942
+ # RPC-specific configuration for `get_tag_value`
943
+ # @return [::Gapic::Config::Method]
944
+ #
945
+ attr_reader :get_tag_value
946
+ ##
947
+ # RPC-specific configuration for `get_namespaced_tag_value`
948
+ # @return [::Gapic::Config::Method]
949
+ #
950
+ attr_reader :get_namespaced_tag_value
951
+ ##
952
+ # RPC-specific configuration for `create_tag_value`
953
+ # @return [::Gapic::Config::Method]
954
+ #
955
+ attr_reader :create_tag_value
956
+ ##
957
+ # RPC-specific configuration for `update_tag_value`
958
+ # @return [::Gapic::Config::Method]
959
+ #
960
+ attr_reader :update_tag_value
961
+ ##
962
+ # RPC-specific configuration for `delete_tag_value`
963
+ # @return [::Gapic::Config::Method]
964
+ #
965
+ attr_reader :delete_tag_value
966
+ ##
967
+ # RPC-specific configuration for `get_iam_policy`
968
+ # @return [::Gapic::Config::Method]
969
+ #
970
+ attr_reader :get_iam_policy
971
+ ##
972
+ # RPC-specific configuration for `set_iam_policy`
973
+ # @return [::Gapic::Config::Method]
974
+ #
975
+ attr_reader :set_iam_policy
976
+ ##
977
+ # RPC-specific configuration for `test_iam_permissions`
978
+ # @return [::Gapic::Config::Method]
979
+ #
980
+ attr_reader :test_iam_permissions
981
+
982
+ # @private
983
+ def initialize parent_rpcs = nil
984
+ list_tag_values_config = parent_rpcs.list_tag_values if parent_rpcs.respond_to? :list_tag_values
985
+ @list_tag_values = ::Gapic::Config::Method.new list_tag_values_config
986
+ get_tag_value_config = parent_rpcs.get_tag_value if parent_rpcs.respond_to? :get_tag_value
987
+ @get_tag_value = ::Gapic::Config::Method.new get_tag_value_config
988
+ get_namespaced_tag_value_config = parent_rpcs.get_namespaced_tag_value if parent_rpcs.respond_to? :get_namespaced_tag_value
989
+ @get_namespaced_tag_value = ::Gapic::Config::Method.new get_namespaced_tag_value_config
990
+ create_tag_value_config = parent_rpcs.create_tag_value if parent_rpcs.respond_to? :create_tag_value
991
+ @create_tag_value = ::Gapic::Config::Method.new create_tag_value_config
992
+ update_tag_value_config = parent_rpcs.update_tag_value if parent_rpcs.respond_to? :update_tag_value
993
+ @update_tag_value = ::Gapic::Config::Method.new update_tag_value_config
994
+ delete_tag_value_config = parent_rpcs.delete_tag_value if parent_rpcs.respond_to? :delete_tag_value
995
+ @delete_tag_value = ::Gapic::Config::Method.new delete_tag_value_config
996
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
997
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
998
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
999
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1000
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1001
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1002
+
1003
+ yield self if block_given?
1004
+ end
1005
+ end
1006
+ end
1007
+ end
1008
+ end
1009
+ end
1010
+ end
1011
+ end
1012
+ end
1013
+ end