Global - Documentation (original) (raw)

Members

(constant) AUTO_RETRY_DEFAULT :boolean

Default behavior: Automatically retry retriable server errors.

(constant) CRC32C_EXTENSIONS

(constant) DEFAULT_PARALLEL_CHUNKED_DOWNLOAD_LIMIT

Default number of concurrently executing promises to use when calling downloadFileInChunks.

(constant) DEFAULT_PARALLEL_CHUNKED_UPLOAD_LIMIT

Default number of concurrently executing promises to use when calling uploadFileInChunks.

(constant) DEFAULT_PARALLEL_DOWNLOAD_LIMIT

Default number of concurrently executing promises to use when calling downloadManyFiles.

(constant) DEFAULT_PARALLEL_UPLOAD_LIMIT

Default number of concurrently executing promises to use when calling uploadManyFiles.

(constant) DOWNLOAD_IN_CHUNKS_DEFAULT_CHUNK_SIZE

The chunk size in bytes to use when calling downloadFileInChunks.

(constant) DOWNLOAD_IN_CHUNKS_FILE_SIZE_THRESHOLD

The minimum size threshold in bytes at which to apply a chunked download strategy when calling downloadFileInChunks.

(constant) GCCL_GCS_CMD_FEATURE

The gccl-gcs-cmd value for the X-Goog-API-Client header. Example: gccl-gcs-cmd/tm.upload_many

See:

GCCL_GCS_CMD_KEY

A unique symbol for providing a gccl-gcs-cmd value for the X-Goog-API-Client header.

E.g. the V in X-Goog-API-Client: gccl-gcs-cmd/V

(constant) MAX_RETRY_DEFAULT :number

Default behavior: Only attempt to retry retriable errors 3 times.

(constant) MAX_RETRY_DELAY_DEFAULT :number

Default behavior: Wait no more than 64 seconds between retries.

(constant) PATH_STYLED_HOST :string

(constant) RETRYABLE_ERR_FN_DEFAULT

Returns true if the API request should be retried, given the error that was given the first time the request was attempted.

(constant) RETRY_DELAY_MULTIPLIER_DEFAULT :number

Default behavior: Wait twice as long as previous retry before retrying.

STORAGE_POST_POLICY_BASE_URL

(constant) TOTAL_TIMEOUT_DEFAULT :number

Default behavior: If the operation doesn't succeed after 600 seconds, stop retrying.

(constant) UPLOAD_IN_CHUNKS_DEFAULT_CHUNK_SIZE

The chunk size in bytes to use when calling uploadFileInChunks.

Methods

checkUploadStatus(cfg)

Check the status of an existing resumable upload.

Parameters:
Name Type Description
cfg A configuration to use. uri is required.
Returns:
Type Description
the current upload status

convertObjKeysToSnakeCase(obj) → {object}

Converts the given objects keys to snake_case

Parameters:
Name Type Description
obj object object to convert keys to snake case.
Returns:
Type Description
object object with keys converted to snake case.

encodeURI(uri, booleanopt) → {string}

URI encode uri for generating signed URLs, using fixedEncodeURIComponent.

Encode every byte except A-Z a-Z 0-9 ~ - . _.

Parameters:
Name Type Attributes Default Description
uri string The URI to encode.
boolean false encodeSlash If true, the "/" character is not encoded.
Returns:
Type Description
string The encoded string.

fixedEncodeURIComponent(str) → {string}

Parameters:
Name Type Description
str string The URI component to encode.
Returns:
Type Description
string The encoded string.

formatAsUTCISO(dateTimeToFormat, includeTime, dateDelimiter, timeDelimiter) → {string}

Formats the provided date object as a UTC ISO string.

Parameters:
Name Type Default Description
dateTimeToFormat Date date object to be formatted.
includeTime boolean false flag to include hours, minutes, seconds in output.
dateDelimiter string delimiter between date components.
timeDelimiter string delimiter between time components.
Returns:
Type Description
string UTC ISO format of provided date obect.

getRuntimeTrackingString() → {string}

Examines the runtime environment and returns the appropriate tracking string.

Returns:
Type Description
string metrics tracking string based on the current runtime environment.

getUserAgentString() → {string}

Looks at package.json and creates the user-agent string to be applied to request headers.

Returns:
Type Description
string user agent string.

objectEntries()

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

qsStringify(url) → {string}

Serialize an object to a URL query string using util.encodeURI(uri, true).

Parameters:
Name Type Description
url string The object to serialize.
Returns:
Type Description
string Serialized string.

unicodeJSONStringify(obj) → {string}

JSON encode str, with unicode \u+ representation.

Parameters:
Name Type Description
obj object The object to encode.
Returns:
Type Description
string Serialized string.

Type Definitions

