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,226 @@
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/resourcemanager/v3/tag_holds_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module ResourceManager
24
+ module V3
25
+ module TagHolds
26
+ module Rest
27
+ ##
28
+ # REST service stub for the TagHolds service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: true,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the create_tag_hold REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Longrunning::Operation]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Longrunning::Operation]
56
+ # A result object deserialized from the server's reply
57
+ def create_tag_hold request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_hold_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # Baseline implementation for the delete_tag_hold REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest]
85
+ # A request object representing the call parameters. Required.
86
+ # @param options [::Gapic::CallOptions]
87
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ #
89
+ # @yield [result, operation] Access the result along with the TransportOperation object
90
+ # @yieldparam result [::Google::Longrunning::Operation]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Longrunning::Operation]
94
+ # A result object deserialized from the server's reply
95
+ def delete_tag_hold request_pb, options = nil
96
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
97
+
98
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_hold_request request_pb
99
+ query_string_params = if query_string_params.any?
100
+ query_string_params.to_h { |p| p.split("=", 2) }
101
+ else
102
+ {}
103
+ end
104
+
105
+ response = @client_stub.make_http_request(
106
+ verb,
107
+ uri: uri,
108
+ body: body || "",
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ operation = ::Gapic::Rest::TransportOperation.new response
113
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
114
+
115
+ yield result, operation if block_given?
116
+ result
117
+ end
118
+
119
+ ##
120
+ # Baseline implementation for the list_tag_holds REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @param options [::Gapic::CallOptions]
125
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
126
+ #
127
+ # @yield [result, operation] Access the result along with the TransportOperation object
128
+ # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse]
132
+ # A result object deserialized from the server's reply
133
+ def list_tag_holds request_pb, options = nil
134
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
135
+
136
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_holds_request request_pb
137
+ query_string_params = if query_string_params.any?
138
+ query_string_params.to_h { |p| p.split("=", 2) }
139
+ else
140
+ {}
141
+ end
142
+
143
+ response = @client_stub.make_http_request(
144
+ verb,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ options: options
149
+ )
150
+ operation = ::Gapic::Rest::TransportOperation.new response
151
+ result = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.decode_json response.body, ignore_unknown_fields: true
152
+
153
+ yield result, operation if block_given?
154
+ result
155
+ end
156
+
157
+ ##
158
+ # @private
159
+ #
160
+ # GRPC transcoding helper method for the create_tag_hold REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest]
163
+ # A request object representing the call parameters. Required.
164
+ # @return [Array(String, [String, nil], Hash{String => String})]
165
+ # Uri, Body, Query string parameters
166
+ def self.transcode_create_tag_hold_request request_pb
167
+ transcoder = Gapic::Rest::GrpcTranscoder.new
168
+ .with_bindings(
169
+ uri_method: :post,
170
+ uri_template: "/v3/{parent}/tagHolds",
171
+ body: "tag_hold",
172
+ matches: [
173
+ ["parent", %r{^tagValues/[^/]+/?$}, false]
174
+ ]
175
+ )
176
+ transcoder.transcode request_pb
177
+ end
178
+
179
+ ##
180
+ # @private
181
+ #
182
+ # GRPC transcoding helper method for the delete_tag_hold REST call
183
+ #
184
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest]
185
+ # A request object representing the call parameters. Required.
186
+ # @return [Array(String, [String, nil], Hash{String => String})]
187
+ # Uri, Body, Query string parameters
188
+ def self.transcode_delete_tag_hold_request request_pb
189
+ transcoder = Gapic::Rest::GrpcTranscoder.new
190
+ .with_bindings(
191
+ uri_method: :delete,
192
+ uri_template: "/v3/{name}",
193
+ matches: [
194
+ ["name", %r{^tagValues/[^/]+/tagHolds/[^/]+/?$}, false]
195
+ ]
196
+ )
197
+ transcoder.transcode request_pb
198
+ end
199
+
200
+ ##
201
+ # @private
202
+ #
203
+ # GRPC transcoding helper method for the list_tag_holds REST call
204
+ #
205
+ # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest]
206
+ # A request object representing the call parameters. Required.
207
+ # @return [Array(String, [String, nil], Hash{String => String})]
208
+ # Uri, Body, Query string parameters
209
+ def self.transcode_list_tag_holds_request request_pb
210
+ transcoder = Gapic::Rest::GrpcTranscoder.new
211
+ .with_bindings(
212
+ uri_method: :get,
213
+ uri_template: "/v3/{parent}/tagHolds",
214
+ matches: [
215
+ ["parent", %r{^tagValues/[^/]+/?$}, false]
216
+ ]
217
+ )
218
+ transcoder.transcode request_pb
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,57 @@
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 "gapic/rest"
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_holds/credentials"
26
+ require "google/cloud/resource_manager/v3/tag_holds/paths"
27
+ require "google/cloud/resource_manager/v3/tag_holds/rest/operations"
28
+ require "google/cloud/resource_manager/v3/tag_holds/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module ResourceManager
33
+ module V3
34
+ ##
35
+ # Allow users to create and manage TagHolds for TagValues. TagHolds represent
36
+ # the use of a Tag Value that is not captured by TagBindings but
37
+ # should still block TagValue deletion (such as a reference in a policy
38
+ # condition). This service provides isolated failure domains by cloud location
39
+ # so that TagHolds can be managed in the same location as their usage.
40
+ #
41
+ # To load this service and instantiate a REST client:
42
+ #
43
+ # require "google/cloud/resource_manager/v3/tag_holds/rest"
44
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new
45
+ #
46
+ module TagHolds
47
+ # Client for the REST transport
48
+ module Rest
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
57
+ require "google/cloud/resource_manager/v3/tag_holds/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,60 @@
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 "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_holds/credentials"
26
+ require "google/cloud/resource_manager/v3/tag_holds/paths"
27
+ require "google/cloud/resource_manager/v3/tag_holds/operations"
28
+ require "google/cloud/resource_manager/v3/tag_holds/client"
29
+ require "google/cloud/resource_manager/v3/tag_holds/rest"
30
+
31
+ module Google
32
+ module Cloud
33
+ module ResourceManager
34
+ module V3
35
+ ##
36
+ # Allow users to create and manage TagHolds for TagValues. TagHolds represent
37
+ # the use of a Tag Value that is not captured by TagBindings but
38
+ # should still block TagValue deletion (such as a reference in a policy
39
+ # condition). This service provides isolated failure domains by cloud location
40
+ # so that TagHolds can be managed in the same location as their usage.
41
+ #
42
+ # @example Load this service and instantiate a gRPC client
43
+ #
44
+ # require "google/cloud/resource_manager/v3/tag_holds"
45
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new
46
+ #
47
+ # @example Load this service and instantiate a REST client
48
+ #
49
+ # require "google/cloud/resource_manager/v3/tag_holds/rest"
50
+ # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new
51
+ #
52
+ module TagHolds
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+ helper_path = ::File.join __dir__, "tag_holds", "helpers.rb"
60
+ require "google/cloud/resource_manager/v3/tag_holds/helpers" if ::File.file? helper_path
@@ -202,9 +202,9 @@ module Google
202
202
  # Required. The resource name of the new TagKey's parent.
