@google-cloud/storage-control 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/build/protos/google/storage/v2/storage.proto +3166 -0
- package/build/protos/protos.d.ts +11304 -40
- package/build/protos/protos.js +30882 -22
- package/build/protos/protos.json +4507 -28
- package/build/src/index.d.ts +2 -3
- package/build/src/index.js +3 -3
- package/build/src/index.js.map +1 -1
- package/build/src/storage_control_client.d.ts +2035 -0
- package/build/src/storage_control_client.js +2440 -0
- package/build/src/storage_control_client.js.map +1 -0
- package/build/src/util/ast_utils.d.ts +22 -0
- package/build/src/util/ast_utils.js +356 -0
- package/build/src/util/ast_utils.js.map +1 -0
- package/build/src/util/index_fix_utils.d.ts +15 -0
- package/build/src/util/index_fix_utils.js +86 -0
- package/build/src/util/index_fix_utils.js.map +1 -0
- package/build/src/util/proto_utils.d.ts +13 -0
- package/build/src/util/proto_utils.js +53 -0
- package/build/src/util/proto_utils.js.map +1 -0
- package/build/src/util/storage_control_utils.d.ts +1 -0
- package/build/src/util/storage_control_utils.js +31 -0
- package/build/src/util/storage_control_utils.js.map +1 -0
- package/build/src/util/uber_client_builder.d.ts +12 -0
- package/build/src/util/uber_client_builder.js +187 -0
- package/build/src/util/uber_client_builder.js.map +1 -0
- package/build/src/v2/index.d.ts +1 -0
- package/build/src/v2/index.js +4 -2
- package/build/src/v2/index.js.map +1 -1
- package/build/src/v2/storage_client.d.ts +614 -0
- package/build/src/v2/storage_client.js +911 -0
- package/build/src/v2/storage_client.js.map +1 -0
- package/build/src/v2/storage_client_config.json +65 -0
- package/build/src/v2/storage_control_client.d.ts +138 -138
- package/build/src/v2/storage_control_client.js +486 -232
- package/build/src/v2/storage_control_client.js.map +1 -1
- package/build/src/v2/storage_proto_list.json +3 -0
- package/package.json +4 -2
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
import type * as gax from 'google-gax';
|
|
2
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
|
|
3
|
+
import { Transform } from 'stream';
|
|
4
|
+
import * as protos from '../../protos/protos';
|
|
5
|
+
/**
|
|
6
|
+
* ## API Overview and Naming Syntax
|
|
7
|
+
*
|
|
8
|
+
* The Cloud Storage gRPC API allows applications to read and write data through
|
|
9
|
+
* the abstractions of buckets and objects. For a description of these
|
|
10
|
+
* abstractions please see [Cloud Storage
|
|
11
|
+
* documentation](https://cloud.google.com/storage/docs).
|
|
12
|
+
*
|
|
13
|
+
* Resources are named as follows:
|
|
14
|
+
*
|
|
15
|
+
* - Projects are referred to as they are defined by the Resource Manager API,
|
|
16
|
+
* using strings like `projects/123456` or `projects/my-string-id`.
|
|
17
|
+
* - Buckets are named using string names of the form:
|
|
18
|
+
* `projects/{project}/buckets/{bucket}`.
|
|
19
|
+
* For globally unique buckets, `_` might be substituted for the project.
|
|
20
|
+
* - Objects are uniquely identified by their name along with the name of the
|
|
21
|
+
* bucket they belong to, as separate strings in this API. For example:
|
|
22
|
+
*
|
|
23
|
+
* ```
|
|
24
|
+
* ReadObjectRequest {
|
|
25
|
+
* bucket: 'projects/_/buckets/my-bucket'
|
|
26
|
+
* object: 'my-object'
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Note that object names can contain `/` characters, which are treated as
|
|
31
|
+
* any other character (no special directory semantics).
|
|
32
|
+
* @class
|
|
33
|
+
* @memberof v2
|
|
34
|
+
*/
|
|
35
|
+
export declare class StorageClient {
|
|
36
|
+
private _terminated;
|
|
37
|
+
private _opts;
|
|
38
|
+
private _providedCustomServicePath;
|
|
39
|
+
private _gaxModule;
|
|
40
|
+
private _gaxGrpc;
|
|
41
|
+
private _protos;
|
|
42
|
+
private _defaults;
|
|
43
|
+
private _universeDomain;
|
|
44
|
+
private _servicePath;
|
|
45
|
+
private _log;
|
|
46
|
+
auth: gax.GoogleAuth;
|
|
47
|
+
descriptors: Descriptors;
|
|
48
|
+
warn: (code: string, message: string, warnType?: string) => void;
|
|
49
|
+
innerApiCalls: {
|
|
50
|
+
[name: string]: Function;
|
|
51
|
+
};
|
|
52
|
+
pathTemplates: {
|
|
53
|
+
[name: string]: gax.PathTemplate;
|
|
54
|
+
};
|
|
55
|
+
storageStub?: Promise<{
|
|
56
|
+
[name: string]: Function;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Construct an instance of StorageClient.
|
|
60
|
+
*
|
|
61
|
+
* @param {object} [options] - The configuration object.
|
|
62
|
+
* The options accepted by the constructor are described in detail
|
|
63
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
64
|
+
* The common options are:
|
|
65
|
+
* @param {object} [options.credentials] - Credentials object.
|
|
66
|
+
* @param {string} [options.credentials.client_email]
|
|
67
|
+
* @param {string} [options.credentials.private_key]
|
|
68
|
+
* @param {string} [options.email] - Account email address. Required when
|
|
69
|
+
* using a .pem or .p12 keyFilename.
|
|
70
|
+
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
|
71
|
+
* .p12 key downloaded from the Google Developers Console. If you provide
|
|
72
|
+
* a path to a JSON file, the projectId option below is not necessary.
|
|
73
|
+
* NOTE: .pem and .p12 require you to specify options.email as well.
|
|
74
|
+
* @param {number} [options.port] - The port on which to connect to
|
|
75
|
+
* the remote host.
|
|
76
|
+
* @param {string} [options.projectId] - The project ID from the Google
|
|
77
|
+
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
78
|
+
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
79
|
+
* app is running in an environment which supports
|
|
80
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
81
|
+
* your project ID will be detected automatically.
|
|
82
|
+
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
83
|
+
* API remote host.
|
|
84
|
+
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
85
|
+
* Follows the structure of {@link gapicConfig}.
|
|
86
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
87
|
+
* For more information, please check the
|
|
88
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
89
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
90
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
91
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
92
|
+
* ```
|
|
93
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
94
|
+
* const client = new StorageClient({fallback: true}, gax);
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
|
98
|
+
/**
|
|
99
|
+
* Initialize the client.
|
|
100
|
+
* Performs asynchronous operations (such as authentication) and prepares the client.
|
|
101
|
+
* This function will be called automatically when any class method is called for the
|
|
102
|
+
* first time, but if you need to initialize it before calling an actual method,
|
|
103
|
+
* feel free to call initialize() directly.
|
|
104
|
+
*
|
|
105
|
+
* You can await on this method if you want to make sure the client is initialized.
|
|
106
|
+
*
|
|
107
|
+
* @returns {Promise} A promise that resolves to an authenticated service stub.
|
|
108
|
+
*/
|
|
109
|
+
initialize(): Promise<{
|
|
110
|
+
[name: string]: Function;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* The DNS address for this API service.
|
|
114
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
115
|
+
* @returns {string} The DNS address for this service.
|
|
116
|
+
*/
|
|
117
|
+
static get servicePath(): string;
|
|
118
|
+
/**
|
|
119
|
+
* The DNS address for this API service - same as servicePath.
|
|
120
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
121
|
+
* @returns {string} The DNS address for this service.
|
|
122
|
+
*/
|
|
123
|
+
static get apiEndpoint(): string;
|
|
124
|
+
/**
|
|
125
|
+
* The DNS address for this API service.
|
|
126
|
+
* @returns {string} The DNS address for this service.
|
|
127
|
+
*/
|
|
128
|
+
get apiEndpoint(): string;
|
|
129
|
+
get universeDomain(): string;
|
|
130
|
+
/**
|
|
131
|
+
* The port for this API service.
|
|
132
|
+
* @returns {number} The default port for this service.
|
|
133
|
+
*/
|
|
134
|
+
static get port(): number;
|
|
135
|
+
/**
|
|
136
|
+
* The scopes needed to make gRPC calls for every method defined
|
|
137
|
+
* in this service.
|
|
138
|
+
* @returns {string[]} List of default scopes.
|
|
139
|
+
*/
|
|
140
|
+
static get scopes(): string[];
|
|
141
|
+
getProjectId(): Promise<string>;
|
|
142
|
+
getProjectId(callback: Callback<string, undefined, undefined>): void;
|
|
143
|
+
/**
|
|
144
|
+
* Permanently deletes an empty bucket.
|
|
145
|
+
* The request fails if there are any live or
|
|
146
|
+
* noncurrent objects in the bucket, but the request succeeds if the
|
|
147
|
+
* bucket only contains soft-deleted objects or incomplete uploads, such
|
|
148
|
+
* as ongoing XML API multipart uploads. Does not permanently delete
|
|
149
|
+
* soft-deleted objects.
|
|
150
|
+
*
|
|
151
|
+
* When this API is used to delete a bucket containing an object that has a
|
|
152
|
+
* soft delete policy
|
|
153
|
+
* enabled, the object becomes soft deleted, and the
|
|
154
|
+
* `softDeleteTime` and `hardDeleteTime` properties are set on the
|
|
155
|
+
* object.
|
|
156
|
+
*
|
|
157
|
+
* Objects and multipart uploads that were in the bucket at the time of
|
|
158
|
+
* deletion are also retained for the specified retention duration. When
|
|
159
|
+
* a soft-deleted bucket reaches the end of its retention duration, it
|
|
160
|
+
* is permanently deleted. The `hardDeleteTime` of the bucket always
|
|
161
|
+
* equals
|
|
162
|
+
* or exceeds the expiration time of the last soft-deleted object in the
|
|
163
|
+
* bucket.
|
|
164
|
+
*
|
|
165
|
+
* **IAM Permissions**:
|
|
166
|
+
*
|
|
167
|
+
* Requires `storage.buckets.delete` IAM permission on the bucket.
|
|
168
|
+
*
|
|
169
|
+
* @param {Object} request
|
|
170
|
+
* The request object that will be sent.
|
|
171
|
+
* @param {string} request.name
|
|
172
|
+
* Required. Name of a bucket to delete.
|
|
173
|
+
* @param {number} request.ifMetagenerationMatch
|
|
174
|
+
* If set, only deletes the bucket if its metageneration matches this value.
|
|
175
|
+
* @param {number} request.ifMetagenerationNotMatch
|
|
176
|
+
* If set, only deletes the bucket if its metageneration does not match this
|
|
177
|
+
* value.
|
|
178
|
+
* @param {object} [options]
|
|
179
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
180
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
181
|
+
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
|
|
182
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
183
|
+
* for more details and examples.
|
|
184
|
+
* @example <caption>include:samples/generated/v2/storage.delete_bucket.js</caption>
|
|
185
|
+
* region_tag:storage_v2_generated_Storage_DeleteBucket_async
|
|
186
|
+
*/
|
|
187
|
+
deleteBucket(request?: protos.google.storage.v2.IDeleteBucketRequest, options?: CallOptions): Promise<[
|
|
188
|
+
protos.google.protobuf.IEmpty,
|
|
189
|
+
protos.google.storage.v2.IDeleteBucketRequest | undefined,
|
|
190
|
+
{} | undefined
|
|
191
|
+
]>;
|
|
192
|
+
deleteBucket(request: protos.google.storage.v2.IDeleteBucketRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.v2.IDeleteBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
193
|
+
deleteBucket(request: protos.google.storage.v2.IDeleteBucketRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.v2.IDeleteBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
194
|
+
/**
|
|
195
|
+
* Returns metadata for the specified bucket.
|
|
196
|
+
*
|
|
197
|
+
* **IAM Permissions**:
|
|
198
|
+
*
|
|
199
|
+
* Requires `storage.buckets.get`
|
|
200
|
+
* IAM permission on
|
|
201
|
+
* the bucket. Additionally, to return specific bucket metadata, the
|
|
202
|
+
* authenticated user must have the following permissions:
|
|
203
|
+
*
|
|
204
|
+
* - To return the IAM policies: `storage.buckets.getIamPolicy`
|
|
205
|
+
* - To return the bucket IP filtering rules: `storage.buckets.getIpFilter`
|
|
206
|
+
*
|
|
207
|
+
* @param {Object} request
|
|
208
|
+
* The request object that will be sent.
|
|
209
|
+
* @param {string} request.name
|
|
210
|
+
* Required. Name of a bucket.
|
|
211
|
+
* @param {number} request.ifMetagenerationMatch
|
|
212
|
+
* If set, only gets the bucket metadata if its metageneration matches this
|
|
213
|
+
* value.
|
|
214
|
+
* @param {number} request.ifMetagenerationNotMatch
|
|
215
|
+
* If set, and if the bucket's current metageneration matches the specified
|
|
216
|
+
* value, the request returns an error.
|
|
217
|
+
* @param {google.protobuf.FieldMask} request.readMask
|
|
218
|
+
* Mask specifying which fields to read.
|
|
219
|
+
* A `*` field might be used to indicate all fields.
|
|
220
|
+
* If no mask is specified, it defaults to all fields.
|
|
221
|
+
* @param {object} [options]
|
|
222
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
223
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
224
|
+
* The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}.
|
|
225
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
226
|
+
* for more details and examples.
|
|
227
|
+
* @example <caption>include:samples/generated/v2/storage.get_bucket.js</caption>
|
|
228
|
+
* region_tag:storage_v2_generated_Storage_GetBucket_async
|
|
229
|
+
*/
|
|
230
|
+
getBucket(request?: protos.google.storage.v2.IGetBucketRequest, options?: CallOptions): Promise<[
|
|
231
|
+
protos.google.storage.v2.IBucket,
|
|
232
|
+
protos.google.storage.v2.IGetBucketRequest | undefined,
|
|
233
|
+
{} | undefined
|
|
234
|
+
]>;
|
|
235
|
+
getBucket(request: protos.google.storage.v2.IGetBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IGetBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
236
|
+
getBucket(request: protos.google.storage.v2.IGetBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IGetBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
237
|
+
/**
|
|
238
|
+
* Creates a new bucket.
|
|
239
|
+
*
|
|
240
|
+
* **IAM Permissions**:
|
|
241
|
+
*
|
|
242
|
+
* Requires `storage.buckets.create` IAM permission on the bucket.
|
|
243
|
+
* Additionally, to enable specific bucket features, the authenticated user
|
|
244
|
+
* must have the following permissions:
|
|
245
|
+
*
|
|
246
|
+
* - To enable object retention using the `enableObjectRetention` query
|
|
247
|
+
* parameter: `storage.buckets.enableObjectRetention`
|
|
248
|
+
* - To set the bucket IP filtering rules: `storage.buckets.setIpFilter`
|
|
249
|
+
*
|
|
250
|
+
* @param {Object} request
|
|
251
|
+
* The request object that will be sent.
|
|
252
|
+
* @param {string} request.parent
|
|
253
|
+
* Required. The project to which this bucket belongs. This field must either
|
|
254
|
+
* be empty or `projects/_`. The project ID that owns this bucket should be
|
|
255
|
+
* specified in the `bucket.project` field.
|
|
256
|
+
* @param {google.storage.v2.Bucket} [request.bucket]
|
|
257
|
+
* Optional. Properties of the new bucket being inserted.
|
|
258
|
+
* The name of the bucket is specified in the `bucket_id` field. Populating
|
|
259
|
+
* `bucket.name` field results in an error.
|
|
260
|
+
* The project of the bucket must be specified in the `bucket.project` field.
|
|
261
|
+
* This field must be in `projects/{projectIdentifier}` format,
|
|
262
|
+
* {projectIdentifier} can be the project ID or project number. The `parent`
|
|
263
|
+
* field must be either empty or `projects/_`.
|
|
264
|
+
* @param {string} request.bucketId
|
|
265
|
+
* Required. The ID to use for this bucket, which becomes the final component
|
|
266
|
+
* of the bucket's resource name. For example, the value `foo` might result in
|
|
267
|
+
* a bucket with the name `projects/123456/buckets/foo`.
|
|
268
|
+
* @param {string} [request.predefinedAcl]
|
|
269
|
+
* Optional. Apply a predefined set of access controls to this bucket.
|
|
270
|
+
* Valid values are `authenticatedRead`, `private`, `projectPrivate`,
|
|
271
|
+
* `publicRead`, or `publicReadWrite`.
|
|
272
|
+
* @param {string} [request.predefinedDefaultObjectAcl]
|
|
273
|
+
* Optional. Apply a predefined set of default object access controls to this
|
|
274
|
+
* bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
|
|
275
|
+
* `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
|
|
276
|
+
* @param {boolean} [request.enableObjectRetention]
|
|
277
|
+
* Optional. If true, enable object retention on the bucket.
|
|
278
|
+
* @param {object} [options]
|
|
279
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
280
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
281
|
+
* The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}.
|
|
282
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
283
|
+
* for more details and examples.
|
|
284
|
+
* @example <caption>include:samples/generated/v2/storage.create_bucket.js</caption>
|
|
285
|
+
* region_tag:storage_v2_generated_Storage_CreateBucket_async
|
|
286
|
+
*/
|
|
287
|
+
createBucket(request?: protos.google.storage.v2.ICreateBucketRequest, options?: CallOptions): Promise<[
|
|
288
|
+
protos.google.storage.v2.IBucket,
|
|
289
|
+
protos.google.storage.v2.ICreateBucketRequest | undefined,
|
|
290
|
+
{} | undefined
|
|
291
|
+
]>;
|
|
292
|
+
createBucket(request: protos.google.storage.v2.ICreateBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ICreateBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
293
|
+
createBucket(request: protos.google.storage.v2.ICreateBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ICreateBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
294
|
+
/**
|
|
295
|
+
* Permanently locks the retention
|
|
296
|
+
* policy that is
|
|
297
|
+
* currently applied to the specified bucket.
|
|
298
|
+
*
|
|
299
|
+
* Caution: Locking a bucket is an
|
|
300
|
+
* irreversible action. Once you lock a bucket:
|
|
301
|
+
*
|
|
302
|
+
* - You cannot remove the retention policy from the bucket.
|
|
303
|
+
* - You cannot decrease the retention period for the policy.
|
|
304
|
+
*
|
|
305
|
+
* Once locked, you must delete the entire bucket in order to remove the
|
|
306
|
+
* bucket's retention policy. However, before you can delete the bucket, you
|
|
307
|
+
* must delete all the objects in the bucket, which is only
|
|
308
|
+
* possible if all the objects have reached the retention period set by the
|
|
309
|
+
* retention policy.
|
|
310
|
+
*
|
|
311
|
+
* **IAM Permissions**:
|
|
312
|
+
*
|
|
313
|
+
* Requires `storage.buckets.update` IAM permission on the bucket.
|
|
314
|
+
*
|
|
315
|
+
* @param {Object} request
|
|
316
|
+
* The request object that will be sent.
|
|
317
|
+
* @param {string} request.bucket
|
|
318
|
+
* Required. Name of a bucket.
|
|
319
|
+
* @param {number} request.ifMetagenerationMatch
|
|
320
|
+
* Required. Makes the operation conditional on whether bucket's current
|
|
321
|
+
* metageneration matches the given value. Must be positive.
|
|
322
|
+
* @param {object} [options]
|
|
323
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
324
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
325
|
+
* The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}.
|
|
326
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
327
|
+
* for more details and examples.
|
|
328
|
+
* @example <caption>include:samples/generated/v2/storage.lock_bucket_retention_policy.js</caption>
|
|
329
|
+
* region_tag:storage_v2_generated_Storage_LockBucketRetentionPolicy_async
|
|
330
|
+
*/
|
|
331
|
+
lockBucketRetentionPolicy(request?: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, options?: CallOptions): Promise<[
|
|
332
|
+
protos.google.storage.v2.IBucket,
|
|
333
|
+
protos.google.storage.v2.ILockBucketRetentionPolicyRequest | undefined,
|
|
334
|
+
{} | undefined
|
|
335
|
+
]>;
|
|
336
|
+
lockBucketRetentionPolicy(request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ILockBucketRetentionPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
337
|
+
lockBucketRetentionPolicy(request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ILockBucketRetentionPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
338
|
+
/**
|
|
339
|
+
* Updates a bucket. Changes to the bucket are readable immediately after
|
|
340
|
+
* writing, but configuration changes might take time to propagate. This
|
|
341
|
+
* method supports `patch` semantics.
|
|
342
|
+
*
|
|
343
|
+
* **IAM Permissions**:
|
|
344
|
+
*
|
|
345
|
+
* Requires `storage.buckets.update` IAM permission on the bucket.
|
|
346
|
+
* Additionally, to enable specific bucket features, the authenticated user
|
|
347
|
+
* must have the following permissions:
|
|
348
|
+
*
|
|
349
|
+
* - To set bucket IP filtering rules: `storage.buckets.setIpFilter`
|
|
350
|
+
* - To update public access prevention policies or access control lists
|
|
351
|
+
* (ACLs): `storage.buckets.setIamPolicy`
|
|
352
|
+
*
|
|
353
|
+
* @param {Object} request
|
|
354
|
+
* The request object that will be sent.
|
|
355
|
+
* @param {google.storage.v2.Bucket} request.bucket
|
|
356
|
+
* Required. The bucket to update.
|
|
357
|
+
* The bucket's `name` field is used to identify the bucket.
|
|
358
|
+
* @param {number} request.ifMetagenerationMatch
|
|
359
|
+
* If set, the request modifies the bucket if its metageneration matches this
|
|
360
|
+
* value.
|
|
361
|
+
* @param {number} request.ifMetagenerationNotMatch
|
|
362
|
+
* If set, the request modifies the bucket if its metageneration doesn't
|
|
363
|
+
* match this value.
|
|
364
|
+
* @param {string} [request.predefinedAcl]
|
|
365
|
+
* Optional. Apply a predefined set of access controls to this bucket.
|
|
366
|
+
* Valid values are `authenticatedRead`, `private`, `projectPrivate`,
|
|
367
|
+
* `publicRead`, or `publicReadWrite`.
|
|
368
|
+
* @param {string} [request.predefinedDefaultObjectAcl]
|
|
369
|
+
* Optional. Apply a predefined set of default object access controls to this
|
|
370
|
+
* bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
|
|
371
|
+
* `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
|
|
372
|
+
* @param {google.protobuf.FieldMask} request.updateMask
|
|
373
|
+
* Required. List of fields to be updated.
|
|
374
|
+
*
|
|
375
|
+
* To specify ALL fields, equivalent to the JSON API's "update" function,
|
|
376
|
+
* specify a single field with the value `*`. Note: not recommended. If a new
|
|
377
|
+
* field is introduced at a later time, an older client updating with the `*`
|
|
378
|
+
* might accidentally reset the new field's value.
|
|
379
|
+
*
|
|
380
|
+
* Not specifying any fields is an error.
|
|
381
|
+
* @param {object} [options]
|
|
382
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
383
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
384
|
+
* The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}.
|
|
385
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
386
|
+
* for more details and examples.
|
|
387
|
+
* @example <caption>include:samples/generated/v2/storage.update_bucket.js</caption>
|
|
388
|
+
* region_tag:storage_v2_generated_Storage_UpdateBucket_async
|
|
389
|
+
*/
|
|
390
|
+
updateBucket(request?: protos.google.storage.v2.IUpdateBucketRequest, options?: CallOptions): Promise<[
|
|
391
|
+
protos.google.storage.v2.IBucket,
|
|
392
|
+
protos.google.storage.v2.IUpdateBucketRequest | undefined,
|
|
393
|
+
{} | undefined
|
|
394
|
+
]>;
|
|
395
|
+
updateBucket(request: protos.google.storage.v2.IUpdateBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IUpdateBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
396
|
+
updateBucket(request: protos.google.storage.v2.IUpdateBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IUpdateBucketRequest | null | undefined, {} | null | undefined>): void;
|
|
397
|
+
/**
|
|
398
|
+
* Retrieves a list of buckets for a given project, ordered
|
|
399
|
+
* lexicographically by name.
|
|
400
|
+
*
|
|
401
|
+
* **IAM Permissions**:
|
|
402
|
+
*
|
|
403
|
+
* Requires `storage.buckets.list` IAM permission on the bucket.
|
|
404
|
+
* Additionally, to enable specific bucket features, the authenticated
|
|
405
|
+
* user must have the following permissions:
|
|
406
|
+
*
|
|
407
|
+
* - To list the IAM policies: `storage.buckets.getIamPolicy`
|
|
408
|
+
* - To list the bucket IP filtering rules: `storage.buckets.getIpFilter`
|
|
409
|
+
*
|
|
410
|
+
* @param {Object} request
|
|
411
|
+
* The request object that will be sent.
|
|
412
|
+
* @param {string} request.parent
|
|
413
|
+
* Required. The project whose buckets we are listing.
|
|
414
|
+
* @param {number} [request.pageSize]
|
|
415
|
+
* Optional. Maximum number of buckets to return in a single response. The
|
|
416
|
+
* service uses this parameter or `1,000` items, whichever is smaller. If
|
|
417
|
+
* `acl` is present in the `read_mask`, the service uses this parameter of
|
|
418
|
+
* `200` items, whichever is smaller.
|
|
419
|
+
* @param {string} [request.pageToken]
|
|
420
|
+
* Optional. A previously-returned page token representing part of the larger
|
|
421
|
+
* set of results to view.
|
|
422
|
+
* @param {string} [request.prefix]
|
|
423
|
+
* Optional. Filter results to buckets whose names begin with this prefix.
|
|
424
|
+
* @param {google.protobuf.FieldMask} request.readMask
|
|
425
|
+
* Mask specifying which fields to read from each result.
|
|
426
|
+
* If no mask is specified, it defaults to all fields except `items.
|
|
427
|
+
* owner`, `items.acl`, and `items.default_object_acl`.
|
|
428
|
+
* `*` might be used to mean "all fields".
|
|
429
|
+
* @param {boolean} [request.returnPartialSuccess]
|
|
430
|
+
* Optional. Allows listing of buckets, even if there are buckets that are
|
|
431
|
+
* unreachable.
|
|
432
|
+
* @param {object} [options]
|
|
433
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
434
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
435
|
+
* The first element of the array is Array of {@link protos.google.storage.v2.Bucket|Bucket}.
|
|
436
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
437
|
+
* times as needed and will merge results from all the pages into this array.
|
|
438
|
+
* Note that it can affect your quota.
|
|
439
|
+
* We recommend using `listBucketsAsync()`
|
|
440
|
+
* method described below for async iteration which you can stop as needed.
|
|
441
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
442
|
+
* for more details and examples.
|
|
443
|
+
*/
|
|
444
|
+
listBuckets(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): Promise<[
|
|
445
|
+
protos.google.storage.v2.IBucket[],
|
|
446
|
+
protos.google.storage.v2.IListBucketsRequest | null,
|
|
447
|
+
protos.google.storage.v2.IListBucketsResponse
|
|
448
|
+
]>;
|
|
449
|
+
listBuckets(request: protos.google.storage.v2.IListBucketsRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.v2.IListBucketsRequest, protos.google.storage.v2.IListBucketsResponse | null | undefined, protos.google.storage.v2.IBucket>): void;
|
|
450
|
+
listBuckets(request: protos.google.storage.v2.IListBucketsRequest, callback: PaginationCallback<protos.google.storage.v2.IListBucketsRequest, protos.google.storage.v2.IListBucketsResponse | null | undefined, protos.google.storage.v2.IBucket>): void;
|
|
451
|
+
/**
|
|
452
|
+
* Equivalent to `listBuckets`, but returns a NodeJS Stream object.
|
|
453
|
+
* @param {Object} request
|
|
454
|
+
* The request object that will be sent.
|
|
455
|
+
* @param {string} request.parent
|
|
456
|
+
* Required. The project whose buckets we are listing.
|
|
457
|
+
* @param {number} [request.pageSize]
|
|
458
|
+
* Optional. Maximum number of buckets to return in a single response. The
|
|
459
|
+
* service uses this parameter or `1,000` items, whichever is smaller. If
|
|
460
|
+
* `acl` is present in the `read_mask`, the service uses this parameter of
|
|
461
|
+
* `200` items, whichever is smaller.
|
|
462
|
+
* @param {string} [request.pageToken]
|
|
463
|
+
* Optional. A previously-returned page token representing part of the larger
|
|
464
|
+
* set of results to view.
|
|
465
|
+
* @param {string} [request.prefix]
|
|
466
|
+
* Optional. Filter results to buckets whose names begin with this prefix.
|
|
467
|
+
* @param {google.protobuf.FieldMask} request.readMask
|
|
468
|
+
* Mask specifying which fields to read from each result.
|
|
469
|
+
* If no mask is specified, it defaults to all fields except `items.
|
|
470
|
+
* owner`, `items.acl`, and `items.default_object_acl`.
|
|
471
|
+
* `*` might be used to mean "all fields".
|
|
472
|
+
* @param {boolean} [request.returnPartialSuccess]
|
|
473
|
+
* Optional. Allows listing of buckets, even if there are buckets that are
|
|
474
|
+
* unreachable.
|
|
475
|
+
* @param {object} [options]
|
|
476
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
477
|
+
* @returns {Stream}
|
|
478
|
+
* An object stream which emits an object representing {@link protos.google.storage.v2.Bucket|Bucket} on 'data' event.
|
|
479
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
480
|
+
* times as needed. Note that it can affect your quota.
|
|
481
|
+
* We recommend using `listBucketsAsync()`
|
|
482
|
+
* method described below for async iteration which you can stop as needed.
|
|
483
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
484
|
+
* for more details and examples.
|
|
485
|
+
*/
|
|
486
|
+
listBucketsStream(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): Transform;
|
|
487
|
+
/**
|
|
488
|
+
* Equivalent to `listBuckets`, but returns an iterable object.
|
|
489
|
+
*
|
|
490
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
491
|
+
* @param {Object} request
|
|
492
|
+
* The request object that will be sent.
|
|
493
|
+
* @param {string} request.parent
|
|
494
|
+
* Required. The project whose buckets we are listing.
|
|
495
|
+
* @param {number} [request.pageSize]
|
|
496
|
+
* Optional. Maximum number of buckets to return in a single response. The
|
|
497
|
+
* service uses this parameter or `1,000` items, whichever is smaller. If
|
|
498
|
+
* `acl` is present in the `read_mask`, the service uses this parameter of
|
|
499
|
+
* `200` items, whichever is smaller.
|
|
500
|
+
* @param {string} [request.pageToken]
|
|
501
|
+
* Optional. A previously-returned page token representing part of the larger
|
|
502
|
+
* set of results to view.
|
|
503
|
+
* @param {string} [request.prefix]
|
|
504
|
+
* Optional. Filter results to buckets whose names begin with this prefix.
|
|
505
|
+
* @param {google.protobuf.FieldMask} request.readMask
|
|
506
|
+
* Mask specifying which fields to read from each result.
|
|
507
|
+
* If no mask is specified, it defaults to all fields except `items.
|
|
508
|
+
* owner`, `items.acl`, and `items.default_object_acl`.
|
|
509
|
+
* `*` might be used to mean "all fields".
|
|
510
|
+
* @param {boolean} [request.returnPartialSuccess]
|
|
511
|
+
* Optional. Allows listing of buckets, even if there are buckets that are
|
|
512
|
+
* unreachable.
|
|
513
|
+
* @param {object} [options]
|
|
514
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
515
|
+
* @returns {Object}
|
|
516
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
517
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
518
|
+
* {@link protos.google.storage.v2.Bucket|Bucket}. The API will be called under the hood as needed, once per the page,
|
|
519
|
+
* so you can stop the iteration when you don't need more results.
|
|
520
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
521
|
+
* for more details and examples.
|
|
522
|
+
* @example <caption>include:samples/generated/v2/storage.list_buckets.js</caption>
|
|
523
|
+
* region_tag:storage_v2_generated_Storage_ListBuckets_async
|
|
524
|
+
*/
|
|
525
|
+
listBucketsAsync(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): AsyncIterable<protos.google.storage.v2.IBucket>;
|
|
526
|
+
/**
|
|
527
|
+
* Return a fully-qualified bucket resource name string.
|
|
528
|
+
*
|
|
529
|
+
* @param {string} project
|
|
530
|
+
* @param {string} bucket
|
|
531
|
+
* @returns {string} Resource name string.
|
|
532
|
+
*/
|
|
533
|
+
bucketPath(project: string, bucket: string): string;
|
|
534
|
+
/**
|
|
535
|
+
* Parse the project from Bucket resource.
|
|
536
|
+
*
|
|
537
|
+
* @param {string} bucketName
|
|
538
|
+
* A fully-qualified path representing Bucket resource.
|
|
539
|
+
* @returns {string} A string representing the project.
|
|
540
|
+
*/
|
|
541
|
+
matchProjectFromBucketName(bucketName: string): string | number;
|
|
542
|
+
/**
|
|
543
|
+
* Parse the bucket from Bucket resource.
|
|
544
|
+
*
|
|
545
|
+
* @param {string} bucketName
|
|
546
|
+
* A fully-qualified path representing Bucket resource.
|
|
547
|
+
* @returns {string} A string representing the bucket.
|
|
548
|
+
*/
|
|
549
|
+
matchBucketFromBucketName(bucketName: string): string | number;
|
|
550
|
+
/**
|
|
551
|
+
* Return a fully-qualified cryptoKey resource name string.
|
|
552
|
+
*
|
|
553
|
+
* @param {string} project
|
|
554
|
+
* @param {string} location
|
|
555
|
+
* @param {string} key_ring
|
|
556
|
+
* @param {string} crypto_key
|
|
557
|
+
* @returns {string} Resource name string.
|
|
558
|
+
*/
|
|
559
|
+
cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;
|
|
560
|
+
/**
|
|
561
|
+
* Parse the project from CryptoKey resource.
|
|
562
|
+
*
|
|
563
|
+
* @param {string} cryptoKeyName
|
|
564
|
+
* A fully-qualified path representing CryptoKey resource.
|
|
565
|
+
* @returns {string} A string representing the project.
|
|
566
|
+
*/
|
|
567
|
+
matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;
|
|
568
|
+
/**
|
|
569
|
+
* Parse the location from CryptoKey resource.
|
|
570
|
+
*
|
|
571
|
+
* @param {string} cryptoKeyName
|
|
572
|
+
* A fully-qualified path representing CryptoKey resource.
|
|
573
|
+
* @returns {string} A string representing the location.
|
|
574
|
+
*/
|
|
575
|
+
matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;
|
|
576
|
+
/**
|
|
577
|
+
* Parse the key_ring from CryptoKey resource.
|
|
578
|
+
*
|
|
579
|
+
* @param {string} cryptoKeyName
|
|
580
|
+
* A fully-qualified path representing CryptoKey resource.
|
|
581
|
+
* @returns {string} A string representing the key_ring.
|
|
582
|
+
*/
|
|
583
|
+
matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;
|
|
584
|
+
/**
|
|
585
|
+
* Parse the crypto_key from CryptoKey resource.
|
|
586
|
+
*
|
|
587
|
+
* @param {string} cryptoKeyName
|
|
588
|
+
* A fully-qualified path representing CryptoKey resource.
|
|
589
|
+
* @returns {string} A string representing the crypto_key.
|
|
590
|
+
*/
|
|
591
|
+
matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;
|
|
592
|
+
/**
|
|
593
|
+
* Return a fully-qualified project resource name string.
|
|
594
|
+
*
|
|
595
|
+
* @param {string} project
|
|
596
|
+
* @returns {string} Resource name string.
|
|
597
|
+
*/
|
|
598
|
+
projectPath(project: string): string;
|
|
599
|
+
/**
|
|
600
|
+
* Parse the project from Project resource.
|
|
601
|
+
*
|
|
602
|
+
* @param {string} projectName
|
|
603
|
+
* A fully-qualified path representing Project resource.
|
|
604
|
+
* @returns {string} A string representing the project.
|
|
605
|
+
*/
|
|
606
|
+
matchProjectFromProjectName(projectName: string): string | number;
|
|
607
|
+
/**
|
|
608
|
+
* Terminate the gRPC channel and close the client.
|
|
609
|
+
*
|
|
610
|
+
* The client will no longer be usable and all future behavior is undefined.
|
|
611
|
+
* @returns {Promise} A promise that resolves when the client is closed.
|
|
612
|
+
*/
|
|
613
|
+
close(): Promise<void>;
|
|
614
|
+
}
|