@googleapis/tasks 7.0.4 → 9.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/build/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
3
  import { Readable } from 'stream';
4
4
  export declare namespace tasks_v1 {
5
5
  export interface Options extends GlobalOptions {
@@ -256,84 +256,422 @@ export declare namespace tasks_v1 {
256
256
  constructor(context: APIRequestContext);
257
257
  /**
258
258
  * Deletes the authenticated user's specified task list. If the list contains assigned tasks, both the assigned tasks and the original tasks in the assignment surface (Docs, Chat Spaces) are deleted.
259
+ * @example
260
+ * ```js
261
+ * // Before running the sample:
262
+ * // - Enable the API at:
263
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
264
+ * // - Login into gcloud by running:
265
+ * // ```sh
266
+ * // $ gcloud auth application-default login
267
+ * // ```
268
+ * // - Install the npm module by running:
269
+ * // ```sh
270
+ * // $ npm install googleapis
271
+ * // ```
272
+ *
273
+ * const {google} = require('googleapis');
274
+ * const tasks = google.tasks('v1');
275
+ *
276
+ * async function main() {
277
+ * const auth = new google.auth.GoogleAuth({
278
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
279
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
280
+ * });
281
+ *
282
+ * // Acquire an auth client, and bind it to all future calls
283
+ * const authClient = await auth.getClient();
284
+ * google.options({auth: authClient});
285
+ *
286
+ * // Do the magic
287
+ * const res = await tasks.tasklists.delete({
288
+ * // Task list identifier.
289
+ * tasklist: 'placeholder-value',
290
+ * });
291
+ * console.log(res.data);
292
+ * }
293
+ *
294
+ * main().catch(e => {
295
+ * console.error(e);
296
+ * throw e;
297
+ * });
298
+ *
299
+ * ```
259
300
  *
260
301
  * @param params - Parameters for request
261
302
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
262
303
  * @param callback - Optional callback that handles the response.
263
304
  * @returns A promise if used with async/await, or void if used with a callback.
264
305
  */
265
- delete(params: Params$Resource$Tasklists$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
266
- delete(params?: Params$Resource$Tasklists$Delete, options?: MethodOptions): GaxiosPromise<void>;
306
+ delete(params: Params$Resource$Tasklists$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
307
+ delete(params?: Params$Resource$Tasklists$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
267
308
  delete(params: Params$Resource$Tasklists$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
268
309
  delete(params: Params$Resource$Tasklists$Delete, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
269
310
  delete(params: Params$Resource$Tasklists$Delete, callback: BodyResponseCallback<void>): void;
270
311
  delete(callback: BodyResponseCallback<void>): void;
271
312
  /**
272
313
  * Returns the authenticated user's specified task list.
314
+ * @example
315
+ * ```js
316
+ * // Before running the sample:
317
+ * // - Enable the API at:
318
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
319
+ * // - Login into gcloud by running:
320
+ * // ```sh
321
+ * // $ gcloud auth application-default login
322
+ * // ```
323
+ * // - Install the npm module by running:
324
+ * // ```sh
325
+ * // $ npm install googleapis
326
+ * // ```
327
+ *
328
+ * const {google} = require('googleapis');
329
+ * const tasks = google.tasks('v1');
330
+ *
331
+ * async function main() {
332
+ * const auth = new google.auth.GoogleAuth({
333
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
334
+ * scopes: [
335
+ * 'https://www.googleapis.com/auth/tasks',
336
+ * 'https://www.googleapis.com/auth/tasks.readonly',
337
+ * ],
338
+ * });
339
+ *
340
+ * // Acquire an auth client, and bind it to all future calls
341
+ * const authClient = await auth.getClient();
342
+ * google.options({auth: authClient});
343
+ *
344
+ * // Do the magic
345
+ * const res = await tasks.tasklists.get({
346
+ * // Task list identifier.
347
+ * tasklist: 'placeholder-value',
348
+ * });
349
+ * console.log(res.data);
350
+ *
351
+ * // Example response
352
+ * // {
353
+ * // "etag": "my_etag",
354
+ * // "id": "my_id",
355
+ * // "kind": "my_kind",
356
+ * // "selfLink": "my_selfLink",
357
+ * // "title": "my_title",
358
+ * // "updated": "my_updated"
359
+ * // }
360
+ * }
361
+ *
362
+ * main().catch(e => {
363
+ * console.error(e);
364
+ * throw e;
365
+ * });
366
+ *
367
+ * ```
273
368
  *
274
369
  * @param params - Parameters for request
275
370
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
276
371
  * @param callback - Optional callback that handles the response.
277
372
  * @returns A promise if used with async/await, or void if used with a callback.
278
373
  */
279
- get(params: Params$Resource$Tasklists$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
280
- get(params?: Params$Resource$Tasklists$Get, options?: MethodOptions): GaxiosPromise<Schema$TaskList>;
374
+ get(params: Params$Resource$Tasklists$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
375
+ get(params?: Params$Resource$Tasklists$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TaskList>>;
281
376
  get(params: Params$Resource$Tasklists$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
282
377
  get(params: Params$Resource$Tasklists$Get, options: MethodOptions | BodyResponseCallback<Schema$TaskList>, callback: BodyResponseCallback<Schema$TaskList>): void;
283
378
  get(params: Params$Resource$Tasklists$Get, callback: BodyResponseCallback<Schema$TaskList>): void;
284
379
  get(callback: BodyResponseCallback<Schema$TaskList>): void;
285
380
  /**
286
381
  * Creates a new task list and adds it to the authenticated user's task lists. A user can have up to 2000 lists at a time.
382
+ * @example
383
+ * ```js
384
+ * // Before running the sample:
385
+ * // - Enable the API at:
386
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
387
+ * // - Login into gcloud by running:
388
+ * // ```sh
389
+ * // $ gcloud auth application-default login
390
+ * // ```
391
+ * // - Install the npm module by running:
392
+ * // ```sh
393
+ * // $ npm install googleapis
394
+ * // ```
395
+ *
396
+ * const {google} = require('googleapis');
397
+ * const tasks = google.tasks('v1');
398
+ *
399
+ * async function main() {
400
+ * const auth = new google.auth.GoogleAuth({
401
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
402
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
403
+ * });
404
+ *
405
+ * // Acquire an auth client, and bind it to all future calls
406
+ * const authClient = await auth.getClient();
407
+ * google.options({auth: authClient});
408
+ *
409
+ * // Do the magic
410
+ * const res = await tasks.tasklists.insert({
411
+ * // Request body metadata
412
+ * requestBody: {
413
+ * // request body parameters
414
+ * // {
415
+ * // "etag": "my_etag",
416
+ * // "id": "my_id",
417
+ * // "kind": "my_kind",
418
+ * // "selfLink": "my_selfLink",
419
+ * // "title": "my_title",
420
+ * // "updated": "my_updated"
421
+ * // }
422
+ * },
423
+ * });
424
+ * console.log(res.data);
425
+ *
426
+ * // Example response
427
+ * // {
428
+ * // "etag": "my_etag",
429
+ * // "id": "my_id",
430
+ * // "kind": "my_kind",
431
+ * // "selfLink": "my_selfLink",
432
+ * // "title": "my_title",
433
+ * // "updated": "my_updated"
434
+ * // }
435
+ * }
436
+ *
437
+ * main().catch(e => {
438
+ * console.error(e);
439
+ * throw e;
440
+ * });
441
+ *
442
+ * ```
287
443
  *
288
444
  * @param params - Parameters for request
289
445
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
290
446
  * @param callback - Optional callback that handles the response.
291
447
  * @returns A promise if used with async/await, or void if used with a callback.
292
448
  */
293
- insert(params: Params$Resource$Tasklists$Insert, options: StreamMethodOptions): GaxiosPromise<Readable>;
294
- insert(params?: Params$Resource$Tasklists$Insert, options?: MethodOptions): GaxiosPromise<Schema$TaskList>;
449
+ insert(params: Params$Resource$Tasklists$Insert, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
450
+ insert(params?: Params$Resource$Tasklists$Insert, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TaskList>>;
295
451
  insert(params: Params$Resource$Tasklists$Insert, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
296
452
  insert(params: Params$Resource$Tasklists$Insert, options: MethodOptions | BodyResponseCallback<Schema$TaskList>, callback: BodyResponseCallback<Schema$TaskList>): void;
297
453
  insert(params: Params$Resource$Tasklists$Insert, callback: BodyResponseCallback<Schema$TaskList>): void;
298
454
  insert(callback: BodyResponseCallback<Schema$TaskList>): void;
299
455
  /**
300
456
  * Returns all the authenticated user's task lists. A user can have up to 2000 lists at a time.
457
+ * @example
458
+ * ```js
459
+ * // Before running the sample:
460
+ * // - Enable the API at:
461
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
462
+ * // - Login into gcloud by running:
463
+ * // ```sh
464
+ * // $ gcloud auth application-default login
465
+ * // ```
466
+ * // - Install the npm module by running:
467
+ * // ```sh
468
+ * // $ npm install googleapis
469
+ * // ```
470
+ *
471
+ * const {google} = require('googleapis');
472
+ * const tasks = google.tasks('v1');
473
+ *
474
+ * async function main() {
475
+ * const auth = new google.auth.GoogleAuth({
476
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
477
+ * scopes: [
478
+ * 'https://www.googleapis.com/auth/tasks',
479
+ * 'https://www.googleapis.com/auth/tasks.readonly',
480
+ * ],
481
+ * });
482
+ *
483
+ * // Acquire an auth client, and bind it to all future calls
484
+ * const authClient = await auth.getClient();
485
+ * google.options({auth: authClient});
486
+ *
487
+ * // Do the magic
488
+ * const res = await tasks.tasklists.list({
489
+ * // Maximum number of task lists returned on one page. Optional. The default is 1000 (max allowed: 1000).
490
+ * maxResults: 'placeholder-value',
491
+ * // Token specifying the result page to return. Optional.
492
+ * pageToken: 'placeholder-value',
493
+ * });
494
+ * console.log(res.data);
495
+ *
496
+ * // Example response
497
+ * // {
498
+ * // "etag": "my_etag",
499
+ * // "items": [],
500
+ * // "kind": "my_kind",
501
+ * // "nextPageToken": "my_nextPageToken"
502
+ * // }
503
+ * }
504
+ *
505
+ * main().catch(e => {
506
+ * console.error(e);
507
+ * throw e;
508
+ * });
509
+ *
510
+ * ```
301
511
  *
302
512
  * @param params - Parameters for request
303
513
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
304
514
  * @param callback - Optional callback that handles the response.
305
515
  * @returns A promise if used with async/await, or void if used with a callback.
306
516
  */
307
- list(params: Params$Resource$Tasklists$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
308
- list(params?: Params$Resource$Tasklists$List, options?: MethodOptions): GaxiosPromise<Schema$TaskLists>;
517
+ list(params: Params$Resource$Tasklists$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
518
+ list(params?: Params$Resource$Tasklists$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TaskLists>>;
309
519
  list(params: Params$Resource$Tasklists$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
310
520
  list(params: Params$Resource$Tasklists$List, options: MethodOptions | BodyResponseCallback<Schema$TaskLists>, callback: BodyResponseCallback<Schema$TaskLists>): void;
311
521
  list(params: Params$Resource$Tasklists$List, callback: BodyResponseCallback<Schema$TaskLists>): void;
312
522
  list(callback: BodyResponseCallback<Schema$TaskLists>): void;
313
523
  /**
314
524
  * Updates the authenticated user's specified task list. This method supports patch semantics.
525
+ * @example
526
+ * ```js
527
+ * // Before running the sample:
528
+ * // - Enable the API at:
529
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
530
+ * // - Login into gcloud by running:
531
+ * // ```sh
532
+ * // $ gcloud auth application-default login
533
+ * // ```
534
+ * // - Install the npm module by running:
535
+ * // ```sh
536
+ * // $ npm install googleapis
537
+ * // ```
538
+ *
539
+ * const {google} = require('googleapis');
540
+ * const tasks = google.tasks('v1');
541
+ *
542
+ * async function main() {
543
+ * const auth = new google.auth.GoogleAuth({
544
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
545
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
546
+ * });
547
+ *
548
+ * // Acquire an auth client, and bind it to all future calls
549
+ * const authClient = await auth.getClient();
550
+ * google.options({auth: authClient});
551
+ *
552
+ * // Do the magic
553
+ * const res = await tasks.tasklists.patch({
554
+ * // Task list identifier.
555
+ * tasklist: 'placeholder-value',
556
+ *
557
+ * // Request body metadata
558
+ * requestBody: {
559
+ * // request body parameters
560
+ * // {
561
+ * // "etag": "my_etag",
562
+ * // "id": "my_id",
563
+ * // "kind": "my_kind",
564
+ * // "selfLink": "my_selfLink",
565
+ * // "title": "my_title",
566
+ * // "updated": "my_updated"
567
+ * // }
568
+ * },
569
+ * });
570
+ * console.log(res.data);
571
+ *
572
+ * // Example response
573
+ * // {
574
+ * // "etag": "my_etag",
575
+ * // "id": "my_id",
576
+ * // "kind": "my_kind",
577
+ * // "selfLink": "my_selfLink",
578
+ * // "title": "my_title",
579
+ * // "updated": "my_updated"
580
+ * // }
581
+ * }
582
+ *
583
+ * main().catch(e => {
584
+ * console.error(e);
585
+ * throw e;
586
+ * });
587
+ *
588
+ * ```
315
589
  *
316
590
  * @param params - Parameters for request
317
591
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
318
592
  * @param callback - Optional callback that handles the response.
319
593
  * @returns A promise if used with async/await, or void if used with a callback.
320
594
  */
321
- patch(params: Params$Resource$Tasklists$Patch, options: StreamMethodOptions): GaxiosPromise<Readable>;
322
- patch(params?: Params$Resource$Tasklists$Patch, options?: MethodOptions): GaxiosPromise<Schema$TaskList>;
595
+ patch(params: Params$Resource$Tasklists$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
596
+ patch(params?: Params$Resource$Tasklists$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TaskList>>;
323
597
  patch(params: Params$Resource$Tasklists$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
324
598
  patch(params: Params$Resource$Tasklists$Patch, options: MethodOptions | BodyResponseCallback<Schema$TaskList>, callback: BodyResponseCallback<Schema$TaskList>): void;
325
599
  patch(params: Params$Resource$Tasklists$Patch, callback: BodyResponseCallback<Schema$TaskList>): void;
326
600
  patch(callback: BodyResponseCallback<Schema$TaskList>): void;
327
601
  /**
328
602
  * Updates the authenticated user's specified task list.
603
+ * @example
604
+ * ```js
605
+ * // Before running the sample:
606
+ * // - Enable the API at:
607
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
608
+ * // - Login into gcloud by running:
609
+ * // ```sh
610
+ * // $ gcloud auth application-default login
611
+ * // ```
612
+ * // - Install the npm module by running:
613
+ * // ```sh
614
+ * // $ npm install googleapis
615
+ * // ```
616
+ *
617
+ * const {google} = require('googleapis');
618
+ * const tasks = google.tasks('v1');
619
+ *
620
+ * async function main() {
621
+ * const auth = new google.auth.GoogleAuth({
622
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
623
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
624
+ * });
625
+ *
626
+ * // Acquire an auth client, and bind it to all future calls
627
+ * const authClient = await auth.getClient();
628
+ * google.options({auth: authClient});
629
+ *
630
+ * // Do the magic
631
+ * const res = await tasks.tasklists.update({
632
+ * // Task list identifier.
633
+ * tasklist: 'placeholder-value',
634
+ *
635
+ * // Request body metadata
636
+ * requestBody: {
637
+ * // request body parameters
638
+ * // {
639
+ * // "etag": "my_etag",
640
+ * // "id": "my_id",
641
+ * // "kind": "my_kind",
642
+ * // "selfLink": "my_selfLink",
643
+ * // "title": "my_title",
644
+ * // "updated": "my_updated"
645
+ * // }
646
+ * },
647
+ * });
648
+ * console.log(res.data);
649
+ *
650
+ * // Example response
651
+ * // {
652
+ * // "etag": "my_etag",
653
+ * // "id": "my_id",
654
+ * // "kind": "my_kind",
655
+ * // "selfLink": "my_selfLink",
656
+ * // "title": "my_title",
657
+ * // "updated": "my_updated"
658
+ * // }
659
+ * }
660
+ *
661
+ * main().catch(e => {
662
+ * console.error(e);
663
+ * throw e;
664
+ * });
665
+ *
666
+ * ```
329
667
  *
330
668
  * @param params - Parameters for request
331
669
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
332
670
  * @param callback - Optional callback that handles the response.
333
671
  * @returns A promise if used with async/await, or void if used with a callback.
334
672
  */
335
- update(params: Params$Resource$Tasklists$Update, options: StreamMethodOptions): GaxiosPromise<Readable>;
336
- update(params?: Params$Resource$Tasklists$Update, options?: MethodOptions): GaxiosPromise<Schema$TaskList>;
673
+ update(params: Params$Resource$Tasklists$Update, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
674
+ update(params?: Params$Resource$Tasklists$Update, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TaskList>>;
337
675
  update(params: Params$Resource$Tasklists$Update, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
338
676
  update(params: Params$Resource$Tasklists$Update, options: MethodOptions | BodyResponseCallback<Schema$TaskList>, callback: BodyResponseCallback<Schema$TaskList>): void;
339
677
  update(params: Params$Resource$Tasklists$Update, callback: BodyResponseCallback<Schema$TaskList>): void;
@@ -392,112 +730,673 @@ export declare namespace tasks_v1 {
392
730
  constructor(context: APIRequestContext);
393
731
  /**
394
732
  * Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
733
+ * @example
734
+ * ```js
735
+ * // Before running the sample:
736
+ * // - Enable the API at:
737
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
738
+ * // - Login into gcloud by running:
739
+ * // ```sh
740
+ * // $ gcloud auth application-default login
741
+ * // ```
742
+ * // - Install the npm module by running:
743
+ * // ```sh
744
+ * // $ npm install googleapis
745
+ * // ```
746
+ *
747
+ * const {google} = require('googleapis');
748
+ * const tasks = google.tasks('v1');
749
+ *
750
+ * async function main() {
751
+ * const auth = new google.auth.GoogleAuth({
752
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
753
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
754
+ * });
755
+ *
756
+ * // Acquire an auth client, and bind it to all future calls
757
+ * const authClient = await auth.getClient();
758
+ * google.options({auth: authClient});
759
+ *
760
+ * // Do the magic
761
+ * const res = await tasks.tasks.clear({
762
+ * // Task list identifier.
763
+ * tasklist: 'placeholder-value',
764
+ * });
765
+ * console.log(res.data);
766
+ * }
767
+ *
768
+ * main().catch(e => {
769
+ * console.error(e);
770
+ * throw e;
771
+ * });
772
+ *
773
+ * ```
395
774
  *
396
775
  * @param params - Parameters for request
397
776
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
398
777
  * @param callback - Optional callback that handles the response.
399
778
  * @returns A promise if used with async/await, or void if used with a callback.
400
779
  */
401
- clear(params: Params$Resource$Tasks$Clear, options: StreamMethodOptions): GaxiosPromise<Readable>;
402
- clear(params?: Params$Resource$Tasks$Clear, options?: MethodOptions): GaxiosPromise<void>;
780
+ clear(params: Params$Resource$Tasks$Clear, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
781
+ clear(params?: Params$Resource$Tasks$Clear, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
403
782
  clear(params: Params$Resource$Tasks$Clear, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
404
783
  clear(params: Params$Resource$Tasks$Clear, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
405
784
  clear(params: Params$Resource$Tasks$Clear, callback: BodyResponseCallback<void>): void;
406
785
  clear(callback: BodyResponseCallback<void>): void;
407
786
  /**
408
787
  * Deletes the specified task from the task list. If the task is assigned, both the assigned task and the original task (in Docs, Chat Spaces) are deleted. To delete the assigned task only, navigate to the assignment surface and unassign the task from there.
788
+ * @example
789
+ * ```js
790
+ * // Before running the sample:
791
+ * // - Enable the API at:
792
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
793
+ * // - Login into gcloud by running:
794
+ * // ```sh
795
+ * // $ gcloud auth application-default login
796
+ * // ```
797
+ * // - Install the npm module by running:
798
+ * // ```sh
799
+ * // $ npm install googleapis
800
+ * // ```
801
+ *
802
+ * const {google} = require('googleapis');
803
+ * const tasks = google.tasks('v1');
804
+ *
805
+ * async function main() {
806
+ * const auth = new google.auth.GoogleAuth({
807
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
808
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
809
+ * });
810
+ *
811
+ * // Acquire an auth client, and bind it to all future calls
812
+ * const authClient = await auth.getClient();
813
+ * google.options({auth: authClient});
814
+ *
815
+ * // Do the magic
816
+ * const res = await tasks.tasks.delete({
817
+ * // Task identifier.
818
+ * task: 'placeholder-value',
819
+ * // Task list identifier.
820
+ * tasklist: 'placeholder-value',
821
+ * });
822
+ * console.log(res.data);
823
+ * }
824
+ *
825
+ * main().catch(e => {
826
+ * console.error(e);
827
+ * throw e;
828
+ * });
829
+ *
830
+ * ```
409
831
  *
410
832
  * @param params - Parameters for request
411
833
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
412
834
  * @param callback - Optional callback that handles the response.
413
835
  * @returns A promise if used with async/await, or void if used with a callback.
414
836
  */
415
- delete(params: Params$Resource$Tasks$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
416
- delete(params?: Params$Resource$Tasks$Delete, options?: MethodOptions): GaxiosPromise<void>;
837
+ delete(params: Params$Resource$Tasks$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
838
+ delete(params?: Params$Resource$Tasks$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
417
839
  delete(params: Params$Resource$Tasks$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
418
840
  delete(params: Params$Resource$Tasks$Delete, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
419
841
  delete(params: Params$Resource$Tasks$Delete, callback: BodyResponseCallback<void>): void;
420
842
  delete(callback: BodyResponseCallback<void>): void;
421
843
  /**
422
844
  * Returns the specified task.
845
+ * @example
846
+ * ```js
847
+ * // Before running the sample:
848
+ * // - Enable the API at:
849
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
850
+ * // - Login into gcloud by running:
851
+ * // ```sh
852
+ * // $ gcloud auth application-default login
853
+ * // ```
854
+ * // - Install the npm module by running:
855
+ * // ```sh
856
+ * // $ npm install googleapis
857
+ * // ```
858
+ *
859
+ * const {google} = require('googleapis');
860
+ * const tasks = google.tasks('v1');
861
+ *
862
+ * async function main() {
863
+ * const auth = new google.auth.GoogleAuth({
864
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
865
+ * scopes: [
866
+ * 'https://www.googleapis.com/auth/tasks',
867
+ * 'https://www.googleapis.com/auth/tasks.readonly',
868
+ * ],
869
+ * });
870
+ *
871
+ * // Acquire an auth client, and bind it to all future calls
872
+ * const authClient = await auth.getClient();
873
+ * google.options({auth: authClient});
874
+ *
875
+ * // Do the magic
876
+ * const res = await tasks.tasks.get({
877
+ * // Task identifier.
878
+ * task: 'placeholder-value',
879
+ * // Task list identifier.
880
+ * tasklist: 'placeholder-value',
881
+ * });
882
+ * console.log(res.data);
883
+ *
884
+ * // Example response
885
+ * // {
886
+ * // "assignmentInfo": {},
887
+ * // "completed": "my_completed",
888
+ * // "deleted": false,
889
+ * // "due": "my_due",
890
+ * // "etag": "my_etag",
891
+ * // "hidden": false,
892
+ * // "id": "my_id",
893
+ * // "kind": "my_kind",
894
+ * // "links": [],
895
+ * // "notes": "my_notes",
896
+ * // "parent": "my_parent",
897
+ * // "position": "my_position",
898
+ * // "selfLink": "my_selfLink",
899
+ * // "status": "my_status",
900
+ * // "title": "my_title",
901
+ * // "updated": "my_updated",
902
+ * // "webViewLink": "my_webViewLink"
903
+ * // }
904
+ * }
905
+ *
906
+ * main().catch(e => {
907
+ * console.error(e);
908
+ * throw e;
909
+ * });
910
+ *
911
+ * ```
423
912
  *
424
913
  * @param params - Parameters for request
425
914
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
426
915
  * @param callback - Optional callback that handles the response.
427
916
  * @returns A promise if used with async/await, or void if used with a callback.
428
917
  */
429
- get(params: Params$Resource$Tasks$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
430
- get(params?: Params$Resource$Tasks$Get, options?: MethodOptions): GaxiosPromise<Schema$Task>;
918
+ get(params: Params$Resource$Tasks$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
919
+ get(params?: Params$Resource$Tasks$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Task>>;
431
920
  get(params: Params$Resource$Tasks$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
432
921
  get(params: Params$Resource$Tasks$Get, options: MethodOptions | BodyResponseCallback<Schema$Task>, callback: BodyResponseCallback<Schema$Task>): void;
433
922
  get(params: Params$Resource$Tasks$Get, callback: BodyResponseCallback<Schema$Task>): void;
434
923
  get(callback: BodyResponseCallback<Schema$Task>): void;
435
924
  /**
436
925
  * Creates a new task on the specified task list. Tasks assigned from Docs or Chat Spaces cannot be inserted from Tasks Public API; they can only be created by assigning them from Docs or Chat Spaces. A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.
926
+ * @example
927
+ * ```js
928
+ * // Before running the sample:
929
+ * // - Enable the API at:
930
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
931
+ * // - Login into gcloud by running:
932
+ * // ```sh
933
+ * // $ gcloud auth application-default login
934
+ * // ```
935
+ * // - Install the npm module by running:
936
+ * // ```sh
937
+ * // $ npm install googleapis
938
+ * // ```
939
+ *
940
+ * const {google} = require('googleapis');
941
+ * const tasks = google.tasks('v1');
942
+ *
943
+ * async function main() {
944
+ * const auth = new google.auth.GoogleAuth({
945
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
946
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
947
+ * });
948
+ *
949
+ * // Acquire an auth client, and bind it to all future calls
950
+ * const authClient = await auth.getClient();
951
+ * google.options({auth: authClient});
952
+ *
953
+ * // Do the magic
954
+ * const res = await tasks.tasks.insert({
955
+ * // Parent task identifier. If the task is created at the top level, this parameter is omitted. An assigned task cannot be a parent task, nor can it have a parent. Setting the parent to an assigned task results in failure of the request. Optional.
956
+ * parent: 'placeholder-value',
957
+ * // Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.
958
+ * previous: 'placeholder-value',
959
+ * // Task list identifier.
960
+ * tasklist: 'placeholder-value',
961
+ *
962
+ * // Request body metadata
963
+ * requestBody: {
964
+ * // request body parameters
965
+ * // {
966
+ * // "assignmentInfo": {},
967
+ * // "completed": "my_completed",
968
+ * // "deleted": false,
969
+ * // "due": "my_due",
970
+ * // "etag": "my_etag",
971
+ * // "hidden": false,
972
+ * // "id": "my_id",
973
+ * // "kind": "my_kind",
974
+ * // "links": [],
975
+ * // "notes": "my_notes",
976
+ * // "parent": "my_parent",
977
+ * // "position": "my_position",
978
+ * // "selfLink": "my_selfLink",
979
+ * // "status": "my_status",
980
+ * // "title": "my_title",
981
+ * // "updated": "my_updated",
982
+ * // "webViewLink": "my_webViewLink"
983
+ * // }
984
+ * },
985
+ * });
986
+ * console.log(res.data);
987
+ *
988
+ * // Example response
989
+ * // {
990
+ * // "assignmentInfo": {},
991
+ * // "completed": "my_completed",
992
+ * // "deleted": false,
993
+ * // "due": "my_due",
994
+ * // "etag": "my_etag",
995
+ * // "hidden": false,
996
+ * // "id": "my_id",
997
+ * // "kind": "my_kind",
998
+ * // "links": [],
999
+ * // "notes": "my_notes",
1000
+ * // "parent": "my_parent",
1001
+ * // "position": "my_position",
1002
+ * // "selfLink": "my_selfLink",
1003
+ * // "status": "my_status",
1004
+ * // "title": "my_title",
1005
+ * // "updated": "my_updated",
1006
+ * // "webViewLink": "my_webViewLink"
1007
+ * // }
1008
+ * }
1009
+ *
1010
+ * main().catch(e => {
1011
+ * console.error(e);
1012
+ * throw e;
1013
+ * });
1014
+ *
1015
+ * ```
437
1016
  *
438
1017
  * @param params - Parameters for request
439
1018
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
440
1019
  * @param callback - Optional callback that handles the response.
441
1020
  * @returns A promise if used with async/await, or void if used with a callback.
442
1021
  */
443
- insert(params: Params$Resource$Tasks$Insert, options: StreamMethodOptions): GaxiosPromise<Readable>;
444
- insert(params?: Params$Resource$Tasks$Insert, options?: MethodOptions): GaxiosPromise<Schema$Task>;
1022
+ insert(params: Params$Resource$Tasks$Insert, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1023
+ insert(params?: Params$Resource$Tasks$Insert, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Task>>;
445
1024
  insert(params: Params$Resource$Tasks$Insert, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
446
1025
  insert(params: Params$Resource$Tasks$Insert, options: MethodOptions | BodyResponseCallback<Schema$Task>, callback: BodyResponseCallback<Schema$Task>): void;
447
1026
  insert(params: Params$Resource$Tasks$Insert, callback: BodyResponseCallback<Schema$Task>): void;
448
1027
  insert(callback: BodyResponseCallback<Schema$Task>): void;
449
1028
  /**
450
1029
  * Returns all tasks in the specified task list. Doesn't return assigned tasks by default (from Docs, Chat Spaces). A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.
1030
+ * @example
1031
+ * ```js
1032
+ * // Before running the sample:
1033
+ * // - Enable the API at:
1034
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
1035
+ * // - Login into gcloud by running:
1036
+ * // ```sh
1037
+ * // $ gcloud auth application-default login
1038
+ * // ```
1039
+ * // - Install the npm module by running:
1040
+ * // ```sh
1041
+ * // $ npm install googleapis
1042
+ * // ```
1043
+ *
1044
+ * const {google} = require('googleapis');
1045
+ * const tasks = google.tasks('v1');
1046
+ *
1047
+ * async function main() {
1048
+ * const auth = new google.auth.GoogleAuth({
1049
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1050
+ * scopes: [
1051
+ * 'https://www.googleapis.com/auth/tasks',
1052
+ * 'https://www.googleapis.com/auth/tasks.readonly',
1053
+ * ],
1054
+ * });
1055
+ *
1056
+ * // Acquire an auth client, and bind it to all future calls
1057
+ * const authClient = await auth.getClient();
1058
+ * google.options({auth: authClient});
1059
+ *
1060
+ * // Do the magic
1061
+ * const res = await tasks.tasks.list({
1062
+ * // Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
1063
+ * completedMax: 'placeholder-value',
1064
+ * // Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
1065
+ * completedMin: 'placeholder-value',
1066
+ * // Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
1067
+ * dueMax: 'placeholder-value',
1068
+ * // Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
1069
+ * dueMin: 'placeholder-value',
1070
+ * // Maximum number of tasks returned on one page. Optional. The default is 20 (max allowed: 100).
1071
+ * maxResults: 'placeholder-value',
1072
+ * // Token specifying the result page to return. Optional.
1073
+ * pageToken: 'placeholder-value',
1074
+ * // Optional. Flag indicating whether tasks assigned to the current user are returned in the result. Optional. The default is False.
1075
+ * showAssigned: 'placeholder-value',
1076
+ * // Flag indicating whether completed tasks are returned in the result. Note that showHidden must also be True to show tasks completed in first party clients, such as the web UI and Google's mobile apps. Optional. The default is True.
1077
+ * showCompleted: 'placeholder-value',
1078
+ * // Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.
1079
+ * showDeleted: 'placeholder-value',
1080
+ * // Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.
1081
+ * showHidden: 'placeholder-value',
1082
+ * // Task list identifier.
1083
+ * tasklist: 'placeholder-value',
1084
+ * // Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.
1085
+ * updatedMin: 'placeholder-value',
1086
+ * });
1087
+ * console.log(res.data);
1088
+ *
1089
+ * // Example response
1090
+ * // {
1091
+ * // "etag": "my_etag",
1092
+ * // "items": [],
1093
+ * // "kind": "my_kind",
1094
+ * // "nextPageToken": "my_nextPageToken"
1095
+ * // }
1096
+ * }
1097
+ *
1098
+ * main().catch(e => {
1099
+ * console.error(e);
1100
+ * throw e;
1101
+ * });
1102
+ *
1103
+ * ```
451
1104
  *
452
1105
  * @param params - Parameters for request
453
1106
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
454
1107
  * @param callback - Optional callback that handles the response.
455
1108
  * @returns A promise if used with async/await, or void if used with a callback.
456
1109
  */
457
- list(params: Params$Resource$Tasks$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
458
- list(params?: Params$Resource$Tasks$List, options?: MethodOptions): GaxiosPromise<Schema$Tasks>;
1110
+ list(params: Params$Resource$Tasks$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1111
+ list(params?: Params$Resource$Tasks$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Tasks>>;
459
1112
  list(params: Params$Resource$Tasks$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
460
1113
  list(params: Params$Resource$Tasks$List, options: MethodOptions | BodyResponseCallback<Schema$Tasks>, callback: BodyResponseCallback<Schema$Tasks>): void;
461
1114
  list(params: Params$Resource$Tasks$List, callback: BodyResponseCallback<Schema$Tasks>): void;
462
1115
  list(callback: BodyResponseCallback<Schema$Tasks>): void;
463
1116
  /**
464
1117
  * Moves the specified task to another position in the destination task list. If the destination list is not specified, the task is moved within its current list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks. A user can have up to 2,000 subtasks per task.
1118
+ * @example
1119
+ * ```js
1120
+ * // Before running the sample:
1121
+ * // - Enable the API at:
1122
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
1123
+ * // - Login into gcloud by running:
1124
+ * // ```sh
1125
+ * // $ gcloud auth application-default login
1126
+ * // ```
1127
+ * // - Install the npm module by running:
1128
+ * // ```sh
1129
+ * // $ npm install googleapis
1130
+ * // ```
1131
+ *
1132
+ * const {google} = require('googleapis');
1133
+ * const tasks = google.tasks('v1');
1134
+ *
1135
+ * async function main() {
1136
+ * const auth = new google.auth.GoogleAuth({
1137
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1138
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
1139
+ * });
1140
+ *
1141
+ * // Acquire an auth client, and bind it to all future calls
1142
+ * const authClient = await auth.getClient();
1143
+ * google.options({auth: authClient});
1144
+ *
1145
+ * // Do the magic
1146
+ * const res = await tasks.tasks.move({
1147
+ * // Optional. Destination task list identifier. If set, the task is moved from tasklist to the destinationTasklist list. Otherwise the task is moved within its current list. Recurrent tasks cannot currently be moved between lists.
1148
+ * destinationTasklist: 'placeholder-value',
1149
+ * // Optional. New parent task identifier. If the task is moved to the top level, this parameter is omitted. The task set as parent must exist in the task list and can not be hidden. Exceptions: 1. Assigned and repeating tasks cannot be set as parent tasks (have subtasks), or be moved under a parent task (become subtasks). 2. Tasks that are both completed and hidden cannot be nested, so the parent field must be empty.
1150
+ * parent: 'placeholder-value',
1151
+ * // Optional. New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. The task set as previous must exist in the task list and can not be hidden. Exceptions: 1. Tasks that are both completed and hidden can only be moved to position 0, so the previous field must be empty.
1152
+ * previous: 'placeholder-value',
1153
+ * // Task identifier.
1154
+ * task: 'placeholder-value',
1155
+ * // Task list identifier.
1156
+ * tasklist: 'placeholder-value',
1157
+ * });
1158
+ * console.log(res.data);
1159
+ *
1160
+ * // Example response
1161
+ * // {
1162
+ * // "assignmentInfo": {},
1163
+ * // "completed": "my_completed",
1164
+ * // "deleted": false,
1165
+ * // "due": "my_due",
1166
+ * // "etag": "my_etag",
1167
+ * // "hidden": false,
1168
+ * // "id": "my_id",
1169
+ * // "kind": "my_kind",
1170
+ * // "links": [],
1171
+ * // "notes": "my_notes",
1172
+ * // "parent": "my_parent",
1173
+ * // "position": "my_position",
1174
+ * // "selfLink": "my_selfLink",
1175
+ * // "status": "my_status",
1176
+ * // "title": "my_title",
1177
+ * // "updated": "my_updated",
1178
+ * // "webViewLink": "my_webViewLink"
1179
+ * // }
1180
+ * }
1181
+ *
1182
+ * main().catch(e => {
1183
+ * console.error(e);
1184
+ * throw e;
1185
+ * });
1186
+ *
1187
+ * ```
465
1188
  *
466
1189
  * @param params - Parameters for request
467
1190
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
468
1191
  * @param callback - Optional callback that handles the response.
469
1192
  * @returns A promise if used with async/await, or void if used with a callback.
470
1193
  */
471
- move(params: Params$Resource$Tasks$Move, options: StreamMethodOptions): GaxiosPromise<Readable>;
472
- move(params?: Params$Resource$Tasks$Move, options?: MethodOptions): GaxiosPromise<Schema$Task>;
1194
+ move(params: Params$Resource$Tasks$Move, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1195
+ move(params?: Params$Resource$Tasks$Move, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Task>>;
473
1196
  move(params: Params$Resource$Tasks$Move, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
474
1197
  move(params: Params$Resource$Tasks$Move, options: MethodOptions | BodyResponseCallback<Schema$Task>, callback: BodyResponseCallback<Schema$Task>): void;
475
1198
  move(params: Params$Resource$Tasks$Move, callback: BodyResponseCallback<Schema$Task>): void;
476
1199
  move(callback: BodyResponseCallback<Schema$Task>): void;
477
1200
  /**
478
1201
  * Updates the specified task. This method supports patch semantics.
1202
+ * @example
1203
+ * ```js
1204
+ * // Before running the sample:
1205
+ * // - Enable the API at:
1206
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
1207
+ * // - Login into gcloud by running:
1208
+ * // ```sh
1209
+ * // $ gcloud auth application-default login
1210
+ * // ```
1211
+ * // - Install the npm module by running:
1212
+ * // ```sh
1213
+ * // $ npm install googleapis
1214
+ * // ```
1215
+ *
1216
+ * const {google} = require('googleapis');
1217
+ * const tasks = google.tasks('v1');
1218
+ *
1219
+ * async function main() {
1220
+ * const auth = new google.auth.GoogleAuth({
1221
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1222
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
1223
+ * });
1224
+ *
1225
+ * // Acquire an auth client, and bind it to all future calls
1226
+ * const authClient = await auth.getClient();
1227
+ * google.options({auth: authClient});
1228
+ *
1229
+ * // Do the magic
1230
+ * const res = await tasks.tasks.patch({
1231
+ * // Task identifier.
1232
+ * task: 'placeholder-value',
1233
+ * // Task list identifier.
1234
+ * tasklist: 'placeholder-value',
1235
+ *
1236
+ * // Request body metadata
1237
+ * requestBody: {
1238
+ * // request body parameters
1239
+ * // {
1240
+ * // "assignmentInfo": {},
1241
+ * // "completed": "my_completed",
1242
+ * // "deleted": false,
1243
+ * // "due": "my_due",
1244
+ * // "etag": "my_etag",
1245
+ * // "hidden": false,
1246
+ * // "id": "my_id",
1247
+ * // "kind": "my_kind",
1248
+ * // "links": [],
1249
+ * // "notes": "my_notes",
1250
+ * // "parent": "my_parent",
1251
+ * // "position": "my_position",
1252
+ * // "selfLink": "my_selfLink",
1253
+ * // "status": "my_status",
1254
+ * // "title": "my_title",
1255
+ * // "updated": "my_updated",
1256
+ * // "webViewLink": "my_webViewLink"
1257
+ * // }
1258
+ * },
1259
+ * });
1260
+ * console.log(res.data);
1261
+ *
1262
+ * // Example response
1263
+ * // {
1264
+ * // "assignmentInfo": {},
1265
+ * // "completed": "my_completed",
1266
+ * // "deleted": false,
1267
+ * // "due": "my_due",
1268
+ * // "etag": "my_etag",
1269
+ * // "hidden": false,
1270
+ * // "id": "my_id",
1271
+ * // "kind": "my_kind",
1272
+ * // "links": [],
1273
+ * // "notes": "my_notes",
1274
+ * // "parent": "my_parent",
1275
+ * // "position": "my_position",
1276
+ * // "selfLink": "my_selfLink",
1277
+ * // "status": "my_status",
1278
+ * // "title": "my_title",
1279
+ * // "updated": "my_updated",
1280
+ * // "webViewLink": "my_webViewLink"
1281
+ * // }
1282
+ * }
1283
+ *
1284
+ * main().catch(e => {
1285
+ * console.error(e);
1286
+ * throw e;
1287
+ * });
1288
+ *
1289
+ * ```
479
1290
  *
480
1291
  * @param params - Parameters for request
481
1292
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
482
1293
  * @param callback - Optional callback that handles the response.
483
1294
  * @returns A promise if used with async/await, or void if used with a callback.
484
1295
  */
485
- patch(params: Params$Resource$Tasks$Patch, options: StreamMethodOptions): GaxiosPromise<Readable>;
486
- patch(params?: Params$Resource$Tasks$Patch, options?: MethodOptions): GaxiosPromise<Schema$Task>;
1296
+ patch(params: Params$Resource$Tasks$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1297
+ patch(params?: Params$Resource$Tasks$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Task>>;
487
1298
  patch(params: Params$Resource$Tasks$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
488
1299
  patch(params: Params$Resource$Tasks$Patch, options: MethodOptions | BodyResponseCallback<Schema$Task>, callback: BodyResponseCallback<Schema$Task>): void;
489
1300
  patch(params: Params$Resource$Tasks$Patch, callback: BodyResponseCallback<Schema$Task>): void;
490
1301
  patch(callback: BodyResponseCallback<Schema$Task>): void;
491
1302
  /**
492
1303
  * Updates the specified task.
1304
+ * @example
1305
+ * ```js
1306
+ * // Before running the sample:
1307
+ * // - Enable the API at:
1308
+ * // https://console.developers.google.com/apis/api/tasks.googleapis.com
1309
+ * // - Login into gcloud by running:
1310
+ * // ```sh
1311
+ * // $ gcloud auth application-default login
1312
+ * // ```
1313
+ * // - Install the npm module by running:
1314
+ * // ```sh
1315
+ * // $ npm install googleapis
1316
+ * // ```
1317
+ *
1318
+ * const {google} = require('googleapis');
1319
+ * const tasks = google.tasks('v1');
1320
+ *
1321
+ * async function main() {
1322
+ * const auth = new google.auth.GoogleAuth({
1323
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1324
+ * scopes: ['https://www.googleapis.com/auth/tasks'],
1325
+ * });
1326
+ *
1327
+ * // Acquire an auth client, and bind it to all future calls
1328
+ * const authClient = await auth.getClient();
1329
+ * google.options({auth: authClient});
1330
+ *
1331
+ * // Do the magic
1332
+ * const res = await tasks.tasks.update({
1333
+ * // Task identifier.
1334
+ * task: 'placeholder-value',
1335
+ * // Task list identifier.
1336
+ * tasklist: 'placeholder-value',
1337
+ *
1338
+ * // Request body metadata
1339
+ * requestBody: {
1340
+ * // request body parameters
1341
+ * // {
1342
+ * // "assignmentInfo": {},
1343
+ * // "completed": "my_completed",
1344
+ * // "deleted": false,
1345
+ * // "due": "my_due",
1346
+ * // "etag": "my_etag",
1347
+ * // "hidden": false,
1348
+ * // "id": "my_id",
1349
+ * // "kind": "my_kind",
1350
+ * // "links": [],
1351
+ * // "notes": "my_notes",
1352
+ * // "parent": "my_parent",
1353
+ * // "position": "my_position",
1354
+ * // "selfLink": "my_selfLink",
1355
+ * // "status": "my_status",
1356
+ * // "title": "my_title",
1357
+ * // "updated": "my_updated",
1358
+ * // "webViewLink": "my_webViewLink"
1359
+ * // }
1360
+ * },
1361
+ * });
1362
+ * console.log(res.data);
1363
+ *
1364
+ * // Example response
1365
+ * // {
1366
+ * // "assignmentInfo": {},
1367
+ * // "completed": "my_completed",
1368
+ * // "deleted": false,
1369
+ * // "due": "my_due",
1370
+ * // "etag": "my_etag",
1371
+ * // "hidden": false,
1372
+ * // "id": "my_id",
1373
+ * // "kind": "my_kind",
1374
+ * // "links": [],
1375
+ * // "notes": "my_notes",
1376
+ * // "parent": "my_parent",
1377
+ * // "position": "my_position",
1378
+ * // "selfLink": "my_selfLink",
1379
+ * // "status": "my_status",
1380
+ * // "title": "my_title",
1381
+ * // "updated": "my_updated",
1382
+ * // "webViewLink": "my_webViewLink"
1383
+ * // }
1384
+ * }
1385
+ *
1386
+ * main().catch(e => {
1387
+ * console.error(e);
1388
+ * throw e;
1389
+ * });
1390
+ *
1391
+ * ```
493
1392
  *
494
1393
  * @param params - Parameters for request
495
1394
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
496
1395
  * @param callback - Optional callback that handles the response.
497
1396
  * @returns A promise if used with async/await, or void if used with a callback.
498
1397
  */
499
- update(params: Params$Resource$Tasks$Update, options: StreamMethodOptions): GaxiosPromise<Readable>;
500
- update(params?: Params$Resource$Tasks$Update, options?: MethodOptions): GaxiosPromise<Schema$Task>;
1398
+ update(params: Params$Resource$Tasks$Update, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1399
+ update(params?: Params$Resource$Tasks$Update, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Task>>;
501
1400
  update(params: Params$Resource$Tasks$Update, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
502
1401
  update(params: Params$Resource$Tasks$Update, options: MethodOptions | BodyResponseCallback<Schema$Task>, callback: BodyResponseCallback<Schema$Task>): void;
503
1402
  update(params: Params$Resource$Tasks$Update, callback: BodyResponseCallback<Schema$Task>): void;
@@ -603,7 +1502,7 @@ export declare namespace tasks_v1 {
603
1502
  */
604
1503
  destinationTasklist?: string;
605
1504
  /**
606
- * Optional. New parent task identifier. If the task is moved to the top level, this parameter is omitted. The task set as parent must exist in the task list and can not be hidden. Exceptions: 1. Assigned tasks can not be set as parent task (have subtasks) or be moved under a parent task (become subtasks). 2. Tasks that are both completed and hidden cannot be nested, so the parent field must be empty.
1505
+ * Optional. New parent task identifier. If the task is moved to the top level, this parameter is omitted. The task set as parent must exist in the task list and can not be hidden. Exceptions: 1. Assigned and repeating tasks cannot be set as parent tasks (have subtasks), or be moved under a parent task (become subtasks). 2. Tasks that are both completed and hidden cannot be nested, so the parent field must be empty.
607
1506
  */
608
1507
  parent?: string;
609
1508
  /**