203
203
  # Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
204
204
  # @param page_size [::Integer]
205
- # Optional. The maximum number of TagKeys to return in the response. The server allows
206
- # a maximum of 300 TagKeys to return. If unspecified, the server will use 100
207
- # as the default.
205
+ # Optional. The maximum number of TagKeys to return in the response. The
206
+ # server allows a maximum of 300 TagKeys to return. If unspecified, the
207
+ # server will use 100 as the default.
208
208
  # @param page_token [::String]
209
209
  # Optional. A pagination token returned from a previous call to `ListTagKey`
210
210
  # that indicates where this listing should continue from.
@@ -229,13 +229,11 @@ module Google
229
229
  # # Call the list_tag_keys method.
230
230
  # result = client.list_tag_keys request
231
231
  #
232
- # # The returned object is of type Gapic::PagedEnumerable. You can
233
- # # iterate over all elements by calling #each, and the enumerable
234
- # # will lazily make API calls to fetch subsequent pages. Other
235
- # # methods are also available for managing paging directly.
236
- # result.each do |response|
232
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
233
+ # # over elements, and API calls will be issued to fetch pages as needed.
234
+ # result.each do |item|
237
235
  # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey.
238
- # p response
236
+ # p item
239
237
  # end
240
238
  #
241
239
  def list_tag_keys request, options = nil
