Globals

Abstract types

Method

objectEntries()

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

Abstract types

AddAclCallback(err, acl, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

acl

object

 

The Acl Objects.

apiResponse

object

 

The full API response.

AddAclResponse  array

Properties

Name Type Optional Description

0

object

 

The Acl Objects.

1

object

 

The full API response.

AddLifecycleRuleOptions  object

Configuration options for Bucket#addLifecycleRule().

Property

Name Type Optional Description

append

string

Yes

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

Defaults to true.

BucketExistsCallback(err, exists)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

exists

boolean

 

Whether the Bucket exists.

BucketExistsOptions  object

Configuration options for Bucket#exists().

Parameter

Name Type Optional Description

userProject

string

Yes

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

BucketExistsResponse  array

Property

Name Type Optional Description

0

boolean

 

Whether the Bucket exists.

BucketLockCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

CombineCallback(err, newFile, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

newFile

File

 

The new File.

apiResponse

object

 

The full API response.

CombineOptions  object

Properties

Name Type Optional Description

kmsKeyName

string

Yes

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

string

Yes

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

CombineResponse  array

Properties

Name Type Optional Description

0

File

 

The new File.

1

object

 

The full API response.

CopyCallback(err, copiedFile, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can 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

Name Type Optional Description

destinationKmsKeyName

string

Yes

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

string

Yes

Retain the ACL for the new file.

predefinedAcl

string

Yes

Set the ACL for the new file.

token

string

Yes

A previously-returned rewriteToken from an unfinished rewrite request.

userProject

string

Yes

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

CopyResponse  array

Properties

Name Type Optional Description

0

File

 

The copied File.

1

object

 

The full API response.

CreateBucketCallback(err, bucket, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

bucket

Bucket

 

The new Bucket.

apiResponse

object

 

The full API response.

CreateBucketRequest  object

Metadata to set for the bucket.

Properties

Name Type Optional Description

coldline

boolean

Yes

Specify the storage class as Coldline.

Defaults to false.

dra

boolean

Yes

Specify the storage class as Durable Reduced Availability.

Defaults to false.

multiRegional

boolean

Yes

Specify the storage class as Multi-Regional.

Defaults to false.

nearline

boolean

Yes

Specify the storage class as Nearline.

Defaults to false.

regional

boolean

Yes

Specify the storage class as Regional.

Defaults to false.

requesterPays

boolean

Yes

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.

Defaults to false.

userProject

string

Yes

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

CreateBucketResponse  array

Properties

Name Type Optional Description

0

Bucket

 

The new Bucket.

1

object

 

The full API response.

CreateChannelCallback(err, channel, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

channel

Channel

 

The new Channel.

apiResponse

object

 

The full API response.

CreateChannelConfig  object

See a Objects: watchAll request body.

Property

Name Type Optional Description

address

string

 

The address where notifications are delivered for this channel.

Extends
WatchAllOptions

CreateChannelOptions  object

Property

Name Type Optional Description

userProject

string

Yes

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

CreateChannelResponse  array

Properties

Name Type Optional Description

0

Channel

 

The new Channel.

1

object

 

The full API response.

CreateNotificationCallback(err, notification, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

notification

Notification

 

The new Notification.

apiResponse

object

 

The full API response.

CreateNotificationOptions  object

Metadata to set for the Notification.

Properties

Name Type Optional Description

customAttributes

object

Yes

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

eventTypes

Array of string

Yes

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

objectNamePrefix

string

Yes

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

payloadFormat

string

Yes

The desired content of the Payload. Defaults to JSON_API_V1.

Acceptable values are:
- `JSON_API_V1`
  • NONE

userProject

string

Yes

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

CreateNotificationResponse  array

Properties

Name Type Optional Description

0

Notification

 

The new Notification.

1

object

 

The full API response.

CreateReadStreamOptions  object

Configuration options for File#createReadStream.

Properties

Name Type Optional Description

userProject

string

Yes

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

validation

(string or boolean)

Yes

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

number

Yes

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

number

Yes

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(err, uri)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

uri

string

 

The resumable upload's unique session URI.

CreateResumableUploadOptions  object

Properties

Name Type Optional Description

metadata

object

Yes

Metadata to set on the file.

origin

string

Yes

Origin header to set for the upload.

predefinedAcl

string

Yes

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

boolean

Yes

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

public

boolean

Yes

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

userProject

string

Yes

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

CreateResumableUploadResponse  array

Property

Name Type Optional Description

0

string

 

The resumable upload's unique session URI.

CreateWriteStreamOptions  object

Configuration options for File#createWriteStream().

Properties

Name Type Optional Description

contentType

string

Yes

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

gzip

(string or boolean)

Yes

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

object

Yes

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

offset

number

Yes

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

predefinedAcl

string

Yes

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

boolean

Yes

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

public

boolean

Yes

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

resumable

boolean

Yes

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

string

Yes

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

userProject

string

Yes

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

validation

(string or boolean)

Yes

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(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

DeleteBucketOptions  object

Configuration options.

Parameter

Name Type Optional Description

userProject

string

Yes

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

DeleteBucketResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

DeleteFileCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

DeleteFileResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

DeleteFilesCallback(err[, apiResponse])

Parameters

Name Type Optional Description

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

object

Yes

The full API response.

DeleteFilesOptions  object

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

Property

Name Type Optional Description

force

boolean

Yes

Suppress errors until all files have been processed.

DeleteLabelsCallback(err, metadata)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

metadata

object

 

Bucket's metadata.

DeleteLabelsResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

DeleteNotificationResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

DisableRequesterPaysCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

DisableRequesterPaysResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

DownloadCallback(err, contents)

Parameters

Name Type Optional Description

err

 

 

Request error, if any.

contents

 

 

The contents of a File.

DownloadResponse  array

Property

Name Type Optional Description

0

 

Yes

The contents of a File.

EnableRequesterPaysCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

EnableRequesterPaysResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

FileExistsCallback(err, exists)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

exists

boolean

 

Whether the File exists.

FileExistsResponse  array

Property

Name Type Optional Description

0

boolean

 

Whether the File exists.

FileOptions  object

Options passed to the File constructor.

Properties

Name Type Optional Description

encryptionKey

string

Yes

A custom encryption key.

generation

number

Yes

Generation to scope the file to.

kmsKeyName

string

Yes

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

string

Yes

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

GetAclCallback(err, acl, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

acl

(object or Array of object)

 

Single or array of Acl Objects.

apiResponse

object

 

The full API response.

GetAclResponse  array

Properties

Name Type Optional Description

0

(object or Array of object)

 

Single or array of Acl Objects.

1

object

 

The full API response.

GetBucketCallback(err, bucket, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

bucket

Bucket

 

The Bucket.

apiResponse

object

 

The full API response.

GetBucketMetadataCallback(err, metadata, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

metadata

object

 

The bucket metadata.

apiResponse

object

 

The full API response.

GetBucketMetadataOptions  object

Configuration options for Bucket#getMetadata().

Property

Name Type Optional Description

userProject

string

Yes

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

GetBucketMetadataResponse  array

Properties

Name Type Optional Description

0

object

 

The bucket metadata.

1

object

 

The full API response.

GetBucketOptions  object

Configuration options for Bucket#get()

Properties

Name Type Optional Description

autoCreate

boolean

Yes

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

userProject

string

Yes

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

GetBucketResponse  array

Properties

Name Type Optional Description

0

Bucket

 

The Bucket.

1

object

 

The full API response.

GetBucketsCallback(err, buckets)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

buckets

Array of Bucket

 

Array of Bucket instances.

GetBucketsRequest  object

Query object for listing buckets.

Properties

Name Type Optional Description

autoPaginate

boolean

Yes

Have pagination handled automatically.

Defaults to true.

maxApiCalls

number

Yes

Maximum number of API calls to make.

maxResults

number

Yes

Maximum number of items plus prefixes to return.

pageToken

string

Yes

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

userProject

string

Yes

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

GetBucketsResponse  array

Property

Name Type Optional Description

0

Array of Bucket

 

Array of Bucket instances.

GetExpirationDateCallback(err, expirationDate)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

expirationDate

date

 

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

GetExpirationDateResponse  array

Property

Name Type Optional Description

0

date

 

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

GetFileCallback(err, file, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

file

File

 

The File.

apiResponse

object

 

The full API response.

GetFileMetadataCallback(err, metadata, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

metadata

object

 

The File metadata.

apiResponse

object

 

The full API response.

GetFileMetadataResponse  array

Properties

Name Type Optional Description

0

object

 

The File metadata.

1

object

 

The full API response.

GetFileResponse  array

Properties

Name Type Optional Description

0

File

 

The File.

1

object

 

The full API response.

GetFilesCallback(err, files)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

files

Array of File

 

Array of File instances.

GetFilesOptions  object

Query object for listing files.

Properties

Name Type Optional Description

autoPaginate

boolean

Yes

Have pagination handled automatically.

Defaults to true.

delimiter

string

Yes

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

string

Yes

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

prefix

string

Yes

Filter results to objects whose names begin with this prefix.

maxApiCalls

number

Yes

Maximum number of API calls to make.

maxResults

number

Yes

Maximum number of items plus prefixes to return.

pageToken

string

Yes

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

userProject

string

Yes

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

versions

boolean

Yes

If true, returns File objects scoped to their versions.

GetFilesResponse  array

Property

Name Type Optional Description

0

Array of File

 

Array of File instances.

GetLabelsCallback(err, labels)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

labels

object

 

Object of labels currently set on this bucket.

GetLabelsOptions  object

Configuration options for Bucket#getLabels().

Parameter

Name Type Optional Description

userProject

string

Yes

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

GetLabelsResponse  array

Property

Name Type Optional Description

0

object

 

Object of labels currently set on this bucket.

GetNotificationOptions  object

Configuration options for Bucket#getNotification().

Property

Name Type Optional Description

userProject

string

Yes

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

GetNotificationsCallback(err, notifications, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

notifications

Array of Notification

 

Array of Notification instances.

apiResponse

object

 

The full API response.

GetNotificationsResponse  array

Properties

Name Type Optional Description

0

Array of Notification

 

Array of Notification instances.

1

object

 

The full API response.

GetServiceAccountCallback(err, serviceAccount, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

serviceAccount

object

 

The serviceAccount resource.

Values in serviceAccount have the following properties:

Name Type Optional Description

emailAddress

string

 

The service account email address.

apiResponse

object

 

The full API response.

GetServiceAccountResponse  array

Properties

Name Type Optional Description

0

object

 

The service account resource.

1

object

 

The full API response.

GetSignedPolicyCallback(err, policy)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

policy

object

 

The document policy.

GetSignedPolicyResponse  array

Property

Name Type Optional Description

0

object

 

The document policy.

GetSignedUrlCallback(err, url)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

url

object

 

The signed URL.

GetSignedUrlResponse  array

Property

Name Type Optional Description

0

object

 

The signed URL.

IsPublicCallback(err, resp)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

resp

boolean

 

Whether file is public or not.

IsPublicResponse  array

Property

Name Type Optional Description

0

boolean

 

Whether file is public or not.

MakeAllFilesPublicPrivateResponse  array

Property

Name Type Optional Description

0

Array of File

 

List of files affected.

MakeBucketPrivateCallback(err, files)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

files

Array of File

 

List of files made private.

MakeBucketPrivateOptions  object

Parameters

Name Type Optional Description

includeFiles

boolean

Yes

Make each file in the bucket private.

Defaults to false.

force

boolean

Yes

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

userProject

string

Yes

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

MakeBucketPrivateResponse  array

Property

Name Type Optional Description

0

Array of File

 

List of files made private.

MakeBucketPublicCallback(err, files)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

files

Array of File

 

List of files made public.

MakeBucketPublicOptions  object

Parameters

Name Type Optional Description

includeFiles

boolean

Yes

Make each file in the bucket private.

Defaults to false.

force

boolean

Yes

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

MakeBucketPublicResponse  array

Property

Name Type Optional Description

0

Array of File

 

List of files made public.

MakeFilePrivateCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

MakeFilePrivateOptions  object

Configuration options for File#makePrivate().

Properties

Name Type Optional Description

strict

boolean

Yes

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

userProject

string

Yes

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

MakeFilePrivateResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

MakeFilePublicCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

MakeFilePublicResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

MoveCallback(err, destinationFile, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

destinationFile

File

 

The destination File.

Value can be null.

apiResponse

object

 

The full API response.

MoveOptions  object

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

Parameter

Name Type Optional Description

userProject

string

Yes

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

MoveResponse  array

Properties

Name Type Optional Description

0

File

 

The destination File.

1

object

 

The full API response.

NotificationExistsCallback(err, exists)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

exists

boolean

 

Whether the notification exists or not.

NotificationExistsResponse  array

Property

Name Type Optional Description

0

boolean

 

Whether the notification exists or not.

RemoveAclCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

RemoveAclResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

RotateEncryptionKeyCallback()

Extends
CopyCallback

RotateEncryptionKeyResponse

Extends
CopyResponse

SaveCallback(err)

Parameter

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

SaveOptions  object

Extends
CreateWriteStreamOptions

SetBucketMetadataCallback(err, metadata)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

metadata

object

 

The bucket metadata.

SetBucketMetadataOptions  object

Configuration options for Bucket#setMetadata().

Property

Name Type Optional Description

userProject

string

Yes

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

SetBucketMetadataResponse  array

Property

Name Type Optional Description

apiResponse

object

 

The full API response.

SetBucketStorageClassCallback(err)

Parameter

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

SetBucketStorageClassOptions  object

Parameter

Name Type Optional Description

userProject

string

Yes

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

SetFileMetadataCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

SetFileMetadataOptions  object

Configuration options for File#setMetadata().

Parameter

Name Type Optional Description

userProject

string

Yes

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

SetFileMetadataResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

SetLabelsCallback(err, metadata)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

metadata

object

 

The bucket metadata.

SetLabelsOptions  object

Configuration options for Bucket#setLabels().

Property

Name Type Optional Description

userProject

string

Yes

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

SetLabelsResponse  array

Property

Name Type Optional Description

0

object

 

The bucket metadata.

SetStorageClassCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

SetStorageClassOptions  object

Configuration options for File#setStorageClass().

Property

Name Type Optional Description

userProject

string

Yes

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

SetStorageClassResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

StopCallback(err, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

apiResponse

object

 

The full API response.

StopResponse  array

Property

Name Type Optional Description

0

object

 

The full API response.

StorageOptions  object

Properties

Name Type Optional Description

projectId

string

Yes

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

string

Yes

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

string

Yes

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

credentials

object

Yes

Credentials object.

Values in credentials have the following properties:

Name Type Optional Description

client_email

string

Yes

private_key

string

Yes

autoRetry

boolean

Yes

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

Defaults to true.

maxRetries

number

Yes

Maximum number of automatic retries attempted before returning the error.

Defaults to 3.

promise

Constructor

Yes

Custom promise module to use instead of native Promises.

UpdateAclCallback(err, acl, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

acl

object

 

The updated Acl Objects.

apiResponse

object

 

The full API response.

UpdateAclResponse  array

Properties

Name Type Optional Description

0

object

 

The updated Acl Objects.

1

object

 

The full API response.

UploadCallback(err, file, apiResponse)

Parameters

Name Type Optional Description

err

Error

 

Request error, if any.

Value can be null.

file

object

 

The uploaded File.

apiResponse

object

 

The full API response.

UploadOptions  object

Configuration options for Bucket#upload().

Parameters

Name Type Optional Description

options.destination

(string or File)

Yes

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

string

Yes

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

options.gzip

boolean

Yes

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

options.kmsKeyName

string

Yes

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

object

Yes

See an Objects: insert request body.

options.offset

string

Yes

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

options.predefinedAcl

string

Yes

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

boolean

Yes

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

options.public

boolean

Yes

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

options.resumable

boolean

Yes

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

options.uri

string

Yes

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

options.userProject

string

Yes

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

options.validation

(string or boolean)

Yes

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

Name Type Optional Description

0

object

 

The uploaded File.

1

object

 

The full API response.