Class: Google::Apis::StorageV1::StorageService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/storage_v1/service.rb

Overview

Cloud Storage JSON API

Stores and retrieves potentially large, immutable data objects.

Examples:

require 'google/apis/storage_v1'

Storage = Google::Apis::StorageV1 # Alias the module
service = Storage::StorageService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStorageService

Returns a new instance of StorageService.



49
50
51
52
53
54
# File 'lib/google/apis/storage_v1/service.rb', line 49

def initialize
  super('https://storage.googleapis.com/', 'storage/v1/',
        client_name: 'google-apis-storage_v1',
        client_version: Google::Apis::StorageV1::GEM_VERSION)
  @batch_path = 'batch/storage/v1'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'lib/google/apis/storage_v1/service.rb', line 38

def key
  @key
end

#quota_userString

Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Returns:

  • (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.



43
44
45
# File 'lib/google/apis/storage_v1/service.rb', line 43

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



47
48
49
# File 'lib/google/apis/storage_v1/service.rb', line 47

def user_ip
  @user_ip
end

Instance Method Details

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Concatenates a list of existing objects into a new object in the same bucket.

Parameters:

  • destination_bucket (String)

    Name of the bucket containing the source objects. The destination object is stored in this bucket.

  • destination_object (String)

    Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • compose_request_object (Google::Apis::StorageV1::ComposeRequest) (defaults to: nil)
  • destination_predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to the destination object.

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • kms_key_name (String) (defaults to: nil)

    Resource name of the Cloud KMS key, of the form projects/my-project/locations/ global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{destinationBucket}/o/{destinationObject}/compose', options)
  command.request_representation = Google::Apis::StorageV1::ComposeRequest::Representation
  command.request_object = compose_request_object
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
  command.params['destinationObject'] = destination_object unless destination_object.nil?
  command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['kmsKeyName'] = kms_key_name unless kms_key_name.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Copies a source object to a destination object. Optionally overrides metadata.

Parameters:

  • source_bucket (String)

    Name of the bucket in which to find the source object.

  • source_object (String)

    Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • destination_bucket (String)

    Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • destination_object (String)

    Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.

  • object_object (Google::Apis::StorageV1::Object) (defaults to: nil)
  • destination_kms_key_name (String) (defaults to: nil)

    Resource name of the Cloud KMS key, of the form projects/my-project/locations/ global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.

  • destination_predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to the destination object.

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current metageneration does not match the given value.

  • if_source_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current generation matches the given value.

  • if_source_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current generation does not match the given value.

  • if_source_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current metageneration matches the given value.

  • if_source_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current metageneration does not match the given value.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • source_generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of the source object (as opposed to the latest version, the default).

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}', options)
  command.request_representation = Google::Apis::StorageV1::Object::Representation
  command.request_object = object_object
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['sourceBucket'] = source_bucket unless source_bucket.nil?
  command.params['sourceObject'] = source_object unless source_object.nil?
  command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
  command.params['destinationObject'] = destination_object unless destination_object.nil?
  command.query['destinationKmsKeyName'] = destination_kms_key_name unless destination_kms_key_name.nil?
  command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['ifSourceGenerationMatch'] = if_source_generation_match unless if_source_generation_match.nil?
  command.query['ifSourceGenerationNotMatch'] = if_source_generation_not_match unless if_source_generation_not_match.nil?
  command.query['ifSourceMetagenerationMatch'] = if_source_metageneration_match unless if_source_metageneration_match.nil?
  command.query['ifSourceMetagenerationNotMatch'] = if_source_metageneration_not_match unless if_source_metageneration_not_match.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['sourceGeneration'] = source_generation unless source_generation.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_project_hmac_key(project_id, service_account_email, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::HmacKey

Creates a new HMAC key for the specified service account.

Parameters:

  • project_id (String)

    Project ID owning the service account.

  • service_account_email (String)

    Email address of the service account.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
# File 'lib/google/apis/storage_v1/service.rb', line 2634

def create_project_hmac_key(project_id, , user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'projects/{projectId}/hmacKeys', options)
  command.response_representation = Google::Apis::StorageV1::HmacKey::Representation
  command.response_class = Google::Apis::StorageV1::HmacKey
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['serviceAccountEmail'] =  unless .nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... }

This method returns an undefined value.