AddAclCallback(errnullable, acl, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
acl object The Acl Objects.
apiResponse object The full API response.

AddAclResponse

Properties:
Name Type Description
0 object The Acl Objects.
1 object The full API response.

AddLifecycleRuleOptions

Configuration options for Bucket#addLifecycleRule().

Properties:
Name Type Attributes Default Description
append boolean true The new rules will be appended to any pre-existing rules.

BucketExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
exists boolean Whether the Bucket exists.

BucketExistsOptions

Configuration options for Bucket#exists().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

BucketExistsResponse

Properties:
Name Type Description
0 boolean Whether the Bucket exists.

BucketLockCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

CRC32CValidator

Properties:
Type Description
Crc32cGeneratorToStringCallback
Crc32cGeneratorValidateCallback
Crc32cGeneratorUpdateCallback

CRC32CValidator

Properties:
Type Description
Crc32cGeneratorToStringCallback
Crc32cGeneratorValidateCallback
Crc32cGeneratorUpdateCallback

CRC32CValidator

Properties:
Type Description
Crc32cGeneratorToStringCallback
Crc32cGeneratorValidateCallback
Crc32cGeneratorUpdateCallback

CombineCallback(errnullable, newFile, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
newFile File The new File.
apiResponse object The full API response.

CombineOptions

Properties:
Name Type Attributes Description
kmsKeyName string Resource name of the Cloud KMS key, of the formprojects/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 The ID of the project which will be billed for the request.

CombineResponse

Properties:
Name Type Description
0 File The new File.
1 object The full API response.

CopyCallback(errnullable, copiedFile, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
copiedFile File The copied File.
apiResponse object The full API response.

CopyOptions

Configuration options for File#copy(). See anObject resource.

Properties:
Name Type Attributes Description
cacheControl string The cacheControl setting for the new file.
contentEncoding string The contentEncoding setting for the new file.
contentType string The contentType setting for the new file.
destinationKmsKeyName string Resource name of the Cloud KMS key, of the formprojects/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.
metadata Metadata Metadata to specify on the copied file.
predefinedAcl string Set the ACL for the new file.
token string A previously-returned rewriteToken from an unfinished rewrite request.
userProject string The ID of the project which will be billed for the request.

CopyResponse

Properties:
Name Type Description
0 File The copied File.
1 object The full API response.

Cors

Properties:
Name Type Attributes Description
maxAgeSeconds number The number of seconds the browser is allowed to make requests before it must repeat the preflight request.
method Array. HTTP method allowed for cross origin resource sharing with this bucket.
origin Array. an origin allowed for cross origin resource sharing with this bucket.
responseHeader Array. A header allowed for cross origin resource sharing with this bucket.

Crc32cGeneratorCallback() → {CRC32CValidator}

Returns:
Type Description
CRC32CValidator

Crc32cGeneratorCallback() → {CRC32CValidator}

Returns:
Type Description
CRC32CValidator

Crc32cGeneratorToStringCallback() → {string}

Returns:
Type Description
string

Example
Hashing the string 'data' should return 'rth90Q=='

```js
const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.toString(); // 'rth90Q=='

[ ](#Crc32cGeneratorToStringCallback) 

#### Crc32cGeneratorToStringCallback() → {string} 

##### Returns:

| Type   | Description |
| ------ | ----------- |
| string |             |

[ ](#Crc32cGeneratorToStringCallback-examples) 

##### Example

Hashing the string 'data' should return 'rth90Q=='

const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.toString(); // 'rth90Q=='

[ ](#Crc32cGeneratorToStringCallback) 

#### Crc32cGeneratorToStringCallback() → {string} 

##### Returns:

| Type   | Description |
| ------ | ----------- |
| string |             |

[ ](#Crc32cGeneratorToStringCallback-examples) 

##### Example

Hashing the string 'data' should return 'rth90Q=='

const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.toString(); // 'rth90Q=='

[ ](#Crc32cGeneratorUpdateCallback) 

#### Crc32cGeneratorUpdateCallback(dataopt) → {undefined} 

##### Parameters:

| Name | Type   | Attributes | Description                      |
| ---- | ------ | ---------- | -------------------------------- |
| data | Buffer | <optional> | data to update CRC32C value with |

##### Returns:

| Type      | Description |
| --------- | ----------- |
| undefined |             |

[ ](#Crc32cGeneratorUpdateCallback-examples) 

##### Example

Hashing buffers from 'some ' and 'text\n'

const buffer1 = Buffer.from('some ');
crc32c.update(buffer1);

const buffer2 = Buffer.from('text\n');
crc32c.update(buffer2);

crc32c.toString(); // 'DkjKuA=='

[ ](#Crc32cGeneratorUpdateCallback) 

#### Crc32cGeneratorUpdateCallback(dataopt) → {undefined} 

##### Parameters:

| Name | Type   | Attributes | Description                      |
| ---- | ------ | ---------- | -------------------------------- |
| data | Buffer | <optional> | data to update CRC32C value with |

##### Returns:

| Type      | Description |
| --------- | ----------- |
| undefined |             |

[ ](#Crc32cGeneratorUpdateCallback-examples) 

##### Example

Hashing buffers from 'some ' and 'text\n'

const buffer1 = Buffer.from('some ');
crc32c.update(buffer1);

const buffer2 = Buffer.from('text\n');
crc32c.update(buffer2);

crc32c.toString(); // 'DkjKuA=='

[ ](#Crc32cGeneratorUpdateCallback) 

#### Crc32cGeneratorUpdateCallback(dataopt) → {undefined} 

##### Parameters:

| Name | Type   | Attributes | Description                      |
| ---- | ------ | ---------- | -------------------------------- |
| data | Buffer | <optional> | data to update CRC32C value with |

##### Returns:

| Type      | Description |
| --------- | ----------- |
| undefined |             |

[ ](#Crc32cGeneratorUpdateCallback-examples) 

##### Example

Hashing buffers from 'some ' and 'text\n'

const buffer1 = Buffer.from('some ');
crc32c.update(buffer1);

const buffer2 = Buffer.from('text\n');
crc32c.update(buffer2);

crc32c.toString(); // 'DkjKuA=='

[ ](#Crc32cGeneratorValidateCallback) 

#### Crc32cGeneratorValidateCallback(valueopt) → {boolean} 

##### Parameters:

| Name  | Type   | Attributes | Description                              |
| ----- | ------ | ---------- | ---------------------------------------- |
| value | string | <optional> | base64-encoded CRC32C string to validate |

##### Returns:

| Type    | Description |
| ------- | ----------- |
| boolean |             |

[ ](#Crc32cGeneratorValidateCallback-examples) 

##### Example

Should return true if the value matches, false otherwise

const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.validate('DkjKuA=='); // false
crc32c.validate('rth90Q=='); // true

[ ](#Crc32cGeneratorValidateCallback) 

#### Crc32cGeneratorValidateCallback(valueopt) → {boolean} 

##### Parameters:

| Name  | Type   | Attributes | Description                              |
| ----- | ------ | ---------- | ---------------------------------------- |
| value | string | <optional> | base64-encoded CRC32C string to validate |

##### Returns:

| Type    | Description |
| ------- | ----------- |
| boolean |             |

[ ](#Crc32cGeneratorValidateCallback-examples) 

##### Example

Should return true if the value matches, false otherwise

const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.validate('DkjKuA=='); // false
crc32c.validate('rth90Q=='); // true

[ ](#Crc32cGeneratorValidateCallback) 

#### Crc32cGeneratorValidateCallback(valueopt) → {boolean} 

##### Parameters:

| Name  | Type   | Attributes | Description                              |
| ----- | ------ | ---------- | ---------------------------------------- |
| value | string | <optional> | base64-encoded CRC32C string to validate |

##### Returns:

| Type    | Description |
| ------- | ----------- |
| boolean |             |

[ ](#Crc32cGeneratorValidateCallback-examples) 

##### Example

Should return true if the value matches, false otherwise

const buffer = Buffer.from('data');
crc32c.update(buffer);
crc32c.validate('DkjKuA=='); // false
crc32c.validate('rth90Q=='); // true

```

CreateBucketCallback(errnullable, bucket, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
bucket Bucket The new Bucket.
apiResponse object The full API response.

CreateBucketRequest

Metadata to set for the bucket.

Properties:
Name Type Attributes Default Description
archive boolean false Specify the storage class as Archive.
autoclass.enabled object false Specify whether Autoclass is enabled for the bucket.
autoclass.terminalStorageClass object 'NEARLINE' The storage class that objects in an Autoclass bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE.
coldline boolean false Specify the storage class as Coldline.
cors Array.<Cors> [] Specify the CORS configuration to use.
customPlacementConfig CustomPlacementConfig {} Specify the bucket's regions for dual-region buckets. For more information, see Bucket Locations.
dra boolean false Specify the storage class as Durable Reduced Availability.
enableObjectRetention boolean false Specifiy whether or not object retention should be enabled on this bucket.
hierarchicalNamespace.enabled object false Specify whether or not to enable hierarchical namespace on this bucket.
location string Specify the bucket's location. If specifying a dual-region, the customPlacementConfig property should be set in conjunction. For more information, see Bucket Locations.
multiRegional boolean false Specify the storage class as Multi-Regional.
nearline boolean false Specify the storage class as Nearline.
regional boolean false Specify the storage class as Regional.
requesterPays boolean false Force the use of the User Project metadata field to assign operational costs when an operation is made on a Bucket and its objects.
rpo string For dual-region buckets, controls whether turbo replication is enabled (ASYNC_TURBO) or disabled (DEFAULT).
standard boolean true Specify the storage class as Standard.
storageClass string The new storage class. (standard,nearline, coldline, or archive).Note: The storage classes multi_regional, regional, anddurable_reduced_availability are now legacy and will be deprecated in the future.
versioning Versioning Specify the versioning status.
userProject string The ID of the project which will be billed for the request.

CreateBucketResponse

Properties:
Name Type Description
0 Bucket The new Bucket.
1 object The full API response.

CreateChannelCallback(errnullable, channel, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
channel Channel The new Channel.
apiResponse object The full API response.

CreateChannelConfig

Properties:
Name Type Attributes Default Description
address string The address where notifications are delivered for this channel.
delimiter string Returns results in a directory-like mode.
maxResults number Maximum number of items plus prefixesto return in a single page of responses.
pageToken string A previously-returned page token representing part of the larger set of results to view.
prefix string Filter results to objects whose names begin with this prefix.
projection string noAcl Set of properties to return.
userProject string The ID of the project which will be billed for the request.
versions boolean false If true, lists all versions of an object as distinct results.

CreateChannelOptions

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

CreateChannelResponse

Properties:
Name Type Description
0 Channel The new Channel.
1 object The full API response.

CreateHmacKeyCallback(errnullable, hmacKey, secret, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
hmacKey HmacKey The HmacKey instance created from API response.
secret string The HMAC key's secret used to access the XML API.
apiResponse object The raw API response.

CreateHmacKeyOptions

Properties:
Name Type Attributes Description
projectId string The project ID of the project that owns the service account of the requested HMAC key. If not provided, the project ID used to instantiate the Storage client will be used.
userProject string This parameter is currently ignored.

CreateHmacKeyResponse

Properties:
Name Type Description
0 HmacKey The HmacKey instance created from API response.
1 string The HMAC key's secret used to access the XML API.
3 object The raw API response.

CreateNotificationCallback(errnullable, notification, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
notification Notification The new Notification.
apiResponse object The full API response.

CreateNotificationOptions

Metadata to set for the Notification.

Properties:
Name Type Attributes Description
customAttributes object An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.
eventTypes Array. If present, only send notifications about listed event types. If empty, sent notifications for all event types.
objectNamePrefix string If present, only apply this notification configuration to object names that begin with this prefix.
payloadFormat string The desired content of the Payload. Defaults to JSON_API_V1. Acceptable values are: JSON_API_V1 NONE
userProject string The ID of the project which will be billed for the request.

CreateNotificationResponse

Properties:
Name Type Description
0 Notification The new Notification.
1 object The full API response.

CreateReadStreamOptions

Configuration options for File#createReadStream.

Properties:
Name Type Attributes Default Description
userProject string The ID of the project which will be billed for the request.
validation string | 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 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 number A byte offset to stop reading the file at. NOTE: Byte ranges are inclusive; that is, options.start = 0 andoptions.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.
decompress boolean true Disable auto decompression of the received data. By default this option is set to true. Applicable in cases where the data was uploaded withgzip: true option. See File#createWriteStream.

CreateResumableUploadCallback(errnullable, uri)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
uri string The resumable upload's unique session URI.

CreateResumableUploadOptions

Properties:
Name Type Attributes Description
metadata object Metadata to set on the file.
offset number The starting byte of the upload stream for resuming an interrupted upload.
origin string Origin header to set for the upload.
predefinedAcl string Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers 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 allUsersget READER access.
private boolean Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public boolean Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
userProject string The ID of the project which will be billed for the request.
chunkSize string Create a separate request per chunk. This value is in bytes and should be a multiple of 256 KiB (2^18).We recommend using at least 8 MiB for the chunk size.

CreateResumableUploadResponse

Properties:
Name Type Description
0 string The resumable upload's unique session URI.

CreateWriteStreamOptions

Configuration options for File#createWriteStream().

Properties:
Name Type Attributes Default Description
contentType string Alias foroptions.metadata.contentType. If set to auto, the file name is used to determine the contentType.
gzip string | 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 togzip if necessary.
metadata object See the examples below orObjects: insert request bodyfor more details.
offset number The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
predefinedAcl string Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers 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 allUsersget READER access.
private boolean Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public boolean Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
resumable 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.
timeout number 60000 Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000
uri string The URI for an already-created resumable upload. See File#createResumableUpload.
userProject string The ID of the project which will be billed for the request.
validation string | 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. In addition to specifying validation type, providing metadata.crc32c or metadata.md5Hash will cause the server to perform validation in addition to client validation. NOTE: Validation is automatically skipped for objects that were uploaded using the gzip option and have already compressed content.

DeleteBucketCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

DeleteBucketResponse

Properties:
Name Type Description
0 object The full API response.

DeleteFileCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

DeleteFileResponse

Properties:
Name Type Description
0 object The full API response.

DeleteFilesCallback(err, apiResponseopt)

Parameters:
Name Type Attributes Description
err Error | ?Array. Request error, if any, or array of errors from files that were not able to be deleted.
apiResponse object The full API response.

DeleteFilesOptions

Query object. See Bucket#getFilesfor all of the supported properties.

Properties:
Name Type Attributes Description
force boolean Suppress errors until all files have been processed.

DeleteHmacKeyCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

DeleteHmacKeyOptions

Properties:
Name Type Attributes Description
userProject string This parameter is currently ignored.

DeleteHmacKeyResponse

Properties:
Name Type Description
0 object The full API response.

DeleteLabelsCallback(errnullable, metadata)

Deprecated: true

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata object Bucket's metadata.

DeleteLabelsResponse

Properties:
Name Type Description
0 object The full API response.

DeleteNotificationResponse

Properties:
Name Type Description
0 object The full API response.

DisableRequesterPaysCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

DisableRequesterPaysResponse

Properties:
Name Type Description
0 object The full API response.

DownloadCallback(err, contents)

Parameters:
Name Type Description
err Request error, if any.
contents The contents of a File.

DownloadFileInChunksOptions

Properties:
Name Type Attributes Description
concurrencyLimit number The number of concurrently executing promises to use when downloading the file.
chunkSizeBytes number The size in bytes of each chunk to be downloaded.
validation string | boolean Whether or not to perform a CRC32C validation check when download is complete.
noReturnData boolean Whether or not to return the downloaded data. A true value here would be useful for files with a size that will not fit into memory.

DownloadManyFilesOptions

Properties:
Name Type Attributes Description
concurrencyLimit number The number of concurrently executing promises to use when downloading the files.
prefix string A prefix to append to all of the downloaded files.
stripPrefix string A prefix to remove from all of the downloaded files.
passthroughOptions object DownloadOptions Options to be passed through to each individual download operation.
skipIfExists boolean Do not download the file if it already exists in the destination.

DownloadResponse

Properties:
Name Type Attributes Description
0 The contents of a File.

EnableLoggingOptions

Configuration object for enabling logging.

Properties:
Name Type Attributes Description
bucket string | Bucket The bucket for the log entries. By default, the current bucket is used.
prefix string A unique prefix for log object names.

EnableRequesterPaysCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

EnableRequesterPaysResponse

Properties:
Name Type Description
0 object The full API response.

Expr

Properties:
Name Type Attributes Description
title string An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
description string An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
expression string Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.The condition that is associated with this binding.

See:

FileExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
exists boolean Whether the File exists.

FileExistsResponse

Properties:
Name Type Description
0 boolean Whether the File exists.

FileOptions

Options passed to the File constructor.

Properties:
Name Type Attributes Description
encryptionKey string A custom encryption key.
generation number Generation to scope the file to.
kmsKeyName 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 string The ID of the project which will be billed for all requests made from File object.
callback Crc32cGeneratorCallback A function that generates a CRC32C Validator. Defaults to CRC32C

GenerateSignedPostPolicyV2Callback(errnullable, policy)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
policy object The document policy.

GenerateSignedPostPolicyV2Response

Properties:
Name Type Description
0 object The document policy.

GenerateSignedPostPolicyV4Callback(errnullable, output)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
output SignedPostPolicyV4Output An object containing the request URL and form fields.

GenerateSignedPostPolicyV4Response

Properties:
Name Type Description
0 SignedPostPolicyV4Output An object containing the request URL and form fields.

GetAclCallback(errnullable, acl, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
acl object | Array. Single or array of Acl Objects.
apiResponse object The full API response.

GetAclResponse

Properties:
Name Type Description
0 object | Array. Single or array of Acl Objects.
1 object The full API response.

GetBucketCallback(errnullable, bucket, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
bucket Bucket The Bucket.
apiResponse object The full API response.

GetBucketMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata object The bucket metadata.
apiResponse object The full API response.

GetBucketMetadataOptions

Configuration options for Bucket#getMetadata().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

GetBucketMetadataResponse

Properties:
Name Type Description
0 object The bucket metadata.
1 object The full API response.

GetBucketOptions

Configuration options for Bucket#get()

Properties:
Name Type Attributes Description
autoCreate boolean Automatically create the object if it does not exist. Default: false
userProject string The ID of the project which will be billed for the request.

GetBucketResponse

Properties:
Name Type Description
0 Bucket The Bucket.
1 object The full API response.

GetBucketSignedUrlConfig

Properties:
Name Type Attributes Default Description
action string Only listing objects within a bucket (HTTP: GET) is supported for bucket-level signed URLs.
expires * A timestamp when this link will expire. Any value given is passed to new Date(). Note: 'v4' supports maximum duration of 7 days (604800 seconds) from now.
version string 'v2' The signing version to use, either 'v2' or 'v4'.
virtualHostedStyle boolean false Use virtual hosted-style URLs ('https://mybucket.storage.googleapis.com/...') instead of path-style ('https://storage.googleapis.com/mybucket/...'). Virtual hosted-style URLs should generally be preferred instaed of path-style URL. Currently defaults to false for path-style, although this may change in a future major-version release.
cname string The cname for this bucket, i.e., "https://cdn.example.com". See reference
extensionHeaders object If these headers are used, the server will check to make sure that the client provides matching values. See Canonical extension headersfor the requirements of this feature, most notably: The header name must be prefixed with x-goog- The header name must be all lowercase Note: Multi-valued header passed as an array in the extensionHeaders object is converted into a string, delimited by , with no space. Requests made using the signed URL will need to delimit multi-valued headers using a single , as well, or else the server will report a mismatched signature.
queryParams object Additional query parameters to include in the signed URL.

GetBucketsCallback(errnullable, buckets, nextQuery, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
buckets Array.<Bucket> Array of Bucket instances.
nextQuery object A query object to receive more results.
apiResponse object The full API response.

GetBucketsRequest

Query object for listing buckets.

Properties:
Name Type Attributes Default Description
autoPaginate boolean true Have pagination handled automatically.
maxApiCalls number Maximum number of API calls to make.
maxResults number Maximum number of items plus prefixes to return per call. Note: By default will handle pagination automatically if more than 1 page worth of results are requested per call. When autoPaginate is set to false the smaller of maxResultsor 1 page of results will be returned per call.
pageToken string A previously-returned page token representing part of the larger set of results to view.
userProject string The ID of the project which will be billed for the request.

GetBucketsResponse

Properties:
Name Type Description
0 Array.<Bucket> Array of Bucket instances.
1 object nextQuery A query object to receive more results.
2 object The full API response.

GetExpirationDateCallback(errnullable, expirationDate)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
expirationDate date A Date object representing the earliest time this file's retention policy will expire.

GetExpirationDateResponse

Properties:
Name Type Description
0 date A Date object representing the earliest time this file's retention policy will expire.

GetFileCallback(errnullable, file, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
file File The File.
apiResponse object The full API response.

GetFileMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata object The File metadata.
apiResponse object The full API response.

GetFileMetadataResponse

Properties:
Name Type Description
0 object The File metadata.
1 object The full API response.

GetFileResponse

Properties:
Name Type Description
0 File The File.
1 object The full API response.

GetFilesCallback(errnullable, files, nextQuery, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
files Array.<File> Array of File instances.
nextQuery object A query object to receive more results.
apiResponse object The full API response.

GetFilesOptions

Query object for listing files.

Properties:
Name Type Attributes Default Description
autoPaginate boolean true Have pagination handled automatically.
delimiter 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.
endOffset string Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).
includeFoldersAsPrefixes boolean If true, includes folders and managed folders in the set of prefixes returned by the query. Only applicable if delimiter is set to / and autoPaginate is set to false. See: https://cloud.google.com/storage/docs/managed-folders
includeTrailingDelimiter boolean If true, objects that end in exactly one instance of delimiter have their metadata included in items[] in addition to the relevant part of the object name appearing in prefixes[].
prefix string Filter results to objects whose names begin with this prefix.
matchGlob string A glob pattern used to filter results, for example foo*bar
maxApiCalls number Maximum number of API calls to make.
maxResults number Maximum number of items plus prefixes to return per call. Note: By default will handle pagination automatically if more than 1 page worth of results are requested per call. When autoPaginate is set to false the smaller of maxResultsor 1 page of results will be returned per call.
pageToken string A previously-returned page token representing part of the larger set of results to view.
softDeleted boolean If true, only soft-deleted object versions will be listed as distinct results in order of generation number. Note soft_deleted andversions cannot be set to true simultaneously.
startOffset string Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).
userProject string The ID of the project which will be billed for the request.
versions boolean If true, returns File objects scoped to their versions.

GetFilesResponse

Properties:
Name Type Description
0 Array.<File> Array of File instances.

GetHmacKeyCallback(errnullable, hmacKey, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
hmacKey HmacKey this HmacKey instance.
apiResponse object The full API response.

GetHmacKeyMetadataOptions

Properties:
Name Type Attributes Description
userProject string This parameter is currently ignored.

GetHmacKeyOptions

Properties:
Name Type Attributes Description
userProject string This parameter is currently ignored.

GetHmacKeyResponse

Properties:
Name Type Description
0 HmacKey This HmacKey instance.
1 object The full API response.

GetLabelsCallback(errnullable, labels)

Deprecated: true

Parameters:
Name Type Attributes Description
err Error Request error, if any.
labels object Object of labels currently set on this bucket.

GetLabelsOptions

Configuration options for Bucket#getLabels().

GetLabelsResponse

Properties:
Name Type Description
0 object Object of labels currently set on this bucket.

GetNotificationsCallback(errnullable, notifications, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
notifications Array.<Notification> Array of Notificationinstances.
apiResponse object The full API response.

GetNotificationsOptions

Configuration options for Bucket#getNotification().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

GetNotificationsResponse

Properties:
Name Type Description
0 Array.<Notification> Array of Notification instances.
1 object The full API response.

GetPolicyOptions

Requested options for IAM#getPolicy().

Properties:
Name Type Attributes Description
requestedPolicyVersion number The version of IAM policies to request. If a policy with a condition is requested without setting this, the server will return an error. This must be set to a value of 3 to retrieve IAM policies containing conditions. This is to prevent client code that isn't aware of IAM conditions from interpreting and modifying policies incorrectly. The service might return a policy with version lower than the one that was requested, based on the feature syntax in the policy fetched. See IAM Policy versions
userProject string The ID of the project which will be billed for the request.

GetPolicyResponse

Properties:
Name Type Description
0 Policy The policy.
1 object The full API response.

GetServiceAccountCallback(errnullable, serviceAccount, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
serviceAccount object The serviceAccount resource. Properties Name Type Description emailAddress string The service account email address.
apiResponse object The fullAPI response.

GetServiceAccountResponse

Properties:
Name Type Description
0 object The service account resource.
1 object The fullAPI response.

GetSignedUrlCallback(errnullable, url)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
url object The signed URL.

GetSignedUrlCallback(errnullable, url)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
url object The signed URL.

GetSignedUrlResponse

Properties:
Name Type Description
0 object The signed URL.

GetSignedUrlResponse

Properties:
Name Type Description
0 object The signed URL.

HmacKeyMetadata

Properties:
Name Type Attributes Description
accessId string The access id identifies which HMAC key was used to sign a request when authenticating with HMAC.
etag string Used to perform a read-modify-write of the key.
id string The resource name of the HMAC key.
projectId string The project ID.
serviceAccountEmail string The service account's email this HMAC key is created for.
state string The state of this HMAC key. One of "ACTIVE", "INACTIVE" or "DELETED".
timeCreated string The creation time of the HMAC key in RFC 3339 format.
updated string The time this HMAC key was last updated in RFC 3339 format.

HmacKeyMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata HmacKeyMetadata The updated HmacKeyMetadata object.
apiResponse object The full API response.

HmacKeyMetadataResponse

Properties:
Name Type Description
0 HmacKeyMetadata The updated HmacKeyMetadata object.
1 object The full API response.

HmacKeyOptions

Properties:
Name Type Attributes Description
projectId string The project ID of the project that owns the service account of the requested HMAC key. If not provided, the project ID used to instantiate the Storage client will be used.

IsPublicCallback(errnullable, resp)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
resp boolean Whether file is public or not.

IsPublicResponse

Properties:
Name Type Description
0 boolean Whether file is public or not.

LifecycleRule

The new lifecycle rule to be added to objects in this bucket.

Properties:
Name Type Attributes Description
action string | object The action to be taken upon matching of all the conditions 'delete', 'setStorageClass', or 'AbortIncompleteMultipartUpload'.Note: For configuring a raw-formatted rule object to be passed as actionplease refer to the examples.
condition object Condition a bucket must meet before the action occurs on the bucket. Refer to following supported conditions.
storageClass string When using the setStorageClassaction, provide this option to dictate which storage class the object should update to. Please seeSetStorageClass option documentation for supported transitions.

MakeAllFilesPublicPrivateResponse

Properties:
Name Type Description
0 Array.<File> List of files affected.

MakeBucketPrivateCallback(errnullable, files)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
files Array.<File> List of files made private.

MakeBucketPrivateOptions

Properties:
Name Type Attributes Default Description
includeFiles boolean false Make each file in the bucket private.
metadata Metadata Define custom metadata properties to define along with the operation.
force boolean Queue errors occurred while making files private until all files have been processed.
userProject string The ID of the project which will be billed for the request.

MakeBucketPrivateResponse

Properties:
Name Type Description
0 Array.<File> List of files made private.

MakeBucketPublicCallback(errnullable, files)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
files Array.<File> List of files made public.

MakeBucketPublicOptions

Properties:
Name Type Attributes Default Description
includeFiles boolean false Make each file in the bucket private.
force boolean Queue errors occurred while making files private until all files have been processed.

MakeBucketPublicResponse

Properties:
Name Type Description
0 Array.<File> List of files made public.

MakeFilePrivateCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

MakeFilePrivateOptions

Configuration options for File#makePrivate().

Properties:
Name Type Attributes Description
metadata Metadata Define custom metadata properties to define along with the operation.
strict boolean If true, set the file to be private to only the owner user. Otherwise, it will be private to the project.
userProject string The ID of the project which will be billed for the request.

MakeFilePrivateResponse

Properties:
Name Type Description
0 object The full API response.

MakeFilePublicCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

MakeFilePublicResponse

Properties:
Name Type Description
0 object The full API response.

MoveCallback(errnullable, destinationFilenullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
destinationFile File The destination File.
apiResponse object The full API response.

MoveFileAtomicCallback(errnullable, movedFile, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
movedFile File The moved File.
apiResponse object The full API response.

MoveFileAtomicOptions

Configuration options for File#moveFileAtomic(). See anObject resource.

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.
preconditionOpts object Precondition options. Properties Name Type Attributes Description ifGenerationMatch number Makes the operation conditional on whether the object's current generation matches the given value.

MoveFileAtomicResponse

Properties:
Name Type Description
0 File The moved File.
1 object The full API response.

MoveOptions

Configuration options for File#move(). See anObject resource.

MoveResponse

Properties:
Name Type Description
0 File The destination File.
1 object The full API response.

NotificationExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
exists boolean Whether the notification exists or not.

NotificationExistsResponse

Properties:
Name Type Description
0 boolean Whether the notification exists or not.

Policy

Properties:
Name Type Attributes Description
policy.bindings Array.<PolicyBinding> Bindings associate members with roles.
policy.etag string Etags are used to perform a read-modify-write.
policy.version number The syntax schema version of the Policy. To set an IAM policy with conditional binding, this field must be set to 3 or greater. See IAM Policy versions

PolicyBinding

Properties:
Name Type Attributes Description
role string Role that is assigned to members.
members Array. Specifies the identities requesting access for the bucket.
condition Expr The condition that is associated with this binding.

RemoveAclCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

RemoveAclResponse

Properties:
Name Type Description
0 object The full API response.

RenameCallback(errnullable, destinationFilenullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
destinationFile File The destination File.
apiResponse object The full API response.

RenameOptions

Configuration options for File#move(). See anObject resource.

RenameResponse

Properties:
Name Type Description
0 File The destination File.
1 object The full API response.

RestoreOptions

RestoreOptions

RotateEncryptionKeyCallback()

RotateEncryptionKeyResponse

SaveCallback(errnullable)

Parameters:
Name Type Attributes Description
err Error Request error, if any.

SaveOptions

SetBucketMetadataCallback(errnullable, metadata)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata object The bucket metadata.

SetBucketMetadataOptions

Configuration options for Bucket#setMetadata().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

SetBucketMetadataResponse

Properties:
Name Type Description
apiResponse object The full API response.

SetBucketStorageClassCallback(errnullable)

Parameters:
Name Type Attributes Description
err Error Request error, if any.

SetBucketStorageClassOptions

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

SetFileMetadataCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

SetFileMetadataOptions

Configuration options for File#setMetadata().

SetFileMetadataResponse

Properties:
Name Type Description
0 object The full API response.

SetHmacKeyMetadata

Properties:
Name Type Attributes Description
state string New state of the HmacKey. Either 'ACTIVE' or 'INACTIVE'.
etag string Include an etag from a previous get HMAC key request to perform safe read-modify-write.

SetHmacKeyMetadataOptions

Properties:
Name Type Attributes Description
userProject string This parameter is currently ignored.

SetLabelsCallback(errnullable, metadata)

Deprecated: true

Parameters:
Name Type Attributes Description
err Error Request error, if any.
metadata object The bucket metadata.

SetLabelsOptions

Configuration options for Bucket#setLabels().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

SetLabelsResponse

Properties:
Name Type Description
0 object The bucket metadata.

SetStorageClassCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

SetStorageClassOptions

Configuration options for File#setStorageClass().

Properties:
Name Type Attributes Description
userProject string The ID of the project which will be billed for the request.

SetStorageClassResponse

Properties:
Name Type Description
0 object The full API response.

SignedPostPolicyV4Output

Properties:
Name Type Description
url string The request URL.
fields object The form fields to include in the POST request.

StopCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
apiResponse object The full API response.

StopResponse

Properties:
Name Type Description
0 object The full API response.

StorageOptions

Properties:
Name Type Attributes Default Description
projectId 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 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 string Account email address. Required when using a .pem or .p12 keyFilename.
credentials object Credentials object. Properties Name Type Attributes Description client_email string private_key string
retryOptions object Options for customizing retries. Retriable server errors will be retried with exponential delay between them dictated by the formula max(maxRetryDelay, retryDelayMultiplier*retryNumber) until maxRetries or totalTimeout has been reached. Retries will only happen if autoRetry is set to true. Properties Name Type Attributes Default Description autoRetry boolean true Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. retryDelayMultiplier number 2 the multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request. totalTimeout number 600 The total time, starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile. maxRetryDelay number 64 The maximum delay time between requests. When this value is reached, retryDelayMultiplier will no longer be used to increase delay time. maxRetries number 3 Maximum number of automatic retries attempted before returning the error. retryableErrorFn function Function that returns true if a given error should be retried and false otherwise. idempotencyStrategy enum IdempotencyStrategy.RetryConditional Enumeration controls how conditionally idempotent operations are retried. Possible values are: RetryAlways - will respect other retry settings and attempt to retry conditionally idempotent operations. RetryConditional - will retry conditionally idempotent operations if the correct preconditions are set. RetryNever - never retry a conditionally idempotent operation.
userAgent string The value to be prepended to the User-Agent header in API requests.
authClient object AuthClient or GoogleAuth client to reuse instead of creating a new one.
timeout number The amount of time in milliseconds to wait per http request before timing out.
interceptors_ Array. Array of custom request interceptors to be returned in the order they were assigned.
apiEndpoint string storage.google.com The API endpoint of the service used to make requests.
useAuthWithCustomEndpoint boolean false Controls whether or not to use authentication when using a custom endpoint.
callback Crc32cGeneratorCallback A function that generates a CRC32C Validator. Defaults to CRC32C

UpdateAclCallback(errnullable, acl, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
acl object The updated Acl Objects.
apiResponse object The full API response.

UpdateAclResponse

Properties:
Name Type Description
0 object The updated Acl Objects.
1 object The full API response.

UploadCallback(errnullable, file, apiResponse)

Parameters:
Name Type Attributes Description
err Error Request error, if any.
file object The uploaded File.
apiResponse object The full API response.

UploadFileInChunksOptions

Properties:
Name Type Attributes Description
concurrencyLimit number The number of concurrently executing promises to use when uploading the file.
chunkSizeBytes number The size in bytes of each chunk to be uploaded.
uploadName string Name of the file when saving to GCS. If ommitted the name is taken from the file path.
maxQueueSize number The number of chunks to be uploaded to hold in memory concurrently. If not specified defaults to the specified concurrency limit.
uploadId string If specified attempts to resume a previous upload.
partsMap Map If specified alongside uploadId, attempts to resume a previous upload from the last chunk specified in partsMap
headers object headers to be sent when initiating the multipart upload. See Request Headers: Initiate a Multipart Upload
autoAbortFailure boolean boolean to indicate if an in progress upload session will be automatically aborted upon failure. If not set, failures will be automatically aborted.

UploadManyFilesOptions

Properties:
Name Type Attributes Description
concurrencyLimit number The number of concurrently executing promises to use when uploading the files.
customDestinationBuilder function A fuction that will take the current path of a local file and return a string representing a custom path to be used to upload the file to GCS.
skipIfExists boolean Do not upload the file if it already exists in the bucket. This will set the precondition ifGenerationMatch = 0.
prefix string A prefix to append to all of the uploaded files.
passthroughOptions object UploadOptions Options to be passed through to each individual upload operation.

UploadOptions

Configuration options for Bucket#upload().

Properties:
Name Type Attributes Default Description
destination string | 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.
encryptionKey string A custom encryption key. SeeCustomer-supplied Encryption Keys.
gzip boolean Automatically gzip the file. This will setoptions.metadata.contentEncoding to gzip.
kmsKeyName 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.
metadata object See anObjects: insert request body.
offset string The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
predefinedAcl string Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers 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 allUsersget READER access.
private boolean Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public boolean Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
resumable boolean true Resumable uploads are automatically enabled and must be shut off explicitly by setting to false.
timeout number 60000 Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000
uri string The URI for an already-created resumable upload. See File#createResumableUpload.
userProject string The ID of the project which will be billed for the request.
validation string | 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

Properties:
Name Type Description
0 object The uploaded File.
1 object The full API response.