google-iam-v2 0.1.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,343 @@
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/iam/v2/policy_pb"
20
+
21
+ module Google
22
+ module Iam
23
+ module V2
24
+ module Policies
25
+ module Rest
26
+ ##
27
+ # REST service stub for the Policies service.
28
+ # Service stub contains baseline method implementations
29
+ # including transcoding, making the REST call, and deserialing the response.
30
+ #
31
+ class ServiceStub
32
+ def initialize endpoint:, credentials:
33
+ # These require statements are intentionally placed here to initialize
34
+ # the REST modules only when it's required.
35
+ require "gapic/rest"
36
+
37
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ numeric_enums: true,
39
+ raise_faraday_errors: false
40
+ end
41
+
42
+ ##
43
+ # Baseline implementation for the list_policies REST call
44
+ #
45
+ # @param request_pb [::Google::Iam::V2::ListPoliciesRequest]
46
+ # A request object representing the call parameters. Required.
47
+ # @param options [::Gapic::CallOptions]
48
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
49
+ #
50
+ # @yield [result, operation] Access the result along with the TransportOperation object
51
+ # @yieldparam result [::Google::Iam::V2::ListPoliciesResponse]
52
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
53
+ #
54
+ # @return [::Google::Iam::V2::ListPoliciesResponse]
55
+ # A result object deserialized from the server's reply
56
+ def list_policies request_pb, options = nil
57
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
58
+
59
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_policies_request request_pb
60
+ query_string_params = if query_string_params.any?
61
+ query_string_params.to_h { |p| p.split("=", 2) }
62
+ else
63
+ {}
64
+ end
65
+
66
+ response = @client_stub.make_http_request(
67
+ verb,
68
+ uri: uri,
69
+ body: body || "",
70
+ params: query_string_params,
71
+ options: options
72
+ )
73
+ operation = ::Gapic::Rest::TransportOperation.new response
74
+ result = ::Google::Iam::V2::ListPoliciesResponse.decode_json response.body, ignore_unknown_fields: true
75
+
76
+ yield result, operation if block_given?
77
+ result
78
+ end
79
+
80
+ ##
81
+ # Baseline implementation for the get_policy REST call
82
+ #
83
+ # @param request_pb [::Google::Iam::V2::GetPolicyRequest]
84
+ # A request object representing the call parameters. Required.
85
+ # @param options [::Gapic::CallOptions]
86
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
87
+ #
88
+ # @yield [result, operation] Access the result along with the TransportOperation object
89
+ # @yieldparam result [::Google::Iam::V2::Policy]
90
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
91
+ #
92
+ # @return [::Google::Iam::V2::Policy]
93
+ # A result object deserialized from the server's reply
94
+ def get_policy request_pb, options = nil
95
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
96
+
97
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_request request_pb
98
+ query_string_params = if query_string_params.any?
99
+ query_string_params.to_h { |p| p.split("=", 2) }
100
+ else
101
+ {}
102
+ end
103
+
104
+ response = @client_stub.make_http_request(
105
+ verb,
106
+ uri: uri,
107
+ body: body || "",
108
+ params: query_string_params,
109
+ options: options
110
+ )
111
+ operation = ::Gapic::Rest::TransportOperation.new response
112
+ result = ::Google::Iam::V2::Policy.decode_json response.body, ignore_unknown_fields: true
113
+
114
+ yield result, operation if block_given?
115
+ result
116
+ end
117
+
118
+ ##
119
+ # Baseline implementation for the create_policy REST call
120
+ #
121
+ # @param request_pb [::Google::Iam::V2::CreatePolicyRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @param options [::Gapic::CallOptions]
124
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
125
+ #
126
+ # @yield [result, operation] Access the result along with the TransportOperation object
127
+ # @yieldparam result [::Google::Longrunning::Operation]
128
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
129
+ #
130
+ # @return [::Google::Longrunning::Operation]
131
+ # A result object deserialized from the server's reply
132
+ def create_policy request_pb, options = nil
133
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
134
+
135
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_request request_pb
136
+ query_string_params = if query_string_params.any?
137
+ query_string_params.to_h { |p| p.split("=", 2) }
138
+ else
139
+ {}
140
+ end
141
+
142
+ response = @client_stub.make_http_request(
143
+ verb,
144
+ uri: uri,
145
+ body: body || "",
146
+ params: query_string_params,
147
+ options: options
148
+ )
149
+ operation = ::Gapic::Rest::TransportOperation.new response
150
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
151
+
152
+ yield result, operation if block_given?
153
+ result
154
+ end
155
+
156
+ ##
157
+ # Baseline implementation for the update_policy REST call
158
+ #
159
+ # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest]
160
+ # A request object representing the call parameters. Required.
161
+ # @param options [::Gapic::CallOptions]
162
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
163
+ #
164
+ # @yield [result, operation] Access the result along with the TransportOperation object
165
+ # @yieldparam result [::Google::Longrunning::Operation]
166
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
167
+ #
168
+ # @return [::Google::Longrunning::Operation]
169
+ # A result object deserialized from the server's reply
170
+ def update_policy request_pb, options = nil
171
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
172
+
173
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_request request_pb
174
+ query_string_params = if query_string_params.any?
175
+ query_string_params.to_h { |p| p.split("=", 2) }
176
+ else
177
+ {}
178
+ end
179
+
180
+ response = @client_stub.make_http_request(
181
+ verb,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ options: options
186
+ )
187
+ operation = ::Gapic::Rest::TransportOperation.new response
188
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
189
+
190
+ yield result, operation if block_given?
191
+ result
192
+ end
193
+
194
+ ##
195
+ # Baseline implementation for the delete_policy REST call
196
+ #
197
+ # @param request_pb [::Google::Iam::V2::DeletePolicyRequest]
198
+ # A request object representing the call parameters. Required.
199
+ # @param options [::Gapic::CallOptions]
200
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
201
+ #
202
+ # @yield [result, operation] Access the result along with the TransportOperation object
203
+ # @yieldparam result [::Google::Longrunning::Operation]
204
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
205
+ #
206
+ # @return [::Google::Longrunning::Operation]
207
+ # A result object deserialized from the server's reply
208
+ def delete_policy request_pb, options = nil
209
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
210
+
211
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_request request_pb
212
+ query_string_params = if query_string_params.any?
213
+ query_string_params.to_h { |p| p.split("=", 2) }
214
+ else
215
+ {}
216
+ end
217
+
218
+ response = @client_stub.make_http_request(
219
+ verb,
220
+ uri: uri,
221
+ body: body || "",
222
+ params: query_string_params,
223
+ options: options
224
+ )
225
+ operation = ::Gapic::Rest::TransportOperation.new response
226
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
227
+
228
+ yield result, operation if block_given?
229
+ result
230
+ end
231
+
232
+ ##
233
+ # @private
234
+ #
235
+ # GRPC transcoding helper method for the list_policies REST call
236
+ #
237
+ # @param request_pb [::Google::Iam::V2::ListPoliciesRequest]
238
+ # A request object representing the call parameters. Required.
239
+ # @return [Array(String, [String, nil], Hash{String => String})]
240
+ # Uri, Body, Query string parameters
241
+ def self.transcode_list_policies_request request_pb
242
+ transcoder = Gapic::Rest::GrpcTranscoder.new
243
+ .with_bindings(
244
+ uri_method: :get,
245
+ uri_template: "/v2/{parent}",
246
+ matches: [
247
+ ["parent", %r{^policies/[^/]+/[^/]+/?$}, false]
248
+ ]
249
+ )
250
+ transcoder.transcode request_pb
251
+ end
252
+
253
+ ##
254
+ # @private
255
+ #
256
+ # GRPC transcoding helper method for the get_policy REST call
257
+ #
258
+ # @param request_pb [::Google::Iam::V2::GetPolicyRequest]
259
+ # A request object representing the call parameters. Required.
260
+ # @return [Array(String, [String, nil], Hash{String => String})]
261
+ # Uri, Body, Query string parameters
262
+ def self.transcode_get_policy_request request_pb
263
+ transcoder = Gapic::Rest::GrpcTranscoder.new
264
+ .with_bindings(
265
+ uri_method: :get,
266
+ uri_template: "/v2/{name}",
267
+ matches: [
268
+ ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false]
269
+ ]
270
+ )
271
+ transcoder.transcode request_pb
272
+ end
273
+
274
+ ##
275
+ # @private
276
+ #
277
+ # GRPC transcoding helper method for the create_policy REST call
278
+ #
279
+ # @param request_pb [::Google::Iam::V2::CreatePolicyRequest]
280
+ # A request object representing the call parameters. Required.
281
+ # @return [Array(String, [String, nil], Hash{String => String})]
282
+ # Uri, Body, Query string parameters
283
+ def self.transcode_create_policy_request request_pb
284
+ transcoder = Gapic::Rest::GrpcTranscoder.new
285
+ .with_bindings(
286
+ uri_method: :post,
287
+ uri_template: "/v2/{parent}",
288
+ body: "policy",
289
+ matches: [
290
+ ["parent", %r{^policies/[^/]+/[^/]+/?$}, false]
291
+ ]
292
+ )
293
+ transcoder.transcode request_pb
294
+ end
295
+
296
+ ##
297
+ # @private
298
+ #
299
+ # GRPC transcoding helper method for the update_policy REST call
300
+ #
301
+ # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest]
302
+ # A request object representing the call parameters. Required.
303
+ # @return [Array(String, [String, nil], Hash{String => String})]
304
+ # Uri, Body, Query string parameters
305
+ def self.transcode_update_policy_request request_pb
306
+ transcoder = Gapic::Rest::GrpcTranscoder.new
307
+ .with_bindings(
308
+ uri_method: :put,
309
+ uri_template: "/v2/{policy.name}",
310
+ body: "policy",
311
+ matches: [
312
+ ["policy.name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false]
313
+ ]
314
+ )
315
+ transcoder.transcode request_pb
316
+ end
317
+
318
+ ##
319
+ # @private
320
+ #
321
+ # GRPC transcoding helper method for the delete_policy REST call
322
+ #
323
+ # @param request_pb [::Google::Iam::V2::DeletePolicyRequest]
324
+ # A request object representing the call parameters. Required.
325
+ # @return [Array(String, [String, nil], Hash{String => String})]
326
+ # Uri, Body, Query string parameters
327
+ def self.transcode_delete_policy_request request_pb
328
+ transcoder = Gapic::Rest::GrpcTranscoder.new
329
+ .with_bindings(
330
+ uri_method: :delete,
331
+ uri_template: "/v2/{name}",
332
+ matches: [
333
+ ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false]
334
+ ]
335
+ )
336
+ transcoder.transcode request_pb
337
+ end
338
+ end
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
@@ -0,0 +1,50 @@
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/iam/v2/version"
24
+
25
+ require "google/iam/v2/policies/credentials"
26
+ require "google/iam/v2/policies/rest/operations"
27
+ require "google/iam/v2/policies/rest/client"
28
+
29
+ module Google
30
+ module Iam
31
+ module V2
32
+ ##
33
+ # An interface for managing Identity and Access Management (IAM) policies.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/iam/v2/policies/rest"
38
+ # client = ::Google::Iam::V2::Policies::Rest::Client.new
39
+ #
40
+ module Policies
41
+ # Client for the REST transport
42
+ module Rest
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
50
+ require "google/iam/v2/policies/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/iam/v2/version"
25
25
  require "google/iam/v2/policies/credentials"