Permanently deletes an empty bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    If set, only deletes the bucket if its metageneration matches this value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    If set, only deletes the bucket if its metageneration does not match this value.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:delete, 'b/{bucket}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_bucket_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes the ACL entry for the specified entity on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:delete, 'b/{bucket}/acl/{entity}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_default_object_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes the default object ACL entry for the specified entity on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



883
884
885
886
887
888
889
890
891
892
893
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:delete, 'b/{bucket}/defaultObjectAcl/{entity}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes a notification subscription.

Parameters:

  • bucket (String)

    The parent bucket of the notification.

  • notification (String)

    ID of the notification to delete.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/google/apis/storage_v1/service.rb', line 1154

def delete_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'b/{bucket}/notificationConfigs/{notification}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['notification'] = notification unless notification.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... }

This method returns an undefined value.

Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • generation (Fixnum) (defaults to: nil)

    If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration does not match the given value.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:delete, 'b/{bucket}/o/{object}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... }

This method returns an undefined value.

Permanently deletes the ACL entry for the specified entity on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:delete, 'b/{bucket}/o/{object}/acl/{entity}', options)
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes an HMAC key.

Parameters:

  • project_id (String)

    Project ID owning the requested key

  • access_id (String)

    Name of the HMAC key to be deleted.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
# File 'lib/google/apis/storage_v1/service.rb', line 2673

def delete_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'projects/{projectId}/hmacKeys/{accessId}', options)
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['accessId'] = access_id unless access_id.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Bucket

Returns metadata for the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}', options)
  command.response_representation = Google::Apis::StorageV1::Bucket::Representation
  command.response_class = Google::Apis::StorageV1::Bucket
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_bucket_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::BucketAccessControl

Returns the ACL entry for the specified entity on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/acl/{entity}', options)
  command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::BucketAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Policy

Returns an IAM policy for the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/iam', options)
  command.response_representation = Google::Apis::StorageV1::Policy::Representation
  command.response_class = Google::Apis::StorageV1::Policy
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['optionsRequestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_default_object_access_control(bucket, entity, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Returns the default object ACL entry for the specified entity on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/defaultObjectAcl/{entity}', options)
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::Notification

View a notification configuration.

Parameters:

  • bucket (String)

    The parent bucket of the notification.

  • notification (String)

    Notification ID

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'lib/google/apis/storage_v1/service.rb', line 1195

