Global

Methods

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 <optional>
false

encodeSlash If true, the "/" character is not encoded.

fixedEncodeURIComponent(str) → {string}

Encode str with encodeURIComponent, plus these reserved characters: ! * ' ( ).

Parameters:
Name Type Description
str string

The URI component to encode.

See:

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.

unicodeJSONStringify(obj) → {string}

JSON encode str, with unicode \u+ representation.

Parameters:
Name Type Description
obj object

The object to encode.

Type Definitions

AddAclCallback(errnullable, acl, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

acl object

The Acl Objects.

apiResponse object

The full API response.

AddAclResponse :array

Properties:
Name Type Description
0 object

The Acl Objects.

1 object

The full API response.

AddLifecycleRuleOptions :object

Configuration options for Bucket#addLifecycleRule().

Properties:
Name Type Attributes Default Description
append string <optional>
true

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

BucketExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

exists boolean

Whether the Bucket exists.

BucketExistsOptions :object

Configuration options for Bucket#exists().

Parameters:
Name Type Attributes Description
userProject string <optional>

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

BucketExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the Bucket exists.

BucketLockCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

CombineCallback(errnullable, newFile, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

newFile File

The new File.

apiResponse object

The full API response.

CombineOptions :object

Properties:
Name Type Attributes Description
kmsKeyName string <optional>

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 <optional>

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

CombineResponse :array

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 <nullable>

Request error, if any.

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 Attributes Description
destinationKmsKeyName string <optional>

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.

predefinedAcl string <optional>

Set the ACL for the new file.

token string <optional>

A previously-returned rewriteToken from an unfinished rewrite request.

userProject string <optional>

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

CopyResponse :array

Properties:
Name Type Description
0 File

The copied File.

1 object

The full API response.

CreateBucketCallback(errnullable, bucket, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

bucket Bucket

The new Bucket.

apiResponse object

The full API response.

CreateBucketRequest :object

Metadata to set for the bucket.

Properties:
Name Type Attributes Default Description
archive boolean <optional>
false

Specify the storage class as Archive.

coldline boolean <optional>
false

Specify the storage class as Coldline.

cors Array.<Cors> <optional>
[]

Specify the CORS configuration to use.

dra boolean <optional>
false

Specify the storage class as Durable Reduced Availability.

multiRegional boolean <optional>
false

Specify the storage class as Multi-Regional.

nearline boolean <optional>
false

Specify the storage class as Nearline.

regional boolean <optional>
false

Specify the storage class as Regional.

requesterPays boolean <optional>
false

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.

standard boolean <optional>
true

Specify the storage class as Standard.

versioning Versioning <optional>

Specify the versioning status.

userProject string <optional>

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

CreateBucketResponse :array

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 <nullable>

Request error, if any.

channel Channel

The new Channel.

apiResponse object

The full API response.

CreateChannelConfig :object

Properties:
Name Type Description
address string

The address where notifications are delivered for this channel.

CreateChannelOptions :object

Properties:
Name Type Attributes Description
userProject string <optional>

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

CreateChannelResponse :array

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 <nullable>

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 :object

Properties:
Name Type Attributes Description
projectId string <optional>

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 <optional>

This parameter is currently ignored.

CreateHmacKeyResponse :array

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 <nullable>

Request error, if any.

notification Notification

The new Notification.

apiResponse object

The full API response.

CreateNotificationOptions :object

Metadata to set for the Notification.

Properties:
Name Type Attributes Description
customAttributes object <optional>

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

eventTypes Array.<string> <optional>

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

objectNamePrefix string <optional>

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

payloadFormat string <optional>

The desired content of the Payload. Defaults to JSON_API_V1.

Acceptable values are:
- `JSON_API_V1`

- `NONE`
userProject string <optional>

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

CreateNotificationResponse :array

Properties:
Name Type Description
0 Notification

The new Notification.

1 object

The full API response.

CreateReadStreamOptions :object

Configuration options for File#createReadStream.

Properties:
Name Type Attributes Default Description
userProject string <optional>

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

validation string | boolean <optional>

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 <optional>

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 <optional>

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.

decompress boolean <optional>
true

Disable auto decompression of the received data. By default this option is set to true. Applicable in cases where the data was uploaded with gzip: true option. See File#createWriteStream.

CreateResumableUploadCallback(errnullable, uri)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

uri string

The resumable upload's unique session URI.

CreateResumableUploadOptions :object

Properties:
Name Type Attributes Description
configPath string <optional>

A full JSON file path to use with gcs-resumable-upload. This maps to the configstore option by the same name.

metadata object <optional>

Metadata to set on the file.

origin string <optional>

Origin header to set for the upload.

predefinedAcl string <optional>

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 <optional>

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

public boolean <optional>

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

userProject string <optional>

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

CreateResumableUploadResponse :array

Properties:
Name Type Description
0 string

The resumable upload's unique session URI.

CreateWriteStreamOptions :object

Configuration options for File#createWriteStream().

Parameters:
Name Type Attributes Default Description
timeout number <optional>
60000

Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000

Properties:
Name Type Attributes Description
configPath string <optional>

This only applies to resumable uploads. A full JSON file path to use with gcs-resumable-upload. This maps to the configstore option by the same name.

contentType string <optional>

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

gzip string | boolean <optional>

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 <optional>

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

offset number <optional>

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

predefinedAcl string <optional>

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 <optional>

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

public boolean <optional>

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

resumable boolean <optional>

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 <optional>

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

userProject string <optional>

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

validation string | boolean <optional>

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. 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 <nullable>

Request error, if any.

apiResponse object

The full API response.

DeleteBucketOptions :object

Configuration options.

Parameters:
Name Type Attributes Description
userProject string <optional>

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

DeleteBucketResponse :array

Properties:
Name Type Description
0 object

The full API response.

DeleteFileCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

DeleteFileResponse :array

Properties:
Name Type Description
0 object

The full API response.

DeleteFilesCallback(err, apiResponseopt)

Parameters:
Name Type Attributes Description
err Error | ?Array.<Error>

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

apiResponse object <optional>

The full API response.

DeleteFilesOptions :object

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

Properties:
Name Type Attributes Description
force boolean <optional>

Suppress errors until all files have been processed.

DeleteHmacKeyCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

DeleteHmacKeyOptions :object

Properties:
Name Type Attributes Description
userProject string <optional>

This parameter is currently ignored.

DeleteHmacKeyResponse :array

Properties:
Name Type Description
0 object

The full API response.

DeleteLabelsCallback(errnullable, metadata)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

Bucket's metadata.

DeleteLabelsResponse :array

Properties:
Name Type Description
0 object

The full API response.

DeleteNotificationResponse :array

Properties:
Name Type Description
0 object

The full API response.

DisableRequesterPaysCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

DisableRequesterPaysResponse :array

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.

DownloadResponse :array

Properties:
Name Type Attributes Description
0 <optional>

The contents of a File.

EnableLoggingOptions :object

Configuration object for enabling logging.

Properties:
Name Type Attributes Description
bucket string | Bucket <optional>

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 <nullable>

Request error, if any.

apiResponse object

The full API response.

EnableRequesterPaysResponse :array

Properties:
Name Type Description
0 object

The full API response.

Expr :object

Properties:
Name Type Attributes Description
title string <optional>

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 <optional>

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:
  • [Condition] https://cloud.google.com/storage/docs/access-control/iam#conditions

FileExistsCallback(errnullable, exists)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

exists boolean

Whether the File exists.

FileExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the File exists.

FileOptions :object

Options passed to the File constructor.

Properties:
Name Type Attributes Description
encryptionKey string <optional>

A custom encryption key.

generation number <optional>

Generation to scope the file to.

kmsKeyName string <optional>

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 <optional>

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

GenerateSignedPostPolicyV2Callback(errnullable, policy)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

policy object

The document policy.

GenerateSignedPostPolicyV2Response :array

Properties:
Name Type Description
0 object

The document policy.

GenerateSignedPostPolicyV4Callback(errnullable, output)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

output SignedPostPolicyV4Output

An object containing the request URL and form fields.

GenerateSignedPostPolicyV4Response :array

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 <nullable>

Request error, if any.

acl object | Array.<object>

Single or array of Acl Objects.

apiResponse object

The full API response.

GetAclResponse :array

Properties:
Name Type Description
0 object | Array.<object>

Single or array of Acl Objects.

1 object

The full API response.

GetBucketCallback(errnullable, bucket, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

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 <nullable>

Request error, if any.

metadata object

The bucket metadata.

apiResponse object

The full API response.

GetBucketMetadataOptions :object

Configuration options for Bucket#getMetadata().

Properties:
Name Type Attributes Description
userProject string <optional>

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

GetBucketMetadataResponse :array

Properties:
Name Type Description
0 object

The bucket metadata.

1 object

The full API response.

GetBucketOptions :object

Configuration options for Bucket#get()

Properties:
Name Type Attributes Description
autoCreate boolean <optional>

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

userProject string <optional>

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

GetBucketResponse :array

Properties:
Name Type Description
0 Bucket

The Bucket.

1 object

The full API response.

GetBucketsCallback(errnullable, buckets)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

buckets Array.<Bucket>

Array of Bucket instances.

GetBucketSignedUrlConfig :object

Parameters:
Name Type Attributes Default Description
virtualHostedStyle boolean <optional>
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.

config.queryParams object <optional>

Additional query parameters to include in the signed URL.

Properties:
Name Type Attributes Default Description
action string

Currently only supports "list" (HTTP: GET).

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 <optional>
'v2'

The signing version to use, either 'v2' or 'v4'.

cname string <optional>

The cname for this bucket, i.e., "https://cdn.example.com". See reference

extensionHeaders object <optional>

If these headers are used, the server will check to make sure that the client provides matching values. See Canonical extension headers for 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.

GetBucketsRequest :object

Query object for listing buckets.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items plus prefixes to return.

pageToken string <optional>

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

userProject string <optional>

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

GetBucketsResponse :array

Properties:
Name Type Description
0 Array.<Bucket>

Array of Bucket instances.

GetExpirationDateCallback(errnullable, expirationDate)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

expirationDate date

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

GetExpirationDateResponse :array

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 <nullable>

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 <nullable>

Request error, if any.

metadata object

The File metadata.

apiResponse object

The full API response.

GetFileMetadataResponse :array

Properties:
Name Type Description
0 object

The File metadata.

1 object

The full API response.

GetFileResponse :array

Properties:
Name Type Description
0 File

The File.

1 object

The full API response.

GetFilesCallback(errnullable, files)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

files Array.<File>

Array of File instances.

GetFilesOptions :object

Query object for listing files.

Properties:
Name Type Attributes Default Description
autoPaginate boolean <optional>
true

Have pagination handled automatically.

delimiter string <optional>

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 <optional>

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

endOffset string <optional>

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).

includeTrailingDelimiter boolean <optional>

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 <optional>

Filter results to objects whose names begin with this prefix.

maxApiCalls number <optional>

Maximum number of API calls to make.

maxResults number <optional>

Maximum number of items plus prefixes to return.

pageToken string <optional>

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

startOffset string <optional>

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 <optional>

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

versions boolean <optional>

If true, returns File objects scoped to their versions.

GetFilesResponse :array

Properties:
Name Type Description
0 Array.<File>

Array of File instances.

GetHmacKeyCallback(errnullable, hmacKey, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

hmacKey HmacKey

this HmacKey instance.

apiResponse object

The full API response.

GetHmacKeyMetadataOptions :object

Properties:
Name Type Attributes Description
userProject string <optional>

This parameter is currently ignored.

GetHmacKeyOptions :object

Properties:
Name Type Attributes Description
userProject string <optional>

This parameter is currently ignored.

GetHmacKeyResponse :array

Properties:
Name Type Description
0 HmacKey

This HmacKey instance.

1 object

The full API response.

GetLabelsCallback(errnullable, labels)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

labels object

Object of labels currently set on this bucket.

GetLabelsOptions :object

Configuration options for Bucket#getLabels().

Parameters:
Name Type Attributes Description
userProject string <optional>

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

GetLabelsResponse :array

Properties:
Name Type Description
0 object

Object of labels currently set on this bucket.

GetNotificationOptions :object

Configuration options for Bucket#getNotification().

Properties:
Name Type Attributes Description
userProject string <optional>

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

GetNotificationsCallback(errnullable, notifications, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

notifications Array.<Notification>

Array of Notification instances.

apiResponse object

The full API response.

GetNotificationsResponse :array

Properties:
Name Type Description
0 Array.<Notification>

Array of Notification instances.

1 object

The full API response.

GetPolicyOptions :object

Requested options for IAM#getPolicy().

Properties:
Name Type Attributes Description
requestedPolicyVersion number <optional>

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.

userProject string <optional>

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

See:

GetPolicyResponse :array

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 <nullable>

Request error, if any.

serviceAccount object

The serviceAccount resource.

Properties
Name Type Description
emailAddress string

The service account email address.

apiResponse object

The full API response.

GetServiceAccountResponse :array

Properties:
Name Type Description
0 object

The service account resource.

1 object

The full API response.

GetSignedPolicyCallback(errnullable, policy)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

policy object

The document policy.

GetSignedPolicyResponse :array

Properties:
Name Type Description
0 object

The document policy.

GetSignedUrlCallback(errnullable, url)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

url object

The signed URL.

GetSignedUrlCallback(errnullable, url)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

url object

The signed URL.

GetSignedUrlResponse :array

Properties:
Name Type Description
0 object

The signed URL.

GetSignedUrlResponse :array

Properties:
Name Type Description
0 object

The signed URL.

HmacKeyMetadata :object

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 <optional>

The time this HMAC key was last updated in RFC 3339 format.

HmacKeyMetadataCallback(errnullable, metadata, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata HmacKeyMetadata

The updated HmacKeyMetadata object.

apiResponse object

The full API response.

HmacKeyMetadataResponse :array

Properties:
Name Type Description
0 HmacKeyMetadata

The updated HmacKeyMetadata object.

1 object

The full API response.

HmacKeyOptions :object

Properties:
Name Type Attributes Description
projectId string <optional>

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 <nullable>

Request error, if any.

resp boolean

Whether file is public or not.

IsPublicResponse :array

Properties:
Name Type Description
0 boolean

Whether file is public or not.

MakeAllFilesPublicPrivateResponse :array

Properties:
Name Type Description
0 Array.<File>

List of files affected.

MakeBucketPrivateCallback(errnullable, files)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

files Array.<File>

List of files made private.

MakeBucketPrivateOptions :object

Parameters:
Name Type Attributes Default Description
includeFiles boolean <optional>
false

Make each file in the bucket private.

force boolean <optional>

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

userProject string <optional>

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

MakeBucketPrivateResponse :array

Properties:
Name Type Description
0 Array.<File>

List of files made private.

MakeBucketPublicCallback(errnullable, files)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

files Array.<File>

List of files made public.

MakeBucketPublicOptions :object

Parameters:
Name Type Attributes Default Description
includeFiles boolean <optional>
false

Make each file in the bucket private.

force boolean <optional>

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

MakeBucketPublicResponse :array

Properties:
Name Type Description
0 Array.<File>

List of files made public.

MakeFilePrivateCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

MakeFilePrivateOptions :object

Configuration options for File#makePrivate().

Properties:
Name Type Attributes Description
strict boolean <optional>

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

userProject string <optional>

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

MakeFilePrivateResponse :array

Properties:
Name Type Description
0 object

The full API response.

MakeFilePublicCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

MakeFilePublicResponse :array

Properties:
Name Type Description
0 object

The full API response.

MoveCallback(errnullable, destinationFilenullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

destinationFile File <nullable>

The destination File.

apiResponse object

The full API response.

MoveOptions :object

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

Parameters:
Name Type Attributes Description
userProject string <optional>

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

MoveResponse :array

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 <nullable>

Request error, if any.

exists boolean

Whether the notification exists or not.

NotificationExistsResponse :array

Properties:
Name Type Description
0 boolean

Whether the notification exists or not.

Policy :object

Properties:
Name Type Attributes Description
policy.bindings Array.<PolicyBinding>

Bindings associate members with roles.

policy.etag string <optional>

Etags are used to perform a read-modify-write.

policy.version number <optional>

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:

PolicyBinding :object

Properties:
Name Type Attributes Description
role string

Role that is assigned to members.

members Array.<string>

Specifies the identities requesting access for the bucket.

condition Expr <optional>

The condition that is associated with this binding.

RemoveAclCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

RemoveAclResponse :array

Properties:
Name Type Description
0 object

The full API response.

RotateEncryptionKeyCallback()

RotateEncryptionKeyResponse

SaveCallback(errnullable)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

SaveOptions :object

SetBucketMetadataCallback(errnullable, metadata)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

The bucket metadata.

SetBucketMetadataOptions :object

Configuration options for Bucket#setMetadata().

Properties:
Name Type Attributes Description
userProject string <optional>

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

SetBucketMetadataResponse :array

Properties:
Name Type Description
apiResponse object

The full API response.

SetBucketStorageClassCallback(errnullable)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

SetBucketStorageClassOptions :object

Parameters:
Name Type Attributes Description
userProject string <optional>

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

SetFileMetadataCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

SetFileMetadataOptions :object

Configuration options for File#setMetadata().

Parameters:
Name Type Attributes Description
userProject string <optional>

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

SetFileMetadataResponse :array

Properties:
Name Type Description
0 object

The full API response.

SetHmacKeyMetadata :object

Subset of HmacKeyMetadata to update.

Properties:
Name Type Attributes Description
state string

New state of the HmacKey. Either 'ACTIVE' or 'INACTIVE'.

etag string <optional>

Include an etag from a previous get HMAC key request to perform safe read-modify-write.

SetHmacKeyMetadataOptions :object

Properties:
Name Type Attributes Description
userProject string <optional>

This parameter is currently ignored.

SetLabelsCallback(errnullable, metadata)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

metadata object

The bucket metadata.

SetLabelsOptions :object

Configuration options for Bucket#setLabels().

Properties:
Name Type Attributes Description
userProject string <optional>

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

SetLabelsResponse :array

Properties:
Name Type Description
0 object

The bucket metadata.

SetStorageClassCallback(errnullable, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

apiResponse object

The full API response.

SetStorageClassOptions :object

Configuration options for File#setStorageClass().

Properties:
Name Type Attributes Description
userProject string <optional>

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

SetStorageClassResponse :array

Properties:
Name Type Description
0 object

The full API response.

SignedPostPolicyV4Output :object

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 <nullable>

Request error, if any.

apiResponse object

The full API response.

StopResponse :array

Properties:
Name Type Description
0 object

The full API response.

StorageOptions :object

Properties:
Name Type Attributes Default Description
projectId string <optional>

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 <optional>

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 <optional>

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

credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
autoRetry boolean <optional>
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.

maxRetries number <optional>
3

Maximum number of automatic retries attempted before returning the error.

promise Constructor <optional>

Custom promise module to use instead of native Promises.

UpdateAclCallback(errnullable, acl, apiResponse)

Parameters:
Name Type Attributes Description
err Error <nullable>

Request error, if any.

acl object

The updated Acl Objects.

apiResponse object

The full API response.

UpdateAclResponse :array

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 <nullable>

Request error, if any.

file object

The uploaded File.

apiResponse object

The full API response.

UploadOptions :object

Configuration options for Bucket#upload().

Parameters:
Name Type Attributes Default Description
options.destination string | File <optional>

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 <optional>

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

options.gzip boolean <optional>

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

options.kmsKeyName string <optional>

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 <optional>

See an Objects: insert request body.

options.offset string <optional>

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

options.predefinedAcl string <optional>

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 <optional>

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

options.public boolean <optional>

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

options.resumable boolean <optional>

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

options.timeout number <optional>
60000

Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000

options.uri string <optional>

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

options.userProject string <optional>

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

options.validation string | boolean <optional>

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 Description
0 object

The uploaded File.

1 object

The full API response.