google-apis-policytroubleshooter_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module PolicytroubleshooterV1
18
+ # Version of the google-apis-policytroubleshooter_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201107"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,203 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module PolicytroubleshooterV1
24
+
25
+ class GoogleCloudPolicytroubleshooterV1AccessTuple
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleCloudPolicytroubleshooterV1BindingExplanation
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleCloudPolicytroubleshooterV1BindingExplanationAnnotatedMembership
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleCloudPolicytroubleshooterV1ExplainedPolicy
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleIamV1AuditConfig
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleIamV1AuditLogConfig
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleIamV1Binding
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleIamV1Policy
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleTypeExpr
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleCloudPolicytroubleshooterV1AccessTuple
92
+ # @private
93
+ class Representation < Google::Apis::Core::JsonRepresentation
94
+ property :full_resource_name, as: 'fullResourceName'
95
+ property :permission, as: 'permission'
96
+ property :principal, as: 'principal'
97
+ end
98
+ end
99
+
100
+ class GoogleCloudPolicytroubleshooterV1BindingExplanation
101
+ # @private
102
+ class Representation < Google::Apis::Core::JsonRepresentation
103
+ property :access, as: 'access'
104
+ property :condition, as: 'condition', class: Google::Apis::PolicytroubleshooterV1::GoogleTypeExpr, decorator: Google::Apis::PolicytroubleshooterV1::GoogleTypeExpr::Representation
105
+
106
+ hash :memberships, as: 'memberships', class: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1BindingExplanationAnnotatedMembership, decorator: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1BindingExplanationAnnotatedMembership::Representation
107
+
108
+ property :relevance, as: 'relevance'
109
+ property :role, as: 'role'
110
+ property :role_permission, as: 'rolePermission'
111
+ property :role_permission_relevance, as: 'rolePermissionRelevance'
112
+ end
113
+ end
114
+
115
+ class GoogleCloudPolicytroubleshooterV1BindingExplanationAnnotatedMembership
116
+ # @private
117
+ class Representation < Google::Apis::Core::JsonRepresentation
118
+ property :membership, as: 'membership'
119
+ property :relevance, as: 'relevance'
120
+ end
121
+ end
122
+
123
+ class GoogleCloudPolicytroubleshooterV1ExplainedPolicy
124
+ # @private
125
+ class Representation < Google::Apis::Core::JsonRepresentation
126
+ property :access, as: 'access'
127
+ collection :binding_explanations, as: 'bindingExplanations', class: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1BindingExplanation, decorator: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1BindingExplanation::Representation
128
+
129
+ property :full_resource_name, as: 'fullResourceName'
130
+ property :policy, as: 'policy', class: Google::Apis::PolicytroubleshooterV1::GoogleIamV1Policy, decorator: Google::Apis::PolicytroubleshooterV1::GoogleIamV1Policy::Representation
131
+
132
+ property :relevance, as: 'relevance'
133
+ end
134
+ end
135
+
136
+ class GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyRequest
137
+ # @private
138
+ class Representation < Google::Apis::Core::JsonRepresentation
139
+ property :access_tuple, as: 'accessTuple', class: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1AccessTuple, decorator: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1AccessTuple::Representation
140
+
141
+ end
142
+ end
143
+
144
+ class GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse
145
+ # @private
146
+ class Representation < Google::Apis::Core::JsonRepresentation
147
+ property :access, as: 'access'
148
+ collection :explained_policies, as: 'explainedPolicies', class: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1ExplainedPolicy, decorator: Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1ExplainedPolicy::Representation
149
+
150
+ end
151
+ end
152
+
153
+ class GoogleIamV1AuditConfig
154
+ # @private
155
+ class Representation < Google::Apis::Core::JsonRepresentation
156
+ collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::PolicytroubleshooterV1::GoogleIamV1AuditLogConfig, decorator: Google::Apis::PolicytroubleshooterV1::GoogleIamV1AuditLogConfig::Representation
157
+
158
+ property :service, as: 'service'
159
+ end
160
+ end
161
+
162
+ class GoogleIamV1AuditLogConfig
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ collection :exempted_members, as: 'exemptedMembers'
166
+ property :log_type, as: 'logType'
167
+ end
168
+ end
169
+
170
+ class GoogleIamV1Binding
171
+ # @private
172
+ class Representation < Google::Apis::Core::JsonRepresentation
173
+ property :condition, as: 'condition', class: Google::Apis::PolicytroubleshooterV1::GoogleTypeExpr, decorator: Google::Apis::PolicytroubleshooterV1::GoogleTypeExpr::Representation
174
+
175
+ collection :members, as: 'members'
176
+ property :role, as: 'role'
177
+ end
178
+ end
179
+
180
+ class GoogleIamV1Policy
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ collection :audit_configs, as: 'auditConfigs', class: Google::Apis::PolicytroubleshooterV1::GoogleIamV1AuditConfig, decorator: Google::Apis::PolicytroubleshooterV1::GoogleIamV1AuditConfig::Representation
184
+
185
+ collection :bindings, as: 'bindings', class: Google::Apis::PolicytroubleshooterV1::GoogleIamV1Binding, decorator: Google::Apis::PolicytroubleshooterV1::GoogleIamV1Binding::Representation
186
+
187
+ property :etag, :base64 => true, as: 'etag'
188
+ property :version, as: 'version'
189
+ end
190
+ end
191
+
192
+ class GoogleTypeExpr
193
+ # @private
194
+ class Representation < Google::Apis::Core::JsonRepresentation
195
+ property :description, as: 'description'
196
+ property :expression, as: 'expression'
197
+ property :location, as: 'location'
198
+ property :title, as: 'title'
199
+ end
200
+ end
201
+ end
202
+ end
203
+ end
@@ -0,0 +1,92 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module PolicytroubleshooterV1
23
+ # Policy Troubleshooter API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/policytroubleshooter_v1'
29
+ #
30
+ # Policytroubleshooter = Google::Apis::PolicytroubleshooterV1 # Alias the module
31
+ # service = Policytroubleshooter::PolicyTroubleshooterService.new
32
+ #
33
+ # @see https://cloud.google.com/iam/
34
+ class PolicyTroubleshooterService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://policytroubleshooter.googleapis.com/', '',
47
+ client_name: 'google-apis-policytroubleshooter_v1',
48
+ client_version: Google::Apis::PolicytroubleshooterV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Checks whether a member has a specific permission for a specific resource, and
53
+ # explains why the member does or does not have that permission.
54
+ # @param [Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyRequest] google_cloud_policytroubleshooter_v1_troubleshoot_iam_policy_request_object
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def troubleshoot_iam(google_cloud_policytroubleshooter_v1_troubleshoot_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:post, 'v1/iam:troubleshoot', options)
74
+ command.request_representation = Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyRequest::Representation
75
+ command.request_object = google_cloud_policytroubleshooter_v1_troubleshoot_iam_policy_request_object
76
+ command.response_representation = Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse::Representation
77
+ command.response_class = Google::Apis::PolicytroubleshooterV1::GoogleCloudPolicytroubleshooterV1TroubleshootIamPolicyResponse
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ protected
84
+
85
+ def apply_command_defaults(command)
86
+ command.query['key'] = key unless key.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-policytroubleshooter_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Policy Troubleshooter API V1. Simple
28
+ REST clients are Ruby client libraries that provide access to Google services via
29
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Policy Troubleshooter API, but note that some services
33
+ may provide a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-policytroubleshooter_v1.rb
44
+ - lib/google/apis/policytroubleshooter_v1.rb
45
+ - lib/google/apis/policytroubleshooter_v1/classes.rb
46
+ - lib/google/apis/policytroubleshooter_v1/gem_version.rb
47
+ - lib/google/apis/policytroubleshooter_v1/representations.rb
48
+ - lib/google/apis/policytroubleshooter_v1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-policytroubleshooter_v1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-policytroubleshooter_v1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-policytroubleshooter_v1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Policy Troubleshooter API V1
76
+ test_files: []