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,606 @@
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_bindings_pb"
21
+ require "google/cloud/resource_manager/v3/tag_bindings/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ResourceManager
26
+ module V3
27
+ module TagBindings
28
+ module Rest
29
+ ##
30
+ # REST client for the TagBindings service.
31
+ #
32
+ # Allow users to create and manage TagBindings between TagValues and
33
+ # different Google Cloud resources throughout the GCP resource hierarchy.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :tag_bindings_stub
40
+
41
+ ##
42
+ # Configure the TagBindings Client class.
43
+ #
44
+ # See {::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all TagBindings clients
50
+ # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "ResourceManager", "V3"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.rpcs.list_tag_bindings.timeout = 60.0
71
+ default_config.rpcs.list_tag_bindings.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
73
+ }
74
+
75
+ default_config.rpcs.create_tag_binding.timeout = 60.0
76
+
77
+ default_config.rpcs.delete_tag_binding.timeout = 60.0
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the TagBindings Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # Create a new TagBindings REST client object.
107
+ #
108
+ # @example
109
+ #
110
+ # # Create a client using the default configuration
111
+ # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new
112
+ #
113
+ # # Create a client using a custom configuration
114
+ # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config|
115
+ # config.timeout = 10.0
116
+ # end
117
+ #
118
+ # @yield [config] Configure the TagBindings client.
119
+ # @yieldparam config [Client::Configuration]
120
+ #
121
+ def initialize
122
+ # Create the configuration object
123
+ @config = Configuration.new Client.configure
124
+
125
+ # Yield the configuration if needed
126
+ yield @config if block_given?
127
+
128
+ # Create credentials
129
+ credentials = @config.credentials
130
+ # Use self-signed JWT if the endpoint is unchanged from default,
131
+ # but only if the default endpoint does not have a region prefix.
132
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
133
+ !@config.endpoint.split(".").first.include?("-")
134
+ credentials ||= Credentials.default scope: @config.scope,
135
+ enable_self_signed_jwt: enable_self_signed_jwt
136
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
+ credentials = Credentials.new credentials, scope: @config.scope
138
+ end
139
+
140
+ @quota_project_id = @config.quota_project
141
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
142
+
143
+ @operations_client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Operations.new do |config|
144
+ config.credentials = credentials
145
+ config.quota_project = @quota_project_id
146
+ config.endpoint = @config.endpoint
147
+ end
148
+
149
+ @tag_bindings_stub = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
150
+ end
151
+
152
+ ##
153
+ # Get the associated client for long-running operations.
154
+ #
155
+ # @return [::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Operations]
156
+ #
157
+ attr_reader :operations_client
158
+
159
+ # Service calls
160
+
161
+ ##
162
+ # Lists the TagBindings for the given Google Cloud resource, as specified
163
+ # with `parent`.
164
+ #
165
+ # NOTE: The `parent` field is expected to be a full resource name:
166
+ # https://cloud.google.com/apis/design/resource_names#full_resource_name
167
+ #
168
+ # @overload list_tag_bindings(request, options = nil)
169
+ # Pass arguments to `list_tag_bindings` via a request object, either of type
170
+ # {::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest} or an equivalent Hash.
171
+ #
172
+ # @param request [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Hash]
173
+ # A request object representing the call parameters. Required. To specify no
174
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
175
+ # @param options [::Gapic::CallOptions, ::Hash]
176
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
177
+ #
178
+ # @overload list_tag_bindings(parent: nil, page_size: nil, page_token: nil)
179
+ # Pass arguments to `list_tag_bindings` via keyword arguments. Note that at
180
+ # least one keyword argument is required. To specify no parameters, or to keep all
181
+ # the default parameter values, pass an empty Hash as a request object (see above).
182
+ #
183
+ # @param parent [::String]
184
+ # Required. The full resource name of a resource for which you want to list
185
+ # existing TagBindings. E.g.
186
+ # "//cloudresourcemanager.googleapis.com/projects/123"
187
+ # @param page_size [::Integer]
188
+ # Optional. The maximum number of TagBindings to return in the response. The
189
+ # server allows a maximum of 300 TagBindings to return. If unspecified, the
190
+ # server will use 100 as the default.
191
+ # @param page_token [::String]
192
+ # Optional. A pagination token returned from a previous call to
193
+ # `ListTagBindings` that indicates where this listing should continue from.
194
+ # @yield [result, operation] Access the result along with the TransportOperation object
195
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>]
196
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
197
+ #
198
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>]
199
+ #
200
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
201
+ def list_tag_bindings request, options = nil
202
+ raise ::ArgumentError, "request must be provided" if request.nil?
203
+
204
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest
205
+
206
+ # Converts hash and nil to an options object
207
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
208
+
209
+ # Customize the options with defaults
210
+ call_metadata = @config.rpcs.list_tag_bindings.metadata.to_h
211
+
212
+ # Set x-goog-api-client and x-goog-user-project headers
213
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
214
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
215
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
216
+ transports_version_send: [:rest]
217
+
218
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
219
+
220
+ options.apply_defaults timeout: @config.rpcs.list_tag_bindings.timeout,
221
+ metadata: call_metadata,
222
+ retry_policy: @config.rpcs.list_tag_bindings.retry_policy
223
+
224
+ options.apply_defaults timeout: @config.timeout,
225
+ metadata: @config.metadata,
226
+ retry_policy: @config.retry_policy
227
+
228
+ @tag_bindings_stub.list_tag_bindings request, options do |result, operation|
229
+ result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_tag_bindings, "tag_bindings", request, result, options
230
+ yield result, operation if block_given?
231
+ return result
232
+ end
233
+ rescue ::Gapic::Rest::Error => e
234
+ raise ::Google::Cloud::Error.from_error(e)
235
+ end
236
+
237
+ ##
238
+ # Creates a TagBinding between a TagValue and a Google Cloud resource.
239
+ #
240
+ # @overload create_tag_binding(request, options = nil)
241
+ # Pass arguments to `create_tag_binding` via a request object, either of type
242
+ # {::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest} or an equivalent Hash.
243
+ #
244
+ # @param request [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Hash]
245
+ # A request object representing the call parameters. Required. To specify no
246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
247
+ # @param options [::Gapic::CallOptions, ::Hash]
248
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
249
+ #
250
+ # @overload create_tag_binding(tag_binding: nil, validate_only: nil)
251
+ # Pass arguments to `create_tag_binding` via keyword arguments. Note that at
252
+ # least one keyword argument is required. To specify no parameters, or to keep all
253
+ # the default parameter values, pass an empty Hash as a request object (see above).
254
+ #
255
+ # @param tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash]
256
+ # Required. The TagBinding to be created.
257
+ # @param validate_only [::Boolean]
258
+ # Optional. Set to true to perform the validations necessary for creating the
259
+ # resource, but not actually perform the action.
260
+ # @yield [result, operation] Access the result along with the TransportOperation object
261
+ # @yieldparam result [::Gapic::Operation]
262
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
263
+ #
264
+ # @return [::Gapic::Operation]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
267
+ def create_tag_binding request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ call_metadata = @config.rpcs.create_tag_binding.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
282
+ transports_version_send: [:rest]
283
+
284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ options.apply_defaults timeout: @config.rpcs.create_tag_binding.timeout,
287
+ metadata: call_metadata,
288
+ retry_policy: @config.rpcs.create_tag_binding.retry_policy
289
+
290
+ options.apply_defaults timeout: @config.timeout,
291
+ metadata: @config.metadata,
292
+ retry_policy: @config.retry_policy
293
+
294
+ @tag_bindings_stub.create_tag_binding request, options do |result, operation|
295
+ result = ::Gapic::Operation.new result, @operations_client, options: options
296
+ yield result, operation if block_given?
297
+ return result
298
+ end
299
+ rescue ::Gapic::Rest::Error => e
300
+ raise ::Google::Cloud::Error.from_error(e)
301
+ end
302
+
303
+ ##
304
+ # Deletes a TagBinding.
305
+ #
306
+ # @overload delete_tag_binding(request, options = nil)
307
+ # Pass arguments to `delete_tag_binding` via a request object, either of type
308
+ # {::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
315
+ #
316
+ # @overload delete_tag_binding(name: nil)
317
+ # Pass arguments to `delete_tag_binding` via keyword arguments. Note that at
318
+ # least one keyword argument is required. To specify no parameters, or to keep all
319
+ # the default parameter values, pass an empty Hash as a request object (see above).
320
+ #
321
+ # @param name [::String]
322
+ # Required. The name of the TagBinding. This is a String of the form:
323
+ # `tagBindings/{id}` (e.g.
324
+ # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`).
325
+ # @yield [result, operation] Access the result along with the TransportOperation object
326
+ # @yieldparam result [::Gapic::Operation]
327
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
328
+ #
329
+ # @return [::Gapic::Operation]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
332
+ def delete_tag_binding request, options = nil
333
+ raise ::ArgumentError, "request must be provided" if request.nil?
334
+
335
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest
336
+
337
+ # Converts hash and nil to an options object
338
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
+
340
+ # Customize the options with defaults
341
+ call_metadata = @config.rpcs.delete_tag_binding.metadata.to_h
342
+
343
+ # Set x-goog-api-client and x-goog-user-project headers
344
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
346
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
347
+ transports_version_send: [:rest]
348
+
349
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
350
+
351
+ options.apply_defaults timeout: @config.rpcs.delete_tag_binding.timeout,
352
+ metadata: call_metadata,
353
+ retry_policy: @config.rpcs.delete_tag_binding.retry_policy
354
+
355
+ options.apply_defaults timeout: @config.timeout,
356
+ metadata: @config.metadata,
357
+ retry_policy: @config.retry_policy
358
+
359
+ @tag_bindings_stub.delete_tag_binding request, options do |result, operation|
360
+ result = ::Gapic::Operation.new result, @operations_client, options: options
361
+ yield result, operation if block_given?
362
+ return result
363
+ end
364
+ rescue ::Gapic::Rest::Error => e
365
+ raise ::Google::Cloud::Error.from_error(e)
366
+ end
367
+
368
+ ##
369
+ # Return a list of effective tags for the given Google Cloud resource, as
370
+ # specified in `parent`.
371
+ #
372
+ # @overload list_effective_tags(request, options = nil)
373
+ # Pass arguments to `list_effective_tags` via a request object, either of type
374
+ # {::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
381
+ #
382
+ # @overload list_effective_tags(parent: nil, page_size: nil, page_token: nil)
383
+ # Pass arguments to `list_effective_tags` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param parent [::String]
388
+ # Required. The full resource name of a resource for which you want to list
389
+ # the effective tags. E.g.
390
+ # "//cloudresourcemanager.googleapis.com/projects/123"
391
+ # @param page_size [::Integer]
392
+ # Optional. The maximum number of effective tags to return in the response.
393
+ # The server allows a maximum of 300 effective tags to return in a single
394
+ # page. If unspecified, the server will use 100 as the default.
395
+ # @param page_token [::String]
396
+ # Optional. A pagination token returned from a previous call to
397
+ # `ListEffectiveTags` that indicates from where this listing should continue.
398
+ # @yield [result, operation] Access the result along with the TransportOperation object
399
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>]
400
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
401
+ #
402
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>]
403
+ #
404
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
405
+ def list_effective_tags request, options = nil
406
+ raise ::ArgumentError, "request must be provided" if request.nil?
407
+
408
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest
409
+
410
+ # Converts hash and nil to an options object
411
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
412
+
413
+ # Customize the options with defaults
414
+ call_metadata = @config.rpcs.list_effective_tags.metadata.to_h
415
+
416
+ # Set x-goog-api-client and x-goog-user-project headers
417
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
418
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
419
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION,
420
+ transports_version_send: [:rest]
421
+
422
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
423
+
424
+ options.apply_defaults timeout: @config.rpcs.list_effective_tags.timeout,
425
+ metadata: call_metadata,
426
+ retry_policy: @config.rpcs.list_effective_tags.retry_policy
427
+
428
+ options.apply_defaults timeout: @config.timeout,
429
+ metadata: @config.metadata,
430
+ retry_policy: @config.retry_policy
431
+
432
+ @tag_bindings_stub.list_effective_tags request, options do |result, operation|
433
+ result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_effective_tags, "effective_tags", request, result, options
434
+ yield result, operation if block_given?
435
+ return result
436
+ end
437
+ rescue ::Gapic::Rest::Error => e
438
+ raise ::Google::Cloud::Error.from_error(e)
439
+ end
440
+
441
+ ##
442
+ # Configuration class for the TagBindings REST API.
443
+ #
444
+ # This class represents the configuration for TagBindings REST,
445
+ # providing control over timeouts, retry behavior, logging, transport
446
+ # parameters, and other low-level controls. Certain parameters can also be
447
+ # applied individually to specific RPCs. See
448
+ # {::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration::Rpcs}
449
+ # for a list of RPCs that can be configured independently.
450
+ #
451
+ # Configuration can be applied globally to all clients, or to a single client
452
+ # on construction.
453
+ #
454
+ # @example
455
+ #
456
+ # # Modify the global config, setting the timeout for
457
+ # # list_tag_bindings to 20 seconds,
458
+ # # and all remaining timeouts to 10 seconds.
459
+ # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config|
460
+ # config.timeout = 10.0
461
+ # config.rpcs.list_tag_bindings.timeout = 20.0
462
+ # end
463
+ #
464
+ # # Apply the above configuration only to a new client.
465
+ # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config|
466
+ # config.timeout = 10.0
467
+ # config.rpcs.list_tag_bindings.timeout = 20.0
468
+ # end
469
+ #
470
+ # @!attribute [rw] endpoint
471
+ # The hostname or hostname:port of the service endpoint.
472
+ # Defaults to `"cloudresourcemanager.googleapis.com"`.
473
+ # @return [::String]
474
+ # @!attribute [rw] credentials
475
+ # Credentials to send with calls. You may provide any of the following types:
476
+ # * (`String`) The path to a service account key file in JSON format
477
+ # * (`Hash`) A service account key as a Hash
478
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
479
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
480
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
481
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
482
+ # * (`nil`) indicating no credentials
483
+ # @return [::Object]
484
+ # @!attribute [rw] scope
485
+ # The OAuth scopes
486
+ # @return [::Array<::String>]
487
+ # @!attribute [rw] lib_name
488
+ # The library name as recorded in instrumentation and logging
489
+ # @return [::String]
490
+ # @!attribute [rw] lib_version
491
+ # The library version as recorded in instrumentation and logging
492
+ # @return [::String]
493
+ # @!attribute [rw] timeout
494
+ # The call timeout in seconds.
495
+ # @return [::Numeric]
496
+ # @!attribute [rw] metadata
497
+ # Additional headers to be sent with the call.
498
+ # @return [::Hash{::Symbol=>::String}]
499
+ # @!attribute [rw] retry_policy
500
+ # The retry policy. The value is a hash with the following keys:
501
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
502
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
503
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
504
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
505
+ # trigger a retry.
506
+ # @return [::Hash]
507
+ # @!attribute [rw] quota_project
508
+ # A separate project against which to charge quota.
509
+ # @return [::String]
510
+ #
511
+ class Configuration
512
+ extend ::Gapic::Config
513
+
514
+ config_attr :endpoint, "cloudresourcemanager.googleapis.com", ::String
515
+ config_attr :credentials, nil do |value|
516
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
517
+ allowed.any? { |klass| klass === value }
518
+ end
519
+ config_attr :scope, nil, ::String, ::Array, nil
520
+ config_attr :lib_name, nil, ::String, nil
521
+ config_attr :lib_version, nil, ::String, nil
522
+ config_attr :timeout, nil, ::Numeric, nil
523
+ config_attr :metadata, nil, ::Hash, nil
524
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
525
+ config_attr :quota_project, nil, ::String, nil
526
+
527
+ # @private
528
+ def initialize parent_config = nil
529
+ @parent_config = parent_config unless parent_config.nil?
530
+
531
+ yield self if block_given?
532
+ end
533
+
534
+ ##
535
+ # Configurations for individual RPCs
536
+ # @return [Rpcs]
537
+ #
538
+ def rpcs
539
+ @rpcs ||= begin
540
+ parent_rpcs = nil
541
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
542
+ Rpcs.new parent_rpcs
543
+ end
544
+ end
545
+
546
+ ##
547
+ # Configuration RPC class for the TagBindings API.
548
+ #
549
+ # Includes fields providing the configuration for each RPC in this service.
550
+ # Each configuration object is of type `Gapic::Config::Method` and includes
551
+ # the following configuration fields:
552
+ #
553
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
554
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
555
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
556
+ # include the following keys:
557
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
558
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
559
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
560
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
561
+ # trigger a retry.
562
+ #
563
+ class Rpcs
564
+ ##
565
+ # RPC-specific configuration for `list_tag_bindings`
566
+ # @return [::Gapic::Config::Method]
567
+ #
568
+ attr_reader :list_tag_bindings
569
+ ##
570
+ # RPC-specific configuration for `create_tag_binding`
571
+ # @return [::Gapic::Config::Method]
572
+ #
573
+ attr_reader :create_tag_binding
574
+ ##
575
+ # RPC-specific configuration for `delete_tag_binding`
576
+ # @return [::Gapic::Config::Method]
577
+ #
578
+ attr_reader :delete_tag_binding
579
+ ##
580
+ # RPC-specific configuration for `list_effective_tags`
581
+ # @return [::Gapic::Config::Method]
582
+ #
583
+ attr_reader :list_effective_tags
584
+
585
+ # @private
586
+ def initialize parent_rpcs = nil
587
+ list_tag_bindings_config = parent_rpcs.list_tag_bindings if parent_rpcs.respond_to? :list_tag_bindings
588
+ @list_tag_bindings = ::Gapic::Config::Method.new list_tag_bindings_config
589
+ create_tag_binding_config = parent_rpcs.create_tag_binding if parent_rpcs.respond_to? :create_tag_binding
590
+ @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config
591
+ delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding
592
+ @delete_tag_binding = ::Gapic::Config::Method.new delete_tag_binding_config
593
+ list_effective_tags_config = parent_rpcs.list_effective_tags if parent_rpcs.respond_to? :list_effective_tags
594
+ @list_effective_tags = ::Gapic::Config::Method.new list_effective_tags_config
595
+
596
+ yield self if block_given?
597
+ end
598
+ end
599
+ end
600
+ end
601
+ end
602
+ end
603
+ end
604
+ end
605
+ end
606
+ end