google-cloud-policy_simulator-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/policy_simulator/v1/rest.rb +37 -0
  6. data/lib/google/cloud/policy_simulator/v1/simulator/client.rb +660 -0
  7. data/lib/google/cloud/policy_simulator/v1/simulator/credentials.rb +47 -0
  8. data/lib/google/cloud/policy_simulator/v1/simulator/operations.rb +770 -0
  9. data/lib/google/cloud/policy_simulator/v1/simulator/paths.rb +91 -0
  10. data/lib/google/cloud/policy_simulator/v1/simulator/rest/client.rb +560 -0
  11. data/lib/google/cloud/policy_simulator/v1/simulator/rest/operations.rb +837 -0
  12. data/lib/google/cloud/policy_simulator/v1/simulator/rest/service_stub.rb +270 -0
  13. data/lib/google/cloud/policy_simulator/v1/simulator/rest.rb +64 -0
  14. data/lib/google/cloud/policy_simulator/v1/simulator.rb +67 -0
  15. data/lib/google/cloud/policy_simulator/v1/version.rb +7 -2
  16. data/lib/google/cloud/policy_simulator/v1.rb +45 -0
  17. data/lib/google/cloud/policysimulator/v1/explanations_pb.rb +55 -0
  18. data/lib/google/cloud/policysimulator/v1/simulator_pb.rb +72 -0
  19. data/lib/google/cloud/policysimulator/v1/simulator_services_pb.rb +63 -0
  20. data/lib/google-cloud-policy_simulator-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +381 -0
  23. data/proto_docs/google/api/field_behavior.rb +71 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/api/resource.rb +222 -0
  26. data/proto_docs/google/cloud/policysimulator/v1/explanations.rb +277 -0
  27. data/proto_docs/google/cloud/policysimulator/v1/simulator.rb +396 -0
  28. data/proto_docs/google/iam/v1/policy.rb +422 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +144 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  34. data/proto_docs/google/rpc/status.rb +48 -0
  35. data/proto_docs/google/type/date.rb +53 -0
  36. data/proto_docs/google/type/expr.rb +75 -0
  37. metadata +215 -12
