google-cloud-storage 1.34.1 → 1.41.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -326,7 +326,7 @@ module Google
326
326
  #
327
327
  def post_object_ext_path
328
328
  path = "/#{@bucket_name}/#{@file_name}"
329
- escaped = Addressable::URI.escape path
329
+ escaped = Addressable::URI.encode_component path, Addressable::URI::CharacterClasses::PATH
330
330
  special_var = "${filename}"
331
331
  # Restore the unencoded `${filename}` variable, if present.
332
332
  if path.include? special_var
@@ -288,12 +288,11 @@ module Google
288
288
  # roles.
289
289
  # * `public`, `public_read`, `publicRead` - File owner gets OWNER
290
290
  # access, and allUsers get READER access.
291
- # @param [String] location The location of the bucket. Object data for
292
- # objects in the bucket resides in physical storage within this
293
- # region. Possible values include `ASIA`, `EU`, and `US`. (See the
294
- # [developer's
295
- # guide](https://cloud.google.com/storage/docs/bucket-locations) for
296
- # the authoritative list. The default value is `US`.
291
+ # @param [String] location The location of the bucket. Optional.
292
+ # If not passed, the default location, 'US', will be used.
293
+ # If specifying a dual-region location, the `customPlacementConfig`
294
+ # property should be set in conjunction. See:
295
+ # [Storage Locations](https://cloud.google.com/storage/docs/locations).
297
296
  # @param [String] logging_bucket The destination bucket for the bucket's
298
297
  # logs. For more information, see [Access
299
298
  # Logs](https://cloud.google.com/storage/docs/access-logs).
@@ -364,14 +363,23 @@ module Google
364
363
  # b.lifecycle.add_set_storage_class_rule "COLDLINE", age: 10
365
364
  # end
366
365
  #
367
- def create_bucket bucket_name, acl: nil, default_acl: nil,
368
- location: nil, storage_class: nil,
369
- logging_bucket: nil, logging_prefix: nil,
370
- website_main: nil, website_404: nil, versioning: nil,
371
- requester_pays: nil, user_project: nil
366
+ def create_bucket bucket_name,
367
+ acl: nil,
368
+ default_acl: nil,
369
+ location: nil,
370
+ custom_placement_config: nil,
371
+ storage_class: nil,
372
+ logging_bucket: nil,
373
+ logging_prefix: nil,
374
+ website_main: nil,
375
+ website_404: nil,
376
+ versioning: nil,
377
+ requester_pays: nil,
378
+ user_project: nil
372
379
  params = {
373
380
  name: bucket_name,
374
- location: location
381
+ location: location,
382
+ custom_placement_config: custom_placement_config
375
383
  }.delete_if { |_, v| v.nil? }
376
384
  new_bucket = Google::Apis::StorageV1::Bucket.new(**params)
377
385
  storage_class = storage_class_for storage_class