def get_notification(bucket, notification, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'b/{bucket}/notificationConfigs/{notification}', options)
  command.response_representation = Google::Apis::StorageV1::Notification::Representation
  command.response_class = Google::Apis::StorageV1::Notification
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['notification'] = notification unless notification.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Retrieves an object or its metadata.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration does not match the given value.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  if download_dest.nil?
    command = make_simple_command(:get, 'b/{bucket}/o/{object}', options)
  else
    command = make_download_command(:get, 'b/{bucket}/o/{object}', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Returns the ACL entry for the specified entity on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/o/{object}/acl/{entity}', options)
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Policy

Returns an IAM policy for the specified object.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam', options)
  command.response_representation = Google::Apis::StorageV1::Policy::Representation
  command.response_class = Google::Apis::StorageV1::Policy
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::HmacKeyMetadata

Retrieves an HMAC key's metadata

Parameters:

  • project_id (String)

    Project ID owning the service account of the requested key.

  • access_id (String)

    Name of the HMAC key.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
# File 'lib/google/apis/storage_v1/service.rb', line 2710

def get_project_hmac_key(project_id, access_id, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'projects/{projectId}/hmacKeys/{accessId}', options)
  command.response_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
  command.response_class = Google::Apis::StorageV1::HmacKeyMetadata
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['accessId'] = access_id unless access_id.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_project_service_account(project_id, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::ServiceAccount

Get the email address of this project's Google Cloud Storage service account.

Parameters:

  • project_id (String)

    Project ID

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
# File 'lib/google/apis/storage_v1/service.rb', line 2846

def (project_id, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'projects/{projectId}/serviceAccount', options)
  command.response_representation = Google::Apis::StorageV1::ServiceAccount::Representation
  command.response_class = Google::Apis::StorageV1::ServiceAccount
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Bucket

Creates a new bucket.

Parameters:

  • project (String)

    A valid API project identifier.

  • bucket_object (Google::Apis::StorageV1::Bucket) (defaults to: nil)
  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this bucket.

  • predefined_default_object_acl (String) (defaults to: nil)

    Apply a predefined set of default object access controls to this bucket.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b', options)
  command.request_representation = Google::Apis::StorageV1::Bucket::Representation
  command.request_object = bucket_object
  command.response_representation = Google::Apis::StorageV1::Bucket::Representation
  command.response_class = Google::Apis::StorageV1::Bucket
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
  command.query['project'] = project unless project.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::BucketAccessControl

Creates a new ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • bucket_access_control_object (Google::Apis::StorageV1::BucketAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/acl', options)
  command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.request_object = bucket_access_control_object
  command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::BucketAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Creates a new default object ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/defaultObjectAcl', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_notification(bucket, notification_object = nil, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::Notification

Creates a notification subscription for a given bucket.

Parameters:

  • bucket (String)

    The parent bucket of the notification.

  • notification_object (Google::Apis::StorageV1::Notification) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/notificationConfigs', options)
  command.request_representation = Google::Apis::StorageV1::Notification::Representation
  command.request_object = notification_object
  command.response_representation = Google::Apis::StorageV1::Notification::Representation
  command.response_class = Google::Apis::StorageV1::Notification
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Stores a new object and metadata.

Parameters:

  • bucket (String)

    Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.

  • object_object (Google::Apis::StorageV1::Object) (defaults to: nil)
  • content_encoding (String) (defaults to: nil)

    If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration does not match the given value.

  • kms_key_name (String) (defaults to: nil)

    Resource name of the Cloud KMS key, of the form projects/my-project/locations/ global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.

  • name (String) (defaults to: nil)

    Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this object.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  if upload_source.nil?
    command = make_simple_command(:post, 'b/{bucket}/o', options)
  else
    command = make_upload_command(:post, 'b/{bucket}/o', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::StorageV1::Object::Representation
  command.request_object = object_object
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['contentEncoding'] = content_encoding unless content_encoding.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['kmsKeyName'] = kms_key_name unless kms_key_name.nil?
  command.query['name'] = name unless name.nil?
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Creates a new ACL entry on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/o/{object}/acl', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_bucket_access_controls(bucket, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::BucketAccessControls

Retrieves ACL entries on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/acl', options)
  command.response_representation = Google::Apis::StorageV1::BucketAccessControls::Representation
  command.response_class = Google::Apis::StorageV1::BucketAccessControls
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Buckets

Retrieves a list of buckets for a given project.

Parameters:

  • project (String)

    A valid API project identifier.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.

  • page_token (String) (defaults to: nil)

    A previously-returned page token representing part of the larger set of results to view.

  • prefix (String) (defaults to: nil)

    Filter results to buckets whose names begin with this prefix.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b', options)
  command.response_representation = Google::Apis::StorageV1::Buckets::Representation
  command.response_class = Google::Apis::StorageV1::Buckets
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['prefix'] = prefix unless prefix.nil?
  command.query['project'] = project unless project.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControls

Retrieves default object ACL entries on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    If present, only return default ACL listing if the bucket's current metageneration matches this value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    If present, only return default ACL listing if the bucket's current metageneration does not match the given value.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/defaultObjectAcl', options)
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControls::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControls
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_notifications(bucket, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::Notifications

Retrieves a list of notification subscriptions for a given bucket.

Parameters:

  • bucket (String)

    Name of a Google Cloud Storage bucket.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
# File 'lib/google/apis/storage_v1/service.rb', line 1279

def list_notifications(bucket, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'b/{bucket}/notificationConfigs', options)
  command.response_representation = Google::Apis::StorageV1::Notifications::Representation
  command.response_class = Google::Apis::StorageV1::Notifications
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControls

Retrieves ACL entries on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/o/{object}/acl', options)
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControls::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControls
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Objects

Retrieves a list of objects matching the criteria.

Parameters:

  • bucket (String)

    Name of the bucket in which to look for objects.

  • delimiter (String) (defaults to: nil)

    Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.

  • end_offset (String) (defaults to: nil)

    Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

  • include_trailing_delimiter (Boolean) (defaults to: nil)

    If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.

  • page_token (String) (defaults to: nil)

    A previously-returned page token representing part of the larger set of results to view.

  • prefix (String) (defaults to: nil)

    Filter results to objects whose names begin with this prefix.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • start_offset (String) (defaults to: nil)

    Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • versions (Boolean) (defaults to: nil)

    If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/o', options)
  command.response_representation = Google::Apis::StorageV1::Objects::Representation
  command.response_class = Google::Apis::StorageV1::Objects
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['delimiter'] = delimiter unless delimiter.nil?
  command.query['endOffset'] = end_offset unless end_offset.nil?
  command.query['includeTrailingDelimiter'] = include_trailing_delimiter unless include_trailing_delimiter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['prefix'] = prefix unless prefix.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['startOffset'] = start_offset unless start_offset.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['versions'] = versions unless versions.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::HmacKeysMetadata

Retrieves a list of HMAC keys matching the criteria.

Parameters:

  • project_id (String)

    Name of the project in which to look for HMAC keys.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.

  • page_token (String) (defaults to: nil)

    A previously-returned page token representing part of the larger set of results to view.

  • service_account_email (String) (defaults to: nil)

    If present, only keys for the given service account are returned.

  • show_deleted_keys (Boolean) (defaults to: nil)

    Whether or not to show keys in the DELETED state.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'projects/{projectId}/hmacKeys', options)
  command.response_representation = Google::Apis::StorageV1::HmacKeysMetadata::Representation
  command.response_class = Google::Apis::StorageV1::HmacKeysMetadata
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['serviceAccountEmail'] =  unless .nil?
  command.query['showDeletedKeys'] = show_deleted_keys unless show_deleted_keys.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Bucket

Locks retention policy on a bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • if_metageneration_match (Fixnum)

    Makes the operation conditional on whether bucket's current metageneration matches the given value.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/lockRetentionPolicy', options)
  command.response_representation = Google::Apis::StorageV1::Bucket::Representation
  command.response_class = Google::Apis::StorageV1::Bucket
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Bucket

Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

Parameters:

  • bucket (String)

    Name of a bucket.

  • bucket_object (Google::Apis::StorageV1::Bucket) (defaults to: nil)
  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.

  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this bucket.

  • predefined_default_object_acl (String) (defaults to: nil)

    Apply a predefined set of default object access controls to this bucket.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:patch, 'b/{bucket}', options)
  command.request_representation = Google::Apis::StorageV1::Bucket::Representation
  command.request_object = bucket_object
  command.response_representation = Google::Apis::StorageV1::Bucket::Representation
  command.response_class = Google::Apis::StorageV1::Bucket
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::BucketAccessControl

Patches an ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • bucket_access_control_object (Google::Apis::StorageV1::BucketAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:patch, 'b/{bucket}/acl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.request_object = bucket_access_control_object
  command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::BucketAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Patches a default object ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:patch, 'b/{bucket}/defaultObjectAcl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Patches an object's metadata.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • object_object (Google::Apis::StorageV1::Object) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration does not match the given value.

  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this object.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request, for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:patch, 'b/{bucket}/o/{object}', options)
  command.request_representation = Google::Apis::StorageV1::Object::Representation
  command.request_object = object_object
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Patches an ACL entry on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:patch, 'b/{bucket}/o/{object}/acl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::RewriteResponse

Rewrites a source object to a destination object. Optionally overrides metadata.

Parameters:

  • source_bucket (String)

    Name of the bucket in which to find the source object.

  • source_object (String)

    Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • destination_bucket (String)

    Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.

  • destination_object (String)

    Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • object_object (Google::Apis::StorageV1::Object) (defaults to: nil)
  • destination_kms_key_name (String) (defaults to: nil)

    Resource name of the Cloud KMS key, of the form projects/my-project/locations/ global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.

  • destination_predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to the destination object.

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the destination object's current metageneration does not match the given value.

  • if_source_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current generation matches the given value.

  • if_source_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current generation does not match the given value.

  • if_source_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current metageneration matches the given value.

  • if_source_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the source object's current metageneration does not match the given value.

  • max_bytes_rewritten_per_call (Fixnum) (defaults to: nil)

    The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB ( 1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • rewrite_token (String) (defaults to: nil)

    Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.

  • source_generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of the source object (as opposed to the latest version, the default).

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}', options)
  command.request_representation = Google::Apis::StorageV1::Object::Representation
  command.request_object = object_object
  command.response_representation = Google::Apis::StorageV1::RewriteResponse::Representation
  command.response_class = Google::Apis::StorageV1::RewriteResponse
  command.params['sourceBucket'] = source_bucket unless source_bucket.nil?
  command.params['sourceObject'] = source_object unless source_object.nil?
  command.params['destinationBucket'] = destination_bucket unless destination_bucket.nil?
  command.params['destinationObject'] = destination_object unless destination_object.nil?
  command.query['destinationKmsKeyName'] = destination_kms_key_name unless destination_kms_key_name.nil?
  command.query['destinationPredefinedAcl'] = destination_predefined_acl unless destination_predefined_acl.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['ifSourceGenerationMatch'] = if_source_generation_match unless if_source_generation_match.nil?
  command.query['ifSourceGenerationNotMatch'] = if_source_generation_not_match unless if_source_generation_not_match.nil?
  command.query['ifSourceMetagenerationMatch'] = if_source_metageneration_match unless if_source_metageneration_match.nil?
  command.query['ifSourceMetagenerationNotMatch'] = if_source_metageneration_not_match unless if_source_metageneration_not_match.nil?
  command.query['maxBytesRewrittenPerCall'] = max_bytes_rewritten_per_call unless max_bytes_rewritten_per_call.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['rewriteToken'] = rewrite_token unless rewrite_token.nil?
  command.query['sourceGeneration'] = source_generation unless source_generation.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Policy

Updates an IAM policy for the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • policy_object (Google::Apis::StorageV1::Policy) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/iam', options)
  command.request_representation = Google::Apis::StorageV1::Policy::Representation
  command.request_object = policy_object
  command.response_representation = Google::Apis::StorageV1::Policy::Representation
  command.response_class = Google::Apis::StorageV1::Policy
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Policy

Updates an IAM policy for the specified object.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • policy_object (Google::Apis::StorageV1::Policy) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/o/{object}/iam', options)
  command.request_representation = Google::Apis::StorageV1::Policy::Representation
  command.request_object = policy_object
  command.response_representation = Google::Apis::StorageV1::Policy::Representation
  command.response_class = Google::Apis::StorageV1::Policy
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Stop watching resources through this channel

Parameters:

  • channel_object (Google::Apis::StorageV1::Channel) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



842
843
844
845
846
847
848
849
850
# File 'lib/google/apis/storage_v1/service.rb', line 842

def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'channels/stop', options)
  command.request_representation = Google::Apis::StorageV1::Channel::Representation
  command.request_object = channel_object
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#test_bucket_iam_permissions(bucket, permissions, provisional_user_project: nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StorageV1::TestIamPermissionsResponse

Tests a set of permissions on the given bucket to see which, if any, are held by the caller.

Parameters:

  • bucket (String)

    Name of a bucket.

  • permissions (Array<String>, String)

    Permissions to test.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



746
747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/iam/testPermissions', options)
  command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['permissions'] = permissions unless permissions.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::TestIamPermissionsResponse

Tests a set of permissions on the given object to see which, if any, are held by the caller.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • permissions (Array<String>, String)

    Permissions to test.

  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam/testPermissions', options)
  command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['permissions'] = permissions unless permissions.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Bucket

Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

Parameters:

  • bucket (String)

    Name of a bucket.

  • bucket_object (Google::Apis::StorageV1::Bucket) (defaults to: nil)
  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.

  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this bucket.

  • predefined_default_object_acl (String) (defaults to: nil)

    Apply a predefined set of default object access controls to this bucket.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}', options)
  command.request_representation = Google::Apis::StorageV1::Bucket::Representation
  command.request_object = bucket_object
  command.response_representation = Google::Apis::StorageV1::Bucket::Representation
  command.response_class = Google::Apis::StorageV1::Bucket
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['predefinedDefaultObjectAcl'] = predefined_default_object_acl unless predefined_default_object_acl.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::BucketAccessControl