@@ -0,0 +1,270 @@
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/policysimulator/v1/simulator_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module PolicySimulator
24
+ module V1
25
+ module Simulator
26
+ module Rest
27
+ ##
28
+ # REST service stub for the Simulator 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 get_replay REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::GetReplayRequest]
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::Cloud::PolicySimulator::V1::Replay]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::PolicySimulator::V1::Replay]
56
+ # A result object deserialized from the server's reply
57
+ def get_replay 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_get_replay_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::Cloud::PolicySimulator::V1::Replay.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 create_replay REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::CreateReplayRequest]
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 create_replay 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_create_replay_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_replay_results REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::ListReplayResultsRequest]
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::PolicySimulator::V1::ListReplayResultsResponse]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::PolicySimulator::V1::ListReplayResultsResponse]
132
+ # A result object deserialized from the server's reply
133
+ def list_replay_results 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_replay_results_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::PolicySimulator::V1::ListReplayResultsResponse.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 get_replay REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::GetReplayRequest]
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_get_replay_request request_pb
167
+ transcoder = Gapic::Rest::GrpcTranscoder.new
168
+ .with_bindings(
169
+ uri_method: :get,
170
+ uri_template: "/v1/{name}",
171
+ matches: [
172
+ ["name", %r{^projects/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
173
+ ]
174
+ )
175
+ .with_bindings(
176
+ uri_method: :get,
177
+ uri_template: "/v1/{name}",
178
+ matches: [
179
+ ["name", %r{^folders/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
180
+ ]
181
+ )
182
+ .with_bindings(
183
+ uri_method: :get,
184
+ uri_template: "/v1/{name}",
185
+ matches: [
186
+ ["name", %r{^organizations/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
187
+ ]
188
+ )
189
+ transcoder.transcode request_pb
190
+ end
191
+
192
+ ##
193
+ # @private
194
+ #
195
+ # GRPC transcoding helper method for the create_replay REST call
196
+ #
197
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::CreateReplayRequest]
198
+ # A request object representing the call parameters. Required.
199
+ # @return [Array(String, [String, nil], Hash{String => String})]
200
+ # Uri, Body, Query string parameters
201
+ def self.transcode_create_replay_request request_pb
202
+ transcoder = Gapic::Rest::GrpcTranscoder.new
203
+ .with_bindings(
204
+ uri_method: :post,
205
+ uri_template: "/v1/{parent}/replays",
206
+ body: "replay",
207
+ matches: [
208
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
209
+ ]
210
+ )
211
+ .with_bindings(
212
+ uri_method: :post,
213
+ uri_template: "/v1/{parent}/replays",
214
+ body: "replay",
215
+ matches: [
216
+ ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false]
217
+ ]
218
+ )
219
+ .with_bindings(
220
+ uri_method: :post,
221
+ uri_template: "/v1/{parent}/replays",
222
+ body: "replay",
223
+ matches: [
224
+ ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
225
+ ]
226
+ )
227
+ transcoder.transcode request_pb
228
+ end
229
+
230
+ ##
231
+ # @private
232
+ #
233
+ # GRPC transcoding helper method for the list_replay_results REST call
234
+ #
235
+ # @param request_pb [::Google::Cloud::PolicySimulator::V1::ListReplayResultsRequest]
236
+ # A request object representing the call parameters. Required.
237
+ # @return [Array(String, [String, nil], Hash{String => String})]
238
+ # Uri, Body, Query string parameters
239
+ def self.transcode_list_replay_results_request request_pb
240
+ transcoder = Gapic::Rest::GrpcTranscoder.new
241
+ .with_bindings(
242
+ uri_method: :get,
243
+ uri_template: "/v1/{parent}/results",
244
+ matches: [
245
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
246
+ ]
247
+ )
248
+ .with_bindings(
249
+ uri_method: :get,
250
+ uri_template: "/v1/{parent}/results",
251
+ matches: [
252
+ ["parent", %r{^folders/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
253
+ ]
254
+ )
255
+ .with_bindings(
256
+ uri_method: :get,
257
+ uri_template: "/v1/{parent}/results",
258
+ matches: [
259
+ ["parent", %r{^organizations/[^/]+/locations/[^/]+/replays/[^/]+/?$}, false]
260
+ ]
261
+ )
262
+ transcoder.transcode request_pb
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
270
+ end
@@ -0,0 +1,64 @@
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_simulator/v1/version"
24
+
25
+ require "google/cloud/policy_simulator/v1/simulator/credentials"
26
+ require "google/cloud/policy_simulator/v1/simulator/paths"
27
+ require "google/cloud/policy_simulator/v1/simulator/rest/operations"
28
+ require "google/cloud/policy_simulator/v1/simulator/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module PolicySimulator
33
+ module V1
34
+ ##
35
+ # Policy Simulator API service.
36
+ #
37
+ # Policy Simulator is a collection of endpoints for creating, running, and
38
+ # viewing a {::Google::Cloud::PolicySimulator::V1::Replay Replay}. A
39
+ # {::Google::Cloud::PolicySimulator::V1::Replay Replay} is a type of simulation that
40
+ # lets you see how your principals' access to resources might change if you
41
+ # changed your IAM policy.
42
+ #
43
+ # During a {::Google::Cloud::PolicySimulator::V1::Replay Replay}, Policy Simulator
44
+ # re-evaluates, or replays, past access attempts under both the current policy
45
+ # and your proposed policy, and compares those results to determine how your
46
+ # principals' access might change under the proposed policy.
47
+ #
48
+ # To load this service and instantiate a REST client:
49
+ #
50
+ # require "google/cloud/policy_simulator/v1/simulator/rest"
51
+ # client = ::Google::Cloud::PolicySimulator::V1::Simulator::Rest::Client.new
52
+ #
53
+ module Simulator
54
+ # Client for the REST transport
55
+ module Rest
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
64
+ require "google/cloud/policy_simulator/v1/simulator/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,67 @@
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_simulator/v1/version"
24
+
25
+ require "google/cloud/policy_simulator/v1/simulator/credentials"
26
+ require "google/cloud/policy_simulator/v1/simulator/paths"
27
+ require "google/cloud/policy_simulator/v1/simulator/operations"
28
+ require "google/cloud/policy_simulator/v1/simulator/client"
29
+ require "google/cloud/policy_simulator/v1/simulator/rest"
30
+
31
+ module Google
32
+ module Cloud
33
+ module PolicySimulator
34
+ module V1
35
+ ##
36
+ # Policy Simulator API service.
37
+ #
38
+ # Policy Simulator is a collection of endpoints for creating, running, and
39
+ # viewing a {::Google::Cloud::PolicySimulator::V1::Replay Replay}. A
40
+ # {::Google::Cloud::PolicySimulator::V1::Replay Replay} is a type of simulation that
41
+ # lets you see how your principals' access to resources might change if you
42
+ # changed your IAM policy.
43
+ #
44
+ # During a {::Google::Cloud::PolicySimulator::V1::Replay Replay}, Policy Simulator
45
+ # re-evaluates, or replays, past access attempts under both the current policy
46
+ # and your proposed policy, and compares those results to determine how your
47
+ # principals' access might change under the proposed policy.
48
+ #
49
+ # @example Load this service and instantiate a gRPC client
50
+ #
51
+ # require "google/cloud/policy_simulator/v1/simulator"
52
+ # client = ::Google::Cloud::PolicySimulator::V1::Simulator::Client.new
53
+ #
54
+ # @example Load this service and instantiate a REST client
55
+ #
56
+ # require "google/cloud/policy_simulator/v1/simulator/rest"
57
+ # client = ::Google::Cloud::PolicySimulator::V1::Simulator::Rest::Client.new
58
+ #
59
+ module Simulator
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ helper_path = ::File.join __dir__, "simulator", "helpers.rb"
67
+ require "google/cloud/policy_simulator/v1/simulator/helpers" if ::File.file? helper_path
@@ -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
- # http://www.apache.org/licenses/LICENSE-2.0
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,11 +14,14 @@
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 PolicySimulator
18
23
  module V1
19
- VERSION = "0.a"
24
+ VERSION = "0.1.0"
20
25
  end
21
26
  end
22
27
  end
@@ -0,0 +1,45 @@
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_simulator/v1/simulator"
20
+ require "google/cloud/policy_simulator/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module PolicySimulator
25
+ ##
26
+ # API client module.
27
+ #
28
+ # @example Load this package, including all its services, and instantiate a gRPC client
29
+ #
30
+ # require "google/cloud/policy_simulator/v1"
31
+ # client = ::Google::Cloud::PolicySimulator::V1::Simulator::Client.new
32
+ #
33
+ # @example Load this package, including all its services, and instantiate a REST client
34
+ #
35
+ # require "google/cloud/policy_simulator/v1"
36
+ # client = ::Google::Cloud::PolicySimulator::V1::Simulator::Rest::Client.new
37
+ #
38
+ module V1
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
45
+ require "google/cloud/policy_simulator/v1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/cloud/policysimulator/v1/explanations.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/iam/v1/policy_pb'
9
+ require 'google/type/expr_pb'
10
+
11
+
12
+ descriptor_data = "\n2google/cloud/policysimulator/v1/explanations.proto\x12\x1fgoogle.cloud.policysimulator.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x16google/type/expr.proto\"_\n\x0b\x41\x63\x63\x65ssTuple\x12\x16\n\tprincipal\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x66ull_resource_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\npermission\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xad\x02\n\x0f\x45xplainedPolicy\x12<\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32,.google.cloud.policysimulator.v1.AccessState\x12\x1a\n\x12\x66ull_resource_name\x18\x02 \x01(\t\x12%\n\x06policy\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12Q\n\x14\x62inding_explanations\x18\x04 \x03(\x0b\x32\x33.google.cloud.policysimulator.v1.BindingExplanation\x12\x46\n\trelevance\x18\x05 \x01(\x0e\x32\x33.google.cloud.policysimulator.v1.HeuristicRelevance\"\xda\x08\n\x12\x42indingExplanation\x12\x41\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32,.google.cloud.policysimulator.v1.AccessStateB\x03\xe0\x41\x02\x12\x0c\n\x04role\x18\x02 \x01(\t\x12[\n\x0frole_permission\x18\x03 \x01(\x0e\x32\x42.google.cloud.policysimulator.v1.BindingExplanation.RolePermission\x12V\n\x19role_permission_relevance\x18\x04 \x01(\x0e\x32\x33.google.cloud.policysimulator.v1.HeuristicRelevance\x12Y\n\x0bmemberships\x18\x05 \x03(\x0b\x32\x44.google.cloud.policysimulator.v1.BindingExplanation.MembershipsEntry\x12\x46\n\trelevance\x18\x06 \x01(\x0e\x32\x33.google.cloud.policysimulator.v1.HeuristicRelevance\x12$\n\tcondition\x18\x07 \x01(\x0b\x32\x11.google.type.Expr\x1a\xb1\x01\n\x13\x41nnotatedMembership\x12R\n\nmembership\x18\x01 \x01(\x0e\x32>.google.cloud.policysimulator.v1.BindingExplanation.Membership\x12\x46\n\trelevance\x18\x02 \x01(\x0e\x32\x33.google.cloud.policysimulator.v1.HeuristicRelevance\x1a{\n\x10MembershipsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12V\n\x05value\x18\x02 \x01(\x0b\x32G.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership:\x02\x38\x01\"\x9a\x01\n\x0eRolePermission\x12\x1f\n\x1bROLE_PERMISSION_UNSPECIFIED\x10\x00\x12\x1c\n\x18ROLE_PERMISSION_INCLUDED\x10\x01\x12 \n\x1cROLE_PERMISSION_NOT_INCLUDED\x10\x02\x12\'\n#ROLE_PERMISSION_UNKNOWN_INFO_DENIED\x10\x03\"\xa6\x01\n\nMembership\x12\x1a\n\x16MEMBERSHIP_UNSPECIFIED\x10\x00\x12\x17\n\x13MEMBERSHIP_INCLUDED\x10\x01\x12\x1b\n\x17MEMBERSHIP_NOT_INCLUDED\x10\x02\x12\"\n\x1eMEMBERSHIP_UNKNOWN_INFO_DENIED\x10\x03\x12\"\n\x1eMEMBERSHIP_UNKNOWN_UNSUPPORTED\x10\x04*{\n\x0b\x41\x63\x63\x65ssState\x12\x1c\n\x18\x41\x43\x43\x45SS_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07GRANTED\x10\x01\x12\x0f\n\x0bNOT_GRANTED\x10\x02\x12\x17\n\x13UNKNOWN_CONDITIONAL\x10\x03\x12\x17\n\x13UNKNOWN_INFO_DENIED\x10\x04*O\n\x12HeuristicRelevance\x12#\n\x1fHEURISTIC_RELEVANCE_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x42\xf5\x01\n#com.google.cloud.policysimulator.v1B\x11\x45xplanationsProtoP\x01ZMcloud.google.com/go/policysimulator/apiv1/policysimulatorpb;policysimulatorpb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.PolicySimulator.V1\xca\x02\x1fGoogle\\Cloud\\PolicySimulator\\V1\xea\x02\"Google::Cloud::PolicySimulator::V1b\x06proto3"
13
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError => e
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ["google.iam.v1.Policy", "google/iam/v1/policy.proto"],
28
+ ["google.type.Expr", "google/type/expr.proto"],
29
+ ]
30
+ imports.each do |type_name, expected_filename|
31
+ import_file = pool.lookup(type_name).file_descriptor
32
+ if import_file.name != expected_filename
33
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
34
+ end
35
+ end
36
+ warn "Each proto file must use a consistent fully-qualified name."
37
+ warn "This will become an error in the next major version."
38
+ end
39
+
40
+ module Google
41
+ module Cloud
42
+ module PolicySimulator
43
+ module V1
44
+ AccessTuple = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.AccessTuple").msgclass
45
+ ExplainedPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ExplainedPolicy").msgclass
46
+ BindingExplanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.BindingExplanation").msgclass
47
+ BindingExplanation::AnnotatedMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership").msgclass
48
+ BindingExplanation::RolePermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.BindingExplanation.RolePermission").enummodule
49
+ BindingExplanation::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.BindingExplanation.Membership").enummodule
50
+ AccessState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.AccessState").enummodule
51
+ HeuristicRelevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.HeuristicRelevance").enummodule
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/cloud/policysimulator/v1/simulator.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/api/client_pb'
9
+ require 'google/api/field_behavior_pb'
10
+ require 'google/api/resource_pb'
11
+ require 'google/cloud/policysimulator/v1/explanations_pb'
12
+ require 'google/iam/v1/policy_pb'
13
+ require 'google/longrunning/operations_pb'
14
+ require 'google/protobuf/timestamp_pb'
15
+ require 'google/rpc/status_pb'
16
+ require 'google/type/date_pb'
17
+
18
+
19
+ descriptor_data = "\n/google/cloud/policysimulator/v1/simulator.proto\x12\x1fgoogle.cloud.policysimulator.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/policysimulator/v1/explanations.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\"\xef\x05\n\x06Replay\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.policysimulator.v1.Replay.StateB\x03\xe0\x41\x03\x12\x42\n\x06\x63onfig\x18\x03 \x01(\x0b\x32-.google.cloud.policysimulator.v1.ReplayConfigB\x03\xe0\x41\x02\x12T\n\x0fresults_summary\x18\x05 \x01(\x0b\x32\x36.google.cloud.policysimulator.v1.Replay.ResultsSummaryB\x03\xe0\x41\x03\x1a\xbb\x01\n\x0eResultsSummary\x12\x11\n\tlog_count\x18\x01 \x01(\x05\x12\x17\n\x0funchanged_count\x18\x02 \x01(\x05\x12\x18\n\x10\x64ifference_count\x18\x03 \x01(\x05\x12\x13\n\x0b\x65rror_count\x18\x04 \x01(\x05\x12&\n\x0boldest_date\x18\x05 \x01(\x0b\x32\x11.google.type.Date\x12&\n\x0bnewest_date\x18\x06 \x01(\x0b\x32\x11.google.type.Date\"S\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:\xe1\x01\xea\x41\xdd\x01\n%policysimulator.googleapis.com/Replay\x12\x38projects/{project}/locations/{location}/replays/{replay}\x12\x36\x66olders/{folder}/locations/{location}/replays/{replay}\x12\x42organizations/{organization}/locations/{location}/replays/{replay}\"\xe5\x04\n\x0cReplayResult\x12;\n\x04\x64iff\x18\x05 \x01(\x0b\x32+.google.cloud.policysimulator.v1.ReplayDiffH\x00\x12#\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12:\n\x06parent\x18\x02 \x01(\tB*\xfa\x41\'\n%policysimulator.googleapis.com/Replay\x12\x42\n\x0c\x61\x63\x63\x65ss_tuple\x18\x03 \x01(\x0b\x32,.google.cloud.policysimulator.v1.AccessTuple\x12)\n\x0elast_seen_date\x18\x04 \x01(\x0b\x32\x11.google.type.Date:\xaf\x02\xea\x41\xab\x02\n+policysimulator.googleapis.com/ReplayResult\x12Pprojects/{project}/locations/{location}/replays/{replay}/results/{replay_result}\x12Nfolders/{folder}/locations/{location}/replays/{replay}/results/{replay_result}\x12Zorganizations/{organization}/locations/{location}/replays/{replay}/results/{replay_result}B\x08\n\x06result\"h\n\x13\x43reateReplayRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06replay\x18\x02 \x01(\x0b\x32\'.google.cloud.policysimulator.v1.ReplayB\x03\xe0\x41\x02\"I\n\x17ReplayOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"O\n\x10GetReplayRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%policysimulator.googleapis.com/Replay\"\x80\x01\n\x18ListReplayResultsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%policysimulator.googleapis.com/Replay\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"{\n\x19ListReplayResultsResponse\x12\x45\n\x0ereplay_results\x18\x01 \x03(\x0b\x32-.google.cloud.policysimulator.v1.ReplayResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc0\x02\n\x0cReplayConfig\x12X\n\x0epolicy_overlay\x18\x01 \x03(\x0b\x32@.google.cloud.policysimulator.v1.ReplayConfig.PolicyOverlayEntry\x12K\n\nlog_source\x18\x02 \x01(\x0e\x32\x37.google.cloud.policysimulator.v1.ReplayConfig.LogSource\x1aK\n\x12PolicyOverlayEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.google.iam.v1.Policy:\x02\x38\x01\"<\n\tLogSource\x12\x1a\n\x16LOG_SOURCE_UNSPECIFIED\x10\x00\x12\x13\n\x0fRECENT_ACCESSES\x10\x01\"S\n\nReplayDiff\x12\x45\n\x0b\x61\x63\x63\x65ss_diff\x18\x02 \x01(\x0b\x32\x30.google.cloud.policysimulator.v1.AccessStateDiff\"\xaa\x03\n\x0f\x41\x63\x63\x65ssStateDiff\x12\x42\n\x08\x62\x61seline\x18\x01 \x01(\x0b\x32\x30.google.cloud.policysimulator.v1.ExplainedAccess\x12\x43\n\tsimulated\x18\x02 \x01(\x0b\x32\x30.google.cloud.policysimulator.v1.ExplainedAccess\x12X\n\raccess_change\x18\x03 \x01(\x0e\x32\x41.google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType\"\xb3\x01\n\x10\x41\x63\x63\x65ssChangeType\x12\"\n\x1e\x41\x43\x43\x45SS_CHANGE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNO_CHANGE\x10\x01\x12\x12\n\x0eUNKNOWN_CHANGE\x10\x02\x12\x12\n\x0e\x41\x43\x43\x45SS_REVOKED\x10\x03\x12\x11\n\rACCESS_GAINED\x10\x04\x12\x18\n\x14\x41\x43\x43\x45SS_MAYBE_REVOKED\x10\x05\x12\x17\n\x13\x41\x43\x43\x45SS_MAYBE_GAINED\x10\x06\"\xbd\x01\n\x0f\x45xplainedAccess\x12\x42\n\x0c\x61\x63\x63\x65ss_state\x18\x01 \x01(\x0e\x32,.google.cloud.policysimulator.v1.AccessState\x12\x42\n\x08policies\x18\x02 \x03(\x0b\x32\x30.google.cloud.policysimulator.v1.ExplainedPolicy\x12\"\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x12.google.rpc.Status2\x81\x08\n\tSimulator\x12\x87\x02\n\tGetReplay\x12\x31.google.cloud.policysimulator.v1.GetReplayRequest\x1a\'.google.cloud.policysimulator.v1.Replay\"\x9d\x01\x82\xd3\xe4\x93\x02\x8f\x01\x12+/v1/{name=projects/*/locations/*/replays/*}Z,\x12*/v1/{name=folders/*/locations/*/replays/*}Z2\x12\x30/v1/{name=organizations/*/locations/*/replays/*}\xda\x41\x04name\x12\xc8\x02\n\x0c\x43reateReplay\x12\x34.google.cloud.policysimulator.v1.CreateReplayRequest\x1a\x1d.google.longrunning.Operation\"\xe2\x01\x82\xd3\xe4\x93\x02\xa7\x01\"+/v1/{parent=projects/*/locations/*}/replays:\x06replayZ4\"*/v1/{parent=folders/*/locations/*}/replays:\x06replayZ:\"0/v1/{parent=organizations/*/locations/*}/replays:\x06replay\xda\x41\rparent,replay\xca\x41!\n\x06Replay\x12\x17ReplayOperationMetadata\x12\xca\x02\n\x11ListReplayResults\x12\x39.google.cloud.policysimulator.v1.ListReplayResultsRequest\x1a:.google.cloud.policysimulator.v1.ListReplayResultsResponse\"\xbd\x01\x82\xd3\xe4\x93\x02\xad\x01\x12\x35/v1/{parent=projects/*/locations/*/replays/*}/resultsZ6\x12\x34/v1/{parent=folders/*/locations/*/replays/*}/resultsZ<\x12:/v1/{parent=organizations/*/locations/*/replays/*}/results\xda\x41\x06parent\x1aR\xca\x41\x1epolicysimulator.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf2\x01\n#com.google.cloud.policysimulator.v1B\x0eSimulatorProtoP\x01ZMcloud.google.com/go/policysimulator/apiv1/policysimulatorpb;policysimulatorpb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.PolicySimulator.V1\xca\x02\x1fGoogle\\Cloud\\PolicySimulator\\V1\xea\x02\"Google::Cloud::PolicySimulator::V1b\x06proto3"
20
+
21
+ pool = Google::Protobuf::DescriptorPool.generated_pool
22
+
23
+ begin
24
+ pool.add_serialized_file(descriptor_data)
25
+ rescue TypeError => e
26
+ # Compatibility code: will be removed in the next major version.
27
+ require 'google/protobuf/descriptor_pb'
28
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
29
+ parsed.clear_dependency
30
+ serialized = parsed.class.encode(parsed)
31
+ file = pool.add_serialized_file(serialized)
32
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
33
+ imports = [
34
+ ["google.type.Date", "google/type/date.proto"],
35
+ ["google.rpc.Status", "google/rpc/status.proto"],
36
+ ["google.cloud.policysimulator.v1.AccessTuple", "google/cloud/policysimulator/v1/explanations.proto"],
37
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
38
+ ["google.iam.v1.Policy", "google/iam/v1/policy.proto"],
39
+ ]
40
+ imports.each do |type_name, expected_filename|
41
+ import_file = pool.lookup(type_name).file_descriptor
42
+ if import_file.name != expected_filename
43
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
44
+ end
45
+ end
46
+ warn "Each proto file must use a consistent fully-qualified name."
47
+ warn "This will become an error in the next major version."
48
+ end
49
+
50
+ module Google
51
+ module Cloud
52
+ module PolicySimulator
53
+ module V1
54
+ Replay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.Replay").msgclass
55
+ Replay::ResultsSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.Replay.ResultsSummary").msgclass
56
+ Replay::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.Replay.State").enummodule
57
+ ReplayResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ReplayResult").msgclass
58
+ CreateReplayRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.CreateReplayRequest").msgclass
59
+ ReplayOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ReplayOperationMetadata").msgclass
60
+ GetReplayRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.GetReplayRequest").msgclass
61
+ ListReplayResultsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ListReplayResultsRequest").msgclass
62
+ ListReplayResultsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ListReplayResultsResponse").msgclass
63
+ ReplayConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ReplayConfig").msgclass
64
+ ReplayConfig::LogSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ReplayConfig.LogSource").enummodule
65
+ ReplayDiff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ReplayDiff").msgclass
66
+ AccessStateDiff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.AccessStateDiff").msgclass
67
+ AccessStateDiff::AccessChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType").enummodule
68
+ ExplainedAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policysimulator.v1.ExplainedAccess").msgclass
69
+ end
70
+ end
71
+ end
72
+ end