google-cloud-resource_manager-v3 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/resource_manager/v3/folders/client.rb +47 -35
  4. data/lib/google/cloud/resource_manager/v3/folders/operations.rb +2 -2
  5. data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +47 -35
  6. data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +2 -2
  7. data/lib/google/cloud/resource_manager/v3/organizations/client.rb +12 -10
  8. data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +12 -10
  9. data/lib/google/cloud/resource_manager/v3/projects/client.rb +44 -39
  10. data/lib/google/cloud/resource_manager/v3/projects/operations.rb +2 -2
  11. data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +44 -39
  12. data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +2 -2
  13. data/lib/google/cloud/resource_manager/v3/rest.rb +1 -0
  14. data/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +115 -17
  15. data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +2 -2
  16. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +96 -17
  17. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +2 -2
  18. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +57 -0
  19. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb +1 -1
  20. data/lib/google/cloud/resource_manager/v3/tag_bindings.rb +1 -1
  21. data/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +640 -0
  22. data/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb +52 -0
  23. data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +768 -0
  24. data/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb +64 -0
  25. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +533 -0
  26. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +793 -0
  27. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +226 -0
  28. data/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb +57 -0
  29. data/lib/google/cloud/resource_manager/v3/tag_holds.rb +60 -0
  30. data/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +111 -22
  31. data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +2 -2
  32. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +96 -22
  33. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +2 -2
  34. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +57 -0
  35. data/lib/google/cloud/resource_manager/v3/tag_values/client.rb +123 -29
  36. data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +2 -2
  37. data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +108 -29
  38. data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +2 -2
  39. data/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +57 -0
  40. data/lib/google/cloud/resource_manager/v3/version.rb +1 -1
  41. data/lib/google/cloud/resource_manager/v3.rb +1 -0
  42. data/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb +23 -17
  43. data/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb +16 -13
  44. data/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb +22 -0
  45. data/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb +7 -5
  46. data/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb +63 -0
  47. data/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb +54 -0
  48. data/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb +11 -0
  49. data/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb +6 -2
  50. data/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb +4 -0
  51. data/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb +7 -4
  52. data/proto_docs/google/api/client.rb +57 -3
  53. data/proto_docs/google/cloud/resourcemanager/v3/folders.rb +25 -19
  54. data/proto_docs/google/cloud/resourcemanager/v3/organizations.rb +13 -11
  55. data/proto_docs/google/cloud/resourcemanager/v3/projects.rb +32 -30
  56. data/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb +101 -15
  57. data/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb +161 -0
  58. data/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb +81 -23
  59. data/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb +52 -29
  60. data/proto_docs/google/iam/v1/policy.rb +8 -4
  61. metadata +14 -2
@@ -30,7 +30,7 @@ module Google
30
30
  # REST client for the TagBindings service.
31
31
  #
32
32
  # Allow users to create and manage TagBindings between TagValues and
33
- # different cloud resources throughout the GCP resource hierarchy.
33
+ # different Google Cloud resources throughout the GCP resource hierarchy.
34
34
  #
35
35
  class Client
36
36
  include Paths
@@ -159,8 +159,8 @@ module Google
159
159
  # Service calls
160
160
 
161
161
  ##
162
- # Lists the TagBindings for the given cloud resource, as specified with
163
- # `parent`.
162
+ # Lists the TagBindings for the given Google Cloud resource, as specified
163
+ # with `parent`.
164
164
  #
165
165
  # NOTE: The `parent` field is expected to be a full resource name:
166
166
  # https://cloud.google.com/apis/design/resource_names#full_resource_name
@@ -181,16 +181,16 @@ module Google
181
181
  # the default parameter values, pass an empty Hash as a request object (see above).
182
182
  #
183
183
  # @param parent [::String]
184
- # Required. The full resource name of a resource for which you want to list existing
185
- # TagBindings.
186
- # E.g. "//cloudresourcemanager.googleapis.com/projects/123"
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
187
  # @param page_size [::Integer]
188
- # Optional. The maximum number of TagBindings to return in the response. The server
189
- # allows a maximum of 300 TagBindings to return. If unspecified, the server
190
- # will use 100 as the default.
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
191
  # @param page_token [::String]
192
- # Optional. A pagination token returned from a previous call to `ListTagBindings`
193
- # that indicates where this listing should continue from.
192
+ # Optional. A pagination token returned from a previous call to
193
+ # `ListTagBindings` that indicates where this listing should continue from.
194
194
  # @yield [result, operation] Access the result along with the TransportOperation object
195
195
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>]
196
196
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -235,8 +235,7 @@ module Google
235
235
  end
236
236
 
237
237
  ##
238
- # Creates a TagBinding between a TagValue and a cloud resource
239
- # (currently project, folder, or organization).
238
+ # Creates a TagBinding between a TagValue and a Google Cloud resource.
240
239
  #
241
240
  # @overload create_tag_binding(request, options = nil)
242
241
  # Pass arguments to `create_tag_binding` via a request object, either of type
