Globals

Method

objectEntries

objectEntries()

Flatten an object into an Array of arrays, [[key, value], ..]. Implements Object.entries() for Node.js <8

Abstract types

AddAclCallback

AddAclCallback(err, acl, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

acl

object

The Acl Objects.

apiResponse

object

The full API response.

AddAclResponse

array

Properties

Parameter

0

object

The Acl Objects.

1

object

The full API response.

AddLifecycleRuleOptions

object

Configuration options for Bucket#addLifecycleRule().

Property

Parameter

append

Optional

string

The new rules will be appended to any pre-existing rules.

BucketExistsCallback

BucketExistsCallback(err, exists)

Parameter

err

Error

Request error, if any.

Value may be null.

exists

boolean

Whether the Bucket exists.

BucketExistsOptions

object

Configuration options for Bucket#exists().

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

BucketExistsResponse

array

Property

Parameter

0

boolean

Whether the Bucket exists.

BucketLockCallback

BucketLockCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

CombineCallback

CombineCallback(err, newFile, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

newFile

File

The new File.

apiResponse

object

The full API response.

CombineOptions

object

Properties

Parameter

kmsKeyName

Optional

string

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

userProject

Optional

string

The ID of the project which will be billed for the request.

CombineResponse

array

Properties

Parameter

0

File

The new File.

1

object

The full API response.

CopyCallback

CopyCallback(err, copiedFile, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

copiedFile

File

The copied File.

apiResponse

object

The full API response.

CopyOptions

object

Configuration options for File#copy(). See an Object resource.

Properties

Parameter

destinationKmsKeyName

Optional

string

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

keepAcl

Optional

string

Retain the ACL for the new file.

predefinedAcl

Optional

string

Set the ACL for the new file.

token

Optional

string

A previously-returned rewriteToken from an unfinished rewrite request.

userProject

Optional

string

The ID of the project which will be billed for the request.

CopyResponse

array

Properties

Parameter

0

File

The copied File.

1

object

The full API response.

CreateBucketCallback

CreateBucketCallback(err, bucket, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

bucket

Bucket

The new Bucket.

apiResponse

object

The full API response.

CreateBucketRequest

object

Metadata to set for the bucket.

Properties

Parameter

coldline

Optional

boolean

Specify the storage class as Coldline.

dra

Optional

boolean

Specify the storage class as Durable Reduced Availability.

multiRegional

Optional

boolean

Specify the storage class as Multi-Regional.

nearline

Optional

boolean

Specify the storage class as Nearline.

regional

Optional

boolean

Specify the storage class as Regional.

requesterPays

Optional

boolean

Early Access Testers Only Force the use of the User Project metadata field to assign operational costs when an operation is made on a Bucket and its objects.

userProject

Optional

string

The ID of the project which will be billed for the request.

CreateBucketResponse

array

Properties

Parameter

0

Bucket

The new Bucket.

1

object

The full API response.

CreateChannelCallback

CreateChannelCallback(err, channel, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

channel

Channel

The new Channel.

apiResponse

object

The full API response.

CreateChannelConfig

object

See a Objects: watchAll request body.

Property

Parameter

address

string

The address where notifications are delivered for this channel.

Extends
WatchAllOptions

CreateChannelOptions

object

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

CreateChannelResponse

array

Properties

Parameter

0

Channel

The new Channel.

1

object

The full API response.

CreateNotificationCallback

CreateNotificationCallback(err, notification, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

notification

Notification

The new Notification.

apiResponse

object

The full API response.

CreateNotificationOptions

object

Metadata to set for the Notification.

Properties

Parameter

customAttributes

Optional

object

An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.

eventTypes

Optional

Array of string

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

objectNamePrefix

Optional

string

If present, only apply this notification configuration to object names that begin with this prefix.

payloadFormat

Optional

string

The desired content of the Payload. Defaults to JSON_API_V1.

Acceptable values are:
- `JSON_API_V1`

- `NONE`

userProject

Optional

string

The ID of the project which will be billed for the request.

CreateNotificationResponse

array

Properties

Parameter

0

Notification

The new Notification.

1

object

The full API response.

CreateReadStreamOptions

object

Configuration options for File#createReadStream.

Properties

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

validation

Optional

(string or boolean)

Possible values: "md5", "crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended.

start

Optional

number

A byte offset to begin the file's download from. Default is 0. NOTE: Byte ranges are inclusive; that is, options.start = 0 and options.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.

end

Optional

number

A byte offset to stop reading the file at. NOTE: Byte ranges are inclusive; that is, options.start = 0 and options.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.

CreateResumableUploadCallback

CreateResumableUploadCallback(err, uri)

Parameter

err

Error

Request error, if any.

Value may be null.

uri

string

The resumable upload's unique session URI.

CreateResumableUploadOptions

object

Properties

Parameter

metadata

Optional

object

Metadata to set on the file.

origin

Optional

string

Origin header to set for the upload.

predefinedAcl

Optional

string

Apply a predefined set of access controls to this object.

Acceptable values are:
- authenticatedRead - Object owner gets OWNER access, and
  allAuthenticatedUsers get READER access.

- bucketOwnerFullControl - Object owner gets OWNER access, and
  project team owners get OWNER access.

- bucketOwnerRead - Object owner gets OWNER access, and project
  team owners get READER access.

- private - Object owner gets OWNER access.

- projectPrivate - Object owner gets OWNER access, and project
  team members get access according to their roles.

- publicRead - Object owner gets OWNER access, and allUsers

get READER access.

private

Optional

boolean

Make the uploaded file private. (Alias for options.predefinedAcl = 'private')

public

Optional

boolean

Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')

userProject

Optional

string

The ID of the project which will be billed for the request.

CreateResumableUploadResponse

array

Property

Parameter

0

string

The resumable upload's unique session URI.

CreateWriteStreamOptions

object

Configuration options for File#createWriteStream().

Properties

Parameter

contentType

Optional

string

Alias for options.metadata.contentType. If set to auto, the file name is used to determine the contentType.

gzip

Optional

(string or boolean)

If true, automatically gzip the file. If set to auto, the contentType is used to determine if the file should be gzipped. This will set options.metadata.contentEncoding to gzip if necessary.

metadata

Optional

object

See the examples below or Objects: insert request body for more details.

offset

Optional

number

The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.

predefinedAcl

Optional

string

Apply a predefined set of access controls to this object.

Acceptable values are:
- authenticatedRead - Object owner gets OWNER access, and
  allAuthenticatedUsers get READER access.

- bucketOwnerFullControl - Object owner gets OWNER access, and
  project team owners get OWNER access.

- bucketOwnerRead - Object owner gets OWNER access, and project
  team owners get READER access.

- private - Object owner gets OWNER access.

- projectPrivate - Object owner gets OWNER access, and project
  team members get access according to their roles.

- publicRead - Object owner gets OWNER access, and allUsers

get READER access.

private

Optional

boolean

Make the uploaded file private. (Alias for options.predefinedAcl = 'private')

public

Optional

boolean

Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')

resumable

Optional

boolean

Force a resumable upload. NOTE: When working with streams, the file format and size is unknown until it's completely consumed. Because of this, it's best for you to be explicit for what makes sense given your input.

uri

Optional

string

The URI for an already-created resumable upload. See File#createResumableUpload.

userProject

Optional

string

The ID of the project which will be billed for the request.

validation

Optional

(string or boolean)

Possible values: "md5", "crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended.

DeleteBucketCallback

DeleteBucketCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

DeleteBucketOptions

object

Configuration options.

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

DeleteBucketResponse

array

Property

Parameter

0

object

The full API response.

DeleteFileCallback

DeleteFileCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

DeleteFileResponse

array

Property

Parameter

0

object

The full API response.

DeleteFilesCallback

DeleteFilesCallback(err, apiResponse)

Parameter

err

(nullable Error or nullable Array of Error)

Request error, if any, or array of errors from files that were not able to be deleted.

apiResponse

Optional

object

The full API response.

DeleteFilesOptions

object

Query object. See Bucket#getFiles for all of the supported properties.

Property

Parameter

force

Optional

boolean

Suppress errors until all files have been processed.

DeleteLabelsCallback

DeleteLabelsCallback(err, metadata)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

Bucket's metadata.

DeleteLabelsResponse

array

Property

Parameter

0

object

The full API response.

DeleteNotificationResponse

array

Property

Parameter

0

object

The full API response.

DisableRequesterPaysCallback

DisableRequesterPaysCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

DisableRequesterPaysResponse

array

Property

Parameter

0

object

The full API response.

DownloadCallback

DownloadCallback(err, contents)

Parameter

err

Request error, if any.

contents

The contents of a File.

DownloadResponse

array

Property

Parameter

0

Optional

The contents of a File.

EnableRequesterPaysCallback

EnableRequesterPaysCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

EnableRequesterPaysResponse

array

Property

Parameter

0

object

The full API response.

FileExistsCallback

FileExistsCallback(err, exists)

Parameter

err

Error

Request error, if any.

Value may be null.

exists

boolean

Whether the File exists.

FileExistsResponse

array

Property

Parameter

0

boolean

Whether the File exists.

FileOptions

object

Options passed to the File constructor.

Properties

Parameter

encryptionKey

Optional

string

A custom encryption key.

generation

Optional

number

Generation to scope the file to.

kmsKeyName

Optional

string

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key. Limited availability; usable only by enabled projects.

userProject

Optional

string

The ID of the project which will be billed for all requests made from File object.

GetAclCallback

GetAclCallback(err, acl, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

acl

(object or Array of object)

Single or array of Acl Objects.

apiResponse

object

The full API response.

GetAclResponse

array

Properties

Parameter

0

(object or Array of object)

Single or array of Acl Objects.

1

object

The full API response.

GetBucketCallback

GetBucketCallback(err, bucket, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

bucket

Bucket

The Bucket.

apiResponse

object

The full API response.

GetBucketMetadataCallback

GetBucketMetadataCallback(err, metadata, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

The bucket metadata.

apiResponse

object

The full API response.

GetBucketMetadataOptions

object

Configuration options for Bucket#getMetadata().

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

GetBucketMetadataResponse

array

Properties

Parameter

0

object

The bucket metadata.

1

object

The full API response.

GetBucketOptions

object

Configuration options for Bucket#get()

Properties

Parameter

autoCreate

Optional

boolean

Automatically create the object if it does not exist. Default: false

userProject

Optional

string

The ID of the project which will be billed for the request.

GetBucketResponse

array

Properties

Parameter

0

Bucket

The Bucket.

1

object

The full API response.

GetBucketsCallback

GetBucketsCallback(err, buckets)

Parameter

err

Error

Request error, if any.

Value may be null.

buckets

Array of Bucket

Array of Bucket instances.

GetBucketsRequest

object

Query object for listing buckets.

Properties

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

maxApiCalls

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items plus prefixes to return.

pageToken

Optional

string

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

userProject

Optional

string

The ID of the project which will be billed for the request.

GetBucketsResponse

array

Property

Parameter

0

Array of Bucket

Array of Bucket instances.

GetExpirationDateCallback

GetExpirationDateCallback(err, expirationDate)

Parameter

err

Error

Request error, if any.

Value may be null.

expirationDate

date

A Date object representing the earliest time this file's retention policy will expire.

GetExpirationDateResponse

array

Property

Parameter

0

date

A Date object representing the earliest time this file's retention policy will expire.

GetFileCallback

GetFileCallback(err, file, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

file

File

The File.

apiResponse

object

The full API response.

GetFileMetadataCallback

GetFileMetadataCallback(err, metadata, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

The File metadata.

apiResponse

object

The full API response.

GetFileMetadataResponse

array

Properties

Parameter

0

object

The File metadata.

1

object

The full API response.

GetFileResponse

array

Properties

Parameter

0

File

The File.

1

object

The full API response.

GetFilesCallback

GetFilesCallback(err, files)

Parameter

err

Error

Request error, if any.

Value may be null.

files

Array of File

Array of File instances.

GetFilesOptions

object

Query object for listing files.

Properties

Parameter

autoPaginate

Optional

boolean

Have pagination handled automatically.

delimiter

Optional

string

Results 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 apiResponse.prefixes. Duplicate prefixes are omitted.

directory

Optional

string

Filter results based on a directory name, or more technically, a "prefix".

prefix

Optional

string

Filter results to objects whose names begin with this prefix.

maxApiCalls

Optional

number

Maximum number of API calls to make.

maxResults

Optional

number

Maximum number of items plus prefixes to return.

pageToken

Optional

string

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

userProject

Optional

string

The ID of the project which will be billed for the request.

versions

Optional

boolean

If true, returns File objects scoped to their versions.

GetFilesResponse

array

Property

Parameter

0

Array of File

Array of File instances.

GetLabelsCallback

GetLabelsCallback(err, labels)

Parameter

err

Error

Request error, if any.

Value may be null.

labels

object

Object of labels currently set on this bucket.

GetLabelsOptions

object

Configuration options for Bucket#getLabels().

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

GetLabelsResponse

array

Property

Parameter

0

object

Object of labels currently set on this bucket.

GetNotificationOptions

object

Configuration options for Bucket#getNotification().

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

GetNotificationsCallback

GetNotificationsCallback(err, notifications, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

notifications

Array of Notification

Array of Notification instances.

apiResponse

object

The full API response.

GetNotificationsResponse

array

Properties

Parameter

0

Array of Notification

Array of Notification instances.

1

object

The full API response.

GetServiceAccountCallback

GetServiceAccountCallback(err, serviceAccount, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

serviceAccount

object

The serviceAccount resource.

Values in serviceAccount have the following properties:

Parameter

emailAddress

string

The service account email address.

apiResponse

object

The full API response.

GetServiceAccountResponse

array

Properties

Parameter

0

object

The service account resource.

1

object

The full API response.

GetSignedPolicyCallback

GetSignedPolicyCallback(err, policy)

Parameter

err

Error

Request error, if any.

Value may be null.

policy

object

The document policy.

GetSignedPolicyResponse

array

Property

Parameter

0

object

The document policy.

GetSignedUrlCallback

GetSignedUrlCallback(err, url)

Parameter

err

Error

Request error, if any.

Value may be null.

url

object

The signed URL.

GetSignedUrlResponse

array

Property

Parameter

0

object

The signed URL.

MakeAllFilesPublicPrivateResponse

array

Property

Parameter

0

Array of File

List of files affected.

MakeBucketPrivateCallback

MakeBucketPrivateCallback(err, files)

Parameter

err

Error

Request error, if any.

Value may be null.

files

Array of File

List of files made private.

MakeBucketPrivateOptions

object

Parameter

includeFiles

Optional

boolean

Make each file in the bucket private.

force

Optional

boolean

Queue errors occurred while making files private until all files have been processed.

userProject

Optional

string

The ID of the project which will be billed for the request.

MakeBucketPrivateResponse

array

Property

Parameter

0

Array of File

List of files made private.

MakeBucketPublicCallback

MakeBucketPublicCallback(err, files)

Parameter

err

Error

Request error, if any.

Value may be null.

files

Array of File

List of files made public.

MakeBucketPublicOptions

object

Parameter

includeFiles

Optional

boolean

Make each file in the bucket private.

force

Optional

boolean

Queue errors occurred while making files private until all files have been processed.

MakeBucketPublicResponse

array

Property

Parameter

0

Array of File

List of files made public.

MakeFilePrivateCallback

MakeFilePrivateCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

MakeFilePrivateOptions

object

Configuration options for File#makePrivate().

Properties

Parameter

strict

Optional

boolean

If true, set the file to be private to only the owner user. Otherwise, it will be private to the project.

userProject

Optional

string

The ID of the project which will be billed for the request.

MakeFilePrivateResponse

array

Property

Parameter

0

object

The full API response.

MakeFilePublicCallback

MakeFilePublicCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

MakeFilePublicResponse

array

Property

Parameter

0

object

The full API response.

MoveCallback

MoveCallback(err, destinationFile, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

destinationFile

File

The destination File.

Value may be null.

apiResponse

object

The full API response.

MoveOptions

object

Configuration options for File#move(). See an Object resource.

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

MoveResponse

array

Properties

Parameter

0

File

The destination File.

1

object

The full API response.

NotificationExistsCallback

NotificationExistsCallback(err, exists)

Parameter

err

Error

Request error, if any.

Value may be null.

exists

boolean

Whether the notification exists or not.

NotificationExistsResponse

array

Property

Parameter

0

boolean

Whether the notification exists or not.

RemoveAclCallback

RemoveAclCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

RemoveAclResponse

array

Property

Parameter

0

object

The full API response.

RotateEncryptionKeyCallback

RotateEncryptionKeyCallback()

Extends
CopyCallback

RotateEncryptionKeyResponse

Extends
CopyResponse

SaveCallback

SaveCallback(err)

Parameter

err

Error

Request error, if any.

Value may be null.

SaveOptions

object

Extends
CreateWriteStreamOptions

SetBucketMetadataCallback

SetBucketMetadataCallback(err, metadata)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

The bucket metadata.

SetBucketMetadataOptions

object

Configuration options for Bucket#setMetadata().

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

SetBucketMetadataResponse

array

Property

Parameter

apiResponse

object

The full API response.

SetBucketStorageClassCallback

SetBucketStorageClassCallback(err)

Parameter

err

Error

Request error, if any.

Value may be null.

SetBucketStorageClassOptions

object

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

SetFileMetadataCallback

SetFileMetadataCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

SetFileMetadataOptions

object

Configuration options for File#setMetadata().

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

SetFileMetadataResponse

array

Property

Parameter

0

object

The full API response.

SetLabelsCallback

SetLabelsCallback(err, metadata)

Parameter

err

Error

Request error, if any.

Value may be null.

metadata

object

The bucket metadata.

SetLabelsOptions

object

Configuration options for Bucket#setLabels().

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

SetLabelsResponse

array

Property

Parameter

0

object

The bucket metadata.

SetStorageClassCallback

SetStorageClassCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

SetStorageClassOptions

object

Configuration options for File#setStorageClass().

Property

Parameter

userProject

Optional

string

The ID of the project which will be billed for the request.

SetStorageClassResponse

array

Property

Parameter

0

object

The full API response.

StopCallback

StopCallback(err, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

apiResponse

object

The full API response.

StopResponse

array

Property

Parameter

0

object

The full API response.

StorageOptions

object

Properties

Parameter

projectId

Optional

string

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

keyFilename

Optional

string

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify the email option as well.

email

Optional

string

Account email address. Required when using a .pem or .p12 keyFilename.

credentials

Optional

object

Credentials object.

Values in credentials have the following properties:

Parameter

client_email

Optional

string

private_key

Optional

string

autoRetry

Optional

boolean

Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default.

maxRetries

Optional

number

Maximum number of automatic retries attempted before returning the error.

promise

Optional

Constructor

Custom promise module to use instead of native Promises.

UpdateAclCallback

UpdateAclCallback(err, acl, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

acl

object

The updated Acl Objects.

apiResponse

object

The full API response.

UpdateAclResponse

array

Properties

Parameter

0

object

The updated Acl Objects.

1

object

The full API response.

UploadCallback

UploadCallback(err, file, apiResponse)

Parameter

err

Error

Request error, if any.

Value may be null.

file

object

The uploaded File.

apiResponse

object

The full API response.

UploadOptions

object

Configuration options for Bucket#upload().

Parameter

options.destination

Optional

(string or File)

The place to save your file. If given a string, the file will be uploaded to the bucket using the string as a filename. When given a File object, your local file will be uploaded to the File object's bucket and under the File object's name. Lastly, when this argument is omitted, the file is uploaded to your bucket using the name of the local file.

options.encryptionKey

Optional

string

A custom encryption key. See Customer-supplied Encryption Keys.

options.gzip

Optional

boolean

Automatically gzip the file. This will set options.metadata.contentEncoding to gzip.

options.kmsKeyName

Optional

string

The name of the Cloud KMS key that will be used to encrypt the object. Must be in the format: projects/my-project/locations/location/keyRings/my-kr/cryptoKeys/my-key.

options.metadata

Optional

object

See an Objects: insert request body.

options.offset

Optional

string

The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.

options.predefinedAcl

Optional

string

Apply a predefined set of access controls to this object.

Acceptable values are:
- authenticatedRead - Object owner gets OWNER access, and
  allAuthenticatedUsers get READER access.

- bucketOwnerFullControl - Object owner gets OWNER access, and
  project team owners get OWNER access.

- bucketOwnerRead - Object owner gets OWNER access, and project
  team owners get READER access.

- private - Object owner gets OWNER access.

- projectPrivate - Object owner gets OWNER access, and project
  team members get access according to their roles.

- publicRead - Object owner gets OWNER access, and allUsers

get READER access.

options.private

Optional

boolean

Make the uploaded file private. (Alias for options.predefinedAcl = 'private')

options.public

Optional

boolean

Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')

options.resumable

Optional

boolean

Force a resumable upload. (default: true for files larger than 5 MB).

options.uri

Optional

string

The URI for an already-created resumable upload. See File#createResumableUpload.

options.userProject

Optional

string

The ID of the project which will be billed for the request.

options.validation

Optional

(string or boolean)

Possible values: "md5", "crc32c", or false. By default, data integrity is validated with an MD5 checksum for maximum reliability. CRC32c will provide better performance with less reliability. You may also choose to skip validation completely, however this is not recommended.

UploadResponse

array

Properties

Parameter

0

object

The uploaded File.

1

object

The full API response.