google-cloud-resource_manager-v3 0.1.0

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