google-cloud-policy_troubleshooter-iam-v3 0.a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/client.rb +391 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/credentials.rb +49 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/client.rb +356 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub.rb +108 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest.rb +55 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter.rb +58 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/rest.rb +39 -0
- data/lib/google/cloud/policy_troubleshooter/iam/v3/version.rb +7 -2
- data/lib/google/cloud/policy_troubleshooter/iam/v3.rb +47 -0
- data/lib/google/cloud/policytroubleshooter/iam/v3/troubleshooter_pb.rb +86 -0
- data/lib/google/cloud/policytroubleshooter/iam/v3/troubleshooter_services_pb.rb +51 -0
- data/lib/google-cloud-policy_troubleshooter-iam-v3.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/policytroubleshooter/iam/v3/troubleshooter.rb +826 -0
- data/proto_docs/google/iam/v1/policy.rb +426 -0
- data/proto_docs/google/iam/v2/deny.rb +110 -0
- data/proto_docs/google/iam/v2/policy.rb +241 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +229 -13
@@ -0,0 +1,356 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/policytroubleshooter/iam/v3/troubleshooter_pb"
|
21
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module PolicyTroubleshooter
|
26
|
+
module Iam
|
27
|
+
module V3
|
28
|
+
module PolicyTroubleshooter
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the PolicyTroubleshooter service.
|
32
|
+
#
|
33
|
+
# IAM Policy Troubleshooter service.
|
34
|
+
#
|
35
|
+
# This service helps you troubleshoot access issues for Google Cloud resources.
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
# @private
|
39
|
+
attr_reader :policy_troubleshooter_stub
|
40
|
+
|
41
|
+
##
|
42
|
+
# Configure the PolicyTroubleshooter Client class.
|
43
|
+
#
|
44
|
+
# See {::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client::Configuration}
|
45
|
+
# for a description of the configuration fields.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
#
|
49
|
+
# # Modify the configuration for all PolicyTroubleshooter clients
|
50
|
+
# ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# @yield [config] Configure the Client client.
|
55
|
+
# @yieldparam config [Client::Configuration]
|
56
|
+
#
|
57
|
+
# @return [Client::Configuration]
|
58
|
+
#
|
59
|
+
def self.configure
|
60
|
+
@configure ||= begin
|
61
|
+
namespace = ["Google", "Cloud", "PolicyTroubleshooter", "Iam", "V3"]
|
62
|
+
parent_config = while namespace.any?
|
63
|
+
parent_name = namespace.join "::"
|
64
|
+
parent_const = const_get parent_name
|
65
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
66
|
+
namespace.pop
|
67
|
+
end
|
68
|
+
default_config = Client::Configuration.new parent_config
|
69
|
+
|
70
|
+
default_config.rpcs.troubleshoot_iam_policy.timeout = 60.0
|
71
|
+
default_config.rpcs.troubleshoot_iam_policy.retry_policy = {
|
72
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
73
|
+
}
|
74
|
+
|
75
|
+
default_config
|
76
|
+
end
|
77
|
+
yield @configure if block_given?
|
78
|
+
@configure
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Configure the PolicyTroubleshooter Client instance.
|
83
|
+
#
|
84
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
85
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
86
|
+
# should be made on {Client.configure}.
|
87
|
+
#
|
88
|
+
# See {::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client::Configuration}
|
89
|
+
# for a description of the configuration fields.
|
90
|
+
#
|
91
|
+
# @yield [config] Configure the Client client.
|
92
|
+
# @yieldparam config [Client::Configuration]
|
93
|
+
#
|
94
|
+
# @return [Client::Configuration]
|
95
|
+
#
|
96
|
+
def configure
|
97
|
+
yield @config if block_given?
|
98
|
+
@config
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Create a new PolicyTroubleshooter REST client object.
|
103
|
+
#
|
104
|
+
# @example
|
105
|
+
#
|
106
|
+
# # Create a client using the default configuration
|
107
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new
|
108
|
+
#
|
109
|
+
# # Create a client using a custom configuration
|
110
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new do |config|
|
111
|
+
# config.timeout = 10.0
|
112
|
+
# end
|
113
|
+
#
|
114
|
+
# @yield [config] Configure the PolicyTroubleshooter client.
|
115
|
+
# @yieldparam config [Client::Configuration]
|
116
|
+
#
|
117
|
+
def initialize
|
118
|
+
# Create the configuration object
|
119
|
+
@config = Configuration.new Client.configure
|
120
|
+
|
121
|
+
# Yield the configuration if needed
|
122
|
+
yield @config if block_given?
|
123
|
+
|
124
|
+
# Create credentials
|
125
|
+
credentials = @config.credentials
|
126
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
|
+
# but only if the default endpoint does not have a region prefix.
|
128
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
129
|
+
!@config.endpoint.split(".").first.include?("-")
|
130
|
+
credentials ||= Credentials.default scope: @config.scope,
|
131
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
132
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
133
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
134
|
+
end
|
135
|
+
|
136
|
+
@quota_project_id = @config.quota_project
|
137
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
138
|
+
|
139
|
+
@policy_troubleshooter_stub = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
140
|
+
end
|
141
|
+
|
142
|
+
# Service calls
|
143
|
+
|
144
|
+
##
|
145
|
+
# Checks whether a principal has a specific permission for a specific
|
146
|
+
# resource, and explains why the principal does or doesn't have that
|
147
|
+
# permission.
|
148
|
+
#
|
149
|
+
# @overload troubleshoot_iam_policy(request, options = nil)
|
150
|
+
# Pass arguments to `troubleshoot_iam_policy` via a request object, either of type
|
151
|
+
# {::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest} or an equivalent Hash.
|
152
|
+
#
|
153
|
+
# @param request [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest, ::Hash]
|
154
|
+
# A request object representing the call parameters. Required. To specify no
|
155
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
156
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
157
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
158
|
+
#
|
159
|
+
# @overload troubleshoot_iam_policy(access_tuple: nil)
|
160
|
+
# Pass arguments to `troubleshoot_iam_policy` via keyword arguments. Note that at
|
161
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
162
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
163
|
+
#
|
164
|
+
# @param access_tuple [::Google::Cloud::PolicyTroubleshooter::Iam::V3::AccessTuple, ::Hash]
|
165
|
+
# The information to use for checking whether a principal has a permission
|
166
|
+
# for a resource.
|
167
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
168
|
+
# @yieldparam result [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse]
|
169
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
170
|
+
#
|
171
|
+
# @return [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse]
|
172
|
+
#
|
173
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
174
|
+
def troubleshoot_iam_policy request, options = nil
|
175
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
176
|
+
|
177
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest
|
178
|
+
|
179
|
+
# Converts hash and nil to an options object
|
180
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
181
|
+
|
182
|
+
# Customize the options with defaults
|
183
|
+
call_metadata = @config.rpcs.troubleshoot_iam_policy.metadata.to_h
|
184
|
+
|
185
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
186
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
187
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
188
|
+
gapic_version: ::Google::Cloud::PolicyTroubleshooter::Iam::V3::VERSION,
|
189
|
+
transports_version_send: [:rest]
|
190
|
+
|
191
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
192
|
+
|
193
|
+
options.apply_defaults timeout: @config.rpcs.troubleshoot_iam_policy.timeout,
|
194
|
+
metadata: call_metadata,
|
195
|
+
retry_policy: @config.rpcs.troubleshoot_iam_policy.retry_policy
|
196
|
+
|
197
|
+
options.apply_defaults timeout: @config.timeout,
|
198
|
+
metadata: @config.metadata,
|
199
|
+
retry_policy: @config.retry_policy
|
200
|
+
|
201
|
+
@policy_troubleshooter_stub.troubleshoot_iam_policy request, options do |result, operation|
|
202
|
+
yield result, operation if block_given?
|
203
|
+
return result
|
204
|
+
end
|
205
|
+
rescue ::Gapic::Rest::Error => e
|
206
|
+
raise ::Google::Cloud::Error.from_error(e)
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Configuration class for the PolicyTroubleshooter REST API.
|
211
|
+
#
|
212
|
+
# This class represents the configuration for PolicyTroubleshooter REST,
|
213
|
+
# providing control over timeouts, retry behavior, logging, transport
|
214
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
215
|
+
# applied individually to specific RPCs. See
|
216
|
+
# {::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client::Configuration::Rpcs}
|
217
|
+
# for a list of RPCs that can be configured independently.
|
218
|
+
#
|
219
|
+
# Configuration can be applied globally to all clients, or to a single client
|
220
|
+
# on construction.
|
221
|
+
#
|
222
|
+
# @example
|
223
|
+
#
|
224
|
+
# # Modify the global config, setting the timeout for
|
225
|
+
# # troubleshoot_iam_policy to 20 seconds,
|
226
|
+
# # and all remaining timeouts to 10 seconds.
|
227
|
+
# ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.configure do |config|
|
228
|
+
# config.timeout = 10.0
|
229
|
+
# config.rpcs.troubleshoot_iam_policy.timeout = 20.0
|
230
|
+
# end
|
231
|
+
#
|
232
|
+
# # Apply the above configuration only to a new client.
|
233
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new do |config|
|
234
|
+
# config.timeout = 10.0
|
235
|
+
# config.rpcs.troubleshoot_iam_policy.timeout = 20.0
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
# @!attribute [rw] endpoint
|
239
|
+
# The hostname or hostname:port of the service endpoint.
|
240
|
+
# Defaults to `"policytroubleshooter.googleapis.com"`.
|
241
|
+
# @return [::String]
|
242
|
+
# @!attribute [rw] credentials
|
243
|
+
# Credentials to send with calls. You may provide any of the following types:
|
244
|
+
# * (`String`) The path to a service account key file in JSON format
|
245
|
+
# * (`Hash`) A service account key as a Hash
|
246
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
247
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
248
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
249
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
250
|
+
# * (`nil`) indicating no credentials
|
251
|
+
# @return [::Object]
|
252
|
+
# @!attribute [rw] scope
|
253
|
+
# The OAuth scopes
|
254
|
+
# @return [::Array<::String>]
|
255
|
+
# @!attribute [rw] lib_name
|
256
|
+
# The library name as recorded in instrumentation and logging
|
257
|
+
# @return [::String]
|
258
|
+
# @!attribute [rw] lib_version
|
259
|
+
# The library version as recorded in instrumentation and logging
|
260
|
+
# @return [::String]
|
261
|
+
# @!attribute [rw] timeout
|
262
|
+
# The call timeout in seconds.
|
263
|
+
# @return [::Numeric]
|
264
|
+
# @!attribute [rw] metadata
|
265
|
+
# Additional headers to be sent with the call.
|
266
|
+
# @return [::Hash{::Symbol=>::String}]
|
267
|
+
# @!attribute [rw] retry_policy
|
268
|
+
# The retry policy. The value is a hash with the following keys:
|
269
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
270
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
271
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
272
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
273
|
+
# trigger a retry.
|
274
|
+
# @return [::Hash]
|
275
|
+
# @!attribute [rw] quota_project
|
276
|
+
# A separate project against which to charge quota.
|
277
|
+
# @return [::String]
|
278
|
+
#
|
279
|
+
class Configuration
|
280
|
+
extend ::Gapic::Config
|
281
|
+
|
282
|
+
DEFAULT_ENDPOINT = "policytroubleshooter.googleapis.com"
|
283
|
+
|
284
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
285
|
+
config_attr :credentials, nil do |value|
|
286
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
287
|
+
allowed.any? { |klass| klass === value }
|
288
|
+
end
|
289
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
290
|
+
config_attr :lib_name, nil, ::String, nil
|
291
|
+
config_attr :lib_version, nil, ::String, nil
|
292
|
+
config_attr :timeout, nil, ::Numeric, nil
|
293
|
+
config_attr :metadata, nil, ::Hash, nil
|
294
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
295
|
+
config_attr :quota_project, nil, ::String, nil
|
296
|
+
|
297
|
+
# @private
|
298
|
+
def initialize parent_config = nil
|
299
|
+
@parent_config = parent_config unless parent_config.nil?
|
300
|
+
|
301
|
+
yield self if block_given?
|
302
|
+
end
|
303
|
+
|
304
|
+
##
|
305
|
+
# Configurations for individual RPCs
|
306
|
+
# @return [Rpcs]
|
307
|
+
#
|
308
|
+
def rpcs
|
309
|
+
@rpcs ||= begin
|
310
|
+
parent_rpcs = nil
|
311
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
312
|
+
Rpcs.new parent_rpcs
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
##
|
317
|
+
# Configuration RPC class for the PolicyTroubleshooter API.
|
318
|
+
#
|
319
|
+
# Includes fields providing the configuration for each RPC in this service.
|
320
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
321
|
+
# the following configuration fields:
|
322
|
+
#
|
323
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
324
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
325
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
326
|
+
# include the following keys:
|
327
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
328
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
329
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
330
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
331
|
+
# trigger a retry.
|
332
|
+
#
|
333
|
+
class Rpcs
|
334
|
+
##
|
335
|
+
# RPC-specific configuration for `troubleshoot_iam_policy`
|
336
|
+
# @return [::Gapic::Config::Method]
|
337
|
+
#
|
338
|
+
attr_reader :troubleshoot_iam_policy
|
339
|
+
|
340
|
+
# @private
|
341
|
+
def initialize parent_rpcs = nil
|
342
|
+
troubleshoot_iam_policy_config = parent_rpcs.troubleshoot_iam_policy if parent_rpcs.respond_to? :troubleshoot_iam_policy
|
343
|
+
@troubleshoot_iam_policy = ::Gapic::Config::Method.new troubleshoot_iam_policy_config
|
344
|
+
|
345
|
+
yield self if block_given?
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
@@ -0,0 +1,108 @@
|
|
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/policytroubleshooter/iam/v3/troubleshooter_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module PolicyTroubleshooter
|
24
|
+
module Iam
|
25
|
+
module V3
|
26
|
+
module PolicyTroubleshooter
|
27
|
+
module Rest
|
28
|
+
##
|
29
|
+
# REST service stub for the PolicyTroubleshooter service.
|
30
|
+
# Service stub contains baseline method implementations
|
31
|
+
# including transcoding, making the REST call, and deserialing the response.
|
32
|
+
#
|
33
|
+
class ServiceStub
|
34
|
+
def initialize endpoint:, credentials:
|
35
|
+
# These require statements are intentionally placed here to initialize
|
36
|
+
# the REST modules only when it's required.
|
37
|
+
require "gapic/rest"
|
38
|
+
|
39
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
40
|
+
numeric_enums: true,
|
41
|
+
raise_faraday_errors: false
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Baseline implementation for the troubleshoot_iam_policy REST call
|
46
|
+
#
|
47
|
+
# @param request_pb [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest]
|
48
|
+
# A request object representing the call parameters. Required.
|
49
|
+
# @param options [::Gapic::CallOptions]
|
50
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
51
|
+
#
|
52
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
53
|
+
# @yieldparam result [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse]
|
54
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
55
|
+
#
|
56
|
+
# @return [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse]
|
57
|
+
# A result object deserialized from the server's reply
|
58
|
+
def troubleshoot_iam_policy request_pb, options = nil
|
59
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
60
|
+
|
61
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_troubleshoot_iam_policy_request request_pb
|
62
|
+
query_string_params = if query_string_params.any?
|
63
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
64
|
+
else
|
65
|
+
{}
|
66
|
+
end
|
67
|
+
|
68
|
+
response = @client_stub.make_http_request(
|
69
|
+
verb,
|
70
|
+
uri: uri,
|
71
|
+
body: body || "",
|
72
|
+
params: query_string_params,
|
73
|
+
options: options
|
74
|
+
)
|
75
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
76
|
+
result = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse.decode_json response.body, ignore_unknown_fields: true
|
77
|
+
|
78
|
+
yield result, operation if block_given?
|
79
|
+
result
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# @private
|
84
|
+
#
|
85
|
+
# GRPC transcoding helper method for the troubleshoot_iam_policy REST call
|
86
|
+
#
|
87
|
+
# @param request_pb [::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest]
|
88
|
+
# A request object representing the call parameters. Required.
|
89
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
90
|
+
# Uri, Body, Query string parameters
|
91
|
+
def self.transcode_troubleshoot_iam_policy_request request_pb
|
92
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
93
|
+
.with_bindings(
|
94
|
+
uri_method: :post,
|
95
|
+
uri_template: "/v3/iam:troubleshoot",
|
96
|
+
body: "*",
|
97
|
+
matches: []
|
98
|
+
)
|
99
|
+
transcoder.transcode request_pb
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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/policy_troubleshooter/iam/v3/version"
|
24
|
+
|
25
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/credentials"
|
26
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/client"
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module PolicyTroubleshooter
|
31
|
+
module Iam
|
32
|
+
module V3
|
33
|
+
##
|
34
|
+
# IAM Policy Troubleshooter service.
|
35
|
+
#
|
36
|
+
# This service helps you troubleshoot access issues for Google Cloud resources.
|
37
|
+
#
|
38
|
+
# To load this service and instantiate a REST client:
|
39
|
+
#
|
40
|
+
# require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest"
|
41
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new
|
42
|
+
#
|
43
|
+
module PolicyTroubleshooter
|
44
|
+
# Client for the REST transport
|
45
|
+
module Rest
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
55
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,58 @@
|
|
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/policy_troubleshooter/iam/v3/version"
|
24
|
+
|
25
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/credentials"
|
26
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/client"
|
27
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module PolicyTroubleshooter
|
32
|
+
module Iam
|
33
|
+
module V3
|
34
|
+
##
|
35
|
+
# IAM Policy Troubleshooter service.
|
36
|
+
#
|
37
|
+
# This service helps you troubleshoot access issues for Google Cloud resources.
|
38
|
+
#
|
39
|
+
# @example Load this service and instantiate a gRPC client
|
40
|
+
#
|
41
|
+
# require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter"
|
42
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.new
|
43
|
+
#
|
44
|
+
# @example Load this service and instantiate a REST client
|
45
|
+
#
|
46
|
+
# require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest"
|
47
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new
|
48
|
+
#
|
49
|
+
module PolicyTroubleshooter
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
helper_path = ::File.join __dir__, "policy_troubleshooter", "helpers.rb"
|
58
|
+
require "google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,39 @@
|
|
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/policy_troubleshooter/iam/v3/policy_troubleshooter/rest"
|
20
|
+
require "google/cloud/policy_troubleshooter/iam/v3/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module PolicyTroubleshooter
|
25
|
+
module Iam
|
26
|
+
##
|
27
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
#
|
31
|
+
# require "google/cloud/policy_troubleshooter/iam/v3/rest"
|
32
|
+
# client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new
|
33
|
+
#
|
34
|
+
module V3
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2023 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
5
7
|
# You may obtain a copy of the License at
|
6
8
|
#
|
7
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
10
|
#
|
9
11
|
# Unless required by applicable law or agreed to in writing, software
|
10
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -12,12 +14,15 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
15
20
|
module Google
|
16
21
|
module Cloud
|
17
22
|
module PolicyTroubleshooter
|
18
23
|
module Iam
|
19
24
|
module V3
|
20
|
-
VERSION = "0.
|
25
|
+
VERSION = "0.1.0"
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|