@@ -256,8 +255,8 @@ module Google
256
255
  # @param tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash]
257
256
  # Required. The TagBinding to be created.
258
257
  # @param validate_only [::Boolean]
259
- # Optional. Set to true to perform the validations necessary for creating the resource,
260
- # but not actually perform the action.
258
+ # Optional. Set to true to perform the validations necessary for creating the
259
+ # resource, but not actually perform the action.
261
260
  # @yield [result, operation] Access the result along with the TransportOperation object
262
261
  # @yieldparam result [::Gapic::Operation]
263
262
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -366,6 +365,79 @@ module Google
366
365
  raise ::Google::Cloud::Error.from_error(e)
367
366
  end
368
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
+
369
441
  ##
370
442
  # Configuration class for the TagBindings REST API.
371
443
  #
@@ -404,9 +476,9 @@ module Google
404
476
  # * (`String`) The path to a service account key file in JSON format
405
477
  # * (`Hash`) A service account key as a Hash
406
478
  # * (`Google::Auth::Credentials`) A googleauth credentials object
407
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
479
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
408
480
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
409
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
481
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
410
482
  # * (`nil`) indicating no credentials
411
483
  # @return [::Object]
412
484
  # @!attribute [rw] scope
@@ -504,6 +576,11 @@ module Google
504
576
  # @return [::Gapic::Config::Method]
505
577
  #
506
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
507
584
 
508
585
  # @private
509
586
  def initialize parent_rpcs = nil
@@ -513,6 +590,8 @@ module Google
513
590
  @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config
514
591
  delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding
515
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
516
595
 
517
596
  yield self if block_given?
518
597
  end
@@ -411,9 +411,9 @@ module Google
411
411
  # * (`String`) The path to a service account key file in JSON format
412
412
  # * (`Hash`) A service account key as a Hash
413
413
  # * (`Google::Auth::Credentials`) A googleauth credentials object
414
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
414
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
415
415
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
416
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
416
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
417
417
  # * (`nil`) indicating no credentials
418
418
  # @return [::Object]
419
419
  # @!attribute [rw] scope
@@ -154,6 +154,44 @@ module Google
154
154
  result
155
155
  end
156
156
 
157
+ ##
158
+ # Baseline implementation for the list_effective_tags REST call
159
+ #
160
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest]
161
+ # A request object representing the call parameters. Required.
162
+ # @param options [::Gapic::CallOptions]
163
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
164
+ #
165
+ # @yield [result, operation] Access the result along with the TransportOperation object
166
+ # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse]
167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
168
+ #
169
+ # @return [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse]
170
+ # A result object deserialized from the server's reply
171
+ def list_effective_tags request_pb, options = nil
172
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
173
+
174
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_tags_request request_pb
175
+ query_string_params = if query_string_params.any?
176
+ query_string_params.to_h { |p| p.split("=", 2) }
177
+ else
178
+ {}
179
+ end
180
+
181
+ response = @client_stub.make_http_request(
182
+ verb,
183
+ uri: uri,
184
+ body: body || "",
185
+ params: query_string_params,
186
+ options: options
187
+ )
188
+ operation = ::Gapic::Rest::TransportOperation.new response
189
+ result = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.decode_json response.body, ignore_unknown_fields: true
190
+
191
+ yield result, operation if block_given?
192
+ result
193
+ end
194
+
157
195
  ##
158
196
  # @private
159
197
  #
@@ -213,6 +251,25 @@ module Google
213
251
  )
214
252
  transcoder.transcode request_pb
215
253
  end
254
+
255
+ ##
256
+ # @private
257
+ #
258
+ # GRPC transcoding helper method for the list_effective_tags REST call
259
+ #
260
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest]
261
+ # A request object representing the call parameters. Required.
262
+ # @return [Array(String, [String, nil], Hash{String => String})]
263
+ # Uri, Body, Query string parameters
264
+ def self.transcode_list_effective_tags_request request_pb
265
+ transcoder = Gapic::Rest::GrpcTranscoder.new
266
+ .with_bindings(
267
+ uri_method: :get,
268
+ uri_template: "/v3/effectiveTags",
269
+ matches: []
270
+ )
271
+ transcoder.transcode request_pb
272
+ end
216
273
  end
217
274
  end
218
275
  end
@@ -33,7 +33,7 @@ module Google
33
33
  module V3
34
34
  ##
35
35
  # Allow users to create and manage TagBindings between TagValues and
36
- # different cloud resources throughout the GCP resource hierarchy.
36
+ # different Google Cloud resources throughout the GCP resource hierarchy.
37
37
  #
38
38
  # To load this service and instantiate a REST client:
39
39
  #
@@ -34,7 +34,7 @@ module Google
34
34
  module V3
35
35
  ##
36
36
  # Allow users to create and manage TagBindings between TagValues and
37
- # different cloud resources throughout the GCP resource hierarchy.
37
+ # different Google Cloud resources throughout the GCP resource hierarchy.
38
38
  #
39
39
  # @example Load this service and instantiate a gRPC client
40
40
  #