Updates an ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • bucket_access_control_object (Google::Apis::StorageV1::BucketAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/acl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.request_object = bucket_access_control_object
  command.response_representation = Google::Apis::StorageV1::BucketAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::BucketAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Updates a default object ACL entry on the specified bucket.

Parameters:

  • bucket (String)

    Name of a bucket.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/defaultObjectAcl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Object

Updates an object's metadata.

Parameters:

  • bucket (String)

    Name of the bucket in which the object resides.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • object_object (Google::Apis::StorageV1::Object) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • if_generation_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

  • if_generation_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

  • if_metageneration_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration matches the given value.

  • if_metageneration_not_match (Fixnum) (defaults to: nil)

    Makes the operation conditional on whether the object's current metageneration does not match the given value.

  • predefined_acl (String) (defaults to: nil)

    Apply a predefined set of access controls to this object.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to full.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/o/{object}', options)
  command.request_representation = Google::Apis::StorageV1::Object::Representation
  command.request_object = object_object
  command.response_representation = Google::Apis::StorageV1::Object::Representation
  command.response_class = Google::Apis::StorageV1::Object
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['ifGenerationMatch'] = if_generation_match unless if_generation_match.nil?
  command.query['ifGenerationNotMatch'] = if_generation_not_match unless if_generation_not_match.nil?
  command.query['ifMetagenerationMatch'] = if_metageneration_match unless if_metageneration_match.nil?
  command.query['ifMetagenerationNotMatch'] = if_metageneration_not_match unless if_metageneration_not_match.nil?
  command.query['predefinedAcl'] = predefined_acl unless predefined_acl.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::ObjectAccessControl

Updates an ACL entry on the specified object.

Parameters:

  • bucket (String)

    Name of a bucket.

  • object (String)

    Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

  • entity (String)

    The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.

  • object_access_control_object (Google::Apis::StorageV1::ObjectAccessControl) (defaults to: nil)
  • generation (Fixnum) (defaults to: nil)

    If present, selects a specific revision of this object (as opposed to the latest version, the default).

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:put, 'b/{bucket}/o/{object}/acl/{entity}', options)
  command.request_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.request_object = object_access_control_object
  command.response_representation = Google::Apis::StorageV1::ObjectAccessControl::Representation
  command.response_class = Google::Apis::StorageV1::ObjectAccessControl
  command.params['bucket'] = bucket unless bucket.nil?
  command.params['object'] = object unless object.nil?
  command.params['entity'] = entity unless entity.nil?
  command.query['generation'] = generation unless generation.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::HmacKeyMetadata

Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.

