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