@@ -359,11 +357,93 @@ module Google
359
357
  raise ::Google::Cloud::Error.from_error(e)
360
358
  end
361
359
 
360
+ ##
361
+ # Retrieves a TagKey by its namespaced name.
362
+ # This method will return `PERMISSION_DENIED` if the key does not exist
363
+ # or the user does not have permission to view it.
364
+ #
365
+ # @overload get_namespaced_tag_key(request, options = nil)
366
+ # Pass arguments to `get_namespaced_tag_key` via a request object, either of type
367
+ # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest} or an equivalent Hash.
368
+ #
369
+ # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Hash]
370
+ # A request object representing the call parameters. Required. To specify no
371
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
372
+ # @param options [::Gapic::CallOptions, ::Hash]
373
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
374
+ #
375
+ # @overload get_namespaced_tag_key(name: nil)
376
+ # Pass arguments to `get_namespaced_tag_key` via keyword arguments. Note that at
377
+ # least one keyword argument is required. To specify no parameters, or to keep all
378
+ # the default parameter values, pass an empty Hash as a request object (see above).
379
+ #
380
+ # @param name [::String]
381
+ # Required. A namespaced tag key name in the format
382
+ # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name
383
+ # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short
384
+ # name "bar" under the project `r2-d2`.
385
+ #
386
+ # @yield [response, operation] Access the result along with the RPC operation
387
+ # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagKey]
388
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
389
+ #
390
+ # @return [::Google::Cloud::ResourceManager::V3::TagKey]
391
+ #
392
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
393
+ #
394
+ # @example Basic example
395
+ # require "google/cloud/resource_manager/v3"
396
+ #
397
+ # # Create a client object. The client can be reused for multiple calls.
398
+ # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new
399
+ #
400
+ # # Create a request. To set request fields, pass in keyword arguments.
401
+ # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new
402
+ #
403
+ # # Call the get_namespaced_tag_key method.
404
+ # result = client.get_namespaced_tag_key request
405
+ #
406
+ # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey.
407
+ # p result
408
+ #
409
+ def get_namespaced_tag_key request, options = nil
410
+ raise ::ArgumentError, "request must be provided" if request.nil?
411
+
412
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest
413
+
414
+ # Converts hash and nil to an options object
415
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
416
+
417
+ # Customize the options with defaults
418
+ metadata = @config.rpcs.get_namespaced_tag_key.metadata.to_h
419
+
420
+ # Set x-goog-api-client and x-goog-user-project headers
421
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
422
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
423
+ gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION
424
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
425
+
426
+ options.apply_defaults timeout: @config.rpcs.get_namespaced_tag_key.timeout,
427
+ metadata: metadata,
428
+ retry_policy: @config.rpcs.get_namespaced_tag_key.retry_policy
429
+
430
+ options.apply_defaults timeout: @config.timeout,
431
+ metadata: @config.metadata,
432
+ retry_policy: @config.retry_policy
433
+
434
+ @tag_keys_stub.call_rpc :get_namespaced_tag_key, request, options: options do |response, operation|
435
+ yield response, operation if block_given?
436
+ return response
437
+ end
438
+ rescue ::GRPC::BadStatus => e
439
+ raise ::Google::Cloud::Error.from_error(e)
440
+ end
441
+
362
442
  ##