26
26
  require "google/iam/v2/policies/operations"
27
27
  require "google/iam/v2/policies/client"
28
+ require "google/iam/v2/policies/rest"
28
29
 
29
30
  module Google
30
31
  module Iam
@@ -32,11 +33,16 @@ module Google
32
33
  ##
33
34
  # An interface for managing Identity and Access Management (IAM) policies.
34
35
  #
35
- # To load this service and instantiate a client:
36
+ # @example Load this service and instantiate a gRPC client
36
37
  #
37
38
  # require "google/iam/v2/policies"
38
39
  # client = ::Google::Iam::V2::Policies::Client.new
39
40
  #
41
+ # @example Load this service and instantiate a REST client
42
+ #
43
+ # require "google/iam/v2/policies/rest"
44
+ # client = ::Google::Iam::V2::Policies::Rest::Client.new
45
+ #
40
46
  module Policies
41
47
  end
42
48
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/iam/v2/policy.proto
3
4
 
@@ -10,55 +11,33 @@ require 'google/iam/v2/deny_pb'
10
11
  require 'google/longrunning/operations_pb'
11
12
  require 'google/protobuf/timestamp_pb'
12
13
 
13
- Google::Protobuf::DescriptorPool.generated_pool.build do
14
- add_file("google/iam/v2/policy.proto", :syntax => :proto3) do
15
- add_message "google.iam.v2.Policy" do
16
- optional :name, :string, 1
17
- optional :uid, :string, 2
18
- optional :kind, :string, 3
19
- optional :display_name, :string, 4
20
- map :annotations, :string, :string, 5
21
- optional :etag, :string, 6
22
- optional :create_time, :message, 7, "google.protobuf.Timestamp"
23
- optional :update_time, :message, 8, "google.protobuf.Timestamp"
24
- optional :delete_time, :message, 9, "google.protobuf.Timestamp"
25
- repeated :rules, :message, 10, "google.iam.v2.PolicyRule"
26
- optional :managing_authority, :string, 11
27
- end
28
- add_message "google.iam.v2.PolicyRule" do
29
- optional :description, :string, 1
30
- oneof :kind do
31
- optional :deny_rule, :message, 2, "google.iam.v2.DenyRule"
32
- end
33
- end
34
- add_message "google.iam.v2.ListPoliciesRequest" do
35
- optional :parent, :string, 1
36
- optional :page_size, :int32, 2
37
- optional :page_token, :string, 3
38
- end
39
- add_message "google.iam.v2.ListPoliciesResponse" do
40
- repeated :policies, :message, 1, "google.iam.v2.Policy"
41
- optional :next_page_token, :string, 2
42
- end
43
- add_message "google.iam.v2.GetPolicyRequest" do
44
- optional :name, :string, 1
45
- end
46
- add_message "google.iam.v2.CreatePolicyRequest" do
47
- optional :parent, :string, 1
48
- optional :policy, :message, 2, "google.iam.v2.Policy"
49
- optional :policy_id, :string, 3
50
- end
51
- add_message "google.iam.v2.UpdatePolicyRequest" do
52
- optional :policy, :message, 1, "google.iam.v2.Policy"
53
- end
54
- add_message "google.iam.v2.DeletePolicyRequest" do
55
- optional :name, :string, 1
56
- optional :etag, :string, 2
57
- end
58
- add_message "google.iam.v2.PolicyOperationMetadata" do
59
- optional :create_time, :message, 1, "google.protobuf.Timestamp"
14
+
15
+ descriptor_data = "\n\x1agoogle/iam/v2/policy.proto\x12\rgoogle.iam.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/iam/v2/deny.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc2\x03\n\x06Policy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04kind\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12;\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32&.google.iam.v2.Policy.AnnotationsEntry\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12(\n\x05rules\x18\n \x03(\x0b\x32\x19.google.iam.v2.PolicyRule\x12\x1f\n\x12managing_authority\x18\x0b \x01(\tB\x03\xe0\x41\x05\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"W\n\nPolicyRule\x12,\n\tdeny_rule\x18\x02 \x01(\x0b\x32\x17.google.iam.v2.DenyRuleH\x00\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x06\n\x04kind\"Q\n\x13ListPoliciesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"X\n\x14ListPoliciesResponse\x12\'\n\x08policies\x18\x01 \x03(\x0b\x32\x15.google.iam.v2.Policy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"%\n\x10GetPolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"i\n\x13\x43reatePolicyRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\x12\x11\n\tpolicy_id\x18\x03 \x01(\t\"A\n\x13UpdatePolicyRequest\x12*\n\x06policy\x18\x01 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\";\n\x13\x44\x65letePolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"J\n\x17PolicyOperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xd0\x06\n\x08Policies\x12\x83\x01\n\x0cListPolicies\x12\".google.iam.v2.ListPoliciesRequest\x1a#.google.iam.v2.ListPoliciesResponse\"*\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{parent=policies/*/*}\xda\x41\x06parent\x12m\n\tGetPolicy\x12\x1f.google.iam.v2.GetPolicyRequest\x1a\x15.google.iam.v2.Policy\"(\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{name=policies/*/*/*}\xda\x41\x04name\x12\xba\x01\n\x0c\x43reatePolicy\x12\".google.iam.v2.CreatePolicyRequest\x1a\x1d.google.longrunning.Operation\"g\x82\xd3\xe4\x93\x02#\"\x19/v2/{parent=policies/*/*}:\x06policy\xda\x41\x17parent,policy,policy_id\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\x12\xa7\x01\n\x0cUpdatePolicy\x12\".google.iam.v2.UpdatePolicyRequest\x1a\x1d.google.longrunning.Operation\"T\x82\xd3\xe4\x93\x02*\x1a /v2/{policy.name=policies/*/*/*}:\x06policy\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\x12\x9f\x01\n\x0c\x44\x65letePolicy\x12\".google.iam.v2.DeletePolicyRequest\x1a\x1d.google.longrunning.Operation\"L\x82\xd3\xe4\x93\x02\x1b*\x19/v2/{name=policies/*/*/*}\xda\x41\x04name\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n\x11\x63om.google.iam.v2B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv2/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V2\xca\x02\x13Google\\Cloud\\Iam\\V2b\x06proto3"
16
+
17
+ pool = Google::Protobuf::DescriptorPool.generated_pool
18
+
19
+ begin
20
+ pool.add_serialized_file(descriptor_data)
21
+ rescue TypeError => e
22
+ # Compatibility code: will be removed in the next major version.
23
+ require 'google/protobuf/descriptor_pb'
24
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
25
+ parsed.clear_dependency
26
+ serialized = parsed.class.encode(parsed)
27
+ file = pool.add_serialized_file(serialized)
28
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
29
+ imports = [
30
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
31
+ ["google.iam.v2.DenyRule", "google/iam/v2/deny.proto"],
32
+ ]
33
+ imports.each do |type_name, expected_filename|
34
+ import_file = pool.lookup(type_name).file_descriptor
35
+ if import_file.name != expected_filename
36
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
60
37
  end
61
38
  end
39
+ warn "Each proto file must use a consistent fully-qualified name."
40
+ warn "This will become an error in the next major version."
62
41
  end
63
42
 
64
43
  module Google
@@ -0,0 +1,35 @@
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/iam/v2/policies/rest"
20
+ require "google/iam/v2/version"
21
+
22
+ module Google
23
+ module Iam
24
+ ##
25
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
26
+ #
27
+ # @example
28
+ #
29
+ # require "google/iam/v2/rest"
30
+ # client = ::Google::Iam::V2::Policies::Rest::Client.new
31
+ #
32
+ module V2
33
+ end
34
+ end
35
+ end
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Iam
22
22
  module V2
23
- VERSION = "0.1.2"
23
+ VERSION = "0.3.0"
24
24
  end
25
25
  end
26
26
  end
data/lib/google/iam/v2.rb CHANGED
@@ -22,13 +22,18 @@ require "google/iam/v2/version"
22
22
  module Google
23
23
  module Iam
24
24
  ##
25
- # To load this package, including all its services, and instantiate a client:
25
+ # API client module.
26
26
  #
27
- # @example
27
+ # @example Load this package, including all its services, and instantiate a gRPC client
28
28
  #
29
29
  # require "google/iam/v2"
30
30
  # client = ::Google::Iam::V2::Policies::Client.new
31
31
  #
32
+ # @example Load this package, including all its services, and instantiate a REST client
33
+ #
34
+ # require "google/iam/v2"
35
+ # client = ::Google::Iam::V2::Policies::Rest::Client.new
36
+ #
32
37
  module V2
33
38
  end
34
39
  end