@googleapis/storagebatchoperations 1.0.1

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/v1.ts ADDED
@@ -0,0 +1,1692 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/no-unused-vars */
16
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17
+ /* eslint-disable @typescript-eslint/no-namespace */
18
+ /* eslint-disable no-irregular-whitespace */
19
+
20
+ import {
21
+ OAuth2Client,
22
+ JWT,
23
+ Compute,
24
+ UserRefreshClient,
25
+ BaseExternalAccountClient,
26
+ GaxiosResponseWithHTTP2,
27
+ GoogleConfigurable,
28
+ createAPIRequest,
29
+ MethodOptions,
30
+ StreamMethodOptions,
31
+ GlobalOptions,
32
+ GoogleAuth,
33
+ BodyResponseCallback,
34
+ APIRequestContext,
35
+ } from 'googleapis-common';
36
+ import {Readable} from 'stream';
37
+
38
+ export namespace storagebatchoperations_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'v1';
41
+ }
42
+
43
+ interface StandardParameters {
44
+ /**
45
+ * Auth client or API Key for the request
46
+ */
47
+ auth?:
48
+ | string
49
+ | OAuth2Client
50
+ | JWT
51
+ | Compute
52
+ | UserRefreshClient
53
+ | BaseExternalAccountClient
54
+ | GoogleAuth;
55
+
56
+ /**
57
+ * V1 error format.
58
+ */
59
+ '$.xgafv'?: string;
60
+ /**
61
+ * OAuth access token.
62
+ */
63
+ access_token?: string;
64
+ /**
65
+ * Data format for response.
66
+ */
67
+ alt?: string;
68
+ /**
69
+ * JSONP
70
+ */
71
+ callback?: string;
72
+ /**
73
+ * Selector specifying which fields to include in a partial response.
74
+ */
75
+ fields?: string;
76
+ /**
77
+ * 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.
78
+ */
79
+ key?: string;
80
+ /**
81
+ * OAuth 2.0 token for the current user.
82
+ */
83
+ oauth_token?: string;
84
+ /**
85
+ * Returns response with indentations and line breaks.
86
+ */
87
+ prettyPrint?: boolean;
88
+ /**
89
+ * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
90
+ */
91
+ quotaUser?: string;
92
+ /**
93
+ * Legacy upload protocol for media (e.g. "media", "multipart").
94
+ */
95
+ uploadType?: string;
96
+ /**
97
+ * Upload protocol for media (e.g. "raw", "multipart").
98
+ */
99
+ upload_protocol?: string;
100
+ }
101
+
102
+ /**
103
+ * Storage Batch Operations API
104
+ *
105
+ *
106
+ *
107
+ * @example
108
+ * ```js
109
+ * const {google} = require('googleapis');
110
+ * const storagebatchoperations = google.storagebatchoperations('v1');
111
+ * ```
112
+ */
113
+ export class Storagebatchoperations {
114
+ context: APIRequestContext;
115
+ projects: Resource$Projects;
116
+
117
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
118
+ this.context = {
119
+ _options: options || {},
120
+ google,
121
+ };
122
+
123
+ this.projects = new Resource$Projects(this.context);
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Describes configuration of a single bucket and its objects to be transformed.
129
+ */
130
+ export interface Schema$Bucket {
131
+ /**
132
+ * Required. Bucket name for the objects to be transformed.
133
+ */
134
+ bucket?: string | null;
135
+ /**
136
+ * Specifies objects in a manifest file.
137
+ */
138
+ manifest?: Schema$Manifest;
139
+ /**
140
+ * Specifies objects matching a prefix set.
141
+ */
142
+ prefixList?: Schema$PrefixList;
143
+ }
144
+ /**
145
+ * Describes list of buckets and their objects to be transformed.
146
+ */
147
+ export interface Schema$BucketList {
148
+ /**
149
+ * Required. List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned.
150
+ */
151
+ buckets?: Schema$Bucket[];
152
+ }
153
+ /**
154
+ * Message for Job to Cancel
155
+ */
156
+ export interface Schema$CancelJobRequest {
157
+ /**
158
+ * Optional. An optional request ID to identify requests. Specify a unique request ID in case you need to retry your request. Requests with same `request_id` will be ignored for at least 60 minutes since the first request. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
159
+ */
160
+ requestId?: string | null;
161
+ }
162
+ /**
163
+ * Message for response to cancel Job.
164
+ */
165
+ export interface Schema$CancelJobResponse {}
166
+ /**
167
+ * The request message for Operations.CancelOperation.
168
+ */
169
+ export interface Schema$CancelOperationRequest {}
170
+ /**
171
+ * Describes details about the progress of the job.
172
+ */
173
+ export interface Schema$Counters {
174
+ /**
175
+ * Output only. Number of objects failed.
176
+ */
177
+ failedObjectCount?: string | null;
178
+ /**
179
+ * Output only. Number of objects completed.
180
+ */
181
+ succeededObjectCount?: string | null;
182
+ /**
183
+ * Output only. Number of objects listed.
184
+ */
185
+ totalObjectCount?: string | null;
186
+ }
187
+ /**
188
+ * Describes options to delete an object.
189
+ */
190
+ export interface Schema$DeleteObject {
191
+ /**
192
+ * Required. Controls deletion behavior when versioning is enabled for the object's bucket. If true both live and noncurrent objects will be permanently deleted. Otherwise live objects in versioned buckets will become noncurrent and objects that were already noncurrent will be skipped. This setting doesn't have any impact on the Soft Delete feature. All objects deleted by this service can be be restored for the duration of the Soft Delete retention duration if enabled. If enabled and the manifest doesn't specify an object's generation, a GetObjectMetadata call (a Class B operation) will be made to determine the live object generation.
193
+ */
194
+ permanentObjectDeletionEnabled?: boolean | null;
195
+ }
196
+ /**
197
+ * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \}
198
+ */
199
+ export interface Schema$Empty {}
200
+ /**
201
+ * An entry describing an error that has occurred.
202
+ */
203
+ export interface Schema$ErrorLogEntry {
204
+ /**
205
+ * Optional. Output only. At most 5 error log entries are recorded for a given error code for a job.
206
+ */
207
+ errorDetails?: string[] | null;
208
+ /**
209
+ * Required. Output only. Object URL. e.g. gs://my_bucket/object.txt
210
+ */
211
+ objectUri?: string | null;
212
+ }
213
+ /**
214
+ * A summary of errors by error code, plus a count and sample error log entries.
215
+ */
216
+ export interface Schema$ErrorSummary {
217
+ /**
218
+ * Required. The canonical error code.
219
+ */
220
+ errorCode?: string | null;
221
+ /**
222
+ * Required. Number of errors encountered per `error_code`.
223
+ */
224
+ errorCount?: string | null;
225
+ /**
226
+ * Required. Sample error logs.
227
+ */
228
+ errorLogEntries?: Schema$ErrorLogEntry[];
229
+ }
230
+ /**
231
+ * The Storage Batch Operations Job description.
232
+ */
233
+ export interface Schema$Job {
234
+ /**
235
+ * Specifies a list of buckets and their objects to be transformed.
236
+ */
237
+ bucketList?: Schema$BucketList;
238
+ /**
239
+ * Output only. The time that the job was completed.
240
+ */
241
+ completeTime?: string | null;
242
+ /**
243
+ * Output only. Information about the progress of the job.
244
+ */
245
+ counters?: Schema$Counters;
246
+ /**
247
+ * Output only. The time that the job was created.
248
+ */
249
+ createTime?: string | null;
250
+ /**
251
+ * Delete objects.
252
+ */
253
+ deleteObject?: Schema$DeleteObject;
254
+ /**
255
+ * Optional. A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.
256
+ */
257
+ description?: string | null;
258
+ /**
259
+ * Output only. Summarizes errors encountered with sample error log entries.
260
+ */
261
+ errorSummaries?: Schema$ErrorSummary[];
262
+ /**
263
+ * Optional. Logging configuration.
264
+ */
265
+ loggingConfig?: Schema$LoggingConfig;
266
+ /**
267
+ * Identifier. The resource name of the Job. job_id is unique within the project, that is either set by the customer or defined by the service. Format: projects/{project\}/locations/global/jobs/{job_id\} . For example: "projects/123456/locations/global/jobs/job01".
268
+ */
269
+ name?: string | null;
270
+ /**
271
+ * Updates object metadata. Allows updating fixed-key and custom metadata and fixed-key metadata i.e. Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time.
272
+ */
273
+ putMetadata?: Schema$PutMetadata;
274
+ /**
275
+ * Changes object hold status.
276
+ */
277
+ putObjectHold?: Schema$PutObjectHold;
278
+ /**
279
+ * Rewrite the object and updates metadata like KMS key.
280
+ */
281
+ rewriteObject?: Schema$RewriteObject;
282
+ /**
283
+ * Output only. The time that the job was scheduled.
284
+ */
285
+ scheduleTime?: string | null;
286
+ /**
287
+ * Output only. State of the job.
288
+ */
289
+ state?: string | null;
290
+ }
291
+ /**
292
+ * Message for response to listing Jobs
293
+ */
294
+ export interface Schema$ListJobsResponse {
295
+ /**
296
+ * A list of storage batch jobs.
297
+ */
298
+ jobs?: Schema$Job[];
299
+ /**
300
+ * A token identifying a page of results.
301
+ */
302
+ nextPageToken?: string | null;
303
+ /**
304
+ * Locations that could not be reached.
305
+ */
306
+ unreachable?: string[] | null;
307
+ }
308
+ /**
309
+ * The response message for Locations.ListLocations.
310
+ */
311
+ export interface Schema$ListLocationsResponse {
312
+ /**
313
+ * A list of locations that matches the specified filter in the request.
314
+ */
315
+ locations?: Schema$Location[];
316
+ /**
317
+ * The standard List next-page token.
318
+ */
319
+ nextPageToken?: string | null;
320
+ }
321
+ /**
322
+ * The response message for Operations.ListOperations.
323
+ */
324
+ export interface Schema$ListOperationsResponse {
325
+ /**
326
+ * The standard List next-page token.
327
+ */
328
+ nextPageToken?: string | null;
329
+ /**
330
+ * A list of operations that matches the specified filter in the request.
331
+ */
332
+ operations?: Schema$Operation[];
333
+ }
334
+ /**
335
+ * A resource that represents a Google Cloud location.
336
+ */
337
+ export interface Schema$Location {
338
+ /**
339
+ * The friendly name for this location, typically a nearby city name. For example, "Tokyo".
340
+ */
341
+ displayName?: string | null;
342
+ /**
343
+ * Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"\}
344
+ */
345
+ labels?: {[key: string]: string} | null;
346
+ /**
347
+ * The canonical id for this location. For example: `"us-east1"`.
348
+ */
349
+ locationId?: string | null;
350
+ /**
351
+ * Service-specific metadata. For example the available capacity at the given location.
352
+ */
353
+ metadata?: {[key: string]: any} | null;
354
+ /**
355
+ * Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
356
+ */
357
+ name?: string | null;
358
+ }
359
+ /**
360
+ * Specifies the Cloud Logging behavior.
361
+ */
362
+ export interface Schema$LoggingConfig {
363
+ /**
364
+ * Required. Specifies the actions to be logged.
365
+ */
366
+ logActions?: string[] | null;
367
+ /**
368
+ * Required. States in which Action are logged.If empty, no logs are generated.
369
+ */
370
+ logActionStates?: string[] | null;
371
+ }
372
+ /**
373
+ * Describes list of objects to be transformed.
374
+ */
375
+ export interface Schema$Manifest {
376
+ /**
377
+ * Required. `manifest_location` must contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Each row in the file must include the object details i.e. BucketId and Name. Generation may optionally be specified. When it is not specified the live object is acted upon. `manifest_location` should either be 1) An absolute path to the object in the format of `gs://bucket_name/path/file_name.csv`. 2) An absolute path with a single wildcard character in the file name, for example `gs://bucket_name/path/file_name*.csv`. If manifest location is specified with a wildcard, objects in all manifest files matching the pattern will be acted upon.
378
+ */
379
+ manifestLocation?: string | null;
380
+ }
381
+ /**
382
+ * This resource represents a long-running operation that is the result of a network API call.
383
+ */
384
+ export interface Schema$Operation {
385
+ /**
386
+ * 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.
387
+ */
388
+ done?: boolean | null;
389
+ /**
390
+ * The error result of the operation in case of failure or cancellation.
391
+ */
392
+ error?: Schema$Status;
393
+ /**
394
+ * 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.
395
+ */
396
+ metadata?: {[key: string]: any} | null;
397
+ /**
398
+ * 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/{unique_id\}`.
399
+ */
400
+ name?: string | null;
401
+ /**
402
+ * The normal, successful response of the operation. 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`.
403
+ */
404
+ response?: {[key: string]: any} | null;
405
+ }
406
+ /**
407
+ * Represents the metadata of the long-running operation.
408
+ */
409
+ export interface Schema$OperationMetadata {
410
+ /**
411
+ * Output only. API version used to start the operation.
412
+ */
413
+ apiVersion?: string | null;
414
+ /**
415
+ * Output only. The time the operation was created.
416
+ */
417
+ createTime?: string | null;
418
+ /**
419
+ * Output only. The time the operation finished running.
420
+ */
421
+ endTime?: string | null;
422
+ /**
423
+ * Output only. The Job associated with the operation.
424
+ */
425
+ job?: Schema$Job;
426
+ /**
427
+ * Output only. The unique operation resource name. Format: projects/{project\}/locations/global/operations/{operation\}.
428
+ */
429
+ operation?: string | null;
430
+ /**
431
+ * Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have google.longrunning.Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
432
+ */
433
+ requestedCancellation?: boolean | null;
434
+ }
435
+ /**
436
+ * Describes prefixes of objects to be transformed.
437
+ */
438
+ export interface Schema$PrefixList {
439
+ /**
440
+ * Optional. Include prefixes of the objects to be transformed. * Supports full object name * Supports prefix of the object name * Wildcards are not supported * Supports empty string for all objects in a bucket.
441
+ */
442
+ includedObjectPrefixes?: string[] | null;
443
+ }
444
+ /**
445
+ * Describes options for object metadata update.
446
+ */
447
+ export interface Schema$PutMetadata {
448
+ /**
449
+ * Optional. Updates objects Cache-Control fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Additionally, the value for Custom-Time cannot decrease. Refer to documentation in https://cloud.google.com/storage/docs/metadata#caching_data.
450
+ */
451
+ cacheControl?: string | null;
452
+ /**
453
+ * Optional. Updates objects Content-Disposition fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer https://cloud.google.com/storage/docs/metadata#content-disposition for additional documentation.
454
+ */
455
+ contentDisposition?: string | null;
456
+ /**
457
+ * Optional. Updates objects Content-Encoding fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-encoding.
458
+ */
459
+ contentEncoding?: string | null;
460
+ /**
461
+ * Optional. Updates objects Content-Language fixed metadata. Refer to ISO 639-1 language codes for typical values of this metadata. Max length 100 characters. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-language.
462
+ */
463
+ contentLanguage?: string | null;
464
+ /**
465
+ * Optional. Updates objects Content-Type fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-type
466
+ */
467
+ contentType?: string | null;
468
+ /**
469
+ * Optional. Updates objects custom metadata. Adds or sets individual custom metadata key value pairs on objects. Keys that are set with empty custom metadata values will have its value cleared. Existing custom metadata not specified with this flag is not changed. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-metadata
470
+ */
471
+ customMetadata?: {[key: string]: string} | null;
472
+ /**
473
+ * Optional. Updates objects Custom-Time fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-time.
474
+ */
475
+ customTime?: string | null;
476
+ }
477
+ /**
478
+ * Describes options to update object hold.
479
+ */
480
+ export interface Schema$PutObjectHold {
481
+ /**
482
+ * Required. Updates object event based holds state. When object event based hold is set, object cannot be deleted or replaced. Resets object's time in the bucket for the purposes of the retention period.
483
+ */
484
+ eventBasedHold?: string | null;
485
+ /**
486
+ * Required. Updates object temporary holds state. When object temporary hold is set, object cannot be deleted or replaced.
487
+ */
488
+ temporaryHold?: string | null;
489
+ }
490
+ /**
491
+ * Describes options for object rewrite.
492
+ */
493
+ export interface Schema$RewriteObject {
494
+ /**
495
+ * Required. Resource name of the Cloud KMS key that will be used to encrypt the object. The Cloud KMS key must be located in same location as the object. Refer to https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key for additional documentation. Format: projects/{project\}/locations/{location\}/keyRings/{keyring\}/cryptoKeys/{key\} For example: "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". The object will be rewritten and set with the specified KMS key.
496
+ */
497
+ kmsKey?: string | null;
498
+ }
499
+ /**
500
+ * 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).
501
+ */
502
+ export interface Schema$Status {
503
+ /**
504
+ * The status code, which should be an enum value of google.rpc.Code.
505
+ */
506
+ code?: number | null;
507
+ /**
508
+ * A list of messages that carry the error details. There is a common set of message types for APIs to use.
509
+ */
510
+ details?: Array<{[key: string]: any}> | null;
511
+ /**
512
+ * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
513
+ */
514
+ message?: string | null;
515
+ }
516
+
517
+ export class Resource$Projects {
518
+ context: APIRequestContext;
519
+ locations: Resource$Projects$Locations;
520
+ constructor(context: APIRequestContext) {
521
+ this.context = context;
522
+ this.locations = new Resource$Projects$Locations(this.context);
523
+ }
524
+ }
525
+
526
+ export class Resource$Projects$Locations {
527
+ context: APIRequestContext;
528
+ jobs: Resource$Projects$Locations$Jobs;
529
+ operations: Resource$Projects$Locations$Operations;
530
+ constructor(context: APIRequestContext) {
531
+ this.context = context;
532
+ this.jobs = new Resource$Projects$Locations$Jobs(this.context);
533
+ this.operations = new Resource$Projects$Locations$Operations(
534
+ this.context
535
+ );
536
+ }
537
+
538
+ /**
539
+ * Gets information about a location.
540
+ *
541
+ * @param params - Parameters for request
542
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
543
+ * @param callback - Optional callback that handles the response.
544
+ * @returns A promise if used with async/await, or void if used with a callback.
545
+ */
546
+ get(
547
+ params: Params$Resource$Projects$Locations$Get,
548
+ options: StreamMethodOptions
549
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
550
+ get(
551
+ params?: Params$Resource$Projects$Locations$Get,
552
+ options?: MethodOptions
553
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Location>>;
554
+ get(
555
+ params: Params$Resource$Projects$Locations$Get,
556
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
557
+ callback: BodyResponseCallback<Readable>
558
+ ): void;
559
+ get(
560
+ params: Params$Resource$Projects$Locations$Get,
561
+ options: MethodOptions | BodyResponseCallback<Schema$Location>,
562
+ callback: BodyResponseCallback<Schema$Location>
563
+ ): void;
564
+ get(
565
+ params: Params$Resource$Projects$Locations$Get,
566
+ callback: BodyResponseCallback<Schema$Location>
567
+ ): void;
568
+ get(callback: BodyResponseCallback<Schema$Location>): void;
569
+ get(
570
+ paramsOrCallback?:
571
+ | Params$Resource$Projects$Locations$Get
572
+ | BodyResponseCallback<Schema$Location>
573
+ | BodyResponseCallback<Readable>,
574
+ optionsOrCallback?:
575
+ | MethodOptions
576
+ | StreamMethodOptions
577
+ | BodyResponseCallback<Schema$Location>
578
+ | BodyResponseCallback<Readable>,
579
+ callback?:
580
+ | BodyResponseCallback<Schema$Location>
581
+ | BodyResponseCallback<Readable>
582
+ ):
583
+ | void
584
+ | Promise<GaxiosResponseWithHTTP2<Schema$Location>>
585
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
586
+ let params = (paramsOrCallback ||
587
+ {}) as Params$Resource$Projects$Locations$Get;
588
+ let options = (optionsOrCallback || {}) as MethodOptions;
589
+
590
+ if (typeof paramsOrCallback === 'function') {
591
+ callback = paramsOrCallback;
592
+ params = {} as Params$Resource$Projects$Locations$Get;
593
+ options = {};
594
+ }
595
+
596
+ if (typeof optionsOrCallback === 'function') {
597
+ callback = optionsOrCallback;
598
+ options = {};
599
+ }
600
+
601
+ const rootUrl =
602
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
603
+ const parameters = {
604
+ options: Object.assign(
605
+ {
606
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
607
+ method: 'GET',
608
+ apiVersion: '',
609
+ },
610
+ options
611
+ ),
612
+ params,
613
+ requiredParams: ['name'],
614
+ pathParams: ['name'],
615
+ context: this.context,
616
+ };
617
+ if (callback) {
618
+ createAPIRequest<Schema$Location>(
619
+ parameters,
620
+ callback as BodyResponseCallback<unknown>
621
+ );
622
+ } else {
623
+ return createAPIRequest<Schema$Location>(parameters);
624
+ }
625
+ }
626
+
627
+ /**
628
+ * Lists information about the supported locations for this service.
629
+ *
630
+ * @param params - Parameters for request
631
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
632
+ * @param callback - Optional callback that handles the response.
633
+ * @returns A promise if used with async/await, or void if used with a callback.
634
+ */
635
+ list(
636
+ params: Params$Resource$Projects$Locations$List,
637
+ options: StreamMethodOptions
638
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
639
+ list(
640
+ params?: Params$Resource$Projects$Locations$List,
641
+ options?: MethodOptions
642
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>;
643
+ list(
644
+ params: Params$Resource$Projects$Locations$List,
645
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
646
+ callback: BodyResponseCallback<Readable>
647
+ ): void;
648
+ list(
649
+ params: Params$Resource$Projects$Locations$List,
650
+ options:
651
+ | MethodOptions
652
+ | BodyResponseCallback<Schema$ListLocationsResponse>,
653
+ callback: BodyResponseCallback<Schema$ListLocationsResponse>
654
+ ): void;
655
+ list(
656
+ params: Params$Resource$Projects$Locations$List,
657
+ callback: BodyResponseCallback<Schema$ListLocationsResponse>
658
+ ): void;
659
+ list(callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
660
+ list(
661
+ paramsOrCallback?:
662
+ | Params$Resource$Projects$Locations$List
663
+ | BodyResponseCallback<Schema$ListLocationsResponse>
664
+ | BodyResponseCallback<Readable>,
665
+ optionsOrCallback?:
666
+ | MethodOptions
667
+ | StreamMethodOptions
668
+ | BodyResponseCallback<Schema$ListLocationsResponse>
669
+ | BodyResponseCallback<Readable>,
670
+ callback?:
671
+ | BodyResponseCallback<Schema$ListLocationsResponse>
672
+ | BodyResponseCallback<Readable>
673
+ ):
674
+ | void
675
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>
676
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
677
+ let params = (paramsOrCallback ||
678
+ {}) as Params$Resource$Projects$Locations$List;
679
+ let options = (optionsOrCallback || {}) as MethodOptions;
680
+
681
+ if (typeof paramsOrCallback === 'function') {
682
+ callback = paramsOrCallback;
683
+ params = {} as Params$Resource$Projects$Locations$List;
684
+ options = {};
685
+ }
686
+
687
+ if (typeof optionsOrCallback === 'function') {
688
+ callback = optionsOrCallback;
689
+ options = {};
690
+ }
691
+
692
+ const rootUrl =
693
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
694
+ const parameters = {
695
+ options: Object.assign(
696
+ {
697
+ url: (rootUrl + '/v1/{+name}/locations').replace(
698
+ /([^:]\/)\/+/g,
699
+ '$1'
700
+ ),
701
+ method: 'GET',
702
+ apiVersion: '',
703
+ },
704
+ options
705
+ ),
706
+ params,
707
+ requiredParams: ['name'],
708
+ pathParams: ['name'],
709
+ context: this.context,
710
+ };
711
+ if (callback) {
712
+ createAPIRequest<Schema$ListLocationsResponse>(
713
+ parameters,
714
+ callback as BodyResponseCallback<unknown>
715
+ );
716
+ } else {
717
+ return createAPIRequest<Schema$ListLocationsResponse>(parameters);
718
+ }
719
+ }
720
+ }
721
+
722
+ export interface Params$Resource$Projects$Locations$Get
723
+ extends StandardParameters {
724
+ /**
725
+ * Resource name for the location.
726
+ */
727
+ name?: string;
728
+ }
729
+ export interface Params$Resource$Projects$Locations$List
730
+ extends StandardParameters {
731
+ /**
732
+ * Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
733
+ */
734
+ extraLocationTypes?: string[];
735
+ /**
736
+ * A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
737
+ */
738
+ filter?: string;
739
+ /**
740
+ * The resource that owns the locations collection, if applicable.
741
+ */
742
+ name?: string;
743
+ /**
744
+ * The maximum number of results to return. If not set, the service selects a default.
745
+ */
746
+ pageSize?: number;
747
+ /**
748
+ * A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
749
+ */
750
+ pageToken?: string;
751
+ }
752
+
753
+ export class Resource$Projects$Locations$Jobs {
754
+ context: APIRequestContext;
755
+ constructor(context: APIRequestContext) {
756
+ this.context = context;
757
+ }
758
+
759
+ /**
760
+ * Cancels a batch job.
761
+ *
762
+ * @param params - Parameters for request
763
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
764
+ * @param callback - Optional callback that handles the response.
765
+ * @returns A promise if used with async/await, or void if used with a callback.
766
+ */
767
+ cancel(
768
+ params: Params$Resource$Projects$Locations$Jobs$Cancel,
769
+ options: StreamMethodOptions
770
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
771
+ cancel(
772
+ params?: Params$Resource$Projects$Locations$Jobs$Cancel,
773
+ options?: MethodOptions
774
+ ): Promise<GaxiosResponseWithHTTP2<Schema$CancelJobResponse>>;
775
+ cancel(
776
+ params: Params$Resource$Projects$Locations$Jobs$Cancel,
777
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
778
+ callback: BodyResponseCallback<Readable>
779
+ ): void;
780
+ cancel(
781
+ params: Params$Resource$Projects$Locations$Jobs$Cancel,
782
+ options: MethodOptions | BodyResponseCallback<Schema$CancelJobResponse>,
783
+ callback: BodyResponseCallback<Schema$CancelJobResponse>
784
+ ): void;
785
+ cancel(
786
+ params: Params$Resource$Projects$Locations$Jobs$Cancel,
787
+ callback: BodyResponseCallback<Schema$CancelJobResponse>
788
+ ): void;
789
+ cancel(callback: BodyResponseCallback<Schema$CancelJobResponse>): void;
790
+ cancel(
791
+ paramsOrCallback?:
792
+ | Params$Resource$Projects$Locations$Jobs$Cancel
793
+ | BodyResponseCallback<Schema$CancelJobResponse>
794
+ | BodyResponseCallback<Readable>,
795
+ optionsOrCallback?:
796
+ | MethodOptions
797
+ | StreamMethodOptions
798
+ | BodyResponseCallback<Schema$CancelJobResponse>
799
+ | BodyResponseCallback<Readable>,
800
+ callback?:
801
+ | BodyResponseCallback<Schema$CancelJobResponse>
802
+ | BodyResponseCallback<Readable>
803
+ ):
804
+ | void
805
+ | Promise<GaxiosResponseWithHTTP2<Schema$CancelJobResponse>>
806
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
807
+ let params = (paramsOrCallback ||
808
+ {}) as Params$Resource$Projects$Locations$Jobs$Cancel;
809
+ let options = (optionsOrCallback || {}) as MethodOptions;
810
+
811
+ if (typeof paramsOrCallback === 'function') {
812
+ callback = paramsOrCallback;
813
+ params = {} as Params$Resource$Projects$Locations$Jobs$Cancel;
814
+ options = {};
815
+ }
816
+
817
+ if (typeof optionsOrCallback === 'function') {
818
+ callback = optionsOrCallback;
819
+ options = {};
820
+ }
821
+
822
+ const rootUrl =
823
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
824
+ const parameters = {
825
+ options: Object.assign(
826
+ {
827
+ url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'),
828
+ method: 'POST',
829
+ apiVersion: '',
830
+ },
831
+ options
832
+ ),
833
+ params,
834
+ requiredParams: ['name'],
835
+ pathParams: ['name'],
836
+ context: this.context,
837
+ };
838
+ if (callback) {
839
+ createAPIRequest<Schema$CancelJobResponse>(
840
+ parameters,
841
+ callback as BodyResponseCallback<unknown>
842
+ );
843
+ } else {
844
+ return createAPIRequest<Schema$CancelJobResponse>(parameters);
845
+ }
846
+ }
847
+
848
+ /**
849
+ * Creates a batch job.
850
+ *
851
+ * @param params - Parameters for request
852
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
853
+ * @param callback - Optional callback that handles the response.
854
+ * @returns A promise if used with async/await, or void if used with a callback.
855
+ */
856
+ create(
857
+ params: Params$Resource$Projects$Locations$Jobs$Create,
858
+ options: StreamMethodOptions
859
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
860
+ create(
861
+ params?: Params$Resource$Projects$Locations$Jobs$Create,
862
+ options?: MethodOptions
863
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
864
+ create(
865
+ params: Params$Resource$Projects$Locations$Jobs$Create,
866
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
867
+ callback: BodyResponseCallback<Readable>
868
+ ): void;
869
+ create(
870
+ params: Params$Resource$Projects$Locations$Jobs$Create,
871
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
872
+ callback: BodyResponseCallback<Schema$Operation>
873
+ ): void;
874
+ create(
875
+ params: Params$Resource$Projects$Locations$Jobs$Create,
876
+ callback: BodyResponseCallback<Schema$Operation>
877
+ ): void;
878
+ create(callback: BodyResponseCallback<Schema$Operation>): void;
879
+ create(
880
+ paramsOrCallback?:
881
+ | Params$Resource$Projects$Locations$Jobs$Create
882
+ | BodyResponseCallback<Schema$Operation>
883
+ | BodyResponseCallback<Readable>,
884
+ optionsOrCallback?:
885
+ | MethodOptions
886
+ | StreamMethodOptions
887
+ | BodyResponseCallback<Schema$Operation>
888
+ | BodyResponseCallback<Readable>,
889
+ callback?:
890
+ | BodyResponseCallback<Schema$Operation>
891
+ | BodyResponseCallback<Readable>
892
+ ):
893
+ | void
894
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
895
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
896
+ let params = (paramsOrCallback ||
897
+ {}) as Params$Resource$Projects$Locations$Jobs$Create;
898
+ let options = (optionsOrCallback || {}) as MethodOptions;
899
+
900
+ if (typeof paramsOrCallback === 'function') {
901
+ callback = paramsOrCallback;
902
+ params = {} as Params$Resource$Projects$Locations$Jobs$Create;
903
+ options = {};
904
+ }
905
+
906
+ if (typeof optionsOrCallback === 'function') {
907
+ callback = optionsOrCallback;
908
+ options = {};
909
+ }
910
+
911
+ const rootUrl =
912
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
913
+ const parameters = {
914
+ options: Object.assign(
915
+ {
916
+ url: (rootUrl + '/v1/{+parent}/jobs').replace(/([^:]\/)\/+/g, '$1'),
917
+ method: 'POST',
918
+ apiVersion: '',
919
+ },
920
+ options
921
+ ),
922
+ params,
923
+ requiredParams: ['parent'],
924
+ pathParams: ['parent'],
925
+ context: this.context,
926
+ };
927
+ if (callback) {
928
+ createAPIRequest<Schema$Operation>(
929
+ parameters,
930
+ callback as BodyResponseCallback<unknown>
931
+ );
932
+ } else {
933
+ return createAPIRequest<Schema$Operation>(parameters);
934
+ }
935
+ }
936
+
937
+ /**
938
+ * Deletes a batch job.
939
+ *
940
+ * @param params - Parameters for request
941
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
942
+ * @param callback - Optional callback that handles the response.
943
+ * @returns A promise if used with async/await, or void if used with a callback.
944
+ */
945
+ delete(
946
+ params: Params$Resource$Projects$Locations$Jobs$Delete,
947
+ options: StreamMethodOptions
948
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
949
+ delete(
950
+ params?: Params$Resource$Projects$Locations$Jobs$Delete,
951
+ options?: MethodOptions
952
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
953
+ delete(
954
+ params: Params$Resource$Projects$Locations$Jobs$Delete,
955
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
956
+ callback: BodyResponseCallback<Readable>
957
+ ): void;
958
+ delete(
959
+ params: Params$Resource$Projects$Locations$Jobs$Delete,
960
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
961
+ callback: BodyResponseCallback<Schema$Empty>
962
+ ): void;
963
+ delete(
964
+ params: Params$Resource$Projects$Locations$Jobs$Delete,
965
+ callback: BodyResponseCallback<Schema$Empty>
966
+ ): void;
967
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
968
+ delete(
969
+ paramsOrCallback?:
970
+ | Params$Resource$Projects$Locations$Jobs$Delete
971
+ | BodyResponseCallback<Schema$Empty>
972
+ | BodyResponseCallback<Readable>,
973
+ optionsOrCallback?:
974
+ | MethodOptions
975
+ | StreamMethodOptions
976
+ | BodyResponseCallback<Schema$Empty>
977
+ | BodyResponseCallback<Readable>,
978
+ callback?:
979
+ | BodyResponseCallback<Schema$Empty>
980
+ | BodyResponseCallback<Readable>
981
+ ):
982
+ | void
983
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
984
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
985
+ let params = (paramsOrCallback ||
986
+ {}) as Params$Resource$Projects$Locations$Jobs$Delete;
987
+ let options = (optionsOrCallback || {}) as MethodOptions;
988
+
989
+ if (typeof paramsOrCallback === 'function') {
990
+ callback = paramsOrCallback;
991
+ params = {} as Params$Resource$Projects$Locations$Jobs$Delete;
992
+ options = {};
993
+ }
994
+
995
+ if (typeof optionsOrCallback === 'function') {
996
+ callback = optionsOrCallback;
997
+ options = {};
998
+ }
999
+
1000
+ const rootUrl =
1001
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1002
+ const parameters = {
1003
+ options: Object.assign(
1004
+ {
1005
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1006
+ method: 'DELETE',
1007
+ apiVersion: '',
1008
+ },
1009
+ options
1010
+ ),
1011
+ params,
1012
+ requiredParams: ['name'],
1013
+ pathParams: ['name'],
1014
+ context: this.context,
1015
+ };
1016
+ if (callback) {
1017
+ createAPIRequest<Schema$Empty>(
1018
+ parameters,
1019
+ callback as BodyResponseCallback<unknown>
1020
+ );
1021
+ } else {
1022
+ return createAPIRequest<Schema$Empty>(parameters);
1023
+ }
1024
+ }
1025
+
1026
+ /**
1027
+ * Gets a batch job.
1028
+ *
1029
+ * @param params - Parameters for request
1030
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1031
+ * @param callback - Optional callback that handles the response.
1032
+ * @returns A promise if used with async/await, or void if used with a callback.
1033
+ */
1034
+ get(
1035
+ params: Params$Resource$Projects$Locations$Jobs$Get,
1036
+ options: StreamMethodOptions
1037
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1038
+ get(
1039
+ params?: Params$Resource$Projects$Locations$Jobs$Get,
1040
+ options?: MethodOptions
1041
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Job>>;
1042
+ get(
1043
+ params: Params$Resource$Projects$Locations$Jobs$Get,
1044
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1045
+ callback: BodyResponseCallback<Readable>
1046
+ ): void;
1047
+ get(
1048
+ params: Params$Resource$Projects$Locations$Jobs$Get,
1049
+ options: MethodOptions | BodyResponseCallback<Schema$Job>,
1050
+ callback: BodyResponseCallback<Schema$Job>
1051
+ ): void;
1052
+ get(
1053
+ params: Params$Resource$Projects$Locations$Jobs$Get,
1054
+ callback: BodyResponseCallback<Schema$Job>
1055
+ ): void;
1056
+ get(callback: BodyResponseCallback<Schema$Job>): void;
1057
+ get(
1058
+ paramsOrCallback?:
1059
+ | Params$Resource$Projects$Locations$Jobs$Get
1060
+ | BodyResponseCallback<Schema$Job>
1061
+ | BodyResponseCallback<Readable>,
1062
+ optionsOrCallback?:
1063
+ | MethodOptions
1064
+ | StreamMethodOptions
1065
+ | BodyResponseCallback<Schema$Job>
1066
+ | BodyResponseCallback<Readable>,
1067
+ callback?:
1068
+ | BodyResponseCallback<Schema$Job>
1069
+ | BodyResponseCallback<Readable>
1070
+ ):
1071
+ | void
1072
+ | Promise<GaxiosResponseWithHTTP2<Schema$Job>>
1073
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1074
+ let params = (paramsOrCallback ||
1075
+ {}) as Params$Resource$Projects$Locations$Jobs$Get;
1076
+ let options = (optionsOrCallback || {}) as MethodOptions;
1077
+
1078
+ if (typeof paramsOrCallback === 'function') {
1079
+ callback = paramsOrCallback;
1080
+ params = {} as Params$Resource$Projects$Locations$Jobs$Get;
1081
+ options = {};
1082
+ }
1083
+
1084
+ if (typeof optionsOrCallback === 'function') {
1085
+ callback = optionsOrCallback;
1086
+ options = {};
1087
+ }
1088
+
1089
+ const rootUrl =
1090
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1091
+ const parameters = {
1092
+ options: Object.assign(
1093
+ {
1094
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1095
+ method: 'GET',
1096
+ apiVersion: '',
1097
+ },
1098
+ options
1099
+ ),
1100
+ params,
1101
+ requiredParams: ['name'],
1102
+ pathParams: ['name'],
1103
+ context: this.context,
1104
+ };
1105
+ if (callback) {
1106
+ createAPIRequest<Schema$Job>(
1107
+ parameters,
1108
+ callback as BodyResponseCallback<unknown>
1109
+ );
1110
+ } else {
1111
+ return createAPIRequest<Schema$Job>(parameters);
1112
+ }
1113
+ }
1114
+
1115
+ /**
1116
+ * Lists Jobs in a given project.
1117
+ *
1118
+ * @param params - Parameters for request
1119
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1120
+ * @param callback - Optional callback that handles the response.
1121
+ * @returns A promise if used with async/await, or void if used with a callback.
1122
+ */
1123
+ list(
1124
+ params: Params$Resource$Projects$Locations$Jobs$List,
1125
+ options: StreamMethodOptions
1126
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1127
+ list(
1128
+ params?: Params$Resource$Projects$Locations$Jobs$List,
1129
+ options?: MethodOptions
1130
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListJobsResponse>>;
1131
+ list(
1132
+ params: Params$Resource$Projects$Locations$Jobs$List,
1133
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1134
+ callback: BodyResponseCallback<Readable>
1135
+ ): void;
1136
+ list(
1137
+ params: Params$Resource$Projects$Locations$Jobs$List,
1138
+ options: MethodOptions | BodyResponseCallback<Schema$ListJobsResponse>,
1139
+ callback: BodyResponseCallback<Schema$ListJobsResponse>
1140
+ ): void;
1141
+ list(
1142
+ params: Params$Resource$Projects$Locations$Jobs$List,
1143
+ callback: BodyResponseCallback<Schema$ListJobsResponse>
1144
+ ): void;
1145
+ list(callback: BodyResponseCallback<Schema$ListJobsResponse>): void;
1146
+ list(
1147
+ paramsOrCallback?:
1148
+ | Params$Resource$Projects$Locations$Jobs$List
1149
+ | BodyResponseCallback<Schema$ListJobsResponse>
1150
+ | BodyResponseCallback<Readable>,
1151
+ optionsOrCallback?:
1152
+ | MethodOptions
1153
+ | StreamMethodOptions
1154
+ | BodyResponseCallback<Schema$ListJobsResponse>
1155
+ | BodyResponseCallback<Readable>,
1156
+ callback?:
1157
+ | BodyResponseCallback<Schema$ListJobsResponse>
1158
+ | BodyResponseCallback<Readable>
1159
+ ):
1160
+ | void
1161
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListJobsResponse>>
1162
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1163
+ let params = (paramsOrCallback ||
1164
+ {}) as Params$Resource$Projects$Locations$Jobs$List;
1165
+ let options = (optionsOrCallback || {}) as MethodOptions;
1166
+
1167
+ if (typeof paramsOrCallback === 'function') {
1168
+ callback = paramsOrCallback;
1169
+ params = {} as Params$Resource$Projects$Locations$Jobs$List;
1170
+ options = {};
1171
+ }
1172
+
1173
+ if (typeof optionsOrCallback === 'function') {
1174
+ callback = optionsOrCallback;
1175
+ options = {};
1176
+ }
1177
+
1178
+ const rootUrl =
1179
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1180
+ const parameters = {
1181
+ options: Object.assign(
1182
+ {
1183
+ url: (rootUrl + '/v1/{+parent}/jobs').replace(/([^:]\/)\/+/g, '$1'),
1184
+ method: 'GET',
1185
+ apiVersion: '',
1186
+ },
1187
+ options
1188
+ ),
1189
+ params,
1190
+ requiredParams: ['parent'],
1191
+ pathParams: ['parent'],
1192
+ context: this.context,
1193
+ };
1194
+ if (callback) {
1195
+ createAPIRequest<Schema$ListJobsResponse>(
1196
+ parameters,
1197
+ callback as BodyResponseCallback<unknown>
1198
+ );
1199
+ } else {
1200
+ return createAPIRequest<Schema$ListJobsResponse>(parameters);
1201
+ }
1202
+ }
1203
+ }
1204
+
1205
+ export interface Params$Resource$Projects$Locations$Jobs$Cancel
1206
+ extends StandardParameters {
1207
+ /**
1208
+ * Required. The `name` of the job to cancel. Format: projects/{project_id\}/locations/global/jobs/{job_id\}.
1209
+ */
1210
+ name?: string;
1211
+
1212
+ /**
1213
+ * Request body metadata
1214
+ */
1215
+ requestBody?: Schema$CancelJobRequest;
1216
+ }
1217
+ export interface Params$Resource$Projects$Locations$Jobs$Create
1218
+ extends StandardParameters {
1219
+ /**
1220
+ * Required. The optional `job_id` for this Job . If not specified, an id is generated. `job_id` should be no more than 128 characters and must include only characters available in DNS names, as defined by RFC-1123.
1221
+ */
1222
+ jobId?: string;
1223
+ /**
1224
+ * Required. Value for parent.
1225
+ */
1226
+ parent?: string;
1227
+ /**
1228
+ * Optional. An optional request ID to identify requests. Specify a unique request ID in case you need to retry your request. Requests with same `request_id` will be ignored for at least 60 minutes since the first request. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1229
+ */
1230
+ requestId?: string;
1231
+
1232
+ /**
1233
+ * Request body metadata
1234
+ */
1235
+ requestBody?: Schema$Job;
1236
+ }
1237
+ export interface Params$Resource$Projects$Locations$Jobs$Delete
1238
+ extends StandardParameters {
1239
+ /**
1240
+ * Required. The `name` of the job to delete. Format: projects/{project_id\}/locations/global/jobs/{job_id\} .
1241
+ */
1242
+ name?: string;
1243
+ /**
1244
+ * Optional. An optional request ID to identify requests. Specify a unique request ID in case you need to retry your request. Requests with same `request_id` will be ignored for at least 60 minutes since the first request. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1245
+ */
1246
+ requestId?: string;
1247
+ }
1248
+ export interface Params$Resource$Projects$Locations$Jobs$Get
1249
+ extends StandardParameters {
1250
+ /**
1251
+ * Required. `name` of the job to retrieve. Format: projects/{project_id\}/locations/global/jobs/{job_id\} .
1252
+ */
1253
+ name?: string;
1254
+ }
1255
+ export interface Params$Resource$Projects$Locations$Jobs$List
1256
+ extends StandardParameters {
1257
+ /**
1258
+ * Optional. Filters results as defined by https://google.aip.dev/160.
1259
+ */
1260
+ filter?: string;
1261
+ /**
1262
+ * Optional. Field to sort by. Supported fields are name, create_time.
1263
+ */
1264
+ orderBy?: string;
1265
+ /**
1266
+ * Optional. The list page size. default page size is 100.
1267
+ */
1268
+ pageSize?: number;
1269
+ /**
1270
+ * Optional. The list page token.
1271
+ */
1272
+ pageToken?: string;
1273
+ /**
1274
+ * Required. Format: projects/{project_id\}/locations/global.
1275
+ */
1276
+ parent?: string;
1277
+ }
1278
+
1279
+ export class Resource$Projects$Locations$Operations {
1280
+ context: APIRequestContext;
1281
+ constructor(context: APIRequestContext) {
1282
+ this.context = context;
1283
+ }
1284
+
1285
+ /**
1286
+ * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
1287
+ *
1288
+ * @param params - Parameters for request
1289
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1290
+ * @param callback - Optional callback that handles the response.
1291
+ * @returns A promise if used with async/await, or void if used with a callback.
1292
+ */
1293
+ cancel(
1294
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
1295
+ options: StreamMethodOptions
1296
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1297
+ cancel(
1298
+ params?: Params$Resource$Projects$Locations$Operations$Cancel,
1299
+ options?: MethodOptions
1300
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
1301
+ cancel(
1302
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
1303
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1304
+ callback: BodyResponseCallback<Readable>
1305
+ ): void;
1306
+ cancel(
1307
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
1308
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
1309
+ callback: BodyResponseCallback<Schema$Empty>
1310
+ ): void;
1311
+ cancel(
1312
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
1313
+ callback: BodyResponseCallback<Schema$Empty>
1314
+ ): void;
1315
+ cancel(callback: BodyResponseCallback<Schema$Empty>): void;
1316
+ cancel(
1317
+ paramsOrCallback?:
1318
+ | Params$Resource$Projects$Locations$Operations$Cancel
1319
+ | BodyResponseCallback<Schema$Empty>
1320
+ | BodyResponseCallback<Readable>,
1321
+ optionsOrCallback?:
1322
+ | MethodOptions
1323
+ | StreamMethodOptions
1324
+ | BodyResponseCallback<Schema$Empty>
1325
+ | BodyResponseCallback<Readable>,
1326
+ callback?:
1327
+ | BodyResponseCallback<Schema$Empty>
1328
+ | BodyResponseCallback<Readable>
1329
+ ):
1330
+ | void
1331
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
1332
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1333
+ let params = (paramsOrCallback ||
1334
+ {}) as Params$Resource$Projects$Locations$Operations$Cancel;
1335
+ let options = (optionsOrCallback || {}) as MethodOptions;
1336
+
1337
+ if (typeof paramsOrCallback === 'function') {
1338
+ callback = paramsOrCallback;
1339
+ params = {} as Params$Resource$Projects$Locations$Operations$Cancel;
1340
+ options = {};
1341
+ }
1342
+
1343
+ if (typeof optionsOrCallback === 'function') {
1344
+ callback = optionsOrCallback;
1345
+ options = {};
1346
+ }
1347
+
1348
+ const rootUrl =
1349
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1350
+ const parameters = {
1351
+ options: Object.assign(
1352
+ {
1353
+ url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'),
1354
+ method: 'POST',
1355
+ apiVersion: '',
1356
+ },
1357
+ options
1358
+ ),
1359
+ params,
1360
+ requiredParams: ['name'],
1361
+ pathParams: ['name'],
1362
+ context: this.context,
1363
+ };
1364
+ if (callback) {
1365
+ createAPIRequest<Schema$Empty>(
1366
+ parameters,
1367
+ callback as BodyResponseCallback<unknown>
1368
+ );
1369
+ } else {
1370
+ return createAPIRequest<Schema$Empty>(parameters);
1371
+ }
1372
+ }
1373
+
1374
+ /**
1375
+ * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1376
+ *
1377
+ * @param params - Parameters for request
1378
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1379
+ * @param callback - Optional callback that handles the response.
1380
+ * @returns A promise if used with async/await, or void if used with a callback.
1381
+ */
1382
+ delete(
1383
+ params: Params$Resource$Projects$Locations$Operations$Delete,
1384
+ options: StreamMethodOptions
1385
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1386
+ delete(
1387
+ params?: Params$Resource$Projects$Locations$Operations$Delete,
1388
+ options?: MethodOptions
1389
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
1390
+ delete(
1391
+ params: Params$Resource$Projects$Locations$Operations$Delete,
1392
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1393
+ callback: BodyResponseCallback<Readable>
1394
+ ): void;
1395
+ delete(
1396
+ params: Params$Resource$Projects$Locations$Operations$Delete,
1397
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
1398
+ callback: BodyResponseCallback<Schema$Empty>
1399
+ ): void;
1400
+ delete(
1401
+ params: Params$Resource$Projects$Locations$Operations$Delete,
1402
+ callback: BodyResponseCallback<Schema$Empty>
1403
+ ): void;
1404
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
1405
+ delete(
1406
+ paramsOrCallback?:
1407
+ | Params$Resource$Projects$Locations$Operations$Delete
1408
+ | BodyResponseCallback<Schema$Empty>
1409
+ | BodyResponseCallback<Readable>,
1410
+ optionsOrCallback?:
1411
+ | MethodOptions
1412
+ | StreamMethodOptions
1413
+ | BodyResponseCallback<Schema$Empty>
1414
+ | BodyResponseCallback<Readable>,
1415
+ callback?:
1416
+ | BodyResponseCallback<Schema$Empty>
1417
+ | BodyResponseCallback<Readable>
1418
+ ):
1419
+ | void
1420
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
1421
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1422
+ let params = (paramsOrCallback ||
1423
+ {}) as Params$Resource$Projects$Locations$Operations$Delete;
1424
+ let options = (optionsOrCallback || {}) as MethodOptions;
1425
+
1426
+ if (typeof paramsOrCallback === 'function') {
1427
+ callback = paramsOrCallback;
1428
+ params = {} as Params$Resource$Projects$Locations$Operations$Delete;
1429
+ options = {};
1430
+ }
1431
+
1432
+ if (typeof optionsOrCallback === 'function') {
1433
+ callback = optionsOrCallback;
1434
+ options = {};
1435
+ }
1436
+
1437
+ const rootUrl =
1438
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1439
+ const parameters = {
1440
+ options: Object.assign(
1441
+ {
1442
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1443
+ method: 'DELETE',
1444
+ apiVersion: '',
1445
+ },
1446
+ options
1447
+ ),
1448
+ params,
1449
+ requiredParams: ['name'],
1450
+ pathParams: ['name'],
1451
+ context: this.context,
1452
+ };
1453
+ if (callback) {
1454
+ createAPIRequest<Schema$Empty>(
1455
+ parameters,
1456
+ callback as BodyResponseCallback<unknown>
1457
+ );
1458
+ } else {
1459
+ return createAPIRequest<Schema$Empty>(parameters);
1460
+ }
1461
+ }
1462
+
1463
+ /**
1464
+ * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
1465
+ *
1466
+ * @param params - Parameters for request
1467
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1468
+ * @param callback - Optional callback that handles the response.
1469
+ * @returns A promise if used with async/await, or void if used with a callback.
1470
+ */
1471
+ get(
1472
+ params: Params$Resource$Projects$Locations$Operations$Get,
1473
+ options: StreamMethodOptions
1474
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1475
+ get(
1476
+ params?: Params$Resource$Projects$Locations$Operations$Get,
1477
+ options?: MethodOptions
1478
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
1479
+ get(
1480
+ params: Params$Resource$Projects$Locations$Operations$Get,
1481
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1482
+ callback: BodyResponseCallback<Readable>
1483
+ ): void;
1484
+ get(
1485
+ params: Params$Resource$Projects$Locations$Operations$Get,
1486
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
1487
+ callback: BodyResponseCallback<Schema$Operation>
1488
+ ): void;
1489
+ get(
1490
+ params: Params$Resource$Projects$Locations$Operations$Get,
1491
+ callback: BodyResponseCallback<Schema$Operation>
1492
+ ): void;
1493
+ get(callback: BodyResponseCallback<Schema$Operation>): void;
1494
+ get(
1495
+ paramsOrCallback?:
1496
+ | Params$Resource$Projects$Locations$Operations$Get
1497
+ | BodyResponseCallback<Schema$Operation>
1498
+ | BodyResponseCallback<Readable>,
1499
+ optionsOrCallback?:
1500
+ | MethodOptions
1501
+ | StreamMethodOptions
1502
+ | BodyResponseCallback<Schema$Operation>
1503
+ | BodyResponseCallback<Readable>,
1504
+ callback?:
1505
+ | BodyResponseCallback<Schema$Operation>
1506
+ | BodyResponseCallback<Readable>
1507
+ ):
1508
+ | void
1509
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
1510
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1511
+ let params = (paramsOrCallback ||
1512
+ {}) as Params$Resource$Projects$Locations$Operations$Get;
1513
+ let options = (optionsOrCallback || {}) as MethodOptions;
1514
+
1515
+ if (typeof paramsOrCallback === 'function') {
1516
+ callback = paramsOrCallback;
1517
+ params = {} as Params$Resource$Projects$Locations$Operations$Get;
1518
+ options = {};
1519
+ }
1520
+
1521
+ if (typeof optionsOrCallback === 'function') {
1522
+ callback = optionsOrCallback;
1523
+ options = {};
1524
+ }
1525
+
1526
+ const rootUrl =
1527
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1528
+ const parameters = {
1529
+ options: Object.assign(
1530
+ {
1531
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1532
+ method: 'GET',
1533
+ apiVersion: '',
1534
+ },
1535
+ options
1536
+ ),
1537
+ params,
1538
+ requiredParams: ['name'],
1539
+ pathParams: ['name'],
1540
+ context: this.context,
1541
+ };
1542
+ if (callback) {
1543
+ createAPIRequest<Schema$Operation>(
1544
+ parameters,
1545
+ callback as BodyResponseCallback<unknown>
1546
+ );
1547
+ } else {
1548
+ return createAPIRequest<Schema$Operation>(parameters);
1549
+ }
1550
+ }
1551
+
1552
+ /**
1553
+ * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
1554
+ *
1555
+ * @param params - Parameters for request
1556
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1557
+ * @param callback - Optional callback that handles the response.
1558
+ * @returns A promise if used with async/await, or void if used with a callback.
1559
+ */
1560
+ list(
1561
+ params: Params$Resource$Projects$Locations$Operations$List,
1562
+ options: StreamMethodOptions
1563
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1564
+ list(
1565
+ params?: Params$Resource$Projects$Locations$Operations$List,
1566
+ options?: MethodOptions
1567
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
1568
+ list(
1569
+ params: Params$Resource$Projects$Locations$Operations$List,
1570
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1571
+ callback: BodyResponseCallback<Readable>
1572
+ ): void;
1573
+ list(
1574
+ params: Params$Resource$Projects$Locations$Operations$List,
1575
+ options:
1576
+ | MethodOptions
1577
+ | BodyResponseCallback<Schema$ListOperationsResponse>,
1578
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
1579
+ ): void;
1580
+ list(
1581
+ params: Params$Resource$Projects$Locations$Operations$List,
1582
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
1583
+ ): void;
1584
+ list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
1585
+ list(
1586
+ paramsOrCallback?:
1587
+ | Params$Resource$Projects$Locations$Operations$List
1588
+ | BodyResponseCallback<Schema$ListOperationsResponse>
1589
+ | BodyResponseCallback<Readable>,
1590
+ optionsOrCallback?:
1591
+ | MethodOptions
1592
+ | StreamMethodOptions
1593
+ | BodyResponseCallback<Schema$ListOperationsResponse>
1594
+ | BodyResponseCallback<Readable>,
1595
+ callback?:
1596
+ | BodyResponseCallback<Schema$ListOperationsResponse>
1597
+ | BodyResponseCallback<Readable>
1598
+ ):
1599
+ | void
1600
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>
1601
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1602
+ let params = (paramsOrCallback ||
1603
+ {}) as Params$Resource$Projects$Locations$Operations$List;
1604
+ let options = (optionsOrCallback || {}) as MethodOptions;
1605
+
1606
+ if (typeof paramsOrCallback === 'function') {
1607
+ callback = paramsOrCallback;
1608
+ params = {} as Params$Resource$Projects$Locations$Operations$List;
1609
+ options = {};
1610
+ }
1611
+
1612
+ if (typeof optionsOrCallback === 'function') {
1613
+ callback = optionsOrCallback;
1614
+ options = {};
1615
+ }
1616
+
1617
+ const rootUrl =
1618
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1619
+ const parameters = {
1620
+ options: Object.assign(
1621
+ {
1622
+ url: (rootUrl + '/v1/{+name}/operations').replace(
1623
+ /([^:]\/)\/+/g,
1624
+ '$1'
1625
+ ),
1626
+ method: 'GET',
1627
+ apiVersion: '',
1628
+ },
1629
+ options
1630
+ ),
1631
+ params,
1632
+ requiredParams: ['name'],
1633
+ pathParams: ['name'],
1634
+ context: this.context,
1635
+ };
1636
+ if (callback) {
1637
+ createAPIRequest<Schema$ListOperationsResponse>(
1638
+ parameters,
1639
+ callback as BodyResponseCallback<unknown>
1640
+ );
1641
+ } else {
1642
+ return createAPIRequest<Schema$ListOperationsResponse>(parameters);
1643
+ }
1644
+ }
1645
+ }
1646
+
1647
+ export interface Params$Resource$Projects$Locations$Operations$Cancel
1648
+ extends StandardParameters {
1649
+ /**
1650
+ * The name of the operation resource to be cancelled.
1651
+ */
1652
+ name?: string;
1653
+
1654
+ /**
1655
+ * Request body metadata
1656
+ */
1657
+ requestBody?: Schema$CancelOperationRequest;
1658
+ }
1659
+ export interface Params$Resource$Projects$Locations$Operations$Delete
1660
+ extends StandardParameters {
1661
+ /**
1662
+ * The name of the operation resource to be deleted.
1663
+ */
1664
+ name?: string;
1665
+ }
1666
+ export interface Params$Resource$Projects$Locations$Operations$Get
1667
+ extends StandardParameters {
1668
+ /**
1669
+ * The name of the operation resource.
1670
+ */
1671
+ name?: string;
1672
+ }
1673
+ export interface Params$Resource$Projects$Locations$Operations$List
1674
+ extends StandardParameters {
1675
+ /**
1676
+ * The standard list filter.
1677
+ */
1678
+ filter?: string;
1679
+ /**
1680
+ * The name of the operation's parent resource.
1681
+ */
1682
+ name?: string;
1683
+ /**
1684
+ * The standard list page size.
1685
+ */
1686
+ pageSize?: number;
1687
+ /**
1688
+ * The standard list page token.
1689
+ */
1690
+ pageToken?: string;
1691
+ }
1692
+ }