@googleapis/storage
Version:
1,411 lines (1,400 loc) • 622 kB
text/typescript
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosResponseWithHTTP2,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace storage_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Upload protocol for media (e.g. "media", "multipart", "resumable").
*/
uploadType?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* Cloud Storage JSON API
*
* Stores and retrieves potentially large, immutable data objects.
*
* @example
* ```js
* const {google} = require('googleapis');
* const storage = google.storage('v1');
* ```
*/
export class Storage {
context: APIRequestContext;
anywhereCaches: Resource$Anywherecaches;
bucketAccessControls: Resource$Bucketaccesscontrols;
buckets: Resource$Buckets;
channels: Resource$Channels;
defaultObjectAccessControls: Resource$Defaultobjectaccesscontrols;
folders: Resource$Folders;
managedFolders: Resource$Managedfolders;
notifications: Resource$Notifications;
objectAccessControls: Resource$Objectaccesscontrols;
objects: Resource$Objects;
operations: Resource$Operations;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.anywhereCaches = new Resource$Anywherecaches(this.context);
this.bucketAccessControls = new Resource$Bucketaccesscontrols(
this.context
);
this.buckets = new Resource$Buckets(this.context);
this.channels = new Resource$Channels(this.context);
this.defaultObjectAccessControls =
new Resource$Defaultobjectaccesscontrols(this.context);
this.folders = new Resource$Folders(this.context);
this.managedFolders = new Resource$Managedfolders(this.context);
this.notifications = new Resource$Notifications(this.context);
this.objectAccessControls = new Resource$Objectaccesscontrols(
this.context
);
this.objects = new Resource$Objects(this.context);
this.operations = new Resource$Operations(this.context);
this.projects = new Resource$Projects(this.context);
}
}
/**
* An AdvanceRelocateBucketOperation request.
*/
export interface Schema$AdvanceRelocateBucketOperationRequest {
/**
* Specifies the time when the relocation will revert to the sync stage if the relocation hasn't succeeded.
*/
expireTime?: string | null;
/**
* Specifies the duration after which the relocation will revert to the sync stage if the relocation hasn't succeeded. Optional, if not supplied, a default value of 12h will be used.
*/
ttl?: string | null;
}
/**
* An Anywhere Cache instance.
*/
export interface Schema$AnywhereCache {
/**
* The cache-level entry admission policy.
*/
admissionPolicy?: string | null;
/**
* The ID of the Anywhere cache instance.
*/
anywhereCacheId?: string | null;
/**
* The name of the bucket containing this cache instance.
*/
bucket?: string | null;
/**
* The creation time of the cache instance in RFC 3339 format.
*/
createTime?: string | null;
/**
* The ID of the resource, including the project number, bucket name and anywhere cache ID.
*/
id?: string | null;
/**
* The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.
*/
kind?: string | null;
/**
* True if the cache instance has an active Update long-running operation.
*/
pendingUpdate?: boolean | null;
/**
* The link to this cache instance.
*/
selfLink?: string | null;
/**
* The current state of the cache instance.
*/
state?: string | null;
/**
* The TTL of all cache entries in whole seconds. e.g., "7200s".
*/
ttl?: string | null;
/**
* The modification time of the cache instance metadata in RFC 3339 format.
*/
updateTime?: string | null;
/**
* The zone in which the cache instance is running. For example, us-central1-a.
*/
zone?: string | null;
}
/**
* A list of Anywhere Caches.
*/
export interface Schema$AnywhereCaches {
/**
* The list of items.
*/
items?: Schema$AnywhereCache[];
/**
* The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
}
/**
* A bucket.
*/
export interface Schema$Bucket {
/**
* Access controls on the bucket.
*/
acl?: Schema$BucketAccessControl[];
/**
* The bucket's Autoclass configuration.
*/
autoclass?: {
enabled?: boolean;
terminalStorageClass?: string;
terminalStorageClassUpdateTime?: string;
toggleTime?: string;
} | null;
/**
* The bucket's billing configuration.
*/
billing?: {requesterPays?: boolean} | null;
/**
* The bucket's Cross-Origin Resource Sharing (CORS) configuration.
*/
cors?: Array<{
maxAgeSeconds?: number;
method?: string[];
origin?: string[];
responseHeader?: string[];
}> | null;
/**
* The bucket's custom placement configuration for Custom Dual Regions.
*/
customPlacementConfig?: {dataLocations?: string[]} | null;
/**
* The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.
*/
defaultEventBasedHold?: boolean | null;
/**
* Default access controls to apply to new objects when no ACL is provided.
*/
defaultObjectAcl?: Schema$ObjectAccessControl[];
/**
* Encryption configuration for a bucket.
*/
encryption?: {
customerManagedEncryptionEnforcementConfig?: {
effectiveTime?: string;
restrictionMode?: string;
};
customerSuppliedEncryptionEnforcementConfig?: {
effectiveTime?: string;
restrictionMode?: string;
};
defaultKmsKeyName?: string;
googleManagedEncryptionEnforcementConfig?: {
effectiveTime?: string;
restrictionMode?: string;
};
} | null;
/**
* HTTP 1.1 Entity tag for the bucket.
*/
etag?: string | null;
/**
* The generation of this bucket.
*/
generation?: string | null;
/**
* The hard delete time of the bucket in RFC 3339 format.
*/
hardDeleteTime?: string | null;
/**
* The bucket's hierarchical namespace configuration.
*/
hierarchicalNamespace?: {enabled?: boolean} | null;
/**
* The bucket's IAM configuration.
*/
iamConfiguration?: {
bucketPolicyOnly?: {enabled?: boolean; lockedTime?: string};
publicAccessPrevention?: string;
uniformBucketLevelAccess?: {enabled?: boolean; lockedTime?: string};
} | null;
/**
* The ID of the bucket. For buckets, the id and name properties are the same.
*/
id?: string | null;
/**
* The bucket's IP filter configuration. Specifies the network sources that are allowed to access the operations on the bucket, as well as its underlying objects. Only enforced when the mode is set to 'Enabled'.
*/
ipFilter?: {
allowAllServiceAgentAccess?: boolean;
allowCrossOrgVpcs?: boolean;
mode?: string;
publicNetworkSource?: {allowedIpCidrRanges?: string[]};
vpcNetworkSources?: Array<{
allowedIpCidrRanges?: string[];
network?: string;
}>;
} | null;
/**
* The kind of item this is. For buckets, this is always storage#bucket.
*/
kind?: string | null;
/**
* User-provided labels, in key/value pairs.
*/
labels?: {[key: string]: string} | null;
/**
* The bucket's lifecycle configuration. See [Lifecycle Management](https://cloud.google.com/storage/docs/lifecycle) for more information.
*/
lifecycle?: {
rule?: Array<{
action?: {storageClass?: string; type?: string};
condition?: {
age?: number;
createdBefore?: string;
customTimeBefore?: string;
daysSinceCustomTime?: number;
daysSinceNoncurrentTime?: number;
isLive?: boolean;
matchesPattern?: string;
matchesPrefix?: string[];
matchesStorageClass?: string[];
matchesSuffix?: string[];
noncurrentTimeBefore?: string;
numNewerVersions?: number;
};
}>;
} | null;
/**
* The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the [Developer's Guide](https://cloud.google.com/storage/docs/locations) for the authoritative list.
*/
location?: string | null;
/**
* The type of the bucket location.
*/
locationType?: string | null;
/**
* The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.
*/
logging?: {logBucket?: string; logObjectPrefix?: string} | null;
/**
* The metadata generation of this bucket.
*/
metageneration?: string | null;
/**
* The name of the bucket.
*/
name?: string | null;
/**
* The bucket's object retention config.
*/
objectRetention?: {mode?: string} | null;
/**
* The owner of the bucket. This is always the project team's owner group.
*/
owner?: {entity?: string; entityId?: string} | null;
/**
* The project number of the project the bucket belongs to.
*/
projectNumber?: string | null;
/**
* The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.
*/
retentionPolicy?: {
effectiveTime?: string;
isLocked?: boolean;
retentionPeriod?: string;
} | null;
/**
* The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket.
*/
rpo?: string | null;
/**
* Reserved for future use.
*/
satisfiesPZI?: boolean | null;
/**
* Reserved for future use.
*/
satisfiesPZS?: boolean | null;
/**
* The URI of this bucket.
*/
selfLink?: string | null;
/**
* The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.
*/
softDeletePolicy?: {
effectiveTime?: string;
retentionDurationSeconds?: string;
} | null;
/**
* The soft delete time of the bucket in RFC 3339 format.
*/
softDeleteTime?: string | null;
/**
* The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see [Storage Classes](https://cloud.google.com/storage/docs/storage-classes).
*/
storageClass?: string | null;
/**
* The creation time of the bucket in RFC 3339 format.
*/
timeCreated?: string | null;
/**
* The modification time of the bucket in RFC 3339 format.
*/
updated?: string | null;
/**
* The bucket's versioning configuration.
*/
versioning?: {enabled?: boolean} | null;
/**
* The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the [Static Website Examples](https://cloud.google.com/storage/docs/static-website) for more information.
*/
website?: {mainPageSuffix?: string; notFoundPage?: string} | null;
}
/**
* An access-control entry.
*/
export interface Schema$BucketAccessControl {
/**
* The name of the bucket.
*/
bucket?: string | null;
/**
* The domain associated with the entity, if any.
*/
domain?: string | null;
/**
* The email address associated with the entity, if any.
*/
email?: string | null;
/**
* The entity holding the permission, in one of the following forms:
* - user-userId
* - user-email
* - group-groupId
* - group-email
* - domain-domain
* - project-team-projectId
* - allUsers
* - allAuthenticatedUsers Examples:
* - The user liz@example.com would be user-liz@example.com.
* - The group example@googlegroups.com would be group-example@googlegroups.com.
* - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
*/
entity?: string | null;
/**
* The ID for the entity, if any.
*/
entityId?: string | null;
/**
* HTTP 1.1 Entity tag for the access-control entry.
*/
etag?: string | null;
/**
* The ID of the access-control entry.
*/
id?: string | null;
/**
* The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.
*/
kind?: string | null;
/**
* The project team associated with the entity, if any.
*/
projectTeam?: {projectNumber?: string; team?: string} | null;
/**
* The access permission for the entity.
*/
role?: string | null;
/**
* The link to this access-control entry.
*/
selfLink?: string | null;
}
/**
* An access-control list.
*/
export interface Schema$BucketAccessControls {
/**
* The list of items.
*/
items?: Schema$BucketAccessControl[];
/**
* The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.
*/
kind?: string | null;
}
/**
* A list of buckets.
*/
export interface Schema$Buckets {
/**
* The list of items.
*/
items?: Schema$Bucket[];
/**
* The kind of item this is. For lists of buckets, this is always storage#buckets.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
}
/**
* The storage layout configuration of a bucket.
*/
export interface Schema$BucketStorageLayout {
/**
* The name of the bucket.
*/
bucket?: string | null;
/**
* The bucket's custom placement configuration for Custom Dual Regions.
*/
customPlacementConfig?: {dataLocations?: string[]} | null;
/**
* The bucket's hierarchical namespace configuration.
*/
hierarchicalNamespace?: {enabled?: boolean} | null;
/**
* The kind of item this is. For storage layout, this is always storage#storageLayout.
*/
kind?: string | null;
/**
* The location of the bucket.
*/
location?: string | null;
/**
* The type of the bucket location.
*/
locationType?: string | null;
}
/**
* A bulk restore objects request.
*/
export interface Schema$BulkRestoreObjectsRequest {
/**
* If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue.
*/
allowOverwrite?: boolean | null;
/**
* If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.
*/
copySourceAcl?: boolean | null;
/**
* Restores only the objects that were created after this time.
*/
createdAfterTime?: string | null;
/**
* Restores only the objects that were created before this time.
*/
createdBeforeTime?: string | null;
/**
* Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.
*/
matchGlobs?: string[] | null;
/**
* Restores only the objects that were soft-deleted after this time.
*/
softDeletedAfterTime?: string | null;
/**
* Restores only the objects that were soft-deleted before this time.
*/
softDeletedBeforeTime?: string | null;
}
/**
* An notification channel used to watch for resource changes.
*/
export interface Schema$Channel {
/**
* The address where notifications are delivered for this channel.
*/
address?: string | null;
/**
* Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
*/
expiration?: string | null;
/**
* A UUID or similar unique string that identifies this channel.
*/
id?: string | null;
/**
* Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
*/
kind?: string | null;
/**
* Additional parameters controlling delivery channel behavior. Optional.
*/
params?: {[key: string]: string} | null;
/**
* A Boolean value to indicate whether payload is wanted. Optional.
*/
payload?: boolean | null;
/**
* An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
*/
resourceId?: string | null;
/**
* A version-specific identifier for the watched resource.
*/
resourceUri?: string | null;
/**
* An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
*/
token?: string | null;
/**
* The type of delivery mechanism used for this channel.
*/
type?: string | null;
}
/**
* A Compose request.
*/
export interface Schema$ComposeRequest {
/**
* Properties of the resulting object.
*/
destination?: Schema$Object;
/**
* The kind of item this is.
*/
kind?: string | null;
/**
* The list of source objects that will be concatenated into a single object.
*/
sourceObjects?: Array<{
generation?: string;
name?: string;
objectPreconditions?: {ifGenerationMatch?: string};
}> | null;
}
/**
* Represents an expression text. Example: title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) \> 0"
*/
export interface Schema$Expr {
/**
* An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
*/
description?: string | null;
/**
* 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.
*/
expression?: string | null;
/**
* An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
*/
location?: string | null;
/**
* 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.
*/
title?: string | null;
}
/**
* A folder. Only available in buckets with hierarchical namespace enabled.
*/
export interface Schema$Folder {
/**
* The name of the bucket containing this folder.
*/
bucket?: string | null;
/**
* The creation time of the folder in RFC 3339 format.
*/
createTime?: string | null;
/**
* The ID of the folder, including the bucket name, folder name.
*/
id?: string | null;
/**
* The kind of item this is. For folders, this is always storage#folder.
*/
kind?: string | null;
/**
* The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.
*/
metageneration?: string | null;
/**
* The name of the folder. Required if not specified by URL parameter.
*/
name?: string | null;
/**
* Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.
*/
pendingRenameInfo?: {operationId?: string} | null;
/**
* The link to this folder.
*/
selfLink?: string | null;
/**
* The modification time of the folder metadata in RFC 3339 format.
*/
updateTime?: string | null;
}
/**
* A list of folders.
*/
export interface Schema$Folders {
/**
* The list of items.
*/
items?: Schema$Folder[];
/**
* The kind of item this is. For lists of folders, this is always storage#folders.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
}
/**
* The response message for storage.buckets.operations.list.
*/
export interface Schema$GoogleLongrunningListOperationsResponse {
/**
* The kind of item this is. For lists of operations, this is always storage#operations.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of operations that matches the specified filter in the request.
*/
operations?: Schema$GoogleLongrunningOperation[];
}
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
export interface Schema$GoogleLongrunningOperation {
/**
* If the value is "false", it means the operation is still in progress. If "true", the operation is completed, and either "error" or "response" is available.
*/
done?: boolean | null;
/**
* The error result of the operation in case of failure or cancellation.
*/
error?: Schema$GoogleRpcStatus;
/**
* The kind of item this is. For operations, this is always storage#operation.
*/
kind?: string | null;
/**
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
*/
metadata?: {[key: string]: any} | null;
/**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the "name" should be a resource name ending with "operations/{operationId\}".
*/
name?: string | null;
/**
* The normal response of the operation in case of success. If the original method returns no data on success, such as "Delete", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type "XxxResponse", where "Xxx" is the original method name. For example, if the original method name is "TakeSnapshot()", the inferred response type is "TakeSnapshotResponse".
*/
response?: {[key: string]: any} | null;
/**
* The link to this long running operation.
*/
selfLink?: string | null;
}
/**
* The "Status" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each "Status" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
*/
export interface Schema$GoogleRpcStatus {
/**
* The status code, which should be an enum value of google.rpc.Code.
*/
code?: number | null;
/**
* A list of messages that carry the error details. There is a common set of message types for APIs to use.
*/
details?: Array<{[key: string]: any}> | null;
/**
* A developer-facing error message, which should be in English.
*/
message?: string | null;
}
/**
* JSON template to produce a JSON-style HMAC Key resource for Create responses.
*/
export interface Schema$HmacKey {
/**
* The kind of item this is. For HMAC keys, this is always storage#hmacKey.
*/
kind?: string | null;
/**
* Key metadata.
*/
metadata?: Schema$HmacKeyMetadata;
/**
* HMAC secret key material.
*/
secret?: string | null;
}
/**
* JSON template to produce a JSON-style HMAC Key metadata resource.
*/
export interface Schema$HmacKeyMetadata {
/**
* The ID of the HMAC Key.
*/
accessId?: string | null;
/**
* HTTP 1.1 Entity tag for the HMAC key.
*/
etag?: string | null;
/**
* The ID of the HMAC key, including the Project ID and the Access ID.
*/
id?: string | null;
/**
* The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.
*/
kind?: string | null;
/**
* Project ID owning the service account to which the key authenticates.
*/
projectId?: string | null;
/**
* The link to this resource.
*/
selfLink?: string | null;
/**
* The email address of the key's associated service account.
*/
serviceAccountEmail?: string | null;
/**
* The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.
*/
state?: string | null;
/**
* The creation time of the HMAC key in RFC 3339 format.
*/
timeCreated?: string | null;
/**
* The last modification time of the HMAC key metadata in RFC 3339 format.
*/
updated?: string | null;
}
/**
* A list of hmacKeys.
*/
export interface Schema$HmacKeysMetadata {
/**
* The list of items.
*/
items?: Schema$HmacKeyMetadata[];
/**
* The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
}
/**
* A managed folder.
*/
export interface Schema$ManagedFolder {
/**
* The name of the bucket containing this managed folder.
*/
bucket?: string | null;
/**
* The creation time of the managed folder in RFC 3339 format.
*/
createTime?: string | null;
/**
* The ID of the managed folder, including the bucket name and managed folder name.
*/
id?: string | null;
/**
* The kind of item this is. For managed folders, this is always storage#managedFolder.
*/
kind?: string | null;
/**
* The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.
*/
metageneration?: string | null;
/**
* The name of the managed folder. Required if not specified by URL parameter.
*/
name?: string | null;
/**
* The link to this managed folder.
*/
selfLink?: string | null;
/**
* The last update time of the managed folder metadata in RFC 3339 format.
*/
updateTime?: string | null;
}
/**
* A list of managed folders.
*/
export interface Schema$ManagedFolders {
/**
* The list of items.
*/
items?: Schema$ManagedFolder[];
/**
* The kind of item this is. For lists of managed folders, this is always storage#managedFolders.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
}
/**
* A subscription to receive Google PubSub notifications.
*/
export interface Schema$Notification {
/**
* An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.
*/
custom_attributes?: {[key: string]: string} | null;
/**
* HTTP 1.1 Entity tag for this subscription notification.
*/
etag?: string | null;
/**
* If present, only send notifications about listed event types. If empty, sent notifications for all event types.
*/
event_types?: string[] | null;
/**
* The ID of the notification.
*/
id?: string | null;
/**
* The kind of item this is. For notifications, this is always storage#notification.
*/
kind?: string | null;
/**
* If present, only apply this notification configuration to object names that begin with this prefix.
*/
object_name_prefix?: string | null;
/**
* The desired content of the Payload.
*/
payload_format?: string | null;
/**
* The canonical URL of this notification.
*/
selfLink?: string | null;
/**
* The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier\}/topics/{my-topic\}'
*/
topic?: string | null;
}
/**
* A list of notification subscriptions.
*/
export interface Schema$Notifications {
/**
* The list of items.
*/
items?: Schema$Notification[];
/**
* The kind of item this is. For lists of notifications, this is always storage#notifications.
*/
kind?: string | null;
}
/**
* An object.
*/
export interface Schema$Object {
/**
* Access controls on the object.
*/
acl?: Schema$ObjectAccessControl[];
/**
* The name of the bucket containing this object.
*/
bucket?: string | null;
/**
* Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
*/
cacheControl?: string | null;
/**
* Number of underlying components that make up this object. Components are accumulated by compose operations.
*/
componentCount?: number | null;
/**
* Content-Disposition of the object data.
*/
contentDisposition?: string | null;
/**
* Content-Encoding of the object data.
*/
contentEncoding?: string | null;
/**
* Content-Language of the object data.
*/
contentLanguage?: string | null;
/**
* Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
*/
contentType?: string | null;
/**
* User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
*/
contexts?: {
custom?: {[key: string]: Schema$ObjectCustomContextPayload};
} | null;
/**
* CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
*/
crc32c?: string | null;
/**
* Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
*/
customerEncryption?: {
encryptionAlgorithm?: string;
keySha256?: string;
} | null;
/**
* A timestamp in RFC 3339 format specified by the user for an object.
*/
customTime?: string | null;
/**
* HTTP 1.1 Entity tag for the object.
*/
etag?: string | null;
/**
* Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
*/
eventBasedHold?: boolean | null;
/**
* The content generation of this object. Used for object versioning.
*/
generation?: string | null;
/**
* This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
*/
hardDeleteTime?: string | null;
/**
* The ID of the object, including the bucket name, object name, and generation number.
*/
id?: string | null;
/**
* The kind of item this is. For objects, this is always storage#object.
*/
kind?: string | null;
/**
* Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
*/
kmsKeyName?: string | null;
/**
* MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
*/
md5Hash?: string | null;
/**
* Media download link.
*/
mediaLink?: string | null;
/**
* User-provided metadata, in key/value pairs.
*/
metadata?: {[key: string]: string} | null;
/**
* The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
*/
metageneration?: string | null;
/**
* The name of the object. Required if not specified by URL parameter.
*/
name?: string | null;
/**
* The owner of the object. This will always be the uploader of the object.
*/
owner?: {entity?: string; entityId?: string} | null;
/**
* Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
*/
restoreToken?: string | null;
/**
* A collection of object level retention parameters.
*/
retention?: {mode?: string; retainUntilTime?: string} | null;
/**
* A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
*/
retentionExpirationTime?: string | null;
/**
* The link to this object.
*/
selfLink?: string | null;
/**
* Content-Length of the data in bytes.
*/
size?: string | null;
/**
* The time at which the object became soft-deleted in RFC 3339 format.
*/
softDeleteTime?: string | null;
/**
* Storage class of the object.
*/
storageClass?: string | null;
/**
* Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
*/
temporaryHold?: boolean | null;
/**
* The creation time of the object in RFC 3339 format.
*/
timeCreated?: string | null;
/**
* The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
*/
timeDeleted?: string | null;
/**
* The time when the object was finalized.
*/
timeFinalized?: string | null;
/**
* The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.
*/
timeStorageClassUpdated?: string | null;
/**
* The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
*/
updated?: string | null;
}
/**
* An access-control entry.
*/
export interface Schema$ObjectAccessControl {
/**
* The name of the bucket.
*/
bucket?: string | null;
/**
* The domain associated with the entity, if any.
*/
domain?: string | null;
/**
* The email address associated with the entity, if any.
*/
email?: string | null;
/**
* The entity holding the permission, in one of the following forms:
* - user-userId
* - user-email
* - group-groupId
* - group-email
* - domain-domain
* - project-team-projectId
* - allUsers
* - allAuthenticatedUsers Examples:
* - The user liz@example.com would be user-liz@example.com.
* - The group example@googlegroups.com would be group-example@googlegroups.com.
* - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
*/
entity?: string | null;
/**
* The ID for the entity, if any.
*/
entityId?: string | null;
/**
* HTTP 1.1 Entity tag for the access-control entry.
*/
etag?: string | null;
/**
* The content generation of the object, if applied to an object.
*/
generation?: string | null;
/**
* The ID of the access-control entry.
*/
id?: string | null;
/**
* The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
*/
kind?: string | null;
/**
* The name of the object, if applied to an object.
*/
object?: string | null;
/**
* The project team associated with the entity, if any.
*/
projectTeam?: {projectNumber?: string; team?: string} | null;
/**
* The access permission for the entity.
*/
role?: string | null;
/**
* The link to this access-control entry.
*/
selfLink?: string | null;
}
/**
* An access-control list.
*/
export interface Schema$ObjectAccessControls {
/**
* The list of items.
*/
items?: Schema$ObjectAccessControl[];
/**
* The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.
*/
kind?: string | null;
}
/**
* The payload of a single user-defined object context.
*/
export interface Schema$ObjectCustomContextPayload {
/**
* The time at which the object context was created in RFC 3339 format.
*/
createTime?: string | null;
/**
* The time at which the object context was last updated in RFC 3339 format.
*/
updateTime?: string | null;
/**
* The value of the object context.
*/
value?: string | null;
}
/**
* A list of objects.
*/
export interface Schema$Objects {
/**
* The list of items.
*/
items?: Schema$Object[];
/**
* The kind of item this is. For lists of objects, this is always storage#objects.
*/
kind?: string | null;
/**
* The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
*/
nextPageToken?: string | null;
/**
* The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.
*/
prefixes?: string[] | null;
}
/**
* A bucket/object/managedFolder IAM policy.
*/
export interface Schema$Policy {
/**
* An association between a role, which comes with a set of permissions, and members who may assume that role.
*/
bindings?: Array<{
condition?: Schema$Expr;
members?: string[];
role?: string;
}> | null;
/**
* HTTP 1.1 Entity tag for the policy.
*/
etag?: string | null;
/**
* The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
*/
kind?: string | null;
/**
* The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
*/
resourceId?: string | null;
/**
* The IAM policy format version.
*/
version?: number | null;
}
/**
* A Relocate Bucket request.
*/
export interface Schema$RelocateBucketRequest {
/**
* The bucket's new custom placement configuration if relocating to a Custom Dual Region.
*/
destinationCustomPlacementConfig?: {dataLocations?: string[]} | null;
/**
* The new location the bucket will be relocated to.
*/
destinationLocation?: string | null;
/**
* If true, validate the operation, but do not actually relocate the bucket.
*/
validateOnly?: boolean | null;
}
/**
* A rewrite response.
*/
export interface Schema$RewriteResponse {
/**
* true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response.
*/
done?: boolean | null;
/**
* The kind of item this is.
*/
kind?: string | null;
/**
* The total size of the object being copied in bytes. This property is always present in the response.
*/
objectSize?: string | null;
/**
* A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes.
*/
resource?: Schema$Object;
/**
* A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy.
*/
rewriteToken?: string | null;
/**
* The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.
*/
totalBytesRewritten?: string | null;
}
/**
* A subscription to receive Google PubSub notifications.
*/
export interface Schema$ServiceAccount {
/**
* The ID of the notification.
*/
email_address?: string | null;
/**
* The kind of item this is. For notifications, this is always storage#notification.
*/
kind?: string | null;
}
/**
* A storage.(buckets|objects|managedFolders).testIamPermissions response.
*/
export interface Schema$TestIamPermissionsResponse {
/**
* The kind of item this is.
*/
kind?: string | null;
/**
* The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows:
* - storage.buckets.delete - Delete bucket.
* - storage.buckets.get - Read bucket metadata.
* - storage.buckets.getIamPolicy - Read bucket IAM policy.
* - storage.buckets.create - Create bucket.
* - storage.buckets.list - List buckets.
* - storage.buckets.setIamPolicy - Update bucket IAM policy.
* - storage.buckets.update - Update bucket metadata.
* - storage.objects.delete - Delete object.
* - storage.objects.get - Read object data and metadata.
* - storage.objects.getIamPolicy - Read object IAM policy.
* - storage.objects.create - Create object.
* - storage.objects.list - List objects.
* - storage.objects.setIamPolicy - Update object IAM policy.
* - storage.objects.update - Update object metadata.
* - storage.managedFolders.delete - Delete managed folder.
* - storage.managedFolders.get - Read managed folder metadata.
* - storage.managedFolders.getIamPolicy - Read managed folder IAM policy.
* - storage.managedFolders.create - Create managed folder.
* - storage.managedFolders.list - List managed folders.
* - storage.managedFolders.setIamPolicy - Update managed folder IAM policy.
*/
permissions?: string[] | null;
}
export class Resource$Anywherecaches {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* Disables an Anywhere Cache instance.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/storage.googleapis.com
* // - Login