google-apis-binaryauthorization_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 BinaryauthorizationV1beta1
18
+ # Version of the google-apis-binaryauthorization_v1beta1 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 = "20201113"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,329 @@
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 BinaryauthorizationV1beta1
24
+
25
+ class AdmissionRule
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AdmissionWhitelistPattern
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AttestationOccurrence
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class Attestor
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class AttestorPublicKey
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Binding
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Empty
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Expr
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class IamPolicy
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Jwt
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class ListAttestorsResponse
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class PkixPublicKey
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Policy
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class SetIamPolicyRequest
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Signature
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class TestIamPermissionsRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class TestIamPermissionsResponse
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class UserOwnedDrydockNote
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class ValidateAttestationOccurrenceRequest
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class ValidateAttestationOccurrenceResponse
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class AdmissionRule
146
+ # @private
147
+ class Representation < Google::Apis::Core::JsonRepresentation
148
+ property :enforcement_mode, as: 'enforcementMode'
149
+ property :evaluation_mode, as: 'evaluationMode'
150
+ collection :require_attestations_by, as: 'requireAttestationsBy'
151
+ end
152
+ end
153
+
154
+ class AdmissionWhitelistPattern
155
+ # @private
156
+ class Representation < Google::Apis::Core::JsonRepresentation
157
+ property :name_pattern, as: 'namePattern'
158
+ end
159
+ end
160
+
161
+ class AttestationOccurrence
162
+ # @private
163
+ class Representation < Google::Apis::Core::JsonRepresentation
164
+ collection :jwts, as: 'jwts', class: Google::Apis::BinaryauthorizationV1beta1::Jwt, decorator: Google::Apis::BinaryauthorizationV1beta1::Jwt::Representation
165
+
166
+ property :serialized_payload, :base64 => true, as: 'serializedPayload'
167
+ collection :signatures, as: 'signatures', class: Google::Apis::BinaryauthorizationV1beta1::Signature, decorator: Google::Apis::BinaryauthorizationV1beta1::Signature::Representation
168
+
169
+ end
170
+ end
171
+
172
+ class Attestor
173
+ # @private
174
+ class Representation < Google::Apis::Core::JsonRepresentation
175
+ property :description, as: 'description'
176
+ property :name, as: 'name'
177
+ property :update_time, as: 'updateTime'
178
+ property :user_owned_drydock_note, as: 'userOwnedDrydockNote', class: Google::Apis::BinaryauthorizationV1beta1::UserOwnedDrydockNote, decorator: Google::Apis::BinaryauthorizationV1beta1::UserOwnedDrydockNote::Representation
179
+
180
+ end
181
+ end
182
+
183
+ class AttestorPublicKey
184
+ # @private
185
+ class Representation < Google::Apis::Core::JsonRepresentation
186
+ property :ascii_armored_pgp_public_key, as: 'asciiArmoredPgpPublicKey'
187
+ property :comment, as: 'comment'
188
+ property :id, as: 'id'
189
+ property :pkix_public_key, as: 'pkixPublicKey', class: Google::Apis::BinaryauthorizationV1beta1::PkixPublicKey, decorator: Google::Apis::BinaryauthorizationV1beta1::PkixPublicKey::Representation
190
+
191
+ end
192
+ end
193
+
194
+ class Binding
195
+ # @private
196
+ class Representation < Google::Apis::Core::JsonRepresentation
197
+ property :condition, as: 'condition', class: Google::Apis::BinaryauthorizationV1beta1::Expr, decorator: Google::Apis::BinaryauthorizationV1beta1::Expr::Representation
198
+
199
+ collection :members, as: 'members'
200
+ property :role, as: 'role'
201
+ end
202
+ end
203
+
204
+ class Empty
205
+ # @private
206
+ class Representation < Google::Apis::Core::JsonRepresentation
207
+ end
208
+ end
209
+
210
+ class Expr
211
+ # @private
212
+ class Representation < Google::Apis::Core::JsonRepresentation
213
+ property :description, as: 'description'
214
+ property :expression, as: 'expression'
215
+ property :location, as: 'location'
216
+ property :title, as: 'title'
217
+ end
218
+ end
219
+
220
+ class IamPolicy
221
+ # @private
222
+ class Representation < Google::Apis::Core::JsonRepresentation
223
+ collection :bindings, as: 'bindings', class: Google::Apis::BinaryauthorizationV1beta1::Binding, decorator: Google::Apis::BinaryauthorizationV1beta1::Binding::Representation
224
+
225
+ property :etag, :base64 => true, as: 'etag'
226
+ property :version, as: 'version'
227
+ end
228
+ end
229
+
230
+ class Jwt
231
+ # @private
232
+ class Representation < Google::Apis::Core::JsonRepresentation
233
+ property :compact_jwt, as: 'compactJwt'
234
+ end
235
+ end
236
+
237
+ class ListAttestorsResponse
238
+ # @private
239
+ class Representation < Google::Apis::Core::JsonRepresentation
240
+ collection :attestors, as: 'attestors', class: Google::Apis::BinaryauthorizationV1beta1::Attestor, decorator: Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
241
+
242
+ property :next_page_token, as: 'nextPageToken'
243
+ end
244
+ end
245
+
246
+ class PkixPublicKey
247
+ # @private
248
+ class Representation < Google::Apis::Core::JsonRepresentation
249
+ property :public_key_pem, as: 'publicKeyPem'
250
+ property :signature_algorithm, as: 'signatureAlgorithm'
251
+ end
252
+ end
253
+
254
+ class Policy
255
+ # @private
256
+ class Representation < Google::Apis::Core::JsonRepresentation
257
+ collection :admission_whitelist_patterns, as: 'admissionWhitelistPatterns', class: Google::Apis::BinaryauthorizationV1beta1::AdmissionWhitelistPattern, decorator: Google::Apis::BinaryauthorizationV1beta1::AdmissionWhitelistPattern::Representation
258
+
259
+ hash :cluster_admission_rules, as: 'clusterAdmissionRules', class: Google::Apis::BinaryauthorizationV1beta1::AdmissionRule, decorator: Google::Apis::BinaryauthorizationV1beta1::AdmissionRule::Representation
260
+
261
+ property :default_admission_rule, as: 'defaultAdmissionRule', class: Google::Apis::BinaryauthorizationV1beta1::AdmissionRule, decorator: Google::Apis::BinaryauthorizationV1beta1::AdmissionRule::Representation
262
+
263
+ property :description, as: 'description'
264
+ property :global_policy_evaluation_mode, as: 'globalPolicyEvaluationMode'
265
+ property :name, as: 'name'
266
+ property :update_time, as: 'updateTime'
267
+ end
268
+ end
269
+
270
+ class SetIamPolicyRequest
271
+ # @private
272
+ class Representation < Google::Apis::Core::JsonRepresentation
273
+ property :policy, as: 'policy', class: Google::Apis::BinaryauthorizationV1beta1::IamPolicy, decorator: Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
274
+
275
+ end
276
+ end
277
+
278
+ class Signature
279
+ # @private
280
+ class Representation < Google::Apis::Core::JsonRepresentation
281
+ property :public_key_id, as: 'publicKeyId'
282
+ property :signature, :base64 => true, as: 'signature'
283
+ end
284
+ end
285
+
286
+ class TestIamPermissionsRequest
287
+ # @private
288
+ class Representation < Google::Apis::Core::JsonRepresentation
289
+ collection :permissions, as: 'permissions'
290
+ end
291
+ end
292
+
293
+ class TestIamPermissionsResponse
294
+ # @private
295
+ class Representation < Google::Apis::Core::JsonRepresentation
296
+ collection :permissions, as: 'permissions'
297
+ end
298
+ end
299
+
300
+ class UserOwnedDrydockNote
301
+ # @private
302
+ class Representation < Google::Apis::Core::JsonRepresentation
303
+ property :delegation_service_account_email, as: 'delegationServiceAccountEmail'
304
+ property :note_reference, as: 'noteReference'
305
+ collection :public_keys, as: 'publicKeys', class: Google::Apis::BinaryauthorizationV1beta1::AttestorPublicKey, decorator: Google::Apis::BinaryauthorizationV1beta1::AttestorPublicKey::Representation
306
+
307
+ end
308
+ end
309
+
310
+ class ValidateAttestationOccurrenceRequest
311
+ # @private
312
+ class Representation < Google::Apis::Core::JsonRepresentation
313
+ property :attestation, as: 'attestation', class: Google::Apis::BinaryauthorizationV1beta1::AttestationOccurrence, decorator: Google::Apis::BinaryauthorizationV1beta1::AttestationOccurrence::Representation
314
+
315
+ property :occurrence_note, as: 'occurrenceNote'
316
+ property :occurrence_resource_uri, as: 'occurrenceResourceUri'
317
+ end
318
+ end
319
+
320
+ class ValidateAttestationOccurrenceResponse
321
+ # @private
322
+ class Representation < Google::Apis::Core::JsonRepresentation
323
+ property :denial_reason, as: 'denialReason'
324
+ property :result, as: 'result'
325
+ end
326
+ end
327
+ end
328
+ end
329
+ end
@@ -0,0 +1,573 @@
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 BinaryauthorizationV1beta1
23
+ # Binary Authorization API
24
+ #
25
+ # The management interface for Binary Authorization, a system providing policy
26
+ # control for images deployed to Kubernetes Engine clusters.
27
+ #
28
+ # @example
29
+ # require 'google/apis/binaryauthorization_v1beta1'
30
+ #
31
+ # Binaryauthorization = Google::Apis::BinaryauthorizationV1beta1 # Alias the module
32
+ # service = Binaryauthorization::BinaryAuthorizationService.new
33
+ #
34
+ # @see https://cloud.google.com/binary-authorization/
35
+ class BinaryAuthorizationService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://binaryauthorization.googleapis.com/', '',
48
+ client_name: 'google-apis-binaryauthorization_v1beta1',
49
+ client_version: Google::Apis::BinaryauthorizationV1beta1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # A policy specifies the attestors that must attest to a container image, before
54
+ # the project is allowed to deploy that image. There is at most one policy per
55
+ # project. All image admission requests are permitted if a project has no policy.
56
+ # Gets the policy for this project. Returns a default policy if the project
57
+ # does not have one.
58
+ # @param [String] name
59
+ # Required. The resource name of the policy to retrieve, in the format `projects/
60
+ # */policy`.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Policy] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Policy]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def get_project_policy(name, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
80
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
81
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Policy
82
+ command.params['name'] = name unless name.nil?
83
+ command.query['fields'] = fields unless fields.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ execute_or_queue_command(command, &block)
86
+ end
87
+
88
+ # Creates or updates a project's policy, and returns a copy of the new policy. A
89
+ # policy is always updated as a whole, to avoid race conditions with concurrent
90
+ # policy enforcement (or management!) requests. Returns NOT_FOUND if the project
91
+ # does not exist, INVALID_ARGUMENT if the request is malformed.
92
+ # @param [String] name
93
+ # Output only. The resource name, in the format `projects/*/policy`. There is at
94
+ # most one policy per project.
95
+ # @param [Google::Apis::BinaryauthorizationV1beta1::Policy] policy_object
96
+ # @param [String] fields
97
+ # Selector specifying which fields to include in a partial response.
98
+ # @param [String] quota_user
99
+ # Available to use for quota purposes for server-side applications. Can be any
100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
101
+ # @param [Google::Apis::RequestOptions] options
102
+ # Request-specific options
103
+ #
104
+ # @yield [result, err] Result & error if block supplied
105
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Policy] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Policy]
109
+ #
110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
113
+ def update_project_policy(name, policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
114
+ command = make_simple_command(:put, 'v1beta1/{+name}', options)
115
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
116
+ command.request_object = policy_object
117
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Policy::Representation
118
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Policy
119
+ command.params['name'] = name unless name.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND
126
+ # if the project does not exist, INVALID_ARGUMENT if the request is malformed,
127
+ # ALREADY_EXISTS if the attestor already exists.
128
+ # @param [String] parent
129
+ # Required. The parent of this attestor.
130
+ # @param [Google::Apis::BinaryauthorizationV1beta1::Attestor] attestor_object
131
+ # @param [String] attestor_id
132
+ # Required. The attestors ID.
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # @param [Google::Apis::RequestOptions] options
139
+ # Request-specific options
140
+ #
141
+ # @yield [result, err] Result & error if block supplied
142
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Attestor] parsed result object
143
+ # @yieldparam err [StandardError] error object if request failed
144
+ #
145
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Attestor]
146
+ #
147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
150
+ def create_project_attestor(parent, attestor_object = nil, attestor_id: nil, fields: nil, quota_user: nil, options: nil, &block)
151
+ command = make_simple_command(:post, 'v1beta1/{+parent}/attestors', options)
152
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
153
+ command.request_object = attestor_object
154
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
155
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Attestor
156
+ command.params['parent'] = parent unless parent.nil?
157
+ command.query['attestorId'] = attestor_id unless attestor_id.nil?
158
+ command.query['fields'] = fields unless fields.nil?
159
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
160
+ execute_or_queue_command(command, &block)
161
+ end
162
+
163
+ # Deletes an attestor. Returns NOT_FOUND if the attestor does not exist.
164
+ # @param [String] name
165
+ # Required. The name of the attestors to delete, in the format `projects/*/
166
+ # attestors/*`.
167
+ # @param [String] fields
168
+ # Selector specifying which fields to include in a partial response.
169
+ # @param [String] quota_user
170
+ # Available to use for quota purposes for server-side applications. Can be any
171
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
172
+ # @param [Google::Apis::RequestOptions] options
173
+ # Request-specific options
174
+ #
175
+ # @yield [result, err] Result & error if block supplied
176
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Empty] parsed result object
177
+ # @yieldparam err [StandardError] error object if request failed
178
+ #
179
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Empty]
180
+ #
181
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
182
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
183
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
184
+ def delete_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block)
185
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
186
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Empty::Representation
187
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Empty
188
+ command.params['name'] = name unless name.nil?
189
+ command.query['fields'] = fields unless fields.nil?
190
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
191
+ execute_or_queue_command(command, &block)
192
+ end
193
+
194
+ # Gets an attestor. Returns NOT_FOUND if the attestor does not exist.
195
+ # @param [String] name
196
+ # Required. The name of the attestor to retrieve, in the format `projects/*/
197
+ # attestors/*`.
198
+ # @param [String] fields
199
+ # Selector specifying which fields to include in a partial response.
200
+ # @param [String] quota_user
201
+ # Available to use for quota purposes for server-side applications. Can be any
202
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
203
+ # @param [Google::Apis::RequestOptions] options
204
+ # Request-specific options
205
+ #
206
+ # @yield [result, err] Result & error if block supplied
207
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Attestor] parsed result object
208
+ # @yieldparam err [StandardError] error object if request failed
209
+ #
210
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Attestor]
211
+ #
212
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
213
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
214
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
215
+ def get_project_attestor(name, fields: nil, quota_user: nil, options: nil, &block)
216
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
217
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
218
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Attestor
219
+ command.params['name'] = name unless name.nil?
220
+ command.query['fields'] = fields unless fields.nil?
221
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
222
+ execute_or_queue_command(command, &block)
223
+ end
224
+
225
+ # Gets the access control policy for a resource. Returns an empty policy if the
226
+ # resource exists and does not have a policy set.
227
+ # @param [String] resource
228
+ # REQUIRED: The resource for which the policy is being requested. See the
229
+ # operation documentation for the appropriate value for this field.
230
+ # @param [Fixnum] options_requested_policy_version
231
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
232
+ # 3. Requests specifying an invalid value will be rejected. Requests for
233
+ # policies with any conditional bindings must specify version 3. Policies
234
+ # without any conditional bindings may specify any valid value or leave the
235
+ # field unset. To learn which resources support conditions in their IAM policies,
236
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
237
+ # resource-policies).
238
+ # @param [String] fields
239
+ # Selector specifying which fields to include in a partial response.
240
+ # @param [String] quota_user
241
+ # Available to use for quota purposes for server-side applications. Can be any
242
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
243
+ # @param [Google::Apis::RequestOptions] options
244
+ # Request-specific options
245
+ #
246
+ # @yield [result, err] Result & error if block supplied
247
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::IamPolicy] parsed result object
248
+ # @yieldparam err [StandardError] error object if request failed
249
+ #
250
+ # @return [Google::Apis::BinaryauthorizationV1beta1::IamPolicy]
251
+ #
252
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
253
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
254
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
255
+ def get_project_attestor_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
256
+ command = make_simple_command(:get, 'v1beta1/{+resource}:getIamPolicy', options)
257
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
258
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::IamPolicy
259
+ command.params['resource'] = resource unless resource.nil?
260
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
261
+ command.query['fields'] = fields unless fields.nil?
262
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
263
+ execute_or_queue_command(command, &block)
264
+ end
265
+
266
+ # Lists attestors. Returns INVALID_ARGUMENT if the project does not exist.
267
+ # @param [String] parent
268
+ # Required. The resource name of the project associated with the attestors, in
269
+ # the format `projects/*`.
270
+ # @param [Fixnum] page_size
271
+ # Requested page size. The server may return fewer results than requested. If
272
+ # unspecified, the server will pick an appropriate default.
273
+ # @param [String] page_token
274
+ # A token identifying a page of results the server should return. Typically,
275
+ # this is the value of ListAttestorsResponse.next_page_token returned from the
276
+ # previous call to the `ListAttestors` method.
277
+ # @param [String] fields
278
+ # Selector specifying which fields to include in a partial response.
279
+ # @param [String] quota_user
280
+ # Available to use for quota purposes for server-side applications. Can be any
281
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
282
+ # @param [Google::Apis::RequestOptions] options
283
+ # Request-specific options
284
+ #
285
+ # @yield [result, err] Result & error if block supplied
286
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse] parsed result object
287
+ # @yieldparam err [StandardError] error object if request failed
288
+ #
289
+ # @return [Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse]
290
+ #
291
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
292
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
293
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
294
+ def list_project_attestors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
295
+ command = make_simple_command(:get, 'v1beta1/{+parent}/attestors', options)
296
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse::Representation
297
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::ListAttestorsResponse
298
+ command.params['parent'] = parent unless parent.nil?
299
+ command.query['pageSize'] = page_size unless page_size.nil?
300
+ command.query['pageToken'] = page_token unless page_token.nil?
301
+ command.query['fields'] = fields unless fields.nil?
302
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
303
+ execute_or_queue_command(command, &block)
304
+ end
305
+
306
+ # Sets the access control policy on the specified resource. Replaces any
307
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
308
+ # PERMISSION_DENIED` errors.
309
+ # @param [String] resource
310
+ # REQUIRED: The resource for which the policy is being specified. See the
311
+ # operation documentation for the appropriate value for this field.
312
+ # @param [Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest] set_iam_policy_request_object
313
+ # @param [String] fields
314
+ # Selector specifying which fields to include in a partial response.
315
+ # @param [String] quota_user
316
+ # Available to use for quota purposes for server-side applications. Can be any
317
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::IamPolicy] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::BinaryauthorizationV1beta1::IamPolicy]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ def set_attestor_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
331
+ command = make_simple_command(:post, 'v1beta1/{+resource}:setIamPolicy', options)
332
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest::Representation
333
+ command.request_object = set_iam_policy_request_object
334
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
335
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::IamPolicy
336
+ command.params['resource'] = resource unless resource.nil?
337
+ command.query['fields'] = fields unless fields.nil?
338
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
339
+ execute_or_queue_command(command, &block)
340
+ end
341
+
342
+ # Returns permissions that a caller has on the specified resource. If the
343
+ # resource does not exist, this will return an empty set of permissions, not a `
344
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
345
+ # permission-aware UIs and command-line tools, not for authorization checking.
346
+ # This operation may "fail open" without warning.
347
+ # @param [String] resource
348
+ # REQUIRED: The resource for which the policy detail is being requested. See the
349
+ # operation documentation for the appropriate value for this field.
350
+ # @param [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest] test_iam_permissions_request_object
351
+ # @param [String] fields
352
+ # Selector specifying which fields to include in a partial response.
353
+ # @param [String] quota_user
354
+ # Available to use for quota purposes for server-side applications. Can be any
355
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
356
+ # @param [Google::Apis::RequestOptions] options
357
+ # Request-specific options
358
+ #
359
+ # @yield [result, err] Result & error if block supplied
360
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse] parsed result object
361
+ # @yieldparam err [StandardError] error object if request failed
362
+ #
363
+ # @return [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse]
364
+ #
365
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
366
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
367
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
368
+ def test_attestor_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
369
+ command = make_simple_command(:post, 'v1beta1/{+resource}:testIamPermissions', options)
370
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest::Representation
371
+ command.request_object = test_iam_permissions_request_object
372
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse::Representation
373
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse
374
+ command.params['resource'] = resource unless resource.nil?
375
+ command.query['fields'] = fields unless fields.nil?
376
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
377
+ execute_or_queue_command(command, &block)
378
+ end
379
+
380
+ # Updates an attestor. Returns NOT_FOUND if the attestor does not exist.
381
+ # @param [String] name
382
+ # Required. The resource name, in the format: `projects/*/attestors/*`. This
383
+ # field may not be updated.
384
+ # @param [Google::Apis::BinaryauthorizationV1beta1::Attestor] attestor_object
385
+ # @param [String] fields
386
+ # Selector specifying which fields to include in a partial response.
387
+ # @param [String] quota_user
388
+ # Available to use for quota purposes for server-side applications. Can be any
389
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
390
+ # @param [Google::Apis::RequestOptions] options
391
+ # Request-specific options
392
+ #
393
+ # @yield [result, err] Result & error if block supplied
394
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::Attestor] parsed result object
395
+ # @yieldparam err [StandardError] error object if request failed
396
+ #
397
+ # @return [Google::Apis::BinaryauthorizationV1beta1::Attestor]
398
+ #
399
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
400
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
401
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
402
+ def update_project_attestor(name, attestor_object = nil, fields: nil, quota_user: nil, options: nil, &block)
403
+ command = make_simple_command(:put, 'v1beta1/{+name}', options)
404
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
405
+ command.request_object = attestor_object
406
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::Attestor::Representation
407
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::Attestor
408
+ command.params['name'] = name unless name.nil?
409
+ command.query['fields'] = fields unless fields.nil?
410
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
411
+ execute_or_queue_command(command, &block)
412
+ end
413
+
414
+ # Returns whether the given Attestation for the given image URI was signed by
415
+ # the given Attestor
416
+ # @param [String] attestor
417
+ # Required. The resource name of the Attestor of the occurrence, in the format `
418
+ # projects/*/attestors/*`.
419
+ # @param [Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceRequest] validate_attestation_occurrence_request_object
420
+ # @param [String] fields
421
+ # Selector specifying which fields to include in a partial response.
422
+ # @param [String] quota_user
423
+ # Available to use for quota purposes for server-side applications. Can be any
424
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
425
+ # @param [Google::Apis::RequestOptions] options
426
+ # Request-specific options
427
+ #
428
+ # @yield [result, err] Result & error if block supplied
429
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceResponse] parsed result object
430
+ # @yieldparam err [StandardError] error object if request failed
431
+ #
432
+ # @return [Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceResponse]
433
+ #
434
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
435
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
436
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
437
+ def validate_attestor_attestation_occurrence(attestor, validate_attestation_occurrence_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
438
+ command = make_simple_command(:post, 'v1beta1/{+attestor}:validateAttestationOccurrence', options)
439
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceRequest::Representation
440
+ command.request_object = validate_attestation_occurrence_request_object
441
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceResponse::Representation
442
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::ValidateAttestationOccurrenceResponse
443
+ command.params['attestor'] = attestor unless attestor.nil?
444
+ command.query['fields'] = fields unless fields.nil?
445
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
446
+ execute_or_queue_command(command, &block)
447
+ end
448
+
449
+ # Gets the access control policy for a resource. Returns an empty policy if the
450
+ # resource exists and does not have a policy set.
451
+ # @param [String] resource
452
+ # REQUIRED: The resource for which the policy is being requested. See the
453
+ # operation documentation for the appropriate value for this field.
454
+ # @param [Fixnum] options_requested_policy_version
455
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
456
+ # 3. Requests specifying an invalid value will be rejected. Requests for
457
+ # policies with any conditional bindings must specify version 3. Policies
458
+ # without any conditional bindings may specify any valid value or leave the
459
+ # field unset. To learn which resources support conditions in their IAM policies,
460
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
461
+ # resource-policies).
462
+ # @param [String] fields
463
+ # Selector specifying which fields to include in a partial response.
464
+ # @param [String] quota_user
465
+ # Available to use for quota purposes for server-side applications. Can be any
466
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
467
+ # @param [Google::Apis::RequestOptions] options
468
+ # Request-specific options
469
+ #
470
+ # @yield [result, err] Result & error if block supplied
471
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::IamPolicy] parsed result object
472
+ # @yieldparam err [StandardError] error object if request failed
473
+ #
474
+ # @return [Google::Apis::BinaryauthorizationV1beta1::IamPolicy]
475
+ #
476
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
477
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
478
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
479
+ def get_project_policy_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
480
+ command = make_simple_command(:get, 'v1beta1/{+resource}:getIamPolicy', options)
481
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
482
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::IamPolicy
483
+ command.params['resource'] = resource unless resource.nil?
484
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
485
+ command.query['fields'] = fields unless fields.nil?
486
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
487
+ execute_or_queue_command(command, &block)
488
+ end
489
+
490
+ # Sets the access control policy on the specified resource. Replaces any
491
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
492
+ # PERMISSION_DENIED` errors.
493
+ # @param [String] resource
494
+ # REQUIRED: The resource for which the policy is being specified. See the
495
+ # operation documentation for the appropriate value for this field.
496
+ # @param [Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest] set_iam_policy_request_object
497
+ # @param [String] fields
498
+ # Selector specifying which fields to include in a partial response.
499
+ # @param [String] quota_user
500
+ # Available to use for quota purposes for server-side applications. Can be any
501
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
502
+ # @param [Google::Apis::RequestOptions] options
503
+ # Request-specific options
504
+ #
505
+ # @yield [result, err] Result & error if block supplied
506
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::IamPolicy] parsed result object
507
+ # @yieldparam err [StandardError] error object if request failed
508
+ #
509
+ # @return [Google::Apis::BinaryauthorizationV1beta1::IamPolicy]
510
+ #
511
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
512
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
513
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
514
+ def set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
515
+ command = make_simple_command(:post, 'v1beta1/{+resource}:setIamPolicy', options)
516
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::SetIamPolicyRequest::Representation
517
+ command.request_object = set_iam_policy_request_object
518
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::IamPolicy::Representation
519
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::IamPolicy
520
+ command.params['resource'] = resource unless resource.nil?
521
+ command.query['fields'] = fields unless fields.nil?
522
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
523
+ execute_or_queue_command(command, &block)
524
+ end
525
+
526
+ # Returns permissions that a caller has on the specified resource. If the
527
+ # resource does not exist, this will return an empty set of permissions, not a `
528
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
529
+ # permission-aware UIs and command-line tools, not for authorization checking.
530
+ # This operation may "fail open" without warning.
531
+ # @param [String] resource
532
+ # REQUIRED: The resource for which the policy detail is being requested. See the
533
+ # operation documentation for the appropriate value for this field.
534
+ # @param [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest] test_iam_permissions_request_object
535
+ # @param [String] fields
536
+ # Selector specifying which fields to include in a partial response.
537
+ # @param [String] quota_user
538
+ # Available to use for quota purposes for server-side applications. Can be any
539
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
540
+ # @param [Google::Apis::RequestOptions] options
541
+ # Request-specific options
542
+ #
543
+ # @yield [result, err] Result & error if block supplied
544
+ # @yieldparam result [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse] parsed result object
545
+ # @yieldparam err [StandardError] error object if request failed
546
+ #
547
+ # @return [Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse]
548
+ #
549
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
550
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
551
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
552
+ def test_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
553
+ command = make_simple_command(:post, 'v1beta1/{+resource}:testIamPermissions', options)
554
+ command.request_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsRequest::Representation
555
+ command.request_object = test_iam_permissions_request_object
556
+ command.response_representation = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse::Representation
557
+ command.response_class = Google::Apis::BinaryauthorizationV1beta1::TestIamPermissionsResponse
558
+ command.params['resource'] = resource unless resource.nil?
559
+ command.query['fields'] = fields unless fields.nil?
560
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
561
+ execute_or_queue_command(command, &block)
562
+ end
563
+
564
+ protected
565
+
566
+ def apply_command_defaults(command)
567
+ command.query['key'] = key unless key.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ end
570
+ end
571
+ end
572
+ end
573
+ end