google-apis-storage_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2869 @@
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 StorageV1
23
+ # Cloud Storage JSON API
24
+ #
25
+ # Stores and retrieves potentially large, immutable data objects.
26
+ #
27
+ # @example
28
+ # require 'google/apis/storage_v1'
29
+ #
30
+ # Storage = Google::Apis::StorageV1 # Alias the module
31
+ # service = Storage::StorageService.new
32
+ #
33
+ # @see https://developers.google.com/storage/docs/json_api/
34
+ class StorageService < 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
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
42
+ # characters.
43
+ attr_accessor :quota_user
44
+
45
+ # @return [String]
46
+ # Deprecated. Please use quotaUser instead.
47
+ attr_accessor :user_ip
48
+
49
+ def initialize
50
+ super('https://storage.googleapis.com/', 'storage/v1/',
51
+ client_name: 'google-apis-storage_v1',
52
+ client_version: Google::Apis::StorageV1::GEM_VERSION)
53
+ @batch_path = 'batch/storage/v1'
54
+ end
55
+
56
+ # Permanently deletes the ACL entry for the specified entity on the specified
57
+ # bucket.
58
+ # @param [String] bucket
59
+ # Name of a bucket.
60
+ # @param [String] entity
61
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
62
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
63
+ # @param [String] provisional_user_project
64
+ # The project to be billed for this request if the target bucket is requester-
65
+ # pays bucket.
66
+ # @param [String] user_project
67
+ # The project to be billed for this request. Required for Requester Pays buckets.
68
+ # @param [String] fields
69
+ # Selector specifying which fields to include in a partial response.
70
+ # @param [String] quota_user
71
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
72
+ # characters.
73
+ # @param [String] user_ip
74
+ # Deprecated. Please use quotaUser instead.
75
+ # @param [Google::Apis::RequestOptions] options
76
+ # Request-specific options
77
+ #
78
+ # @yield [result, err] Result & error if block supplied
79
+ # @yieldparam result [NilClass] No result returned for this method
80
+ # @yieldparam err [StandardError] error object if request failed
81
+ #
82
+ # @return [void]
83
+ #
84
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
85
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
86
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
87
+ def delete_bucket_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
88
+ command = make_simple_command(:delete, 'b/{bucket}/acl/{entity}', options)
89
+ command.params['bucket'] = bucket unless bucket.nil?
90
+ command.params['entity'] = entity unless entity.nil?
91
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
92
+ command.query['userProject'] = user_project unless user_project.nil?
93
+ command.query['fields'] = fields unless fields.nil?
94
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
95
+ command.query['userIp'] = user_ip unless user_ip.nil?
96
+ execute_or_queue_command(command, &block)
97
+ end
98
+
99
+ # Returns the ACL entry for the specified entity on the specified bucket.
100
+ # @param [String] bucket
101
+ # Name of a bucket.
102
+ # @param [String] entity
103
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
104
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
105
+ # @param [String] provisional_user_project
106
+ # The project to be billed for this request if the target bucket is requester-
107
+ # pays bucket.
108
+ # @param [String] user_project
109
+ # The project to be billed for this request. Required for Requester Pays buckets.
110
+ # @param [String] fields
111
+ # Selector specifying which fields to include in a partial response.
112
+ # @param [String] quota_user
113
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
114
+ # characters.
115
+ # @param [String] user_ip
116
+ # Deprecated. Please use quotaUser instead.
117
+ # @param [Google::Apis::RequestOptions] options
118
+ # Request-specific options
119
+ #
120
+ # @yield [result, err] Result & error if block supplied
121
+ # @yieldparam result [Google::Apis::StorageV1::BucketAccessControl] parsed result object
122
+ # @yieldparam err [StandardError] error object if request failed
123
+ #
124
+ # @return [Google::Apis::StorageV1::BucketAccessControl]
125
+ #
126
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
127
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
128
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
129
+ def get_bucket_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
130
+ command = make_simple_command(:get, 'b/{bucket}/acl/{entity}', options)
131
+ command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
132
+ command.response_class = Google::Apis::StorageV1::BucketAccessControl
133
+ command.params['bucket'] = bucket unless bucket.nil?
134
+ command.params['entity'] = entity unless entity.nil?
135
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
136
+ command.query['userProject'] = user_project unless user_project.nil?
137
+ command.query['fields'] = fields unless fields.nil?
138
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
139
+ command.query['userIp'] = user_ip unless user_ip.nil?
140
+ execute_or_queue_command(command, &block)
141
+ end
142
+
143
+ # Creates a new ACL entry on the specified bucket.
144
+ # @param [String] bucket
145
+ # Name of a bucket.
146
+ # @param [Google::Apis::StorageV1::BucketAccessControl] bucket_access_control_object
147
+ # @param [String] provisional_user_project
148
+ # The project to be billed for this request if the target bucket is requester-
149
+ # pays bucket.
150
+ # @param [String] user_project
151
+ # The project to be billed for this request. Required for Requester Pays buckets.
152
+ # @param [String] fields
153
+ # Selector specifying which fields to include in a partial response.
154
+ # @param [String] quota_user
155
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
156
+ # characters.
157
+ # @param [String] user_ip
158
+ # Deprecated. Please use quotaUser instead.
159
+ # @param [Google::Apis::RequestOptions] options
160
+ # Request-specific options
161
+ #
162
+ # @yield [result, err] Result & error if block supplied
163
+ # @yieldparam result [Google::Apis::StorageV1::BucketAccessControl] parsed result object
164
+ # @yieldparam err [StandardError] error object if request failed
165
+ #
166
+ # @return [Google::Apis::StorageV1::BucketAccessControl]
167
+ #
168
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
169
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
170
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
171
+ def insert_bucket_access_control(bucket, bucket_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
172
+ command = make_simple_command(:post, 'b/{bucket}/acl', options)
173
+ command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
174
+ command.request_object = bucket_access_control_object
175
+ command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
176
+ command.response_class = Google::Apis::StorageV1::BucketAccessControl
177
+ command.params['bucket'] = bucket unless bucket.nil?
178
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
179
+ command.query['userProject'] = user_project unless user_project.nil?
180
+ command.query['fields'] = fields unless fields.nil?
181
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
182
+ command.query['userIp'] = user_ip unless user_ip.nil?
183
+ execute_or_queue_command(command, &block)
184
+ end
185
+
186
+ # Retrieves ACL entries on the specified bucket.
187
+ # @param [String] bucket
188
+ # Name of a bucket.
189
+ # @param [String] provisional_user_project
190
+ # The project to be billed for this request if the target bucket is requester-
191
+ # pays bucket.
192
+ # @param [String] user_project
193
+ # The project to be billed for this request. Required for Requester Pays buckets.
194
+ # @param [String] fields
195
+ # Selector specifying which fields to include in a partial response.
196
+ # @param [String] quota_user
197
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
198
+ # characters.
199
+ # @param [String] user_ip
200
+ # Deprecated. Please use quotaUser instead.
201
+ # @param [Google::Apis::RequestOptions] options
202
+ # Request-specific options
203
+ #
204
+ # @yield [result, err] Result & error if block supplied
205
+ # @yieldparam result [Google::Apis::StorageV1::BucketAccessControls] parsed result object
206
+ # @yieldparam err [StandardError] error object if request failed
207
+ #
208
+ # @return [Google::Apis::StorageV1::BucketAccessControls]
209
+ #
210
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
211
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
212
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
213
+ def list_bucket_access_controls(bucket, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
214
+ command = make_simple_command(:get, 'b/{bucket}/acl', options)
215
+ command.response_representation = Google::Apis::StorageV1::BucketAccessControls::Representation
216
+ command.response_class = Google::Apis::StorageV1::BucketAccessControls
217
+ command.params['bucket'] = bucket unless bucket.nil?
218
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
219
+ command.query['userProject'] = user_project unless user_project.nil?
220
+ command.query['fields'] = fields unless fields.nil?
221
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
222
+ command.query['userIp'] = user_ip unless user_ip.nil?
223
+ execute_or_queue_command(command, &block)
224
+ end
225
+
226
+ # Patches an ACL entry on the specified bucket.
227
+ # @param [String] bucket
228
+ # Name of a bucket.
229
+ # @param [String] entity
230
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
231
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
232
+ # @param [Google::Apis::StorageV1::BucketAccessControl] bucket_access_control_object
233
+ # @param [String] provisional_user_project
234
+ # The project to be billed for this request if the target bucket is requester-
235
+ # pays bucket.
236
+ # @param [String] user_project
237
+ # The project to be billed for this request. Required for Requester Pays buckets.
238
+ # @param [String] fields
239
+ # Selector specifying which fields to include in a partial response.
240
+ # @param [String] quota_user
241
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
242
+ # characters.
243
+ # @param [String] user_ip
244
+ # Deprecated. Please use quotaUser instead.
245
+ # @param [Google::Apis::RequestOptions] options
246
+ # Request-specific options
247
+ #
248
+ # @yield [result, err] Result & error if block supplied
249
+ # @yieldparam result [Google::Apis::StorageV1::BucketAccessControl] parsed result object
250
+ # @yieldparam err [StandardError] error object if request failed
251
+ #
252
+ # @return [Google::Apis::StorageV1::BucketAccessControl]
253
+ #
254
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
255
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
256
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
257
+ def patch_bucket_access_control(bucket, entity, bucket_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
258
+ command = make_simple_command(:patch, 'b/{bucket}/acl/{entity}', options)
259
+ command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
260
+ command.request_object = bucket_access_control_object
261
+ command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
262
+ command.response_class = Google::Apis::StorageV1::BucketAccessControl
263
+ command.params['bucket'] = bucket unless bucket.nil?
264
+ command.params['entity'] = entity unless entity.nil?
265
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
266
+ command.query['userProject'] = user_project unless user_project.nil?
267
+ command.query['fields'] = fields unless fields.nil?
268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
269
+ command.query['userIp'] = user_ip unless user_ip.nil?
270
+ execute_or_queue_command(command, &block)
271
+ end
272
+
273
+ # Updates an ACL entry on the specified bucket.
274
+ # @param [String] bucket
275
+ # Name of a bucket.
276
+ # @param [String] entity
277
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
278
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
279
+ # @param [Google::Apis::StorageV1::BucketAccessControl] bucket_access_control_object
280
+ # @param [String] provisional_user_project
281
+ # The project to be billed for this request if the target bucket is requester-
282
+ # pays bucket.
283
+ # @param [String] user_project
284
+ # The project to be billed for this request. Required for Requester Pays buckets.
285
+ # @param [String] fields
286
+ # Selector specifying which fields to include in a partial response.
287
+ # @param [String] quota_user
288
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
289
+ # characters.
290
+ # @param [String] user_ip
291
+ # Deprecated. Please use quotaUser instead.
292
+ # @param [Google::Apis::RequestOptions] options
293
+ # Request-specific options
294
+ #
295
+ # @yield [result, err] Result & error if block supplied
296
+ # @yieldparam result [Google::Apis::StorageV1::BucketAccessControl] parsed result object
297
+ # @yieldparam err [StandardError] error object if request failed
298
+ #
299
+ # @return [Google::Apis::StorageV1::BucketAccessControl]
300
+ #
301
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
302
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
303
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
304
+ def update_bucket_access_control(bucket, entity, bucket_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
305
+ command = make_simple_command(:put, 'b/{bucket}/acl/{entity}', options)
306
+ command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
307
+ command.request_object = bucket_access_control_object
308
+ command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
309
+ command.response_class = Google::Apis::StorageV1::BucketAccessControl
310
+ command.params['bucket'] = bucket unless bucket.nil?
311
+ command.params['entity'] = entity unless entity.nil?
312
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
313
+ command.query['userProject'] = user_project unless user_project.nil?
314
+ command.query['fields'] = fields unless fields.nil?
315
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
316
+ command.query['userIp'] = user_ip unless user_ip.nil?
317
+ execute_or_queue_command(command, &block)
318
+ end
319
+
320
+ # Permanently deletes an empty bucket.
321
+ # @param [String] bucket
322
+ # Name of a bucket.
323
+ # @param [Fixnum] if_metageneration_match
324
+ # If set, only deletes the bucket if its metageneration matches this value.
325
+ # @param [Fixnum] if_metageneration_not_match
326
+ # If set, only deletes the bucket if its metageneration does not match this
327
+ # value.
328
+ # @param [String] provisional_user_project
329
+ # The project to be billed for this request if the target bucket is requester-
330
+ # pays bucket.
331
+ # @param [String] user_project
332
+ # The project to be billed for this request. Required for Requester Pays buckets.
333
+ # @param [String] fields
334
+ # Selector specifying which fields to include in a partial response.
335
+ # @param [String] quota_user
336
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
337
+ # characters.
338
+ # @param [String] user_ip
339
+ # Deprecated. Please use quotaUser instead.
340
+ # @param [Google::Apis::RequestOptions] options
341
+ # Request-specific options
342
+ #
343
+ # @yield [result, err] Result & error if block supplied
344
+ # @yieldparam result [NilClass] No result returned for this method
345
+ # @yieldparam err [StandardError] error object if request failed
346
+ #
347
+ # @return [void]
348
+ #
349
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
350
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
351
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
352
+ def delete_bucket(bucket, if_metageneration_match: nil, if_metageneration_not_match: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
353
+ command = make_simple_command(:delete, 'b/{bucket}', options)
354
+ command.params['bucket'] = bucket unless bucket.nil?
355
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
356
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
357
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
358
+ command.query['userProject'] = user_project unless user_project.nil?
359
+ command.query['fields'] = fields unless fields.nil?
360
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
361
+ command.query['userIp'] = user_ip unless user_ip.nil?
362
+ execute_or_queue_command(command, &block)
363
+ end
364
+
365
+ # Returns metadata for the specified bucket.
366
+ # @param [String] bucket
367
+ # Name of a bucket.
368
+ # @param [Fixnum] if_metageneration_match
369
+ # Makes the return of the bucket metadata conditional on whether the bucket's
370
+ # current metageneration matches the given value.
371
+ # @param [Fixnum] if_metageneration_not_match
372
+ # Makes the return of the bucket metadata conditional on whether the bucket's
373
+ # current metageneration does not match the given value.
374
+ # @param [String] projection
375
+ # Set of properties to return. Defaults to noAcl.
376
+ # @param [String] provisional_user_project
377
+ # The project to be billed for this request if the target bucket is requester-
378
+ # pays bucket.
379
+ # @param [String] user_project
380
+ # The project to be billed for this request. Required for Requester Pays buckets.
381
+ # @param [String] fields
382
+ # Selector specifying which fields to include in a partial response.
383
+ # @param [String] quota_user
384
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
385
+ # characters.
386
+ # @param [String] user_ip
387
+ # Deprecated. Please use quotaUser instead.
388
+ # @param [Google::Apis::RequestOptions] options
389
+ # Request-specific options
390
+ #
391
+ # @yield [result, err] Result & error if block supplied
392
+ # @yieldparam result [Google::Apis::StorageV1::Bucket] parsed result object
393
+ # @yieldparam err [StandardError] error object if request failed
394
+ #
395
+ # @return [Google::Apis::StorageV1::Bucket]
396
+ #
397
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
398
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
399
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
400
+ def get_bucket(bucket, if_metageneration_match: nil, if_metageneration_not_match: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
401
+ command = make_simple_command(:get, 'b/{bucket}', options)
402
+ command.response_representation = Google::Apis::StorageV1::Bucket::Representation
403
+ command.response_class = Google::Apis::StorageV1::Bucket
404
+ command.params['bucket'] = bucket unless bucket.nil?
405
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
406
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
407
+ command.query['projection'] = projection unless projection.nil?
408
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
409
+ command.query['userProject'] = user_project unless user_project.nil?
410
+ command.query['fields'] = fields unless fields.nil?
411
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
412
+ command.query['userIp'] = user_ip unless user_ip.nil?
413
+ execute_or_queue_command(command, &block)
414
+ end
415
+
416
+ # Returns an IAM policy for the specified bucket.
417
+ # @param [String] bucket
418
+ # Name of a bucket.
419
+ # @param [Fixnum] options_requested_policy_version
420
+ # The IAM policy format version to be returned. If the
421
+ # optionsRequestedPolicyVersion is for an older version that doesn't support
422
+ # part of the requested IAM policy, the request fails.
423
+ # @param [String] provisional_user_project
424
+ # The project to be billed for this request if the target bucket is requester-
425
+ # pays bucket.
426
+ # @param [String] user_project
427
+ # The project to be billed for this request. Required for Requester Pays buckets.
428
+ # @param [String] fields
429
+ # Selector specifying which fields to include in a partial response.
430
+ # @param [String] quota_user
431
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
432
+ # characters.
433
+ # @param [String] user_ip
434
+ # Deprecated. Please use quotaUser instead.
435
+ # @param [Google::Apis::RequestOptions] options
436
+ # Request-specific options
437
+ #
438
+ # @yield [result, err] Result & error if block supplied
439
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
440
+ # @yieldparam err [StandardError] error object if request failed
441
+ #
442
+ # @return [Google::Apis::StorageV1::Policy]
443
+ #
444
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
445
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
446
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
447
+ def get_bucket_iam_policy(bucket, options_requested_policy_version: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
448
+ command = make_simple_command(:get, 'b/{bucket}/iam', options)
449
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
450
+ command.response_class = Google::Apis::StorageV1::Policy
451
+ command.params['bucket'] = bucket unless bucket.nil?
452
+ command.query['optionsRequestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
453
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
454
+ command.query['userProject'] = user_project unless user_project.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ command.query['userIp'] = user_ip unless user_ip.nil?
458
+ execute_or_queue_command(command, &block)
459
+ end
460
+
461
+ # Creates a new bucket.
462
+ # @param [String] project
463
+ # A valid API project identifier.
464
+ # @param [Google::Apis::StorageV1::Bucket] bucket_object
465
+ # @param [String] predefined_acl
466
+ # Apply a predefined set of access controls to this bucket.
467
+ # @param [String] predefined_default_object_acl
468
+ # Apply a predefined set of default object access controls to this bucket.
469
+ # @param [String] projection
470
+ # Set of properties to return. Defaults to noAcl, unless the bucket resource
471
+ # specifies acl or defaultObjectAcl properties, when it defaults to full.
472
+ # @param [String] provisional_user_project
473
+ # The project to be billed for this request if the target bucket is requester-
474
+ # pays bucket.
475
+ # @param [String] user_project
476
+ # The project to be billed for this request.
477
+ # @param [String] fields
478
+ # Selector specifying which fields to include in a partial response.
479
+ # @param [String] quota_user
480
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
481
+ # characters.
482
+ # @param [String] user_ip
483
+ # Deprecated. Please use quotaUser instead.
484
+ # @param [Google::Apis::RequestOptions] options
485
+ # Request-specific options
486
+ #
487
+ # @yield [result, err] Result & error if block supplied
488
+ # @yieldparam result [Google::Apis::StorageV1::Bucket] parsed result object
489
+ # @yieldparam err [StandardError] error object if request failed
490
+ #
491
+ # @return [Google::Apis::StorageV1::Bucket]
492
+ #
493
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
494
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
495
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
496
+ def insert_bucket(project, bucket_object = nil, predefined_acl: nil, predefined_default_object_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
497
+ command = make_simple_command(:post, 'b', options)
498
+ command.request_representation = Google::Apis::StorageV1::Bucket::Representation
499
+ command.request_object = bucket_object
500
+ command.response_representation = Google::Apis::StorageV1::Bucket::Representation
501
+ command.response_class = Google::Apis::StorageV1::Bucket
502
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
503
+ command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
504
+ command.query['project'] = project unless project.nil?
505
+ command.query['projection'] = projection unless projection.nil?
506
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
507
+ command.query['userProject'] = user_project unless user_project.nil?
508
+ command.query['fields'] = fields unless fields.nil?
509
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
510
+ command.query['userIp'] = user_ip unless user_ip.nil?
511
+ execute_or_queue_command(command, &block)
512
+ end
513
+
514
+ # Retrieves a list of buckets for a given project.
515
+ # @param [String] project
516
+ # A valid API project identifier.
517
+ # @param [Fixnum] max_results
518
+ # Maximum number of buckets to return in a single response. The service will use
519
+ # this parameter or 1,000 items, whichever is smaller.
520
+ # @param [String] page_token
521
+ # A previously-returned page token representing part of the larger set of
522
+ # results to view.
523
+ # @param [String] prefix
524
+ # Filter results to buckets whose names begin with this prefix.
525
+ # @param [String] projection
526
+ # Set of properties to return. Defaults to noAcl.
527
+ # @param [String] provisional_user_project
528
+ # The project to be billed for this request if the target bucket is requester-
529
+ # pays bucket.
530
+ # @param [String] user_project
531
+ # The project to be billed for this request.
532
+ # @param [String] fields
533
+ # Selector specifying which fields to include in a partial response.
534
+ # @param [String] quota_user
535
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
536
+ # characters.
537
+ # @param [String] user_ip
538
+ # Deprecated. Please use quotaUser instead.
539
+ # @param [Google::Apis::RequestOptions] options
540
+ # Request-specific options
541
+ #
542
+ # @yield [result, err] Result & error if block supplied
543
+ # @yieldparam result [Google::Apis::StorageV1::Buckets] parsed result object
544
+ # @yieldparam err [StandardError] error object if request failed
545
+ #
546
+ # @return [Google::Apis::StorageV1::Buckets]
547
+ #
548
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
549
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
550
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
551
+ def list_buckets(project, max_results: nil, page_token: nil, prefix: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
552
+ command = make_simple_command(:get, 'b', options)
553
+ command.response_representation = Google::Apis::StorageV1::Buckets::Representation
554
+ command.response_class = Google::Apis::StorageV1::Buckets
555
+ command.query['maxResults'] = max_results unless max_results.nil?
556
+ command.query['pageToken'] = page_token unless page_token.nil?
557
+ command.query['prefix'] = prefix unless prefix.nil?
558
+ command.query['project'] = project unless project.nil?
559
+ command.query['projection'] = projection unless projection.nil?
560
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
561
+ command.query['userProject'] = user_project unless user_project.nil?
562
+ command.query['fields'] = fields unless fields.nil?
563
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
564
+ command.query['userIp'] = user_ip unless user_ip.nil?
565
+ execute_or_queue_command(command, &block)
566
+ end
567
+
568
+ # Locks retention policy on a bucket.
569
+ # @param [String] bucket
570
+ # Name of a bucket.
571
+ # @param [Fixnum] if_metageneration_match
572
+ # Makes the operation conditional on whether bucket's current metageneration
573
+ # matches the given value.
574
+ # @param [String] provisional_user_project
575
+ # The project to be billed for this request if the target bucket is requester-
576
+ # pays bucket.
577
+ # @param [String] user_project
578
+ # The project to be billed for this request. Required for Requester Pays buckets.
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
583
+ # characters.
584
+ # @param [String] user_ip
585
+ # Deprecated. Please use quotaUser instead.
586
+ # @param [Google::Apis::RequestOptions] options
587
+ # Request-specific options
588
+ #
589
+ # @yield [result, err] Result & error if block supplied
590
+ # @yieldparam result [Google::Apis::StorageV1::Bucket] parsed result object
591
+ # @yieldparam err [StandardError] error object if request failed
592
+ #
593
+ # @return [Google::Apis::StorageV1::Bucket]
594
+ #
595
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
596
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
597
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
598
+ def lock_bucket_retention_policy(bucket, if_metageneration_match, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
599
+ command = make_simple_command(:post, 'b/{bucket}/lockRetentionPolicy', options)
600
+ command.response_representation = Google::Apis::StorageV1::Bucket::Representation
601
+ command.response_class = Google::Apis::StorageV1::Bucket
602
+ command.params['bucket'] = bucket unless bucket.nil?
603
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
604
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
605
+ command.query['userProject'] = user_project unless user_project.nil?
606
+ command.query['fields'] = fields unless fields.nil?
607
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
608
+ command.query['userIp'] = user_ip unless user_ip.nil?
609
+ execute_or_queue_command(command, &block)
610
+ end
611
+
612
+ # Patches a bucket. Changes to the bucket will be readable immediately after
613
+ # writing, but configuration changes may take time to propagate.
614
+ # @param [String] bucket
615
+ # Name of a bucket.
616
+ # @param [Google::Apis::StorageV1::Bucket] bucket_object
617
+ # @param [Fixnum] if_metageneration_match
618
+ # Makes the return of the bucket metadata conditional on whether the bucket's
619
+ # current metageneration matches the given value.
620
+ # @param [Fixnum] if_metageneration_not_match
621
+ # Makes the return of the bucket metadata conditional on whether the bucket's
622
+ # current metageneration does not match the given value.
623
+ # @param [String] predefined_acl
624
+ # Apply a predefined set of access controls to this bucket.
625
+ # @param [String] predefined_default_object_acl
626
+ # Apply a predefined set of default object access controls to this bucket.
627
+ # @param [String] projection
628
+ # Set of properties to return. Defaults to full.
629
+ # @param [String] provisional_user_project
630
+ # The project to be billed for this request if the target bucket is requester-
631
+ # pays bucket.
632
+ # @param [String] user_project
633
+ # The project to be billed for this request. Required for Requester Pays buckets.
634
+ # @param [String] fields
635
+ # Selector specifying which fields to include in a partial response.
636
+ # @param [String] quota_user
637
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
638
+ # characters.
639
+ # @param [String] user_ip
640
+ # Deprecated. Please use quotaUser instead.
641
+ # @param [Google::Apis::RequestOptions] options
642
+ # Request-specific options
643
+ #
644
+ # @yield [result, err] Result & error if block supplied
645
+ # @yieldparam result [Google::Apis::StorageV1::Bucket] parsed result object
646
+ # @yieldparam err [StandardError] error object if request failed
647
+ #
648
+ # @return [Google::Apis::StorageV1::Bucket]
649
+ #
650
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
651
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
652
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
653
+ def patch_bucket(bucket, bucket_object = nil, if_metageneration_match: nil, if_metageneration_not_match: nil, predefined_acl: nil, predefined_default_object_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
654
+ command = make_simple_command(:patch, 'b/{bucket}', options)
655
+ command.request_representation = Google::Apis::StorageV1::Bucket::Representation
656
+ command.request_object = bucket_object
657
+ command.response_representation = Google::Apis::StorageV1::Bucket::Representation
658
+ command.response_class = Google::Apis::StorageV1::Bucket
659
+ command.params['bucket'] = bucket unless bucket.nil?
660
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
661
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
662
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
663
+ command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
664
+ command.query['projection'] = projection unless projection.nil?
665
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
666
+ command.query['userProject'] = user_project unless user_project.nil?
667
+ command.query['fields'] = fields unless fields.nil?
668
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
669
+ command.query['userIp'] = user_ip unless user_ip.nil?
670
+ execute_or_queue_command(command, &block)
671
+ end
672
+
673
+ # Updates an IAM policy for the specified bucket.
674
+ # @param [String] bucket
675
+ # Name of a bucket.
676
+ # @param [Google::Apis::StorageV1::Policy] policy_object
677
+ # @param [String] provisional_user_project
678
+ # The project to be billed for this request if the target bucket is requester-
679
+ # pays bucket.
680
+ # @param [String] user_project
681
+ # The project to be billed for this request. Required for Requester Pays buckets.
682
+ # @param [String] fields
683
+ # Selector specifying which fields to include in a partial response.
684
+ # @param [String] quota_user
685
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
686
+ # characters.
687
+ # @param [String] user_ip
688
+ # Deprecated. Please use quotaUser instead.
689
+ # @param [Google::Apis::RequestOptions] options
690
+ # Request-specific options
691
+ #
692
+ # @yield [result, err] Result & error if block supplied
693
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
694
+ # @yieldparam err [StandardError] error object if request failed
695
+ #
696
+ # @return [Google::Apis::StorageV1::Policy]
697
+ #
698
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
699
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
700
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
701
+ def set_bucket_iam_policy(bucket, policy_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
702
+ command = make_simple_command(:put, 'b/{bucket}/iam', options)
703
+ command.request_representation = Google::Apis::StorageV1::Policy::Representation
704
+ command.request_object = policy_object
705
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
706
+ command.response_class = Google::Apis::StorageV1::Policy
707
+ command.params['bucket'] = bucket unless bucket.nil?
708
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
709
+ command.query['userProject'] = user_project unless user_project.nil?
710
+ command.query['fields'] = fields unless fields.nil?
711
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
712
+ command.query['userIp'] = user_ip unless user_ip.nil?
713
+ execute_or_queue_command(command, &block)
714
+ end
715
+
716
+ # Tests a set of permissions on the given bucket to see which, if any, are held
717
+ # by the caller.
718
+ # @param [String] bucket
719
+ # Name of a bucket.
720
+ # @param [Array<String>, String] permissions
721
+ # Permissions to test.
722
+ # @param [String] provisional_user_project
723
+ # The project to be billed for this request if the target bucket is requester-
724
+ # pays bucket.
725
+ # @param [String] user_project
726
+ # The project to be billed for this request. Required for Requester Pays buckets.
727
+ # @param [String] fields
728
+ # Selector specifying which fields to include in a partial response.
729
+ # @param [String] quota_user
730
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
731
+ # characters.
732
+ # @param [String] user_ip
733
+ # Deprecated. Please use quotaUser instead.
734
+ # @param [Google::Apis::RequestOptions] options
735
+ # Request-specific options
736
+ #
737
+ # @yield [result, err] Result & error if block supplied
738
+ # @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
739
+ # @yieldparam err [StandardError] error object if request failed
740
+ #
741
+ # @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
742
+ #
743
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
744
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
745
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
746
+ def test_bucket_iam_permissions(bucket, permissions, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
747
+ command = make_simple_command(:get, 'b/{bucket}/iam/testPermissions', options)
748
+ command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
749
+ command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
750
+ command.params['bucket'] = bucket unless bucket.nil?
751
+ command.query['permissions'] = permissions unless permissions.nil?
752
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
753
+ command.query['userProject'] = user_project unless user_project.nil?
754
+ command.query['fields'] = fields unless fields.nil?
755
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
756
+ command.query['userIp'] = user_ip unless user_ip.nil?
757
+ execute_or_queue_command(command, &block)
758
+ end
759
+
760
+ # Updates a bucket. Changes to the bucket will be readable immediately after
761
+ # writing, but configuration changes may take time to propagate.
762
+ # @param [String] bucket
763
+ # Name of a bucket.
764
+ # @param [Google::Apis::StorageV1::Bucket] bucket_object
765
+ # @param [Fixnum] if_metageneration_match
766
+ # Makes the return of the bucket metadata conditional on whether the bucket's
767
+ # current metageneration matches the given value.
768
+ # @param [Fixnum] if_metageneration_not_match
769
+ # Makes the return of the bucket metadata conditional on whether the bucket's
770
+ # current metageneration does not match the given value.
771
+ # @param [String] predefined_acl
772
+ # Apply a predefined set of access controls to this bucket.
773
+ # @param [String] predefined_default_object_acl
774
+ # Apply a predefined set of default object access controls to this bucket.
775
+ # @param [String] projection
776
+ # Set of properties to return. Defaults to full.
777
+ # @param [String] provisional_user_project
778
+ # The project to be billed for this request if the target bucket is requester-
779
+ # pays bucket.
780
+ # @param [String] user_project
781
+ # The project to be billed for this request. Required for Requester Pays buckets.
782
+ # @param [String] fields
783
+ # Selector specifying which fields to include in a partial response.
784
+ # @param [String] quota_user
785
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
786
+ # characters.
787
+ # @param [String] user_ip
788
+ # Deprecated. Please use quotaUser instead.
789
+ # @param [Google::Apis::RequestOptions] options
790
+ # Request-specific options
791
+ #
792
+ # @yield [result, err] Result & error if block supplied
793
+ # @yieldparam result [Google::Apis::StorageV1::Bucket] parsed result object
794
+ # @yieldparam err [StandardError] error object if request failed
795
+ #
796
+ # @return [Google::Apis::StorageV1::Bucket]
797
+ #
798
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
799
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
800
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
801
+ def update_bucket(bucket, bucket_object = nil, if_metageneration_match: nil, if_metageneration_not_match: nil, predefined_acl: nil, predefined_default_object_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
802
+ command = make_simple_command(:put, 'b/{bucket}', options)
803
+ command.request_representation = Google::Apis::StorageV1::Bucket::Representation
804
+ command.request_object = bucket_object
805
+ command.response_representation = Google::Apis::StorageV1::Bucket::Representation
806
+ command.response_class = Google::Apis::StorageV1::Bucket
807
+ command.params['bucket'] = bucket unless bucket.nil?
808
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
809
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
810
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
811
+ command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
812
+ command.query['projection'] = projection unless projection.nil?
813
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
814
+ command.query['userProject'] = user_project unless user_project.nil?
815
+ command.query['fields'] = fields unless fields.nil?
816
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
817
+ command.query['userIp'] = user_ip unless user_ip.nil?
818
+ execute_or_queue_command(command, &block)
819
+ end
820
+
821
+ # Stop watching resources through this channel
822
+ # @param [Google::Apis::StorageV1::Channel] channel_object
823
+ # @param [String] fields
824
+ # Selector specifying which fields to include in a partial response.
825
+ # @param [String] quota_user
826
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
827
+ # characters.
828
+ # @param [String] user_ip
829
+ # Deprecated. Please use quotaUser instead.
830
+ # @param [Google::Apis::RequestOptions] options
831
+ # Request-specific options
832
+ #
833
+ # @yield [result, err] Result & error if block supplied
834
+ # @yieldparam result [NilClass] No result returned for this method
835
+ # @yieldparam err [StandardError] error object if request failed
836
+ #
837
+ # @return [void]
838
+ #
839
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
840
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
841
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
842
+ def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
843
+ command = make_simple_command(:post, 'channels/stop', options)
844
+ command.request_representation = Google::Apis::StorageV1::Channel::Representation
845
+ command.request_object = channel_object
846
+ command.query['fields'] = fields unless fields.nil?
847
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
848
+ command.query['userIp'] = user_ip unless user_ip.nil?
849
+ execute_or_queue_command(command, &block)
850
+ end
851
+
852
+ # Permanently deletes the default object ACL entry for the specified entity on
853
+ # the specified bucket.
854
+ # @param [String] bucket
855
+ # Name of a bucket.
856
+ # @param [String] entity
857
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
858
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
859
+ # @param [String] provisional_user_project
860
+ # The project to be billed for this request if the target bucket is requester-
861
+ # pays bucket.
862
+ # @param [String] user_project
863
+ # The project to be billed for this request. Required for Requester Pays buckets.
864
+ # @param [String] fields
865
+ # Selector specifying which fields to include in a partial response.
866
+ # @param [String] quota_user
867
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
868
+ # characters.
869
+ # @param [String] user_ip
870
+ # Deprecated. Please use quotaUser instead.
871
+ # @param [Google::Apis::RequestOptions] options
872
+ # Request-specific options
873
+ #
874
+ # @yield [result, err] Result & error if block supplied
875
+ # @yieldparam result [NilClass] No result returned for this method
876
+ # @yieldparam err [StandardError] error object if request failed
877
+ #
878
+ # @return [void]
879
+ #
880
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
881
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
882
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
883
+ def delete_default_object_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
884
+ command = make_simple_command(:delete, 'b/{bucket}/defaultObjectAcl/{entity}', options)
885
+ command.params['bucket'] = bucket unless bucket.nil?
886
+ command.params['entity'] = entity unless entity.nil?
887
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
888
+ command.query['userProject'] = user_project unless user_project.nil?
889
+ command.query['fields'] = fields unless fields.nil?
890
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
891
+ command.query['userIp'] = user_ip unless user_ip.nil?
892
+ execute_or_queue_command(command, &block)
893
+ end
894
+
895
+ # Returns the default object ACL entry for the specified entity on the specified
896
+ # bucket.
897
+ # @param [String] bucket
898
+ # Name of a bucket.
899
+ # @param [String] entity
900
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
901
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
902
+ # @param [String] provisional_user_project
903
+ # The project to be billed for this request if the target bucket is requester-
904
+ # pays bucket.
905
+ # @param [String] user_project
906
+ # The project to be billed for this request. Required for Requester Pays buckets.
907
+ # @param [String] fields
908
+ # Selector specifying which fields to include in a partial response.
909
+ # @param [String] quota_user
910
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
911
+ # characters.
912
+ # @param [String] user_ip
913
+ # Deprecated. Please use quotaUser instead.
914
+ # @param [Google::Apis::RequestOptions] options
915
+ # Request-specific options
916
+ #
917
+ # @yield [result, err] Result & error if block supplied
918
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
919
+ # @yieldparam err [StandardError] error object if request failed
920
+ #
921
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
922
+ #
923
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
924
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
925
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
926
+ def get_default_object_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
927
+ command = make_simple_command(:get, 'b/{bucket}/defaultObjectAcl/{entity}', options)
928
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
929
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
930
+ command.params['bucket'] = bucket unless bucket.nil?
931
+ command.params['entity'] = entity unless entity.nil?
932
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
933
+ command.query['userProject'] = user_project unless user_project.nil?
934
+ command.query['fields'] = fields unless fields.nil?
935
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
936
+ command.query['userIp'] = user_ip unless user_ip.nil?
937
+ execute_or_queue_command(command, &block)
938
+ end
939
+
940
+ # Creates a new default object ACL entry on the specified bucket.
941
+ # @param [String] bucket
942
+ # Name of a bucket.
943
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
944
+ # @param [String] provisional_user_project
945
+ # The project to be billed for this request if the target bucket is requester-
946
+ # pays bucket.
947
+ # @param [String] user_project
948
+ # The project to be billed for this request. Required for Requester Pays buckets.
949
+ # @param [String] fields
950
+ # Selector specifying which fields to include in a partial response.
951
+ # @param [String] quota_user
952
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
953
+ # characters.
954
+ # @param [String] user_ip
955
+ # Deprecated. Please use quotaUser instead.
956
+ # @param [Google::Apis::RequestOptions] options
957
+ # Request-specific options
958
+ #
959
+ # @yield [result, err] Result & error if block supplied
960
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
961
+ # @yieldparam err [StandardError] error object if request failed
962
+ #
963
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
964
+ #
965
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
966
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
967
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
968
+ def insert_default_object_access_control(bucket, object_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
969
+ command = make_simple_command(:post, 'b/{bucket}/defaultObjectAcl', options)
970
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
971
+ command.request_object = object_access_control_object
972
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
973
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
974
+ command.params['bucket'] = bucket unless bucket.nil?
975
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
976
+ command.query['userProject'] = user_project unless user_project.nil?
977
+ command.query['fields'] = fields unless fields.nil?
978
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
979
+ command.query['userIp'] = user_ip unless user_ip.nil?
980
+ execute_or_queue_command(command, &block)
981
+ end
982
+
983
+ # Retrieves default object ACL entries on the specified bucket.
984
+ # @param [String] bucket
985
+ # Name of a bucket.
986
+ # @param [Fixnum] if_metageneration_match
987
+ # If present, only return default ACL listing if the bucket's current
988
+ # metageneration matches this value.
989
+ # @param [Fixnum] if_metageneration_not_match
990
+ # If present, only return default ACL listing if the bucket's current
991
+ # metageneration does not match the given value.
992
+ # @param [String] provisional_user_project
993
+ # The project to be billed for this request if the target bucket is requester-
994
+ # pays bucket.
995
+ # @param [String] user_project
996
+ # The project to be billed for this request. Required for Requester Pays buckets.
997
+ # @param [String] fields
998
+ # Selector specifying which fields to include in a partial response.
999
+ # @param [String] quota_user
1000
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1001
+ # characters.
1002
+ # @param [String] user_ip
1003
+ # Deprecated. Please use quotaUser instead.
1004
+ # @param [Google::Apis::RequestOptions] options
1005
+ # Request-specific options
1006
+ #
1007
+ # @yield [result, err] Result & error if block supplied
1008
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControls] parsed result object
1009
+ # @yieldparam err [StandardError] error object if request failed
1010
+ #
1011
+ # @return [Google::Apis::StorageV1::ObjectAccessControls]
1012
+ #
1013
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1014
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1015
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1016
+ def list_default_object_access_controls(bucket, if_metageneration_match: nil, if_metageneration_not_match: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1017
+ command = make_simple_command(:get, 'b/{bucket}/defaultObjectAcl', options)
1018
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControls::Representation
1019
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControls
1020
+ command.params['bucket'] = bucket unless bucket.nil?
1021
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
1022
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
1023
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1024
+ command.query['userProject'] = user_project unless user_project.nil?
1025
+ command.query['fields'] = fields unless fields.nil?
1026
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1027
+ command.query['userIp'] = user_ip unless user_ip.nil?
1028
+ execute_or_queue_command(command, &block)
1029
+ end
1030
+
1031
+ # Patches a default object ACL entry on the specified bucket.
1032
+ # @param [String] bucket
1033
+ # Name of a bucket.
1034
+ # @param [String] entity
1035
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1036
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1037
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
1038
+ # @param [String] provisional_user_project
1039
+ # The project to be billed for this request if the target bucket is requester-
1040
+ # pays bucket.
1041
+ # @param [String] user_project
1042
+ # The project to be billed for this request. Required for Requester Pays buckets.
1043
+ # @param [String] fields
1044
+ # Selector specifying which fields to include in a partial response.
1045
+ # @param [String] quota_user
1046
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1047
+ # characters.
1048
+ # @param [String] user_ip
1049
+ # Deprecated. Please use quotaUser instead.
1050
+ # @param [Google::Apis::RequestOptions] options
1051
+ # Request-specific options
1052
+ #
1053
+ # @yield [result, err] Result & error if block supplied
1054
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1055
+ # @yieldparam err [StandardError] error object if request failed
1056
+ #
1057
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1058
+ #
1059
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1060
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1061
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1062
+ def patch_default_object_access_control(bucket, entity, object_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1063
+ command = make_simple_command(:patch, 'b/{bucket}/defaultObjectAcl/{entity}', options)
1064
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1065
+ command.request_object = object_access_control_object
1066
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1067
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1068
+ command.params['bucket'] = bucket unless bucket.nil?
1069
+ command.params['entity'] = entity unless entity.nil?
1070
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1071
+ command.query['userProject'] = user_project unless user_project.nil?
1072
+ command.query['fields'] = fields unless fields.nil?
1073
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1074
+ command.query['userIp'] = user_ip unless user_ip.nil?
1075
+ execute_or_queue_command(command, &block)
1076
+ end
1077
+
1078
+ # Updates a default object ACL entry on the specified bucket.
1079
+ # @param [String] bucket
1080
+ # Name of a bucket.
1081
+ # @param [String] entity
1082
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1083
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1084
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
1085
+ # @param [String] provisional_user_project
1086
+ # The project to be billed for this request if the target bucket is requester-
1087
+ # pays bucket.
1088
+ # @param [String] user_project
1089
+ # The project to be billed for this request. Required for Requester Pays buckets.
1090
+ # @param [String] fields
1091
+ # Selector specifying which fields to include in a partial response.
1092
+ # @param [String] quota_user
1093
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1094
+ # characters.
1095
+ # @param [String] user_ip
1096
+ # Deprecated. Please use quotaUser instead.
1097
+ # @param [Google::Apis::RequestOptions] options
1098
+ # Request-specific options
1099
+ #
1100
+ # @yield [result, err] Result & error if block supplied
1101
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1102
+ # @yieldparam err [StandardError] error object if request failed
1103
+ #
1104
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1105
+ #
1106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1109
+ def update_default_object_access_control(bucket, entity, object_access_control_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1110
+ command = make_simple_command(:put, 'b/{bucket}/defaultObjectAcl/{entity}', options)
1111
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1112
+ command.request_object = object_access_control_object
1113
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1114
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1115
+ command.params['bucket'] = bucket unless bucket.nil?
1116
+ command.params['entity'] = entity unless entity.nil?
1117
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1118
+ command.query['userProject'] = user_project unless user_project.nil?
1119
+ command.query['fields'] = fields unless fields.nil?
1120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1121
+ command.query['userIp'] = user_ip unless user_ip.nil?
1122
+ execute_or_queue_command(command, &block)
1123
+ end
1124
+
1125
+ # Permanently deletes a notification subscription.
1126
+ # @param [String] bucket
1127
+ # The parent bucket of the notification.
1128
+ # @param [String] notification
1129
+ # ID of the notification to delete.
1130
+ # @param [String] provisional_user_project
1131
+ # The project to be billed for this request if the target bucket is requester-
1132
+ # pays bucket.
1133
+ # @param [String] user_project
1134
+ # The project to be billed for this request. Required for Requester Pays buckets.
1135
+ # @param [String] fields
1136
+ # Selector specifying which fields to include in a partial response.
1137
+ # @param [String] quota_user
1138
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1139
+ # characters.
1140
+ # @param [String] user_ip
1141
+ # Deprecated. Please use quotaUser instead.
1142
+ # @param [Google::Apis::RequestOptions] options
1143
+ # Request-specific options
1144
+ #
1145
+ # @yield [result, err] Result & error if block supplied
1146
+ # @yieldparam result [NilClass] No result returned for this method
1147
+ # @yieldparam err [StandardError] error object if request failed
1148
+ #
1149
+ # @return [void]
1150
+ #
1151
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1152
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1153
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1154
+ def delete_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1155
+ command = make_simple_command(:delete, 'b/{bucket}/notificationConfigs/{notification}', options)
1156
+ command.params['bucket'] = bucket unless bucket.nil?
1157
+ command.params['notification'] = notification unless notification.nil?
1158
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1159
+ command.query['userProject'] = user_project unless user_project.nil?
1160
+ command.query['fields'] = fields unless fields.nil?
1161
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1162
+ command.query['userIp'] = user_ip unless user_ip.nil?
1163
+ execute_or_queue_command(command, &block)
1164
+ end
1165
+
1166
+ # View a notification configuration.
1167
+ # @param [String] bucket
1168
+ # The parent bucket of the notification.
1169
+ # @param [String] notification
1170
+ # Notification ID
1171
+ # @param [String] provisional_user_project
1172
+ # The project to be billed for this request if the target bucket is requester-
1173
+ # pays bucket.
1174
+ # @param [String] user_project
1175
+ # The project to be billed for this request. Required for Requester Pays buckets.
1176
+ # @param [String] fields
1177
+ # Selector specifying which fields to include in a partial response.
1178
+ # @param [String] quota_user
1179
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1180
+ # characters.
1181
+ # @param [String] user_ip
1182
+ # Deprecated. Please use quotaUser instead.
1183
+ # @param [Google::Apis::RequestOptions] options
1184
+ # Request-specific options
1185
+ #
1186
+ # @yield [result, err] Result & error if block supplied
1187
+ # @yieldparam result [Google::Apis::StorageV1::Notification] parsed result object
1188
+ # @yieldparam err [StandardError] error object if request failed
1189
+ #
1190
+ # @return [Google::Apis::StorageV1::Notification]
1191
+ #
1192
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1193
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1194
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1195
+ def get_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1196
+ command = make_simple_command(:get, 'b/{bucket}/notificationConfigs/{notification}', options)
1197
+ command.response_representation = Google::Apis::StorageV1::Notification::Representation
1198
+ command.response_class = Google::Apis::StorageV1::Notification
1199
+ command.params['bucket'] = bucket unless bucket.nil?
1200
+ command.params['notification'] = notification unless notification.nil?
1201
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1202
+ command.query['userProject'] = user_project unless user_project.nil?
1203
+ command.query['fields'] = fields unless fields.nil?
1204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1205
+ command.query['userIp'] = user_ip unless user_ip.nil?
1206
+ execute_or_queue_command(command, &block)
1207
+ end
1208
+
1209
+ # Creates a notification subscription for a given bucket.
1210
+ # @param [String] bucket
1211
+ # The parent bucket of the notification.
1212
+ # @param [Google::Apis::StorageV1::Notification] notification_object
1213
+ # @param [String] provisional_user_project
1214
+ # The project to be billed for this request if the target bucket is requester-
1215
+ # pays bucket.
1216
+ # @param [String] user_project
1217
+ # The project to be billed for this request. Required for Requester Pays buckets.
1218
+ # @param [String] fields
1219
+ # Selector specifying which fields to include in a partial response.
1220
+ # @param [String] quota_user
1221
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1222
+ # characters.
1223
+ # @param [String] user_ip
1224
+ # Deprecated. Please use quotaUser instead.
1225
+ # @param [Google::Apis::RequestOptions] options
1226
+ # Request-specific options
1227
+ #
1228
+ # @yield [result, err] Result & error if block supplied
1229
+ # @yieldparam result [Google::Apis::StorageV1::Notification] parsed result object
1230
+ # @yieldparam err [StandardError] error object if request failed
1231
+ #
1232
+ # @return [Google::Apis::StorageV1::Notification]
1233
+ #
1234
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1235
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1236
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1237
+ def insert_notification(bucket, notification_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1238
+ command = make_simple_command(:post, 'b/{bucket}/notificationConfigs', options)
1239
+ command.request_representation = Google::Apis::StorageV1::Notification::Representation
1240
+ command.request_object = notification_object
1241
+ command.response_representation = Google::Apis::StorageV1::Notification::Representation
1242
+ command.response_class = Google::Apis::StorageV1::Notification
1243
+ command.params['bucket'] = bucket unless bucket.nil?
1244
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1245
+ command.query['userProject'] = user_project unless user_project.nil?
1246
+ command.query['fields'] = fields unless fields.nil?
1247
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1248
+ command.query['userIp'] = user_ip unless user_ip.nil?
1249
+ execute_or_queue_command(command, &block)
1250
+ end
1251
+
1252
+ # Retrieves a list of notification subscriptions for a given bucket.
1253
+ # @param [String] bucket
1254
+ # Name of a Google Cloud Storage bucket.
1255
+ # @param [String] provisional_user_project
1256
+ # The project to be billed for this request if the target bucket is requester-
1257
+ # pays bucket.
1258
+ # @param [String] user_project
1259
+ # The project to be billed for this request. Required for Requester Pays buckets.
1260
+ # @param [String] fields
1261
+ # Selector specifying which fields to include in a partial response.
1262
+ # @param [String] quota_user
1263
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1264
+ # characters.
1265
+ # @param [String] user_ip
1266
+ # Deprecated. Please use quotaUser instead.
1267
+ # @param [Google::Apis::RequestOptions] options
1268
+ # Request-specific options
1269
+ #
1270
+ # @yield [result, err] Result & error if block supplied
1271
+ # @yieldparam result [Google::Apis::StorageV1::Notifications] parsed result object
1272
+ # @yieldparam err [StandardError] error object if request failed
1273
+ #
1274
+ # @return [Google::Apis::StorageV1::Notifications]
1275
+ #
1276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1279
+ def list_notifications(bucket, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1280
+ command = make_simple_command(:get, 'b/{bucket}/notificationConfigs', options)
1281
+ command.response_representation = Google::Apis::StorageV1::Notifications::Representation
1282
+ command.response_class = Google::Apis::StorageV1::Notifications
1283
+ command.params['bucket'] = bucket unless bucket.nil?
1284
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1285
+ command.query['userProject'] = user_project unless user_project.nil?
1286
+ command.query['fields'] = fields unless fields.nil?
1287
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1288
+ command.query['userIp'] = user_ip unless user_ip.nil?
1289
+ execute_or_queue_command(command, &block)
1290
+ end
1291
+
1292
+ # Permanently deletes the ACL entry for the specified entity on the specified
1293
+ # object.
1294
+ # @param [String] bucket
1295
+ # Name of a bucket.
1296
+ # @param [String] object
1297
+ # Name of the object. For information about how to URL encode object names to be
1298
+ # path safe, see Encoding URI Path Parts.
1299
+ # @param [String] entity
1300
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1301
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1302
+ # @param [Fixnum] generation
1303
+ # If present, selects a specific revision of this object (as opposed to the
1304
+ # latest version, the default).
1305
+ # @param [String] provisional_user_project
1306
+ # The project to be billed for this request if the target bucket is requester-
1307
+ # pays bucket.
1308
+ # @param [String] user_project
1309
+ # The project to be billed for this request. Required for Requester Pays buckets.
1310
+ # @param [String] fields
1311
+ # Selector specifying which fields to include in a partial response.
1312
+ # @param [String] quota_user
1313
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1314
+ # characters.
1315
+ # @param [String] user_ip
1316
+ # Deprecated. Please use quotaUser instead.
1317
+ # @param [Google::Apis::RequestOptions] options
1318
+ # Request-specific options
1319
+ #
1320
+ # @yield [result, err] Result & error if block supplied
1321
+ # @yieldparam result [NilClass] No result returned for this method
1322
+ # @yieldparam err [StandardError] error object if request failed
1323
+ #
1324
+ # @return [void]
1325
+ #
1326
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1327
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1328
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1329
+ def delete_object_access_control(bucket, object, entity, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1330
+ command = make_simple_command(:delete, 'b/{bucket}/o/{object}/acl/{entity}', options)
1331
+ command.params['bucket'] = bucket unless bucket.nil?
1332
+ command.params['object'] = object unless object.nil?
1333
+ command.params['entity'] = entity unless entity.nil?
1334
+ command.query['generation'] = generation unless generation.nil?
1335
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1336
+ command.query['userProject'] = user_project unless user_project.nil?
1337
+ command.query['fields'] = fields unless fields.nil?
1338
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1339
+ command.query['userIp'] = user_ip unless user_ip.nil?
1340
+ execute_or_queue_command(command, &block)
1341
+ end
1342
+
1343
+ # Returns the ACL entry for the specified entity on the specified object.
1344
+ # @param [String] bucket
1345
+ # Name of a bucket.
1346
+ # @param [String] object
1347
+ # Name of the object. For information about how to URL encode object names to be
1348
+ # path safe, see Encoding URI Path Parts.
1349
+ # @param [String] entity
1350
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1351
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1352
+ # @param [Fixnum] generation
1353
+ # If present, selects a specific revision of this object (as opposed to the
1354
+ # latest version, the default).
1355
+ # @param [String] provisional_user_project
1356
+ # The project to be billed for this request if the target bucket is requester-
1357
+ # pays bucket.
1358
+ # @param [String] user_project
1359
+ # The project to be billed for this request. Required for Requester Pays buckets.
1360
+ # @param [String] fields
1361
+ # Selector specifying which fields to include in a partial response.
1362
+ # @param [String] quota_user
1363
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1364
+ # characters.
1365
+ # @param [String] user_ip
1366
+ # Deprecated. Please use quotaUser instead.
1367
+ # @param [Google::Apis::RequestOptions] options
1368
+ # Request-specific options
1369
+ #
1370
+ # @yield [result, err] Result & error if block supplied
1371
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1372
+ # @yieldparam err [StandardError] error object if request failed
1373
+ #
1374
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1375
+ #
1376
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1377
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1378
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1379
+ def get_object_access_control(bucket, object, entity, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1380
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/acl/{entity}', options)
1381
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1382
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1383
+ command.params['bucket'] = bucket unless bucket.nil?
1384
+ command.params['object'] = object unless object.nil?
1385
+ command.params['entity'] = entity unless entity.nil?
1386
+ command.query['generation'] = generation unless generation.nil?
1387
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1388
+ command.query['userProject'] = user_project unless user_project.nil?
1389
+ command.query['fields'] = fields unless fields.nil?
1390
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1391
+ command.query['userIp'] = user_ip unless user_ip.nil?
1392
+ execute_or_queue_command(command, &block)
1393
+ end
1394
+
1395
+ # Creates a new ACL entry on the specified object.
1396
+ # @param [String] bucket
1397
+ # Name of a bucket.
1398
+ # @param [String] object
1399
+ # Name of the object. For information about how to URL encode object names to be
1400
+ # path safe, see Encoding URI Path Parts.
1401
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
1402
+ # @param [Fixnum] generation
1403
+ # If present, selects a specific revision of this object (as opposed to the
1404
+ # latest version, the default).
1405
+ # @param [String] provisional_user_project
1406
+ # The project to be billed for this request if the target bucket is requester-
1407
+ # pays bucket.
1408
+ # @param [String] user_project
1409
+ # The project to be billed for this request. Required for Requester Pays buckets.
1410
+ # @param [String] fields
1411
+ # Selector specifying which fields to include in a partial response.
1412
+ # @param [String] quota_user
1413
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1414
+ # characters.
1415
+ # @param [String] user_ip
1416
+ # Deprecated. Please use quotaUser instead.
1417
+ # @param [Google::Apis::RequestOptions] options
1418
+ # Request-specific options
1419
+ #
1420
+ # @yield [result, err] Result & error if block supplied
1421
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1422
+ # @yieldparam err [StandardError] error object if request failed
1423
+ #
1424
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1425
+ #
1426
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1427
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1428
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1429
+ def insert_object_access_control(bucket, object, object_access_control_object = nil, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1430
+ command = make_simple_command(:post, 'b/{bucket}/o/{object}/acl', options)
1431
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1432
+ command.request_object = object_access_control_object
1433
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1434
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1435
+ command.params['bucket'] = bucket unless bucket.nil?
1436
+ command.params['object'] = object unless object.nil?
1437
+ command.query['generation'] = generation unless generation.nil?
1438
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1439
+ command.query['userProject'] = user_project unless user_project.nil?
1440
+ command.query['fields'] = fields unless fields.nil?
1441
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1442
+ command.query['userIp'] = user_ip unless user_ip.nil?
1443
+ execute_or_queue_command(command, &block)
1444
+ end
1445
+
1446
+ # Retrieves ACL entries on the specified object.
1447
+ # @param [String] bucket
1448
+ # Name of a bucket.
1449
+ # @param [String] object
1450
+ # Name of the object. For information about how to URL encode object names to be
1451
+ # path safe, see Encoding URI Path Parts.
1452
+ # @param [Fixnum] generation
1453
+ # If present, selects a specific revision of this object (as opposed to the
1454
+ # latest version, the default).
1455
+ # @param [String] provisional_user_project
1456
+ # The project to be billed for this request if the target bucket is requester-
1457
+ # pays bucket.
1458
+ # @param [String] user_project
1459
+ # The project to be billed for this request. Required for Requester Pays buckets.
1460
+ # @param [String] fields
1461
+ # Selector specifying which fields to include in a partial response.
1462
+ # @param [String] quota_user
1463
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1464
+ # characters.
1465
+ # @param [String] user_ip
1466
+ # Deprecated. Please use quotaUser instead.
1467
+ # @param [Google::Apis::RequestOptions] options
1468
+ # Request-specific options
1469
+ #
1470
+ # @yield [result, err] Result & error if block supplied
1471
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControls] parsed result object
1472
+ # @yieldparam err [StandardError] error object if request failed
1473
+ #
1474
+ # @return [Google::Apis::StorageV1::ObjectAccessControls]
1475
+ #
1476
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1477
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1478
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1479
+ def list_object_access_controls(bucket, object, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1480
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/acl', options)
1481
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControls::Representation
1482
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControls
1483
+ command.params['bucket'] = bucket unless bucket.nil?
1484
+ command.params['object'] = object unless object.nil?
1485
+ command.query['generation'] = generation unless generation.nil?
1486
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1487
+ command.query['userProject'] = user_project unless user_project.nil?
1488
+ command.query['fields'] = fields unless fields.nil?
1489
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1490
+ command.query['userIp'] = user_ip unless user_ip.nil?
1491
+ execute_or_queue_command(command, &block)
1492
+ end
1493
+
1494
+ # Patches an ACL entry on the specified object.
1495
+ # @param [String] bucket
1496
+ # Name of a bucket.
1497
+ # @param [String] object
1498
+ # Name of the object. For information about how to URL encode object names to be
1499
+ # path safe, see Encoding URI Path Parts.
1500
+ # @param [String] entity
1501
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1502
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1503
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
1504
+ # @param [Fixnum] generation
1505
+ # If present, selects a specific revision of this object (as opposed to the
1506
+ # latest version, the default).
1507
+ # @param [String] provisional_user_project
1508
+ # The project to be billed for this request if the target bucket is requester-
1509
+ # pays bucket.
1510
+ # @param [String] user_project
1511
+ # The project to be billed for this request. Required for Requester Pays buckets.
1512
+ # @param [String] fields
1513
+ # Selector specifying which fields to include in a partial response.
1514
+ # @param [String] quota_user
1515
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1516
+ # characters.
1517
+ # @param [String] user_ip
1518
+ # Deprecated. Please use quotaUser instead.
1519
+ # @param [Google::Apis::RequestOptions] options
1520
+ # Request-specific options
1521
+ #
1522
+ # @yield [result, err] Result & error if block supplied
1523
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1524
+ # @yieldparam err [StandardError] error object if request failed
1525
+ #
1526
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1527
+ #
1528
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1529
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1530
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1531
+ def patch_object_access_control(bucket, object, entity, object_access_control_object = nil, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1532
+ command = make_simple_command(:patch, 'b/{bucket}/o/{object}/acl/{entity}', options)
1533
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1534
+ command.request_object = object_access_control_object
1535
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1536
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1537
+ command.params['bucket'] = bucket unless bucket.nil?
1538
+ command.params['object'] = object unless object.nil?
1539
+ command.params['entity'] = entity unless entity.nil?
1540
+ command.query['generation'] = generation unless generation.nil?
1541
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1542
+ command.query['userProject'] = user_project unless user_project.nil?
1543
+ command.query['fields'] = fields unless fields.nil?
1544
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1545
+ command.query['userIp'] = user_ip unless user_ip.nil?
1546
+ execute_or_queue_command(command, &block)
1547
+ end
1548
+
1549
+ # Updates an ACL entry on the specified object.
1550
+ # @param [String] bucket
1551
+ # Name of a bucket.
1552
+ # @param [String] object
1553
+ # Name of the object. For information about how to URL encode object names to be
1554
+ # path safe, see Encoding URI Path Parts.
1555
+ # @param [String] entity
1556
+ # The entity holding the permission. Can be user-userId, user-emailAddress,
1557
+ # group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
1558
+ # @param [Google::Apis::StorageV1::ObjectAccessControl] object_access_control_object
1559
+ # @param [Fixnum] generation
1560
+ # If present, selects a specific revision of this object (as opposed to the
1561
+ # latest version, the default).
1562
+ # @param [String] provisional_user_project
1563
+ # The project to be billed for this request if the target bucket is requester-
1564
+ # pays bucket.
1565
+ # @param [String] user_project
1566
+ # The project to be billed for this request. Required for Requester Pays buckets.
1567
+ # @param [String] fields
1568
+ # Selector specifying which fields to include in a partial response.
1569
+ # @param [String] quota_user
1570
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1571
+ # characters.
1572
+ # @param [String] user_ip
1573
+ # Deprecated. Please use quotaUser instead.
1574
+ # @param [Google::Apis::RequestOptions] options
1575
+ # Request-specific options
1576
+ #
1577
+ # @yield [result, err] Result & error if block supplied
1578
+ # @yieldparam result [Google::Apis::StorageV1::ObjectAccessControl] parsed result object
1579
+ # @yieldparam err [StandardError] error object if request failed
1580
+ #
1581
+ # @return [Google::Apis::StorageV1::ObjectAccessControl]
1582
+ #
1583
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1584
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1585
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1586
+ def update_object_access_control(bucket, object, entity, object_access_control_object = nil, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1587
+ command = make_simple_command(:put, 'b/{bucket}/o/{object}/acl/{entity}', options)
1588
+ command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1589
+ command.request_object = object_access_control_object
1590
+ command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
1591
+ command.response_class = Google::Apis::StorageV1::ObjectAccessControl
1592
+ command.params['bucket'] = bucket unless bucket.nil?
1593
+ command.params['object'] = object unless object.nil?
1594
+ command.params['entity'] = entity unless entity.nil?
1595
+ command.query['generation'] = generation unless generation.nil?
1596
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1597
+ command.query['userProject'] = user_project unless user_project.nil?
1598
+ command.query['fields'] = fields unless fields.nil?
1599
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1600
+ command.query['userIp'] = user_ip unless user_ip.nil?
1601
+ execute_or_queue_command(command, &block)
1602
+ end
1603
+
1604
+ # Concatenates a list of existing objects into a new object in the same bucket.
1605
+ # @param [String] destination_bucket
1606
+ # Name of the bucket containing the source objects. The destination object is
1607
+ # stored in this bucket.
1608
+ # @param [String] destination_object
1609
+ # Name of the new object. For information about how to URL encode object names
1610
+ # to be path safe, see Encoding URI Path Parts.
1611
+ # @param [Google::Apis::StorageV1::ComposeRequest] compose_request_object
1612
+ # @param [String] destination_predefined_acl
1613
+ # Apply a predefined set of access controls to the destination object.
1614
+ # @param [Fixnum] if_generation_match
1615
+ # Makes the operation conditional on whether the object's current generation
1616
+ # matches the given value. Setting to 0 makes the operation succeed only if
1617
+ # there are no live versions of the object.
1618
+ # @param [Fixnum] if_metageneration_match
1619
+ # Makes the operation conditional on whether the object's current metageneration
1620
+ # matches the given value.
1621
+ # @param [String] kms_key_name
1622
+ # Resource name of the Cloud KMS key, of the form projects/my-project/locations/
1623
+ # global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the
1624
+ # object. Overrides the object metadata's kms_key_name value, if any.
1625
+ # @param [String] provisional_user_project
1626
+ # The project to be billed for this request if the target bucket is requester-
1627
+ # pays bucket.
1628
+ # @param [String] user_project
1629
+ # The project to be billed for this request. Required for Requester Pays buckets.
1630
+ # @param [String] fields
1631
+ # Selector specifying which fields to include in a partial response.
1632
+ # @param [String] quota_user
1633
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1634
+ # characters.
1635
+ # @param [String] user_ip
1636
+ # Deprecated. Please use quotaUser instead.
1637
+ # @param [Google::Apis::RequestOptions] options
1638
+ # Request-specific options
1639
+ #
1640
+ # @yield [result, err] Result & error if block supplied
1641
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
1642
+ # @yieldparam err [StandardError] error object if request failed
1643
+ #
1644
+ # @return [Google::Apis::StorageV1::Object]
1645
+ #
1646
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1647
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1648
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1649
+ def compose_object(destination_bucket, destination_object, compose_request_object = nil, destination_predefined_acl: nil, if_generation_match: nil, if_metageneration_match: nil, kms_key_name: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1650
+ command = make_simple_command(:post, 'b/{destinationBucket}/o/{destinationObject}/compose', options)
1651
+ command.request_representation = Google::Apis::StorageV1::ComposeRequest::Representation
1652
+ command.request_object = compose_request_object
1653
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
1654
+ command.response_class = Google::Apis::StorageV1::Object
1655
+ command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
1656
+ command.params['destinationObject'] = destination_object unless destination_object.nil?
1657
+ command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
1658
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
1659
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
1660
+ command.query['kmsKeyName'] = kms_key_name unless kms_key_name.nil?
1661
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1662
+ command.query['userProject'] = user_project unless user_project.nil?
1663
+ command.query['fields'] = fields unless fields.nil?
1664
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1665
+ command.query['userIp'] = user_ip unless user_ip.nil?
1666
+ execute_or_queue_command(command, &block)
1667
+ end
1668
+
1669
+ # Copies a source object to a destination object. Optionally overrides metadata.
1670
+ # @param [String] source_bucket
1671
+ # Name of the bucket in which to find the source object.
1672
+ # @param [String] source_object
1673
+ # Name of the source object. For information about how to URL encode object
1674
+ # names to be path safe, see Encoding URI Path Parts.
1675
+ # @param [String] destination_bucket
1676
+ # Name of the bucket in which to store the new object. Overrides the provided
1677
+ # object metadata's bucket value, if any.For information about how to URL encode
1678
+ # object names to be path safe, see Encoding URI Path Parts.
1679
+ # @param [String] destination_object
1680
+ # Name of the new object. Required when the object metadata is not otherwise
1681
+ # provided. Overrides the object metadata's name value, if any.
1682
+ # @param [Google::Apis::StorageV1::Object] object_object
1683
+ # @param [String] destination_kms_key_name
1684
+ # Resource name of the Cloud KMS key, of the form projects/my-project/locations/
1685
+ # global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the
1686
+ # object. Overrides the object metadata's kms_key_name value, if any.
1687
+ # @param [String] destination_predefined_acl
1688
+ # Apply a predefined set of access controls to the destination object.
1689
+ # @param [Fixnum] if_generation_match
1690
+ # Makes the operation conditional on whether the destination object's current
1691
+ # generation matches the given value. Setting to 0 makes the operation succeed
1692
+ # only if there are no live versions of the object.
1693
+ # @param [Fixnum] if_generation_not_match
1694
+ # Makes the operation conditional on whether the destination object's current
1695
+ # generation does not match the given value. If no live object exists, the
1696
+ # precondition fails. Setting to 0 makes the operation succeed only if there is
1697
+ # a live version of the object.
1698
+ # @param [Fixnum] if_metageneration_match
1699
+ # Makes the operation conditional on whether the destination object's current
1700
+ # metageneration matches the given value.
1701
+ # @param [Fixnum] if_metageneration_not_match
1702
+ # Makes the operation conditional on whether the destination object's current
1703
+ # metageneration does not match the given value.
1704
+ # @param [Fixnum] if_source_generation_match
1705
+ # Makes the operation conditional on whether the source object's current
1706
+ # generation matches the given value.
1707
+ # @param [Fixnum] if_source_generation_not_match
1708
+ # Makes the operation conditional on whether the source object's current
1709
+ # generation does not match the given value.
1710
+ # @param [Fixnum] if_source_metageneration_match
1711
+ # Makes the operation conditional on whether the source object's current
1712
+ # metageneration matches the given value.
1713
+ # @param [Fixnum] if_source_metageneration_not_match
1714
+ # Makes the operation conditional on whether the source object's current
1715
+ # metageneration does not match the given value.
1716
+ # @param [String] projection
1717
+ # Set of properties to return. Defaults to noAcl, unless the object resource
1718
+ # specifies the acl property, when it defaults to full.
1719
+ # @param [String] provisional_user_project
1720
+ # The project to be billed for this request if the target bucket is requester-
1721
+ # pays bucket.
1722
+ # @param [Fixnum] source_generation
1723
+ # If present, selects a specific revision of the source object (as opposed to
1724
+ # the latest version, the default).
1725
+ # @param [String] user_project
1726
+ # The project to be billed for this request. Required for Requester Pays buckets.
1727
+ # @param [String] fields
1728
+ # Selector specifying which fields to include in a partial response.
1729
+ # @param [String] quota_user
1730
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1731
+ # characters.
1732
+ # @param [String] user_ip
1733
+ # Deprecated. Please use quotaUser instead.
1734
+ # @param [Google::Apis::RequestOptions] options
1735
+ # Request-specific options
1736
+ #
1737
+ # @yield [result, err] Result & error if block supplied
1738
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
1739
+ # @yieldparam err [StandardError] error object if request failed
1740
+ #
1741
+ # @return [Google::Apis::StorageV1::Object]
1742
+ #
1743
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1744
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1745
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1746
+ def copy_object(source_bucket, source_object, destination_bucket, destination_object, object_object = nil, destination_kms_key_name: nil, destination_predefined_acl: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, if_source_generation_match: nil, if_source_generation_not_match: nil, if_source_metageneration_match: nil, if_source_metageneration_not_match: nil, projection: nil, provisional_user_project: nil, source_generation: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1747
+ command = make_simple_command(:post, 'b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}', options)
1748
+ command.request_representation = Google::Apis::StorageV1::Object::Representation
1749
+ command.request_object = object_object
1750
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
1751
+ command.response_class = Google::Apis::StorageV1::Object
1752
+ command.params['sourceBucket'] = source_bucket unless source_bucket.nil?
1753
+ command.params['sourceObject'] = source_object unless source_object.nil?
1754
+ command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
1755
+ command.params['destinationObject'] = destination_object unless destination_object.nil?
1756
+ command.query['destinationKmsKeyName'] = destination_kms_key_name unless destination_kms_key_name.nil?
1757
+ command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
1758
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
1759
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
1760
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
1761
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
1762
+ command.query['ifSourceGenerationMatch'] = if_source_generation_match unless if_source_generation_match.nil?
1763
+ command.query['ifSourceGenerationNotMatch'] = if_source_generation_not_match unless if_source_generation_not_match.nil?
1764
+ command.query['ifSourceMetagenerationMatch'] = if_source_metageneration_match unless if_source_metageneration_match.nil?
1765
+ command.query['ifSourceMetagenerationNotMatch'] = if_source_metageneration_not_match unless if_source_metageneration_not_match.nil?
1766
+ command.query['projection'] = projection unless projection.nil?
1767
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1768
+ command.query['sourceGeneration'] = source_generation unless source_generation.nil?
1769
+ command.query['userProject'] = user_project unless user_project.nil?
1770
+ command.query['fields'] = fields unless fields.nil?
1771
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1772
+ command.query['userIp'] = user_ip unless user_ip.nil?
1773
+ execute_or_queue_command(command, &block)
1774
+ end
1775
+
1776
+ # Deletes an object and its metadata. Deletions are permanent if versioning is
1777
+ # not enabled for the bucket, or if the generation parameter is used.
1778
+ # @param [String] bucket
1779
+ # Name of the bucket in which the object resides.
1780
+ # @param [String] object
1781
+ # Name of the object. For information about how to URL encode object names to be
1782
+ # path safe, see Encoding URI Path Parts.
1783
+ # @param [Fixnum] generation
1784
+ # If present, permanently deletes a specific revision of this object (as opposed
1785
+ # to the latest version, the default).
1786
+ # @param [Fixnum] if_generation_match
1787
+ # Makes the operation conditional on whether the object's current generation
1788
+ # matches the given value. Setting to 0 makes the operation succeed only if
1789
+ # there are no live versions of the object.
1790
+ # @param [Fixnum] if_generation_not_match
1791
+ # Makes the operation conditional on whether the object's current generation
1792
+ # does not match the given value. If no live object exists, the precondition
1793
+ # fails. Setting to 0 makes the operation succeed only if there is a live
1794
+ # version of the object.
1795
+ # @param [Fixnum] if_metageneration_match
1796
+ # Makes the operation conditional on whether the object's current metageneration
1797
+ # matches the given value.
1798
+ # @param [Fixnum] if_metageneration_not_match
1799
+ # Makes the operation conditional on whether the object's current metageneration
1800
+ # does not match the given value.
1801
+ # @param [String] provisional_user_project
1802
+ # The project to be billed for this request if the target bucket is requester-
1803
+ # pays bucket.
1804
+ # @param [String] user_project
1805
+ # The project to be billed for this request. Required for Requester Pays buckets.
1806
+ # @param [String] fields
1807
+ # Selector specifying which fields to include in a partial response.
1808
+ # @param [String] quota_user
1809
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1810
+ # characters.
1811
+ # @param [String] user_ip
1812
+ # Deprecated. Please use quotaUser instead.
1813
+ # @param [Google::Apis::RequestOptions] options
1814
+ # Request-specific options
1815
+ #
1816
+ # @yield [result, err] Result & error if block supplied
1817
+ # @yieldparam result [NilClass] No result returned for this method
1818
+ # @yieldparam err [StandardError] error object if request failed
1819
+ #
1820
+ # @return [void]
1821
+ #
1822
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1823
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1824
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1825
+ def delete_object(bucket, object, generation: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1826
+ command = make_simple_command(:delete, 'b/{bucket}/o/{object}', options)
1827
+ command.params['bucket'] = bucket unless bucket.nil?
1828
+ command.params['object'] = object unless object.nil?
1829
+ command.query['generation'] = generation unless generation.nil?
1830
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
1831
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
1832
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
1833
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
1834
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1835
+ command.query['userProject'] = user_project unless user_project.nil?
1836
+ command.query['fields'] = fields unless fields.nil?
1837
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1838
+ command.query['userIp'] = user_ip unless user_ip.nil?
1839
+ execute_or_queue_command(command, &block)
1840
+ end
1841
+
1842
+ # Retrieves an object or its metadata.
1843
+ # @param [String] bucket
1844
+ # Name of the bucket in which the object resides.
1845
+ # @param [String] object
1846
+ # Name of the object. For information about how to URL encode object names to be
1847
+ # path safe, see Encoding URI Path Parts.
1848
+ # @param [Fixnum] generation
1849
+ # If present, selects a specific revision of this object (as opposed to the
1850
+ # latest version, the default).
1851
+ # @param [Fixnum] if_generation_match
1852
+ # Makes the operation conditional on whether the object's current generation
1853
+ # matches the given value. Setting to 0 makes the operation succeed only if
1854
+ # there are no live versions of the object.
1855
+ # @param [Fixnum] if_generation_not_match
1856
+ # Makes the operation conditional on whether the object's current generation
1857
+ # does not match the given value. If no live object exists, the precondition
1858
+ # fails. Setting to 0 makes the operation succeed only if there is a live
1859
+ # version of the object.
1860
+ # @param [Fixnum] if_metageneration_match
1861
+ # Makes the operation conditional on whether the object's current metageneration
1862
+ # matches the given value.
1863
+ # @param [Fixnum] if_metageneration_not_match
1864
+ # Makes the operation conditional on whether the object's current metageneration
1865
+ # does not match the given value.
1866
+ # @param [String] projection
1867
+ # Set of properties to return. Defaults to noAcl.
1868
+ # @param [String] provisional_user_project
1869
+ # The project to be billed for this request if the target bucket is requester-
1870
+ # pays bucket.
1871
+ # @param [String] user_project
1872
+ # The project to be billed for this request. Required for Requester Pays buckets.
1873
+ # @param [String] fields
1874
+ # Selector specifying which fields to include in a partial response.
1875
+ # @param [String] quota_user
1876
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1877
+ # characters.
1878
+ # @param [String] user_ip
1879
+ # Deprecated. Please use quotaUser instead.
1880
+ # @param [IO, String] download_dest
1881
+ # IO stream or filename to receive content download
1882
+ # @param [Google::Apis::RequestOptions] options
1883
+ # Request-specific options
1884
+ #
1885
+ # @yield [result, err] Result & error if block supplied
1886
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
1887
+ # @yieldparam err [StandardError] error object if request failed
1888
+ #
1889
+ # @return [Google::Apis::StorageV1::Object]
1890
+ #
1891
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1892
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1893
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1894
+ def get_object(bucket, object, generation: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
1895
+ if download_dest.nil?
1896
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}', options)
1897
+ else
1898
+ command = make_download_command(:get, 'b/{bucket}/o/{object}', options)
1899
+ command.download_dest = download_dest
1900
+ end
1901
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
1902
+ command.response_class = Google::Apis::StorageV1::Object
1903
+ command.params['bucket'] = bucket unless bucket.nil?
1904
+ command.params['object'] = object unless object.nil?
1905
+ command.query['generation'] = generation unless generation.nil?
1906
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
1907
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
1908
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
1909
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
1910
+ command.query['projection'] = projection unless projection.nil?
1911
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1912
+ command.query['userProject'] = user_project unless user_project.nil?
1913
+ command.query['fields'] = fields unless fields.nil?
1914
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1915
+ command.query['userIp'] = user_ip unless user_ip.nil?
1916
+ execute_or_queue_command(command, &block)
1917
+ end
1918
+
1919
+ # Returns an IAM policy for the specified object.
1920
+ # @param [String] bucket
1921
+ # Name of the bucket in which the object resides.
1922
+ # @param [String] object
1923
+ # Name of the object. For information about how to URL encode object names to be
1924
+ # path safe, see Encoding URI Path Parts.
1925
+ # @param [Fixnum] generation
1926
+ # If present, selects a specific revision of this object (as opposed to the
1927
+ # latest version, the default).
1928
+ # @param [String] provisional_user_project
1929
+ # The project to be billed for this request if the target bucket is requester-
1930
+ # pays bucket.
1931
+ # @param [String] user_project
1932
+ # The project to be billed for this request. Required for Requester Pays buckets.
1933
+ # @param [String] fields
1934
+ # Selector specifying which fields to include in a partial response.
1935
+ # @param [String] quota_user
1936
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
1937
+ # characters.
1938
+ # @param [String] user_ip
1939
+ # Deprecated. Please use quotaUser instead.
1940
+ # @param [Google::Apis::RequestOptions] options
1941
+ # Request-specific options
1942
+ #
1943
+ # @yield [result, err] Result & error if block supplied
1944
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
1945
+ # @yieldparam err [StandardError] error object if request failed
1946
+ #
1947
+ # @return [Google::Apis::StorageV1::Policy]
1948
+ #
1949
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1950
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1951
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1952
+ def get_object_iam_policy(bucket, object, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1953
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam', options)
1954
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
1955
+ command.response_class = Google::Apis::StorageV1::Policy
1956
+ command.params['bucket'] = bucket unless bucket.nil?
1957
+ command.params['object'] = object unless object.nil?
1958
+ command.query['generation'] = generation unless generation.nil?
1959
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
1960
+ command.query['userProject'] = user_project unless user_project.nil?
1961
+ command.query['fields'] = fields unless fields.nil?
1962
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1963
+ command.query['userIp'] = user_ip unless user_ip.nil?
1964
+ execute_or_queue_command(command, &block)
1965
+ end
1966
+
1967
+ # Stores a new object and metadata.
1968
+ # @param [String] bucket
1969
+ # Name of the bucket in which to store the new object. Overrides the provided
1970
+ # object metadata's bucket value, if any.
1971
+ # @param [Google::Apis::StorageV1::Object] object_object
1972
+ # @param [String] content_encoding
1973
+ # If set, sets the contentEncoding property of the final object to this value.
1974
+ # Setting this parameter is equivalent to setting the contentEncoding metadata
1975
+ # property. This can be useful when uploading an object with uploadType=media to
1976
+ # indicate the encoding of the content being uploaded.
1977
+ # @param [Fixnum] if_generation_match
1978
+ # Makes the operation conditional on whether the object's current generation
1979
+ # matches the given value. Setting to 0 makes the operation succeed only if
1980
+ # there are no live versions of the object.
1981
+ # @param [Fixnum] if_generation_not_match
1982
+ # Makes the operation conditional on whether the object's current generation
1983
+ # does not match the given value. If no live object exists, the precondition
1984
+ # fails. Setting to 0 makes the operation succeed only if there is a live
1985
+ # version of the object.
1986
+ # @param [Fixnum] if_metageneration_match
1987
+ # Makes the operation conditional on whether the object's current metageneration
1988
+ # matches the given value.
1989
+ # @param [Fixnum] if_metageneration_not_match
1990
+ # Makes the operation conditional on whether the object's current metageneration
1991
+ # does not match the given value.
1992
+ # @param [String] kms_key_name
1993
+ # Resource name of the Cloud KMS key, of the form projects/my-project/locations/
1994
+ # global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the
1995
+ # object. Overrides the object metadata's kms_key_name value, if any.
1996
+ # @param [String] name
1997
+ # Name of the object. Required when the object metadata is not otherwise
1998
+ # provided. Overrides the object metadata's name value, if any. For information
1999
+ # about how to URL encode object names to be path safe, see Encoding URI Path
2000
+ # Parts.
2001
+ # @param [String] predefined_acl
2002
+ # Apply a predefined set of access controls to this object.
2003
+ # @param [String] projection
2004
+ # Set of properties to return. Defaults to noAcl, unless the object resource
2005
+ # specifies the acl property, when it defaults to full.
2006
+ # @param [String] provisional_user_project
2007
+ # The project to be billed for this request if the target bucket is requester-
2008
+ # pays bucket.
2009
+ # @param [String] user_project
2010
+ # The project to be billed for this request. Required for Requester Pays buckets.
2011
+ # @param [String] fields
2012
+ # Selector specifying which fields to include in a partial response.
2013
+ # @param [String] quota_user
2014
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2015
+ # characters.
2016
+ # @param [String] user_ip
2017
+ # Deprecated. Please use quotaUser instead.
2018
+ # @param [IO, String] upload_source
2019
+ # IO stream or filename containing content to upload
2020
+ # @param [String] content_type
2021
+ # Content type of the uploaded content.
2022
+ # @param [Google::Apis::RequestOptions] options
2023
+ # Request-specific options
2024
+ #
2025
+ # @yield [result, err] Result & error if block supplied
2026
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
2027
+ # @yieldparam err [StandardError] error object if request failed
2028
+ #
2029
+ # @return [Google::Apis::StorageV1::Object]
2030
+ #
2031
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2032
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2033
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2034
+ def insert_object(bucket, object_object = nil, content_encoding: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, kms_key_name: nil, name: nil, predefined_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
2035
+ if upload_source.nil?
2036
+ command = make_simple_command(:post, 'b/{bucket}/o', options)
2037
+ else
2038
+ command = make_upload_command(:post, 'b/{bucket}/o', options)
2039
+ command.upload_source = upload_source
2040
+ command.upload_content_type = content_type
2041
+ end
2042
+ command.request_representation = Google::Apis::StorageV1::Object::Representation
2043
+ command.request_object = object_object
2044
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
2045
+ command.response_class = Google::Apis::StorageV1::Object
2046
+ command.params['bucket'] = bucket unless bucket.nil?
2047
+ command.query['contentEncoding'] = content_encoding unless content_encoding.nil?
2048
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
2049
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
2050
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
2051
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
2052
+ command.query['kmsKeyName'] = kms_key_name unless kms_key_name.nil?
2053
+ command.query['name'] = name unless name.nil?
2054
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
2055
+ command.query['projection'] = projection unless projection.nil?
2056
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2057
+ command.query['userProject'] = user_project unless user_project.nil?
2058
+ command.query['fields'] = fields unless fields.nil?
2059
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2060
+ command.query['userIp'] = user_ip unless user_ip.nil?
2061
+ execute_or_queue_command(command, &block)
2062
+ end
2063
+
2064
+ # Retrieves a list of objects matching the criteria.
2065
+ # @param [String] bucket
2066
+ # Name of the bucket in which to look for objects.
2067
+ # @param [String] delimiter
2068
+ # Returns results in a directory-like mode. items will contain only objects
2069
+ # whose names, aside from the prefix, do not contain delimiter. Objects whose
2070
+ # names, aside from the prefix, contain delimiter will have their name,
2071
+ # truncated after the delimiter, returned in prefixes. Duplicate prefixes are
2072
+ # omitted.
2073
+ # @param [String] end_offset
2074
+ # Filter results to objects whose names are lexicographically before endOffset.
2075
+ # If startOffset is also set, the objects listed will have names between
2076
+ # startOffset (inclusive) and endOffset (exclusive).
2077
+ # @param [Boolean] include_trailing_delimiter
2078
+ # If true, objects that end in exactly one instance of delimiter will have their
2079
+ # metadata included in items in addition to prefixes.
2080
+ # @param [Fixnum] max_results
2081
+ # Maximum number of items plus prefixes to return in a single page of responses.
2082
+ # As duplicate prefixes are omitted, fewer total results may be returned than
2083
+ # requested. The service will use this parameter or 1,000 items, whichever is
2084
+ # smaller.
2085
+ # @param [String] page_token
2086
+ # A previously-returned page token representing part of the larger set of
2087
+ # results to view.
2088
+ # @param [String] prefix
2089
+ # Filter results to objects whose names begin with this prefix.
2090
+ # @param [String] projection
2091
+ # Set of properties to return. Defaults to noAcl.
2092
+ # @param [String] provisional_user_project
2093
+ # The project to be billed for this request if the target bucket is requester-
2094
+ # pays bucket.
2095
+ # @param [String] start_offset
2096
+ # Filter results to objects whose names are lexicographically equal to or after
2097
+ # startOffset. If endOffset is also set, the objects listed will have names
2098
+ # between startOffset (inclusive) and endOffset (exclusive).
2099
+ # @param [String] user_project
2100
+ # The project to be billed for this request. Required for Requester Pays buckets.
2101
+ # @param [Boolean] versions
2102
+ # If true, lists all versions of an object as distinct results. The default is
2103
+ # false. For more information, see Object Versioning.
2104
+ # @param [String] fields
2105
+ # Selector specifying which fields to include in a partial response.
2106
+ # @param [String] quota_user
2107
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2108
+ # characters.
2109
+ # @param [String] user_ip
2110
+ # Deprecated. Please use quotaUser instead.
2111
+ # @param [Google::Apis::RequestOptions] options
2112
+ # Request-specific options
2113
+ #
2114
+ # @yield [result, err] Result & error if block supplied
2115
+ # @yieldparam result [Google::Apis::StorageV1::Objects] parsed result object
2116
+ # @yieldparam err [StandardError] error object if request failed
2117
+ #
2118
+ # @return [Google::Apis::StorageV1::Objects]
2119
+ #
2120
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2121
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2122
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2123
+ def list_objects(bucket, delimiter: nil, end_offset: nil, include_trailing_delimiter: nil, max_results: nil, page_token: nil, prefix: nil, projection: nil, provisional_user_project: nil, start_offset: nil, user_project: nil, versions: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2124
+ command = make_simple_command(:get, 'b/{bucket}/o', options)
2125
+ command.response_representation = Google::Apis::StorageV1::Objects::Representation
2126
+ command.response_class = Google::Apis::StorageV1::Objects
2127
+ command.params['bucket'] = bucket unless bucket.nil?
2128
+ command.query['delimiter'] = delimiter unless delimiter.nil?
2129
+ command.query['endOffset'] = end_offset unless end_offset.nil?
2130
+ command.query['includeTrailingDelimiter'] = include_trailing_delimiter unless include_trailing_delimiter.nil?
2131
+ command.query['maxResults'] = max_results unless max_results.nil?
2132
+ command.query['pageToken'] = page_token unless page_token.nil?
2133
+ command.query['prefix'] = prefix unless prefix.nil?
2134
+ command.query['projection'] = projection unless projection.nil?
2135
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2136
+ command.query['startOffset'] = start_offset unless start_offset.nil?
2137
+ command.query['userProject'] = user_project unless user_project.nil?
2138
+ command.query['versions'] = versions unless versions.nil?
2139
+ command.query['fields'] = fields unless fields.nil?
2140
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2141
+ command.query['userIp'] = user_ip unless user_ip.nil?
2142
+ execute_or_queue_command(command, &block)
2143
+ end
2144
+
2145
+ # Patches an object's metadata.
2146
+ # @param [String] bucket
2147
+ # Name of the bucket in which the object resides.
2148
+ # @param [String] object
2149
+ # Name of the object. For information about how to URL encode object names to be
2150
+ # path safe, see Encoding URI Path Parts.
2151
+ # @param [Google::Apis::StorageV1::Object] object_object
2152
+ # @param [Fixnum] generation
2153
+ # If present, selects a specific revision of this object (as opposed to the
2154
+ # latest version, the default).
2155
+ # @param [Fixnum] if_generation_match
2156
+ # Makes the operation conditional on whether the object's current generation
2157
+ # matches the given value. Setting to 0 makes the operation succeed only if
2158
+ # there are no live versions of the object.
2159
+ # @param [Fixnum] if_generation_not_match
2160
+ # Makes the operation conditional on whether the object's current generation
2161
+ # does not match the given value. If no live object exists, the precondition
2162
+ # fails. Setting to 0 makes the operation succeed only if there is a live
2163
+ # version of the object.
2164
+ # @param [Fixnum] if_metageneration_match
2165
+ # Makes the operation conditional on whether the object's current metageneration
2166
+ # matches the given value.
2167
+ # @param [Fixnum] if_metageneration_not_match
2168
+ # Makes the operation conditional on whether the object's current metageneration
2169
+ # does not match the given value.
2170
+ # @param [String] predefined_acl
2171
+ # Apply a predefined set of access controls to this object.
2172
+ # @param [String] projection
2173
+ # Set of properties to return. Defaults to full.
2174
+ # @param [String] provisional_user_project
2175
+ # The project to be billed for this request if the target bucket is requester-
2176
+ # pays bucket.
2177
+ # @param [String] user_project
2178
+ # The project to be billed for this request, for Requester Pays buckets.
2179
+ # @param [String] fields
2180
+ # Selector specifying which fields to include in a partial response.
2181
+ # @param [String] quota_user
2182
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2183
+ # characters.
2184
+ # @param [String] user_ip
2185
+ # Deprecated. Please use quotaUser instead.
2186
+ # @param [Google::Apis::RequestOptions] options
2187
+ # Request-specific options
2188
+ #
2189
+ # @yield [result, err] Result & error if block supplied
2190
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
2191
+ # @yieldparam err [StandardError] error object if request failed
2192
+ #
2193
+ # @return [Google::Apis::StorageV1::Object]
2194
+ #
2195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2198
+ def patch_object(bucket, object, object_object = nil, generation: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, predefined_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2199
+ command = make_simple_command(:patch, 'b/{bucket}/o/{object}', options)
2200
+ command.request_representation = Google::Apis::StorageV1::Object::Representation
2201
+ command.request_object = object_object
2202
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
2203
+ command.response_class = Google::Apis::StorageV1::Object
2204
+ command.params['bucket'] = bucket unless bucket.nil?
2205
+ command.params['object'] = object unless object.nil?
2206
+ command.query['generation'] = generation unless generation.nil?
2207
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
2208
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
2209
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
2210
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
2211
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
2212
+ command.query['projection'] = projection unless projection.nil?
2213
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2214
+ command.query['userProject'] = user_project unless user_project.nil?
2215
+ command.query['fields'] = fields unless fields.nil?
2216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2217
+ command.query['userIp'] = user_ip unless user_ip.nil?
2218
+ execute_or_queue_command(command, &block)
2219
+ end
2220
+
2221
+ # Rewrites a source object to a destination object. Optionally overrides
2222
+ # metadata.
2223
+ # @param [String] source_bucket
2224
+ # Name of the bucket in which to find the source object.
2225
+ # @param [String] source_object
2226
+ # Name of the source object. For information about how to URL encode object
2227
+ # names to be path safe, see Encoding URI Path Parts.
2228
+ # @param [String] destination_bucket
2229
+ # Name of the bucket in which to store the new object. Overrides the provided
2230
+ # object metadata's bucket value, if any.
2231
+ # @param [String] destination_object
2232
+ # Name of the new object. Required when the object metadata is not otherwise
2233
+ # provided. Overrides the object metadata's name value, if any. For information
2234
+ # about how to URL encode object names to be path safe, see Encoding URI Path
2235
+ # Parts.
2236
+ # @param [Google::Apis::StorageV1::Object] object_object
2237
+ # @param [String] destination_kms_key_name
2238
+ # Resource name of the Cloud KMS key, of the form projects/my-project/locations/
2239
+ # global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the
2240
+ # object. Overrides the object metadata's kms_key_name value, if any.
2241
+ # @param [String] destination_predefined_acl
2242
+ # Apply a predefined set of access controls to the destination object.
2243
+ # @param [Fixnum] if_generation_match
2244
+ # Makes the operation conditional on whether the object's current generation
2245
+ # matches the given value. Setting to 0 makes the operation succeed only if
2246
+ # there are no live versions of the object.
2247
+ # @param [Fixnum] if_generation_not_match
2248
+ # Makes the operation conditional on whether the object's current generation
2249
+ # does not match the given value. If no live object exists, the precondition
2250
+ # fails. Setting to 0 makes the operation succeed only if there is a live
2251
+ # version of the object.
2252
+ # @param [Fixnum] if_metageneration_match
2253
+ # Makes the operation conditional on whether the destination object's current
2254
+ # metageneration matches the given value.
2255
+ # @param [Fixnum] if_metageneration_not_match
2256
+ # Makes the operation conditional on whether the destination object's current
2257
+ # metageneration does not match the given value.
2258
+ # @param [Fixnum] if_source_generation_match
2259
+ # Makes the operation conditional on whether the source object's current
2260
+ # generation matches the given value.
2261
+ # @param [Fixnum] if_source_generation_not_match
2262
+ # Makes the operation conditional on whether the source object's current
2263
+ # generation does not match the given value.
2264
+ # @param [Fixnum] if_source_metageneration_match
2265
+ # Makes the operation conditional on whether the source object's current
2266
+ # metageneration matches the given value.
2267
+ # @param [Fixnum] if_source_metageneration_not_match
2268
+ # Makes the operation conditional on whether the source object's current
2269
+ # metageneration does not match the given value.
2270
+ # @param [Fixnum] max_bytes_rewritten_per_call
2271
+ # The maximum number of bytes that will be rewritten per rewrite request. Most
2272
+ # callers shouldn't need to specify this parameter - it is primarily in place to
2273
+ # support testing. If specified the value must be an integral multiple of 1 MiB (
2274
+ # 1048576). Also, this only applies to requests where the source and destination
2275
+ # span locations and/or storage classes. Finally, this value must not change
2276
+ # across rewrite calls else you'll get an error that the rewriteToken is invalid.
2277
+ # @param [String] projection
2278
+ # Set of properties to return. Defaults to noAcl, unless the object resource
2279
+ # specifies the acl property, when it defaults to full.
2280
+ # @param [String] provisional_user_project
2281
+ # The project to be billed for this request if the target bucket is requester-
2282
+ # pays bucket.
2283
+ # @param [String] rewrite_token
2284
+ # Include this field (from the previous rewrite response) on each rewrite
2285
+ # request after the first one, until the rewrite response 'done' flag is true.
2286
+ # Calls that provide a rewriteToken can omit all other request fields, but if
2287
+ # included those fields must match the values provided in the first rewrite
2288
+ # request.
2289
+ # @param [Fixnum] source_generation
2290
+ # If present, selects a specific revision of the source object (as opposed to
2291
+ # the latest version, the default).
2292
+ # @param [String] user_project
2293
+ # The project to be billed for this request. Required for Requester Pays buckets.
2294
+ # @param [String] fields
2295
+ # Selector specifying which fields to include in a partial response.
2296
+ # @param [String] quota_user
2297
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2298
+ # characters.
2299
+ # @param [String] user_ip
2300
+ # Deprecated. Please use quotaUser instead.
2301
+ # @param [Google::Apis::RequestOptions] options
2302
+ # Request-specific options
2303
+ #
2304
+ # @yield [result, err] Result & error if block supplied
2305
+ # @yieldparam result [Google::Apis::StorageV1::RewriteResponse] parsed result object
2306
+ # @yieldparam err [StandardError] error object if request failed
2307
+ #
2308
+ # @return [Google::Apis::StorageV1::RewriteResponse]
2309
+ #
2310
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2311
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2312
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2313
+ def rewrite_object(source_bucket, source_object, destination_bucket, destination_object, object_object = nil, destination_kms_key_name: nil, destination_predefined_acl: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, if_source_generation_match: nil, if_source_generation_not_match: nil, if_source_metageneration_match: nil, if_source_metageneration_not_match: nil, max_bytes_rewritten_per_call: nil, projection: nil, provisional_user_project: nil, rewrite_token: nil, source_generation: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2314
+ command = make_simple_command(:post, 'b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}', options)
2315
+ command.request_representation = Google::Apis::StorageV1::Object::Representation
2316
+ command.request_object = object_object
2317
+ command.response_representation = Google::Apis::StorageV1::RewriteResponse::Representation
2318
+ command.response_class = Google::Apis::StorageV1::RewriteResponse
2319
+ command.params['sourceBucket'] = source_bucket unless source_bucket.nil?
2320
+ command.params['sourceObject'] = source_object unless source_object.nil?
2321
+ command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
2322
+ command.params['destinationObject'] = destination_object unless destination_object.nil?
2323
+ command.query['destinationKmsKeyName'] = destination_kms_key_name unless destination_kms_key_name.nil?
2324
+ command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
2325
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
2326
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
2327
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
2328
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
2329
+ command.query['ifSourceGenerationMatch'] = if_source_generation_match unless if_source_generation_match.nil?
2330
+ command.query['ifSourceGenerationNotMatch'] = if_source_generation_not_match unless if_source_generation_not_match.nil?
2331
+ command.query['ifSourceMetagenerationMatch'] = if_source_metageneration_match unless if_source_metageneration_match.nil?
2332
+ command.query['ifSourceMetagenerationNotMatch'] = if_source_metageneration_not_match unless if_source_metageneration_not_match.nil?
2333
+ command.query['maxBytesRewrittenPerCall'] = max_bytes_rewritten_per_call unless max_bytes_rewritten_per_call.nil?
2334
+ command.query['projection'] = projection unless projection.nil?
2335
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2336
+ command.query['rewriteToken'] = rewrite_token unless rewrite_token.nil?
2337
+ command.query['sourceGeneration'] = source_generation unless source_generation.nil?
2338
+ command.query['userProject'] = user_project unless user_project.nil?
2339
+ command.query['fields'] = fields unless fields.nil?
2340
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2341
+ command.query['userIp'] = user_ip unless user_ip.nil?
2342
+ execute_or_queue_command(command, &block)
2343
+ end
2344
+
2345
+ # Updates an IAM policy for the specified object.
2346
+ # @param [String] bucket
2347
+ # Name of the bucket in which the object resides.
2348
+ # @param [String] object
2349
+ # Name of the object. For information about how to URL encode object names to be
2350
+ # path safe, see Encoding URI Path Parts.
2351
+ # @param [Google::Apis::StorageV1::Policy] policy_object
2352
+ # @param [Fixnum] generation
2353
+ # If present, selects a specific revision of this object (as opposed to the
2354
+ # latest version, the default).
2355
+ # @param [String] provisional_user_project
2356
+ # The project to be billed for this request if the target bucket is requester-
2357
+ # pays bucket.
2358
+ # @param [String] user_project
2359
+ # The project to be billed for this request. Required for Requester Pays buckets.
2360
+ # @param [String] fields
2361
+ # Selector specifying which fields to include in a partial response.
2362
+ # @param [String] quota_user
2363
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2364
+ # characters.
2365
+ # @param [String] user_ip
2366
+ # Deprecated. Please use quotaUser instead.
2367
+ # @param [Google::Apis::RequestOptions] options
2368
+ # Request-specific options
2369
+ #
2370
+ # @yield [result, err] Result & error if block supplied
2371
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
2372
+ # @yieldparam err [StandardError] error object if request failed
2373
+ #
2374
+ # @return [Google::Apis::StorageV1::Policy]
2375
+ #
2376
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2377
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2378
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2379
+ def set_object_iam_policy(bucket, object, policy_object = nil, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2380
+ command = make_simple_command(:put, 'b/{bucket}/o/{object}/iam', options)
2381
+ command.request_representation = Google::Apis::StorageV1::Policy::Representation
2382
+ command.request_object = policy_object
2383
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
2384
+ command.response_class = Google::Apis::StorageV1::Policy
2385
+ command.params['bucket'] = bucket unless bucket.nil?
2386
+ command.params['object'] = object unless object.nil?
2387
+ command.query['generation'] = generation unless generation.nil?
2388
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2389
+ command.query['userProject'] = user_project unless user_project.nil?
2390
+ command.query['fields'] = fields unless fields.nil?
2391
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2392
+ command.query['userIp'] = user_ip unless user_ip.nil?
2393
+ execute_or_queue_command(command, &block)
2394
+ end
2395
+
2396
+ # Tests a set of permissions on the given object to see which, if any, are held
2397
+ # by the caller.
2398
+ # @param [String] bucket
2399
+ # Name of the bucket in which the object resides.
2400
+ # @param [String] object
2401
+ # Name of the object. For information about how to URL encode object names to be
2402
+ # path safe, see Encoding URI Path Parts.
2403
+ # @param [Array<String>, String] permissions
2404
+ # Permissions to test.
2405
+ # @param [Fixnum] generation
2406
+ # If present, selects a specific revision of this object (as opposed to the
2407
+ # latest version, the default).
2408
+ # @param [String] provisional_user_project
2409
+ # The project to be billed for this request if the target bucket is requester-
2410
+ # pays bucket.
2411
+ # @param [String] user_project
2412
+ # The project to be billed for this request. Required for Requester Pays buckets.
2413
+ # @param [String] fields
2414
+ # Selector specifying which fields to include in a partial response.
2415
+ # @param [String] quota_user
2416
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2417
+ # characters.
2418
+ # @param [String] user_ip
2419
+ # Deprecated. Please use quotaUser instead.
2420
+ # @param [Google::Apis::RequestOptions] options
2421
+ # Request-specific options
2422
+ #
2423
+ # @yield [result, err] Result & error if block supplied
2424
+ # @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
2425
+ # @yieldparam err [StandardError] error object if request failed
2426
+ #
2427
+ # @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
2428
+ #
2429
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2430
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2431
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2432
+ def test_object_iam_permissions(bucket, object, permissions, generation: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2433
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam/testPermissions', options)
2434
+ command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
2435
+ command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
2436
+ command.params['bucket'] = bucket unless bucket.nil?
2437
+ command.params['object'] = object unless object.nil?
2438
+ command.query['generation'] = generation unless generation.nil?
2439
+ command.query['permissions'] = permissions unless permissions.nil?
2440
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2441
+ command.query['userProject'] = user_project unless user_project.nil?
2442
+ command.query['fields'] = fields unless fields.nil?
2443
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2444
+ command.query['userIp'] = user_ip unless user_ip.nil?
2445
+ execute_or_queue_command(command, &block)
2446
+ end
2447
+
2448
+ # Updates an object's metadata.
2449
+ # @param [String] bucket
2450
+ # Name of the bucket in which the object resides.
2451
+ # @param [String] object
2452
+ # Name of the object. For information about how to URL encode object names to be
2453
+ # path safe, see Encoding URI Path Parts.
2454
+ # @param [Google::Apis::StorageV1::Object] object_object
2455
+ # @param [Fixnum] generation
2456
+ # If present, selects a specific revision of this object (as opposed to the
2457
+ # latest version, the default).
2458
+ # @param [Fixnum] if_generation_match
2459
+ # Makes the operation conditional on whether the object's current generation
2460
+ # matches the given value. Setting to 0 makes the operation succeed only if
2461
+ # there are no live versions of the object.
2462
+ # @param [Fixnum] if_generation_not_match
2463
+ # Makes the operation conditional on whether the object's current generation
2464
+ # does not match the given value. If no live object exists, the precondition
2465
+ # fails. Setting to 0 makes the operation succeed only if there is a live
2466
+ # version of the object.
2467
+ # @param [Fixnum] if_metageneration_match
2468
+ # Makes the operation conditional on whether the object's current metageneration
2469
+ # matches the given value.
2470
+ # @param [Fixnum] if_metageneration_not_match
2471
+ # Makes the operation conditional on whether the object's current metageneration
2472
+ # does not match the given value.
2473
+ # @param [String] predefined_acl
2474
+ # Apply a predefined set of access controls to this object.
2475
+ # @param [String] projection
2476
+ # Set of properties to return. Defaults to full.
2477
+ # @param [String] provisional_user_project
2478
+ # The project to be billed for this request if the target bucket is requester-
2479
+ # pays bucket.
2480
+ # @param [String] user_project
2481
+ # The project to be billed for this request. Required for Requester Pays buckets.
2482
+ # @param [String] fields
2483
+ # Selector specifying which fields to include in a partial response.
2484
+ # @param [String] quota_user
2485
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2486
+ # characters.
2487
+ # @param [String] user_ip
2488
+ # Deprecated. Please use quotaUser instead.
2489
+ # @param [Google::Apis::RequestOptions] options
2490
+ # Request-specific options
2491
+ #
2492
+ # @yield [result, err] Result & error if block supplied
2493
+ # @yieldparam result [Google::Apis::StorageV1::Object] parsed result object
2494
+ # @yieldparam err [StandardError] error object if request failed
2495
+ #
2496
+ # @return [Google::Apis::StorageV1::Object]
2497
+ #
2498
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2499
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2500
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2501
+ def update_object(bucket, object, object_object = nil, generation: nil, if_generation_match: nil, if_generation_not_match: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, predefined_acl: nil, projection: nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2502
+ command = make_simple_command(:put, 'b/{bucket}/o/{object}', options)
2503
+ command.request_representation = Google::Apis::StorageV1::Object::Representation
2504
+ command.request_object = object_object
2505
+ command.response_representation = Google::Apis::StorageV1::Object::Representation
2506
+ command.response_class = Google::Apis::StorageV1::Object
2507
+ command.params['bucket'] = bucket unless bucket.nil?
2508
+ command.params['object'] = object unless object.nil?
2509
+ command.query['generation'] = generation unless generation.nil?
2510
+ command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
2511
+ command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
2512
+ command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
2513
+ command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
2514
+ command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
2515
+ command.query['projection'] = projection unless projection.nil?
2516
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2517
+ command.query['userProject'] = user_project unless user_project.nil?
2518
+ command.query['fields'] = fields unless fields.nil?
2519
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2520
+ command.query['userIp'] = user_ip unless user_ip.nil?
2521
+ execute_or_queue_command(command, &block)
2522
+ end
2523
+
2524
+ # Watch for changes on all objects in a bucket.
2525
+ # @param [String] bucket
2526
+ # Name of the bucket in which to look for objects.
2527
+ # @param [Google::Apis::StorageV1::Channel] channel_object
2528
+ # @param [String] delimiter
2529
+ # Returns results in a directory-like mode. items will contain only objects
2530
+ # whose names, aside from the prefix, do not contain delimiter. Objects whose
2531
+ # names, aside from the prefix, contain delimiter will have their name,
2532
+ # truncated after the delimiter, returned in prefixes. Duplicate prefixes are
2533
+ # omitted.
2534
+ # @param [String] end_offset
2535
+ # Filter results to objects whose names are lexicographically before endOffset.
2536
+ # If startOffset is also set, the objects listed will have names between
2537
+ # startOffset (inclusive) and endOffset (exclusive).
2538
+ # @param [Boolean] include_trailing_delimiter
2539
+ # If true, objects that end in exactly one instance of delimiter will have their
2540
+ # metadata included in items in addition to prefixes.
2541
+ # @param [Fixnum] max_results
2542
+ # Maximum number of items plus prefixes to return in a single page of responses.
2543
+ # As duplicate prefixes are omitted, fewer total results may be returned than
2544
+ # requested. The service will use this parameter or 1,000 items, whichever is
2545
+ # smaller.
2546
+ # @param [String] page_token
2547
+ # A previously-returned page token representing part of the larger set of
2548
+ # results to view.
2549
+ # @param [String] prefix
2550
+ # Filter results to objects whose names begin with this prefix.
2551
+ # @param [String] projection
2552
+ # Set of properties to return. Defaults to noAcl.
2553
+ # @param [String] provisional_user_project
2554
+ # The project to be billed for this request if the target bucket is requester-
2555
+ # pays bucket.
2556
+ # @param [String] start_offset
2557
+ # Filter results to objects whose names are lexicographically equal to or after
2558
+ # startOffset. If endOffset is also set, the objects listed will have names
2559
+ # between startOffset (inclusive) and endOffset (exclusive).
2560
+ # @param [String] user_project
2561
+ # The project to be billed for this request. Required for Requester Pays buckets.
2562
+ # @param [Boolean] versions
2563
+ # If true, lists all versions of an object as distinct results. The default is
2564
+ # false. For more information, see Object Versioning.
2565
+ # @param [String] fields
2566
+ # Selector specifying which fields to include in a partial response.
2567
+ # @param [String] quota_user
2568
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2569
+ # characters.
2570
+ # @param [String] user_ip
2571
+ # Deprecated. Please use quotaUser instead.
2572
+ # @param [Google::Apis::RequestOptions] options
2573
+ # Request-specific options
2574
+ #
2575
+ # @yield [result, err] Result & error if block supplied
2576
+ # @yieldparam result [Google::Apis::StorageV1::Channel] parsed result object
2577
+ # @yieldparam err [StandardError] error object if request failed
2578
+ #
2579
+ # @return [Google::Apis::StorageV1::Channel]
2580
+ #
2581
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2582
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2583
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2584
+ def watch_all_objects(bucket, channel_object = nil, delimiter: nil, end_offset: nil, include_trailing_delimiter: nil, max_results: nil, page_token: nil, prefix: nil, projection: nil, provisional_user_project: nil, start_offset: nil, user_project: nil, versions: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2585
+ command = make_simple_command(:post, 'b/{bucket}/o/watch', options)
2586
+ command.request_representation = Google::Apis::StorageV1::Channel::Representation
2587
+ command.request_object = channel_object
2588
+ command.response_representation = Google::Apis::StorageV1::Channel::Representation
2589
+ command.response_class = Google::Apis::StorageV1::Channel
2590
+ command.params['bucket'] = bucket unless bucket.nil?
2591
+ command.query['delimiter'] = delimiter unless delimiter.nil?
2592
+ command.query['endOffset'] = end_offset unless end_offset.nil?
2593
+ command.query['includeTrailingDelimiter'] = include_trailing_delimiter unless include_trailing_delimiter.nil?
2594
+ command.query['maxResults'] = max_results unless max_results.nil?
2595
+ command.query['pageToken'] = page_token unless page_token.nil?
2596
+ command.query['prefix'] = prefix unless prefix.nil?
2597
+ command.query['projection'] = projection unless projection.nil?
2598
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2599
+ command.query['startOffset'] = start_offset unless start_offset.nil?
2600
+ command.query['userProject'] = user_project unless user_project.nil?
2601
+ command.query['versions'] = versions unless versions.nil?
2602
+ command.query['fields'] = fields unless fields.nil?
2603
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2604
+ command.query['userIp'] = user_ip unless user_ip.nil?
2605
+ execute_or_queue_command(command, &block)
2606
+ end
2607
+
2608
+ # Creates a new HMAC key for the specified service account.
2609
+ # @param [String] project_id
2610
+ # Project ID owning the service account.
2611
+ # @param [String] service_account_email
2612
+ # Email address of the service account.
2613
+ # @param [String] user_project
2614
+ # The project to be billed for this request.
2615
+ # @param [String] fields
2616
+ # Selector specifying which fields to include in a partial response.
2617
+ # @param [String] quota_user
2618
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2619
+ # characters.
2620
+ # @param [String] user_ip
2621
+ # Deprecated. Please use quotaUser instead.
2622
+ # @param [Google::Apis::RequestOptions] options
2623
+ # Request-specific options
2624
+ #
2625
+ # @yield [result, err] Result & error if block supplied
2626
+ # @yieldparam result [Google::Apis::StorageV1::HmacKey] parsed result object
2627
+ # @yieldparam err [StandardError] error object if request failed
2628
+ #
2629
+ # @return [Google::Apis::StorageV1::HmacKey]
2630
+ #
2631
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2632
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2633
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2634
+ def create_project_hmac_key(project_id, service_account_email, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2635
+ command = make_simple_command(:post, 'projects/{projectId}/hmacKeys', options)
2636
+ command.response_representation = Google::Apis::StorageV1::HmacKey::Representation
2637
+ command.response_class = Google::Apis::StorageV1::HmacKey
2638
+ command.params['projectId'] = project_id unless project_id.nil?
2639
+ command.query['serviceAccountEmail'] = service_account_email unless service_account_email.nil?
2640
+ command.query['userProject'] = user_project unless user_project.nil?
2641
+ command.query['fields'] = fields unless fields.nil?
2642
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2643
+ command.query['userIp'] = user_ip unless user_ip.nil?
2644
+ execute_or_queue_command(command, &block)
2645
+ end
2646
+
2647
+ # Deletes an HMAC key.
2648
+ # @param [String] project_id
2649
+ # Project ID owning the requested key
2650
+ # @param [String] access_id
2651
+ # Name of the HMAC key to be deleted.
2652
+ # @param [String] user_project
2653
+ # The project to be billed for this request.
2654
+ # @param [String] fields
2655
+ # Selector specifying which fields to include in a partial response.
2656
+ # @param [String] quota_user
2657
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2658
+ # characters.
2659
+ # @param [String] user_ip
2660
+ # Deprecated. Please use quotaUser instead.
2661
+ # @param [Google::Apis::RequestOptions] options
2662
+ # Request-specific options
2663
+ #
2664
+ # @yield [result, err] Result & error if block supplied
2665
+ # @yieldparam result [NilClass] No result returned for this method
2666
+ # @yieldparam err [StandardError] error object if request failed
2667
+ #
2668
+ # @return [void]
2669
+ #
2670
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2671
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2672
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2673
+ def delete_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2674
+ command = make_simple_command(:delete, 'projects/{projectId}/hmacKeys/{accessId}', options)
2675
+ command.params['projectId'] = project_id unless project_id.nil?
2676
+ command.params['accessId'] = access_id unless access_id.nil?
2677
+ command.query['userProject'] = user_project unless user_project.nil?
2678
+ command.query['fields'] = fields unless fields.nil?
2679
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2680
+ command.query['userIp'] = user_ip unless user_ip.nil?
2681
+ execute_or_queue_command(command, &block)
2682
+ end
2683
+
2684
+ # Retrieves an HMAC key's metadata
2685
+ # @param [String] project_id
2686
+ # Project ID owning the service account of the requested key.
2687
+ # @param [String] access_id
2688
+ # Name of the HMAC key.
2689
+ # @param [String] user_project
2690
+ # The project to be billed for this request.
2691
+ # @param [String] fields
2692
+ # Selector specifying which fields to include in a partial response.
2693
+ # @param [String] quota_user
2694
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2695
+ # characters.
2696
+ # @param [String] user_ip
2697
+ # Deprecated. Please use quotaUser instead.
2698
+ # @param [Google::Apis::RequestOptions] options
2699
+ # Request-specific options
2700
+ #
2701
+ # @yield [result, err] Result & error if block supplied
2702
+ # @yieldparam result [Google::Apis::StorageV1::HmacKeyMetadata] parsed result object
2703
+ # @yieldparam err [StandardError] error object if request failed
2704
+ #
2705
+ # @return [Google::Apis::StorageV1::HmacKeyMetadata]
2706
+ #
2707
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2708
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2709
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2710
+ def get_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2711
+ command = make_simple_command(:get, 'projects/{projectId}/hmacKeys/{accessId}', options)
2712
+ command.response_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
2713
+ command.response_class = Google::Apis::StorageV1::HmacKeyMetadata
2714
+ command.params['projectId'] = project_id unless project_id.nil?
2715
+ command.params['accessId'] = access_id unless access_id.nil?
2716
+ command.query['userProject'] = user_project unless user_project.nil?
2717
+ command.query['fields'] = fields unless fields.nil?
2718
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2719
+ command.query['userIp'] = user_ip unless user_ip.nil?
2720
+ execute_or_queue_command(command, &block)
2721
+ end
2722
+
2723
+ # Retrieves a list of HMAC keys matching the criteria.
2724
+ # @param [String] project_id
2725
+ # Name of the project in which to look for HMAC keys.
2726
+ # @param [Fixnum] max_results
2727
+ # Maximum number of items to return in a single page of responses. The service
2728
+ # uses this parameter or 250 items, whichever is smaller. The max number of
2729
+ # items per page will also be limited by the number of distinct service accounts
2730
+ # in the response. If the number of service accounts in a single response is too
2731
+ # high, the page will truncated and a next page token will be returned.
2732
+ # @param [String] page_token
2733
+ # A previously-returned page token representing part of the larger set of
2734
+ # results to view.
2735
+ # @param [String] service_account_email
2736
+ # If present, only keys for the given service account are returned.
2737
+ # @param [Boolean] show_deleted_keys
2738
+ # Whether or not to show keys in the DELETED state.
2739
+ # @param [String] user_project
2740
+ # The project to be billed for this request.
2741
+ # @param [String] fields
2742
+ # Selector specifying which fields to include in a partial response.
2743
+ # @param [String] quota_user
2744
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2745
+ # characters.
2746
+ # @param [String] user_ip
2747
+ # Deprecated. Please use quotaUser instead.
2748
+ # @param [Google::Apis::RequestOptions] options
2749
+ # Request-specific options
2750
+ #
2751
+ # @yield [result, err] Result & error if block supplied
2752
+ # @yieldparam result [Google::Apis::StorageV1::HmacKeysMetadata] parsed result object
2753
+ # @yieldparam err [StandardError] error object if request failed
2754
+ #
2755
+ # @return [Google::Apis::StorageV1::HmacKeysMetadata]
2756
+ #
2757
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2758
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2759
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2760
+ def list_project_hmac_keys(project_id, max_results: nil, page_token: nil, service_account_email: nil, show_deleted_keys: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2761
+ command = make_simple_command(:get, 'projects/{projectId}/hmacKeys', options)
2762
+ command.response_representation = Google::Apis::StorageV1::HmacKeysMetadata::Representation
2763
+ command.response_class = Google::Apis::StorageV1::HmacKeysMetadata
2764
+ command.params['projectId'] = project_id unless project_id.nil?
2765
+ command.query['maxResults'] = max_results unless max_results.nil?
2766
+ command.query['pageToken'] = page_token unless page_token.nil?
2767
+ command.query['serviceAccountEmail'] = service_account_email unless service_account_email.nil?
2768
+ command.query['showDeletedKeys'] = show_deleted_keys unless show_deleted_keys.nil?
2769
+ command.query['userProject'] = user_project unless user_project.nil?
2770
+ command.query['fields'] = fields unless fields.nil?
2771
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2772
+ command.query['userIp'] = user_ip unless user_ip.nil?
2773
+ execute_or_queue_command(command, &block)
2774
+ end
2775
+
2776
+ # Updates the state of an HMAC key. See the HMAC Key resource descriptor for
2777
+ # valid states.
2778
+ # @param [String] project_id
2779
+ # Project ID owning the service account of the updated key.
2780
+ # @param [String] access_id
2781
+ # Name of the HMAC key being updated.
2782
+ # @param [Google::Apis::StorageV1::HmacKeyMetadata] hmac_key_metadata_object
2783
+ # @param [String] user_project
2784
+ # The project to be billed for this request.
2785
+ # @param [String] fields
2786
+ # Selector specifying which fields to include in a partial response.
2787
+ # @param [String] quota_user
2788
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2789
+ # characters.
2790
+ # @param [String] user_ip
2791
+ # Deprecated. Please use quotaUser instead.
2792
+ # @param [Google::Apis::RequestOptions] options
2793
+ # Request-specific options
2794
+ #
2795
+ # @yield [result, err] Result & error if block supplied
2796
+ # @yieldparam result [Google::Apis::StorageV1::HmacKeyMetadata] parsed result object
2797
+ # @yieldparam err [StandardError] error object if request failed
2798
+ #
2799
+ # @return [Google::Apis::StorageV1::HmacKeyMetadata]
2800
+ #
2801
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2802
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2803
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2804
+ def update_project_hmac_key(project_id, access_id, hmac_key_metadata_object = nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2805
+ command = make_simple_command(:put, 'projects/{projectId}/hmacKeys/{accessId}', options)
2806
+ command.request_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
2807
+ command.request_object = hmac_key_metadata_object
2808
+ command.response_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
2809
+ command.response_class = Google::Apis::StorageV1::HmacKeyMetadata
2810
+ command.params['projectId'] = project_id unless project_id.nil?
2811
+ command.params['accessId'] = access_id unless access_id.nil?
2812
+ command.query['userProject'] = user_project unless user_project.nil?
2813
+ command.query['fields'] = fields unless fields.nil?
2814
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2815
+ command.query['userIp'] = user_ip unless user_ip.nil?
2816
+ execute_or_queue_command(command, &block)
2817
+ end
2818
+
2819
+ # Get the email address of this project's Google Cloud Storage service account.
2820
+ # @param [String] project_id
2821
+ # Project ID
2822
+ # @param [String] provisional_user_project
2823
+ # The project to be billed for this request if the target bucket is requester-
2824
+ # pays bucket.
2825
+ # @param [String] user_project
2826
+ # The project to be billed for this request.
2827
+ # @param [String] fields
2828
+ # Selector specifying which fields to include in a partial response.
2829
+ # @param [String] quota_user
2830
+ # An opaque string that represents a user for quota purposes. Must not exceed 40
2831
+ # characters.
2832
+ # @param [String] user_ip
2833
+ # Deprecated. Please use quotaUser instead.
2834
+ # @param [Google::Apis::RequestOptions] options
2835
+ # Request-specific options
2836
+ #
2837
+ # @yield [result, err] Result & error if block supplied
2838
+ # @yieldparam result [Google::Apis::StorageV1::ServiceAccount] parsed result object
2839
+ # @yieldparam err [StandardError] error object if request failed
2840
+ #
2841
+ # @return [Google::Apis::StorageV1::ServiceAccount]
2842
+ #
2843
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2844
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2845
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2846
+ def get_project_service_account(project_id, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2847
+ command = make_simple_command(:get, 'projects/{projectId}/serviceAccount', options)
2848
+ command.response_representation = Google::Apis::StorageV1::ServiceAccount::Representation
2849
+ command.response_class = Google::Apis::StorageV1::ServiceAccount
2850
+ command.params['projectId'] = project_id unless project_id.nil?
2851
+ command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
2852
+ command.query['userProject'] = user_project unless user_project.nil?
2853
+ command.query['fields'] = fields unless fields.nil?
2854
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2855
+ command.query['userIp'] = user_ip unless user_ip.nil?
2856
+ execute_or_queue_command(command, &block)
2857
+ end
2858
+
2859
+ protected
2860
+
2861
+ def apply_command_defaults(command)
2862
+ command.query['key'] = key unless key.nil?
2863
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2864
+ command.query['userIp'] = user_ip unless user_ip.nil?
2865
+ end
2866
+ end
2867
+ end
2868
+ end
2869
+ end