363
443
  # Creates a new TagKey. If another request with the same parameters is
364
444
  # sent while the original request is in process, the second request
365
- # will receive an error. A maximum of 300 TagKeys can exist under a parent at
366
- # any given time.
445
+ # will receive an error. A maximum of 1000 TagKeys can exist under a parent
446
+ # at any given time.
367
447
  #
368
448
  # @overload create_tag_key(request, options = nil)
369
449
  # Pass arguments to `create_tag_key` via a request object, either of type
@@ -381,11 +461,11 @@ module Google
381
461
  # the default parameter values, pass an empty Hash as a request object (see above).
382
462
  #
383
463
  # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash]
384
- # Required. The TagKey to be created. Only fields `short_name`, `description`,
385
- # and `parent` are considered during the creation request.
464
+ # Required. The TagKey to be created. Only fields `short_name`,
465
+ # `description`, and `parent` are considered during the creation request.
386
466
  # @param validate_only [::Boolean]
387
- # Optional. Set to true to perform validations necessary for creating the resource, but
388
- # not actually perform the action.
467
+ # Optional. Set to true to perform validations necessary for creating the
468
+ # resource, but not actually perform the action.
389
469
  #
390
470
  # @yield [response, operation] Access the result along with the RPC operation
391
471
  # @yieldparam response [::Gapic::Operation]
@@ -407,14 +487,14 @@ module Google
407
487
  # # Call the create_tag_key method.
408
488
  # result = client.create_tag_key request
409
489
  #
410
- # # The returned object is of type Gapic::Operation. You can use this
411
- # # object to check the status of an operation, cancel it, or wait
412
- # # for results. Here is how to block until completion:
490
+ # # The returned object is of type Gapic::Operation. You can use it to
491
+ # # check the status of an operation, cancel it, or wait for results.
492
+ # # Here is how to wait for a response.
413
493
  # result.wait_until_done! timeout: 60
414
494
  # if result.response?
415
495
  # p result.response
416
496
  # else
417
- # puts "Error!"
497
+ # puts "No response received."
418
498
  # end
419
499
  #
420
500
  def create_tag_key request, options = nil
@@ -470,10 +550,10 @@ module Google
470
550
  # the default parameter values, pass an empty Hash as a request object (see above).
471
551
  #
472
552
  # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash]
473
- # Required. The new definition of the TagKey. Only the `description` and `etag` fields
474
- # can be updated by this request. If the `etag` field is not empty, it
475
- # must match the `etag` field of the existing tag key. Otherwise,
476
- # `FAILED_PRECONDITION` will be returned.
553
+ # Required. The new definition of the TagKey. Only the `description` and
554
+ # `etag` fields can be updated by this request. If the `etag` field is not
555
+ # empty, it must match the `etag` field of the existing tag key. Otherwise,
556
+ # `ABORTED` will be returned.
477
557
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
478
558
  # Fields to be updated. The mask may only contain `description` or
479
559
  # `etag`. If omitted entirely, both `description` and `etag` are assumed to
@@ -502,14 +582,14 @@ module Google
502
582
  # # Call the update_tag_key method.
503
583
  # result = client.update_tag_key request
504
584
  #
505
- # # The returned object is of type Gapic::Operation. You can use this
506
- # # object to check the status of an operation, cancel it, or wait
507
- # # for results. Here is how to block until completion:
585
+ # # The returned object is of type Gapic::Operation. You can use it to
586
+ # # check the status of an operation, cancel it, or wait for results.
587
+ # # Here is how to wait for a response.
508
588
  # result.wait_until_done! timeout: 60
509
589
  # if result.response?
510
590
  # p result.response
511
591
  # else
512
- # puts "Error!"
592
+ # puts "No response received."
513
593
  # end
514
594
  #
515
595
  def update_tag_key request, options = nil