Parameters:

  • project_id (String)

    Project ID owning the service account of the updated key.

  • access_id (String)

    Name of the HMAC key being updated.

  • hmac_key_metadata_object (Google::Apis::StorageV1::HmacKeyMetadata) (defaults to: nil)
  • user_project (String) (defaults to: nil)

    The project to be billed for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
# File 'lib/google/apis/storage_v1/service.rb', line 2804

def update_project_hmac_key(project_id, access_id,  = nil, user_project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'projects/{projectId}/hmacKeys/{accessId}', options)
  command.request_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
  command.request_object = 
  command.response_representation = Google::Apis::StorageV1::HmacKeyMetadata::Representation
  command.response_class = Google::Apis::StorageV1::HmacKeyMetadata
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['accessId'] = access_id unless access_id.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) {|result, err| ... } ⇒ Google::Apis::StorageV1::Channel

Watch for changes on all objects in a bucket.

Parameters:

  • bucket (String)

    Name of the bucket in which to look for objects.

  • channel_object (Google::Apis::StorageV1::Channel) (defaults to: nil)
  • delimiter (String) (defaults to: nil)

    Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.

  • end_offset (String) (defaults to: nil)

    Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

  • include_trailing_delimiter (Boolean) (defaults to: nil)

    If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.

  • page_token (String) (defaults to: nil)

    A previously-returned page token representing part of the larger set of results to view.

  • prefix (String) (defaults to: nil)

    Filter results to objects whose names begin with this prefix.

  • projection (String) (defaults to: nil)

    Set of properties to return. Defaults to noAcl.

  • provisional_user_project (String) (defaults to: nil)

    The project to be billed for this request if the target bucket is requester- pays bucket.

  • start_offset (String) (defaults to: nil)

    Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

  • user_project (String) (defaults to: nil)

    The project to be billed for this request. Required for Requester Pays buckets.

  • versions (Boolean) (defaults to: nil)

    If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
# File 'lib/google/apis/storage_v1/service.rb', line 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)
  command = make_simple_command(:post, 'b/{bucket}/o/watch', options)
  command.request_representation = Google::Apis::StorageV1::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::StorageV1::Channel::Representation
  command.response_class = Google::Apis::StorageV1::Channel
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['delimiter'] = delimiter unless delimiter.nil?
  command.query['endOffset'] = end_offset unless end_offset.nil?
  command.query['includeTrailingDelimiter'] = include_trailing_delimiter unless include_trailing_delimiter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['prefix'] = prefix unless prefix.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['provisionalUserProject'] = provisional_user_project unless provisional_user_project.nil?
  command.query['startOffset'] = start_offset unless start_offset.nil?
  command.query['userProject'] = user_project unless user_project.nil?
  command.query['versions'] = versions unless versions.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end