@maxim_mazurok/gapi.client.drive-v3 0.0.20240827 → 0.0.20240903

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.d.ts +180 -1
  2. package/package.json +1 -1
  3. package/readme.md +25 -0
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://www.googleapis.com/discovery/v1/apis/drive/v3/rest
12
- // Revision: 20240827
12
+ // Revision: 20240903
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -728,6 +728,12 @@ declare namespace gapi.client {
728
728
  /** If true, the label will be removed from the file. */
729
729
  removeLabel?: boolean;
730
730
  }
731
+ interface ListOperationsResponse {
732
+ /** The standard List next-page token. */
733
+ nextPageToken?: string;
734
+ /** A list of operations that matches the specified filter in the request. */
735
+ operations?: Operation[];
736
+ }
731
737
  interface ModifyLabelsRequest {
732
738
  /** This is always drive#modifyLabelsRequest. */
733
739
  kind?: string;
@@ -740,6 +746,18 @@ declare namespace gapi.client {
740
746
  /** The list of labels which were added or updated by the request. */
741
747
  modifiedLabels?: Label[];
742
748
  }
749
+ interface Operation {
750
+ /** 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. */
751
+ done?: boolean;
752
+ /** The error result of the operation in case of failure or cancellation. */
753
+ error?: Status;
754
+ /** 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. */
755
+ metadata?: {[P in string]: any};
756
+ /** 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}`. */
757
+ name?: string;
758
+ /** 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`. */
759
+ response?: {[P in string]: any};
760
+ }
743
761
  interface Permission {
744
762
  /** Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`. */
745
763
  allowFileDiscovery?: boolean;
@@ -870,6 +888,14 @@ declare namespace gapi.client {
870
888
  /** The starting page token for listing future changes. The page token doesn't expire. */
871
889
  startPageToken?: string;
872
890
  }
891
+ interface Status {
892
+ /** The status code, which should be an enum value of google.rpc.Code. */
893
+ code?: number;
894
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
895
+ details?: Array<{[P in string]: any}>;
896
+ /** 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. */
897
+ message?: string;
898
+ }
873
899
  interface TeamDrive {
874
900
  /** An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field; it can only be set on `drive.teamdrives.update` requests that don't set `themeId`. When specified, all fields of the `backgroundImageFile` must be set. */
875
901
  backgroundImageFile?: {
@@ -2020,6 +2046,37 @@ declare namespace gapi.client {
2020
2046
  /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2021
2047
  uploadType?: string;
2022
2048
  }): Request<void>;
2049
+ /** Downloads content of a file. Operations are valid for 24 hours from the time of creation. */
2050
+ download(request?: {
2051
+ /** V1 error format. */
2052
+ '$.xgafv'?: string;
2053
+ /** OAuth access token. */
2054
+ access_token?: string;
2055
+ /** Data format for response. */
2056
+ alt?: string;
2057
+ /** JSONP */
2058
+ callback?: string;
2059
+ /** Selector specifying which fields to include in a partial response. */
2060
+ fields?: string;
2061
+ /** Required. The ID of the file to download. */
2062
+ fileId: string;
2063
+ /** 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. */
2064
+ key?: string;
2065
+ /** Optional. The MIME type the file should be downloaded as. This field can only be set when downloading Google Workspace documents. See [Export MIME types for Google Workspace documents](/drive/api/guides/ref-export-formats) for the list of supported MIME types. If not set, a Google Workspace document is downloaded with a default MIME type. The default MIME type might change in the future. */
2066
+ mimeType?: string;
2067
+ /** OAuth 2.0 token for the current user. */
2068
+ oauth_token?: string;
2069
+ /** Returns response with indentations and line breaks. */
2070
+ prettyPrint?: boolean;
2071
+ /** 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. */
2072
+ quotaUser?: string;
2073
+ /** Optional. The revision ID of the file to download. This field can only be set when downloading blob files, Google Docs, and Google Sheets. Returns `INVALID_ARGUMENT` if downloading a specific revision on the file is unsupported. */
2074
+ revisionId?: string;
2075
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2076
+ upload_protocol?: string;
2077
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2078
+ uploadType?: string;
2079
+ }): Request<Operation>;
2023
2080
  /** Permanently deletes all of the user's trashed files. */
2024
2081
  emptyTrash(request?: {
2025
2082
  /** V1 error format. */
@@ -2467,6 +2524,124 @@ declare namespace gapi.client {
2467
2524
  body: Channel
2468
2525
  ): Request<Channel>;
2469
2526
  }
2527
+ interface OperationResource {
2528
+ /** 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`. */
2529
+ cancel(request?: {
2530
+ /** V1 error format. */
2531
+ '$.xgafv'?: string;
2532
+ /** OAuth access token. */
2533
+ access_token?: string;
2534
+ /** Data format for response. */
2535
+ alt?: string;
2536
+ /** JSONP */
2537
+ callback?: string;
2538
+ /** Selector specifying which fields to include in a partial response. */
2539
+ fields?: string;
2540
+ /** 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. */
2541
+ key?: string;
2542
+ /** The name of the operation resource to be cancelled. */
2543
+ name: string;
2544
+ /** OAuth 2.0 token for the current user. */
2545
+ oauth_token?: string;
2546
+ /** Returns response with indentations and line breaks. */
2547
+ prettyPrint?: boolean;
2548
+ /** 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. */
2549
+ quotaUser?: string;
2550
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2551
+ upload_protocol?: string;
2552
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2553
+ uploadType?: string;
2554
+ }): Request<void>;
2555
+ /** 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`. */
2556
+ delete(request?: {
2557
+ /** V1 error format. */
2558
+ '$.xgafv'?: string;
2559
+ /** OAuth access token. */
2560
+ access_token?: string;
2561
+ /** Data format for response. */
2562
+ alt?: string;
2563
+ /** JSONP */
2564
+ callback?: string;
2565
+ /** Selector specifying which fields to include in a partial response. */
2566
+ fields?: string;
2567
+ /** 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. */
2568
+ key?: string;
2569
+ /** The name of the operation resource to be deleted. */
2570
+ name: string;
2571
+ /** OAuth 2.0 token for the current user. */
2572
+ oauth_token?: string;
2573
+ /** Returns response with indentations and line breaks. */
2574
+ prettyPrint?: boolean;
2575
+ /** 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. */
2576
+ quotaUser?: string;
2577
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2578
+ upload_protocol?: string;
2579
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2580
+ uploadType?: string;
2581
+ }): Request<void>;
2582
+ }
2583
+ interface OperationsResource {
2584
+ /** 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. */
2585
+ get(request?: {
2586
+ /** V1 error format. */
2587
+ '$.xgafv'?: string;
2588
+ /** OAuth access token. */
2589
+ access_token?: string;
2590
+ /** Data format for response. */
2591
+ alt?: string;
2592
+ /** JSONP */
2593
+ callback?: string;
2594
+ /** Selector specifying which fields to include in a partial response. */
2595
+ fields?: string;
2596
+ /** 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. */
2597
+ key?: string;
2598
+ /** The name of the operation resource. */
2599
+ name: string;
2600
+ /** OAuth 2.0 token for the current user. */
2601
+ oauth_token?: string;
2602
+ /** Returns response with indentations and line breaks. */
2603
+ prettyPrint?: boolean;
2604
+ /** 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. */
2605
+ quotaUser?: string;
2606
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2607
+ upload_protocol?: string;
2608
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2609
+ uploadType?: string;
2610
+ }): Request<Operation>;
2611
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
2612
+ list(request?: {
2613
+ /** V1 error format. */
2614
+ '$.xgafv'?: string;
2615
+ /** OAuth access token. */
2616
+ access_token?: string;
2617
+ /** Data format for response. */
2618
+ alt?: string;
2619
+ /** JSONP */
2620
+ callback?: string;
2621
+ /** Selector specifying which fields to include in a partial response. */
2622
+ fields?: string;
2623
+ /** The standard list filter. */
2624
+ filter?: string;
2625
+ /** 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. */
2626
+ key?: string;
2627
+ /** The name of the operation's parent resource. */
2628
+ name?: string;
2629
+ /** OAuth 2.0 token for the current user. */
2630
+ oauth_token?: string;
2631
+ /** The standard list page size. */
2632
+ pageSize?: number;
2633
+ /** The standard list page token. */
2634
+ pageToken?: string;
2635
+ /** Returns response with indentations and line breaks. */
2636
+ prettyPrint?: boolean;
2637
+ /** 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. */
2638
+ quotaUser?: string;
2639
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2640
+ upload_protocol?: string;
2641
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2642
+ uploadType?: string;
2643
+ }): Request<ListOperationsResponse>;
2644
+ }
2470
2645
  interface PermissionsResource {
2471
2646
  /** Creates a permission for a file or shared drive. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied. */
2472
2647
  create(request: {
@@ -3360,6 +3535,10 @@ declare namespace gapi.client {
3360
3535
 
3361
3536
  const files: FilesResource;
3362
3537
 
3538
+ const operation: OperationResource;
3539
+
3540
+ const operations: OperationsResource;
3541
+
3363
3542
  const permissions: PermissionsResource;
3364
3543
 
3365
3544
  const replies: RepliesResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.drive-v3",
3
- "version": "0.0.20240827",
3
+ "version": "0.0.20240903",
4
4
  "description": "TypeScript typings for Google Drive API v3",
5
5
  "repository": {
6
6
  "type": "git",
package/readme.md CHANGED
@@ -207,6 +207,11 @@ Permanently deletes a file owned by the user without moving it to the trash. If
207
207
  */
208
208
  await gapi.client.drive.files.delete({ fileId: "fileId", });
209
209
 
210
+ /*
211
+ Downloads content of a file. Operations are valid for 24 hours from the time of creation.
212
+ */
213
+ await gapi.client.drive.files.download({ fileId: "fileId", });
214
+
210
215
  /*
211
216
  Permanently deletes all of the user's trashed files.
212
217
  */
@@ -252,6 +257,26 @@ Subscribes to changes to a file.
252
257
  */
253
258
  await gapi.client.drive.files.watch({ fileId: "fileId", });
254
259
 
260
+ /*
261
+ 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`.
262
+ */
263
+ await gapi.client.drive.operation.cancel({ name: "name", });
264
+
265
+ /*
266
+ 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`.
267
+ */
268
+ await gapi.client.drive.operation.delete({ name: "name", });
269
+
270
+ /*
271
+ 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.
272
+ */
273
+ await gapi.client.drive.operations.get({ name: "name", });
274
+
275
+ /*
276
+ Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
277
+ */
278
+ await gapi.client.drive.operations.list({ });
279
+
255
280
  /*
256
281
  Creates a permission for a file or shared drive. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied.
257
282
  */