@@ -574,15 +654,15 @@ module Google
574
654
  # the default parameter values, pass an empty Hash as a request object (see above).
575
655
  #
576
656
  # @param name [::String]
577
- # Required. The resource name of a TagKey to be deleted in the format `tagKeys/123`.
578
- # The TagKey cannot be a parent of any existing TagValues or it will not be
579
- # deleted successfully.
657
+ # Required. The resource name of a TagKey to be deleted in the format
658
+ # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or
659
+ # it will not be deleted successfully.
580
660
  # @param validate_only [::Boolean]
581
- # Optional. Set as true to perform validations necessary for deletion, but not actually
582
- # perform the action.
661
+ # Optional. Set as true to perform validations necessary for deletion, but
662
+ # not actually perform the action.
583
663
  # @param etag [::String]
584
- # Optional. The etag known to the client for the expected state of the TagKey. This is
585
- # to be used for optimistic concurrency.
664
+ # Optional. The etag known to the client for the expected state of the
665
+ # TagKey. This is to be used for optimistic concurrency.
586
666
  #
587
667
  # @yield [response, operation] Access the result along with the RPC operation
588
668
  # @yieldparam response [::Gapic::Operation]
@@ -604,14 +684,14 @@ module Google
604
684
  # # Call the delete_tag_key method.
605
685
  # result = client.delete_tag_key request
606
686
  #
607
- # # The returned object is of type Gapic::Operation. You can use this
608
- # # object to check the status of an operation, cancel it, or wait
609
- # # for results. Here is how to block until completion:
687
+ # # The returned object is of type Gapic::Operation. You can use it to
688
+ # # check the status of an operation, cancel it, or wait for results.
689
+ # # Here is how to wait for a response.
610
690
  # result.wait_until_done! timeout: 60
611
691
  # if result.response?
612
692
  # p result.response
613
693
  # else
614
- # puts "Error!"
694
+ # puts "No response received."
615
695
  # end
616
696
  #
617
697
  def delete_tag_key request, options = nil
@@ -984,9 +1064,9 @@ module Google
984
1064
  # * (`String`) The path to a service account key file in JSON format
985
1065
  # * (`Hash`) A service account key as a Hash
986
1066
  # * (`Google::Auth::Credentials`) A googleauth credentials object
987
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1067
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
988
1068
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
989
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1069
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
990
1070
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
991
1071
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
992
1072
  # * (`nil`) indicating no credentials
@@ -1092,6 +1172,11 @@ module Google
1092
1172
  #
1093
1173
  attr_reader :get_tag_key
1094
1174
  ##
1175
+ # RPC-specific configuration for `get_namespaced_tag_key`
1176
+ # @return [::Gapic::Config::Method]
1177
+ #
1178
+ attr_reader :get_namespaced_tag_key
1179
+ ##
1095
1180
  # RPC-specific configuration for `create_tag_key`
1096
1181
  # @return [::Gapic::Config::Method]
1097
1182
  #
@@ -1128,6 +1213,8 @@ module Google
1128
1213
  @list_tag_keys = ::Gapic::Config::Method.new list_tag_keys_config
1129
1214
  get_tag_key_config = parent_rpcs.get_tag_key if parent_rpcs.respond_to? :get_tag_key
1130
1215
  @get_tag_key = ::Gapic::Config::Method.new get_tag_key_config
1216
+ get_namespaced_tag_key_config = parent_rpcs.get_namespaced_tag_key if parent_rpcs.respond_to? :get_namespaced_tag_key
1217
+ @get_namespaced_tag_key = ::Gapic::Config::Method.new get_namespaced_tag_key_config
1131
1218
  create_tag_key_config = parent_rpcs.create_tag_key if parent_rpcs.respond_to? :create_tag_key
1132
1219
  @create_tag_key = ::Gapic::Config::Method.new create_tag_key_config
1133
1220
  update_tag_key_config = parent_rpcs.update_tag_key if parent_rpcs.respond_to? :update_tag_key