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,640 @@
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_holds_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module ResourceManager
25
+ module V3
26
+ module TagHolds
27
+ ##
28
+ # Client for the TagHolds service.
29
+ #
30
+ # Allow users to create and manage TagHolds for TagValues. TagHolds represent
31
+ # the use of a Tag Value that is not captured by TagBindings but
32
+ # should still block TagValue deletion (such as a reference in a policy
33
+ # condition). This service provides isolated failure domains by cloud location
34
+ # so that TagHolds can be managed in the same location as their usage.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :tag_holds_stub
41
+
42
+ ##
43
+ # Configure the TagHolds Client class.
44
+ #
45
+ # See {::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all TagHolds clients
51
+ # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "ResourceManager", "V3"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the TagHolds Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new TagHolds client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the TagHolds client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # These require statements are intentionally placed here to initialize
115
+ # the gRPC module only when it's required.
116
+ # See https://github.com/googleapis/toolkit/issues/446
117
+ require "gapic/grpc"
118
+ require "google/cloud/resourcemanager/v3/tag_holds_services_pb"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ # Use self-signed JWT if the endpoint is unchanged from default,
129
+ # but only if the default endpoint does not have a region prefix.
130
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @tag_holds_stub = ::Gapic::ServiceStub.new(
147
+ ::Google::Cloud::ResourceManager::V3::TagHolds::Stub,
148
+ credentials: credentials,
149
+ endpoint: @config.endpoint,
150
+ channel_args: @config.channel_args,
151
+ interceptors: @config.interceptors
152
+ )
153
+ end
154
+
155
+ ##
156
+ # Get the associated client for long-running operations.
157
+ #
158
+ # @return [::Google::Cloud::ResourceManager::V3::TagHolds::Operations]
159
+ #
160
+ attr_reader :operations_client
161
+
162
+ # Service calls
163
+
164
+ ##
165
+ # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same
166
+ # resource and origin exists under the same TagValue.
167
+ #
168
+ # @overload create_tag_hold(request, options = nil)
169
+ # Pass arguments to `create_tag_hold` via a request object, either of type
170
+ # {::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest} or an equivalent Hash.
171
+ #
172
+ # @param request [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::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 create_tag_hold(parent: nil, tag_hold: nil, validate_only: nil)
179
+ # Pass arguments to `create_tag_hold` 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 resource name of the TagHold's parent TagValue. Must be of
185
+ # the form: `tagValues/{tag-value-id}`.
186
+ # @param tag_hold [::Google::Cloud::ResourceManager::V3::TagHold, ::Hash]
187
+ # Required. The TagHold to be created.
188
+ # @param validate_only [::Boolean]
189
+ # Optional. Set to true to perform the validations necessary for creating the
190
+ # resource, but not actually perform the action.
191
+ #
192
+ # @yield [response, operation] Access the result along with the RPC operation
193
+ # @yieldparam response [::Gapic::Operation]
194
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
195
+ #
196
+ # @return [::Gapic::Operation]
197
+ #
198
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
199
+ #
200
+ # @example Basic example
201
+ # require "google/cloud/resource_manager/v3"
202
+ #
203
+ # # Create a client object. The client can be reused for multiple calls.
204
+ # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new
205
+ #
206
+ # # Create a request. To set request fields, pass in keyword arguments.
207
+ # request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new
208
+ #
209
+ # # Call the create_tag_hold method.
210
+ # result = client.create_tag_hold request
211
+ #
212
+ # # The returned object is of type Gapic::Operation. You can use it to
213
+ # # check the status of an operation, cancel it, or wait for results.
214
+ # # Here is how to wait for a response.
215
+ # result.wait_until_done! timeout: 60
216
+ # if result.response?
217
+ # p result.response
218
+ # else
219
+ # puts "No response received."
220
+ # end
221
+ #
222
+ def create_tag_hold request, options = nil
223
+ raise ::ArgumentError, "request must be provided" if request.nil?
224
+
225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest
226
+
227
+ # Converts hash and nil to an options object
228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
229
+
230
+ # Customize the options with defaults
231
+ metadata = @config.rpcs.create_tag_hold.metadata.to_h
232
+
233
+ # Set x-goog-api-client and x-goog-user-project headers
234
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
235
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
236
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION
237
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
238
+
239
+ header_params = {}
240
+ if request.parent
241
+ header_params["parent"] = request.parent
242
+ end
243
+
244
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
245
+ metadata[:"x-goog-request-params"] ||= request_params_header
246
+
247
+ options.apply_defaults timeout: @config.rpcs.create_tag_hold.timeout,
248
+ metadata: metadata,
249
+ retry_policy: @config.rpcs.create_tag_hold.retry_policy
250
+
251
+ options.apply_defaults timeout: @config.timeout,
252
+ metadata: @config.metadata,
253
+ retry_policy: @config.retry_policy
254
+
255
+ @tag_holds_stub.call_rpc :create_tag_hold, request, options: options do |response, operation|
256
+ response = ::Gapic::Operation.new response, @operations_client, options: options
257
+ yield response, operation if block_given?
258
+ return response
259
+ end
260
+ rescue ::GRPC::BadStatus => e
261
+ raise ::Google::Cloud::Error.from_error(e)
262
+ end
263
+
264
+ ##
265
+ # Deletes a TagHold.
266
+ #
267
+ # @overload delete_tag_hold(request, options = nil)
268
+ # Pass arguments to `delete_tag_hold` via a request object, either of type
269
+ # {::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest} or an equivalent Hash.
270
+ #
271
+ # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Hash]
272
+ # A request object representing the call parameters. Required. To specify no
273
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
274
+ # @param options [::Gapic::CallOptions, ::Hash]
275
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
276
+ #
277
+ # @overload delete_tag_hold(name: nil, validate_only: nil)
278
+ # Pass arguments to `delete_tag_hold` via keyword arguments. Note that at
279
+ # least one keyword argument is required. To specify no parameters, or to keep all
280
+ # the default parameter values, pass an empty Hash as a request object (see above).
281
+ #
282
+ # @param name [::String]
283
+ # Required. The resource name of the TagHold to delete. Must be of the form:
284
+ # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`.
285
+ # @param validate_only [::Boolean]
286
+ # Optional. Set to true to perform the validations necessary for deleting the
287
+ # resource, but not actually perform the action.
288
+ #
289
+ # @yield [response, operation] Access the result along with the RPC operation
290
+ # @yieldparam response [::Gapic::Operation]
291
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
292
+ #
293
+ # @return [::Gapic::Operation]
294
+ #
295
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
296
+ #
297
+ # @example Basic example
298
+ # require "google/cloud/resource_manager/v3"
299
+ #
300
+ # # Create a client object. The client can be reused for multiple calls.
301
+ # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new
302
+ #
303
+ # # Create a request. To set request fields, pass in keyword arguments.
304
+ # request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new
305
+ #
306
+ # # Call the delete_tag_hold method.
307
+ # result = client.delete_tag_hold request
308
+ #
309
+ # # The returned object is of type Gapic::Operation. You can use it to
310
+ # # check the status of an operation, cancel it, or wait for results.
311
+ # # Here is how to wait for a response.
312
+ # result.wait_until_done! timeout: 60
313
+ # if result.response?
314
+ # p result.response
315
+ # else
316
+ # puts "No response received."
317
+ # end
318
+ #
319
+ def delete_tag_hold request, options = nil
320
+ raise ::ArgumentError, "request must be provided" if request.nil?
321
+
322
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest
323
+
324
+ # Converts hash and nil to an options object
325
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
326
+
327
+ # Customize the options with defaults
328
+ metadata = @config.rpcs.delete_tag_hold.metadata.to_h
329
+
330
+ # Set x-goog-api-client and x-goog-user-project headers
331
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
332
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
333
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION
334
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
335
+
336
+ header_params = {}
337
+ if request.name
338
+ header_params["name"] = request.name
339
+ end
340
+
341
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
342
+ metadata[:"x-goog-request-params"] ||= request_params_header
343
+
344
+ options.apply_defaults timeout: @config.rpcs.delete_tag_hold.timeout,
345
+ metadata: metadata,
346
+ retry_policy: @config.rpcs.delete_tag_hold.retry_policy
347
+
348
+ options.apply_defaults timeout: @config.timeout,
349
+ metadata: @config.metadata,
350
+ retry_policy: @config.retry_policy
351
+
352
+ @tag_holds_stub.call_rpc :delete_tag_hold, request, options: options do |response, operation|
353
+ response = ::Gapic::Operation.new response, @operations_client, options: options
354
+ yield response, operation if block_given?
355
+ return response
356
+ end
357
+ rescue ::GRPC::BadStatus => e
358
+ raise ::Google::Cloud::Error.from_error(e)
359
+ end
360
+
361
+ ##
362
+ # Lists TagHolds under a TagValue.
363
+ #
364
+ # @overload list_tag_holds(request, options = nil)
365
+ # Pass arguments to `list_tag_holds` via a request object, either of type
366
+ # {::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest} or an equivalent Hash.
367
+ #
368
+ # @param request [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Hash]
369
+ # A request object representing the call parameters. Required. To specify no
370
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
371
+ # @param options [::Gapic::CallOptions, ::Hash]
372
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
373
+ #
374
+ # @overload list_tag_holds(parent: nil, page_size: nil, page_token: nil, filter: nil)
375
+ # Pass arguments to `list_tag_holds` via keyword arguments. Note that at
376
+ # least one keyword argument is required. To specify no parameters, or to keep all
377
+ # the default parameter values, pass an empty Hash as a request object (see above).
378
+ #
379
+ # @param parent [::String]
380
+ # Required. The resource name of the parent TagValue. Must be of the form:
381
+ # `tagValues/{tag-value-id}`.
382
+ # @param page_size [::Integer]
383
+ # Optional. The maximum number of TagHolds to return in the response. The
384
+ # server allows a maximum of 300 TagHolds to return. If unspecified, the
385
+ # server will use 100 as the default.
386
+ # @param page_token [::String]
387
+ # Optional. A pagination token returned from a previous call to
388
+ # `ListTagHolds` that indicates where this listing should continue from.
389
+ # @param filter [::String]
390
+ # Optional. Criteria used to select a subset of TagHolds parented by the
391
+ # TagValue to return. This field follows the syntax defined by aip.dev/160;
392
+ # the `holder` and `origin` fields are supported for filtering. Currently
393
+ # only `AND` syntax is supported. Some example queries are:
394
+ #
395
+ # * `holder =
396
+ # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group`
397
+ # * `origin = 35678234`
398
+ # * `holder =
399
+ # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group
400
+ # AND origin = 35678234`
401
+ #
402
+ # @yield [response, operation] Access the result along with the RPC operation
403
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>]
404
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
405
+ #
406
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>]
407
+ #
408
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
409
+ #
410
+ # @example Basic example
411
+ # require "google/cloud/resource_manager/v3"
412
+ #
413
+ # # Create a client object. The client can be reused for multiple calls.
414
+ # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new
415
+ #
416
+ # # Create a request. To set request fields, pass in keyword arguments.
417
+ # request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new
418
+ #
419
+ # # Call the list_tag_holds method.
420
+ # result = client.list_tag_holds request
421
+ #
422
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
423
+ # # over elements, and API calls will be issued to fetch pages as needed.
424
+ # result.each do |item|
425
+ # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold.
426
+ # p item
427
+ # end
428
+ #
429
+ def list_tag_holds request, options = nil
430
+ raise ::ArgumentError, "request must be provided" if request.nil?
431
+
432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest
433
+
434
+ # Converts hash and nil to an options object
435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
436
+
437
+ # Customize the options with defaults
438
+ metadata = @config.rpcs.list_tag_holds.metadata.to_h
439
+
440
+ # Set x-goog-api-client and x-goog-user-project headers
441
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
443
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION
444
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
+
446
+ header_params = {}
447
+ if request.parent
448
+ header_params["parent"] = request.parent
449
+ end
450
+
451
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
452
+ metadata[:"x-goog-request-params"] ||= request_params_header
453
+
454
+ options.apply_defaults timeout: @config.rpcs.list_tag_holds.timeout,
455
+ metadata: metadata,
456
+ retry_policy: @config.rpcs.list_tag_holds.retry_policy
457
+
458
+ options.apply_defaults timeout: @config.timeout,
459
+ metadata: @config.metadata,
460
+ retry_policy: @config.retry_policy
461
+
462
+ @tag_holds_stub.call_rpc :list_tag_holds, request, options: options do |response, operation|
463
+ response = ::Gapic::PagedEnumerable.new @tag_holds_stub, :list_tag_holds, request, response, operation, options
464
+ yield response, operation if block_given?
465
+ return response
466
+ end
467
+ rescue ::GRPC::BadStatus => e
468
+ raise ::Google::Cloud::Error.from_error(e)
469
+ end
470
+
471
+ ##
472
+ # Configuration class for the TagHolds API.
473
+ #
474
+ # This class represents the configuration for TagHolds,
475
+ # providing control over timeouts, retry behavior, logging, transport
476
+ # parameters, and other low-level controls. Certain parameters can also be
477
+ # applied individually to specific RPCs. See
478
+ # {::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration::Rpcs}
479
+ # for a list of RPCs that can be configured independently.
480
+ #
481
+ # Configuration can be applied globally to all clients, or to a single client
482
+ # on construction.
483
+ #
484
+ # @example
485
+ #
486
+ # # Modify the global config, setting the timeout for
487
+ # # create_tag_hold to 20 seconds,
488
+ # # and all remaining timeouts to 10 seconds.
489
+ # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config|
490
+ # config.timeout = 10.0
491
+ # config.rpcs.create_tag_hold.timeout = 20.0
492
+ # end
493
+ #
494
+ # # Apply the above configuration only to a new client.
495
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config|
496
+ # config.timeout = 10.0
497
+ # config.rpcs.create_tag_hold.timeout = 20.0
498
+ # end
499
+ #
500
+ # @!attribute [rw] endpoint
501
+ # The hostname or hostname:port of the service endpoint.
502
+ # Defaults to `"cloudresourcemanager.googleapis.com"`.
503
+ # @return [::String]
504
+ # @!attribute [rw] credentials
505
+ # Credentials to send with calls. You may provide any of the following types:
506
+ # * (`String`) The path to a service account key file in JSON format
507
+ # * (`Hash`) A service account key as a Hash
508
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
509
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
510
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
511
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
512
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
513
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
514
+ # * (`nil`) indicating no credentials
515
+ # @return [::Object]
516
+ # @!attribute [rw] scope
517
+ # The OAuth scopes
518
+ # @return [::Array<::String>]
519
+ # @!attribute [rw] lib_name
520
+ # The library name as recorded in instrumentation and logging
521
+ # @return [::String]
522
+ # @!attribute [rw] lib_version
523
+ # The library version as recorded in instrumentation and logging
524
+ # @return [::String]
525
+ # @!attribute [rw] channel_args
526
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
527
+ # `GRPC::Core::Channel` object is provided as the credential.
528
+ # @return [::Hash]
529
+ # @!attribute [rw] interceptors
530
+ # An array of interceptors that are run before calls are executed.
531
+ # @return [::Array<::GRPC::ClientInterceptor>]
532
+ # @!attribute [rw] timeout
533
+ # The call timeout in seconds.
534
+ # @return [::Numeric]
535
+ # @!attribute [rw] metadata
536
+ # Additional gRPC headers to be sent with the call.
537
+ # @return [::Hash{::Symbol=>::String}]
538
+ # @!attribute [rw] retry_policy
539
+ # The retry policy. The value is a hash with the following keys:
540
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
541
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
542
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
543
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
544
+ # trigger a retry.
545
+ # @return [::Hash]
546
+ # @!attribute [rw] quota_project
547
+ # A separate project against which to charge quota.
548
+ # @return [::String]
549
+ #
550
+ class Configuration
551
+ extend ::Gapic::Config
552
+
553
+ config_attr :endpoint, "cloudresourcemanager.googleapis.com", ::String
554
+ config_attr :credentials, nil do |value|
555
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
556
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
557
+ allowed.any? { |klass| klass === value }
558
+ end
559
+ config_attr :scope, nil, ::String, ::Array, nil
560
+ config_attr :lib_name, nil, ::String, nil
561
+ config_attr :lib_version, nil, ::String, nil
562
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
563
+ config_attr :interceptors, nil, ::Array, nil
564
+ config_attr :timeout, nil, ::Numeric, nil
565
+ config_attr :metadata, nil, ::Hash, nil
566
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
567
+ config_attr :quota_project, nil, ::String, nil
568
+
569
+ # @private
570
+ def initialize parent_config = nil
571
+ @parent_config = parent_config unless parent_config.nil?
572
+
573
+ yield self if block_given?
574
+ end
575
+
576
+ ##
577
+ # Configurations for individual RPCs
578
+ # @return [Rpcs]
579
+ #
580
+ def rpcs
581
+ @rpcs ||= begin
582
+ parent_rpcs = nil
583
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
584
+ Rpcs.new parent_rpcs
585
+ end
586
+ end
587
+
588
+ ##
589
+ # Configuration RPC class for the TagHolds API.
590
+ #
591
+ # Includes fields providing the configuration for each RPC in this service.
592
+ # Each configuration object is of type `Gapic::Config::Method` and includes
593
+ # the following configuration fields:
594
+ #
595
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
596
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
597
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
598
+ # include the following keys:
599
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
600
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
601
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
602
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
603
+ # trigger a retry.
604
+ #
605
+ class Rpcs
606
+ ##
607
+ # RPC-specific configuration for `create_tag_hold`
608
+ # @return [::Gapic::Config::Method]
609
+ #
610
+ attr_reader :create_tag_hold
611
+ ##
612
+ # RPC-specific configuration for `delete_tag_hold`
613
+ # @return [::Gapic::Config::Method]
614
+ #
615
+ attr_reader :delete_tag_hold
616
+ ##
617
+ # RPC-specific configuration for `list_tag_holds`
618
+ # @return [::Gapic::Config::Method]
619
+ #
620
+ attr_reader :list_tag_holds
621
+
622
+ # @private
623
+ def initialize parent_rpcs = nil
624
+ create_tag_hold_config = parent_rpcs.create_tag_hold if parent_rpcs.respond_to? :create_tag_hold
625
+ @create_tag_hold = ::Gapic::Config::Method.new create_tag_hold_config
626
+ delete_tag_hold_config = parent_rpcs.delete_tag_hold if parent_rpcs.respond_to? :delete_tag_hold
627
+ @delete_tag_hold = ::Gapic::Config::Method.new delete_tag_hold_config
628
+ list_tag_holds_config = parent_rpcs.list_tag_holds if parent_rpcs.respond_to? :list_tag_holds
629
+ @list_tag_holds = ::Gapic::Config::Method.new list_tag_holds_config
630
+
631
+ yield self if block_given?
632
+ end
633
+ end
634
+ end
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end
640
+ end