mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[gapi.client.tasks] Update Google Tasks API (#41530)
This commit is contained in:
parent
c537b15a91
commit
e10f23a2c2
@ -1,7 +1,7 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* This is stub file for gapi.client.tasks definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
* This file was automatically generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
@ -12,104 +12,187 @@ gapi.load('client', () => {
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage your tasks */
|
||||
/** Create, edit, organize, and delete all your tasks */
|
||||
'https://www.googleapis.com/auth/tasks',
|
||||
/** View your tasks */
|
||||
'https://www.googleapis.com/auth/tasks.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
const immediate = false;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
/** handle successful authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Deletes the authenticated user's specified task list. */
|
||||
await gapi.client.tasklists.delete({
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasklists.delete({
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Returns the authenticated user's specified task list. */
|
||||
await gapi.client.tasklists.get({
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasklists.get({
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Creates a new task list and adds it to the authenticated user's task lists. */
|
||||
await gapi.client.tasklists.insert({
|
||||
await gapi.client.tasks.tasklists.insert({
|
||||
}, {
|
||||
etag: "Test string",
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
selfLink: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
/** Returns all the authenticated user's task lists. */
|
||||
await gapi.client.tasklists.list({
|
||||
maxResults: "maxResults",
|
||||
pageToken: "pageToken",
|
||||
await gapi.client.tasks.tasklists.list({
|
||||
maxResults: "Test string",
|
||||
pageToken: "Test string",
|
||||
});
|
||||
/** Updates the authenticated user's specified task list. This method supports patch semantics. */
|
||||
await gapi.client.tasklists.patch({
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasklists.patch({
|
||||
tasklist: "Test string",
|
||||
}, {
|
||||
etag: "Test string",
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
selfLink: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
/** Updates the authenticated user's specified task list. */
|
||||
await gapi.client.tasklists.update({
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasklists.update({
|
||||
tasklist: "Test string",
|
||||
}, {
|
||||
etag: "Test string",
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
selfLink: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
await gapi.client.tasks.clear({
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.clear({
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Deletes the specified task from the task list. */
|
||||
await gapi.client.tasks.delete({
|
||||
task: "task",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.delete({
|
||||
task: "Test string",
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Returns the specified task. */
|
||||
await gapi.client.tasks.get({
|
||||
task: "task",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.get({
|
||||
task: "Test string",
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Creates a new task on the specified task list. */
|
||||
await gapi.client.tasks.insert({
|
||||
parent: "parent",
|
||||
previous: "previous",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.insert({
|
||||
parent: "Test string",
|
||||
previous: "Test string",
|
||||
tasklist: "Test string",
|
||||
}, {
|
||||
completed: "Test string",
|
||||
deleted: true,
|
||||
due: "Test string",
|
||||
etag: "Test string",
|
||||
hidden: true,
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
links: [
|
||||
{
|
||||
description: "Test string",
|
||||
link: "Test string",
|
||||
type: "Test string",
|
||||
} ],
|
||||
notes: "Test string",
|
||||
parent: "Test string",
|
||||
position: "Test string",
|
||||
selfLink: "Test string",
|
||||
status: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
/** Returns all tasks in the specified task list. */
|
||||
await gapi.client.tasks.list({
|
||||
completedMax: "completedMax",
|
||||
completedMin: "completedMin",
|
||||
dueMax: "dueMax",
|
||||
dueMin: "dueMin",
|
||||
maxResults: "maxResults",
|
||||
pageToken: "pageToken",
|
||||
await gapi.client.tasks.tasks.list({
|
||||
completedMax: "Test string",
|
||||
completedMin: "Test string",
|
||||
dueMax: "Test string",
|
||||
dueMin: "Test string",
|
||||
maxResults: "Test string",
|
||||
pageToken: "Test string",
|
||||
showCompleted: true,
|
||||
showDeleted: true,
|
||||
showHidden: true,
|
||||
tasklist: "tasklist",
|
||||
updatedMin: "updatedMin",
|
||||
tasklist: "Test string",
|
||||
updatedMin: "Test string",
|
||||
});
|
||||
/**
|
||||
* Moves the specified task to another position in the task 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.
|
||||
*/
|
||||
await gapi.client.tasks.move({
|
||||
parent: "parent",
|
||||
previous: "previous",
|
||||
task: "task",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.move({
|
||||
parent: "Test string",
|
||||
previous: "Test string",
|
||||
task: "Test string",
|
||||
tasklist: "Test string",
|
||||
});
|
||||
/** Updates the specified task. This method supports patch semantics. */
|
||||
await gapi.client.tasks.patch({
|
||||
task: "task",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.patch({
|
||||
task: "Test string",
|
||||
tasklist: "Test string",
|
||||
}, {
|
||||
completed: "Test string",
|
||||
deleted: true,
|
||||
due: "Test string",
|
||||
etag: "Test string",
|
||||
hidden: true,
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
links: [
|
||||
{
|
||||
description: "Test string",
|
||||
link: "Test string",
|
||||
type: "Test string",
|
||||
} ],
|
||||
notes: "Test string",
|
||||
parent: "Test string",
|
||||
position: "Test string",
|
||||
selfLink: "Test string",
|
||||
status: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
/** Updates the specified task. */
|
||||
await gapi.client.tasks.update({
|
||||
task: "task",
|
||||
tasklist: "tasklist",
|
||||
await gapi.client.tasks.tasks.update({
|
||||
task: "Test string",
|
||||
tasklist: "Test string",
|
||||
}, {
|
||||
completed: "Test string",
|
||||
deleted: true,
|
||||
due: "Test string",
|
||||
etag: "Test string",
|
||||
hidden: true,
|
||||
id: "Test string",
|
||||
kind: "Test string",
|
||||
links: [
|
||||
{
|
||||
description: "Test string",
|
||||
link: "Test string",
|
||||
type: "Test string",
|
||||
} ],
|
||||
notes: "Test string",
|
||||
parent: "Test string",
|
||||
position: "Test string",
|
||||
selfLink: "Test string",
|
||||
status: "Test string",
|
||||
title: "Test string",
|
||||
updated: "Test string",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
257
types/gapi.client.tasks/index.d.ts
vendored
257
types/gapi.client.tasks/index.d.ts
vendored
@ -1,12 +1,12 @@
|
||||
// Type definitions for non-npm package Google Tasks API v1 1.0
|
||||
// Type definitions for non-npm package Tasks API v1 1.0
|
||||
// Project: https://developers.google.com/google-apps/tasks/firstapp
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/tasks/v1/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
@ -16,17 +16,16 @@ declare namespace gapi.client {
|
||||
function load(name: "tasks", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "tasks", version: "v1", callback: () => any): void;
|
||||
|
||||
const tasklists: tasks.TasklistsResource;
|
||||
|
||||
const tasks: tasks.TasksResource;
|
||||
|
||||
namespace tasks {
|
||||
interface Task {
|
||||
/** Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed. */
|
||||
completed?: string;
|
||||
/** Flag indicating whether the task has been deleted. The default if False. */
|
||||
deleted?: boolean;
|
||||
/** Due date of the task (as a RFC 3339 timestamp). Optional. */
|
||||
/**
|
||||
* Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded
|
||||
* when setting the due date. It isn't possible to read or write the time that a task is due via the API.
|
||||
*/
|
||||
due?: string;
|
||||
/** ETag of the resource. */
|
||||
etag?: string;
|
||||
@ -117,14 +116,11 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<void>;
|
||||
/** Returns the authenticated user's specified task list. */
|
||||
@ -139,14 +135,11 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<TaskList>;
|
||||
/** Creates a new task list and adds it to the authenticated user's task lists. */
|
||||
@ -161,14 +154,30 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: TaskList;
|
||||
}): Request<TaskList>;
|
||||
insert(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: TaskList): Request<TaskList>;
|
||||
/** Returns all the authenticated user's task lists. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
@ -177,7 +186,7 @@ declare namespace gapi.client {
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Maximum number of task lists returned on one page. Optional. The default is 100. */
|
||||
/** Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). */
|
||||
maxResults?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
@ -185,12 +194,9 @@ declare namespace gapi.client {
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<TaskLists>;
|
||||
/** Updates the authenticated user's specified task list. This method supports patch semantics. */
|
||||
@ -205,16 +211,34 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: TaskList;
|
||||
}): Request<TaskList>;
|
||||
patch(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: TaskList): Request<TaskList>;
|
||||
/** Updates the authenticated user's specified task list. */
|
||||
update(request: {
|
||||
/** Data format for the response. */
|
||||
@ -227,16 +251,34 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: TaskList;
|
||||
}): Request<TaskList>;
|
||||
update(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: TaskList): Request<TaskList>;
|
||||
}
|
||||
interface TasksResource {
|
||||
/**
|
||||
@ -254,14 +296,11 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<void>;
|
||||
/** Deletes the specified task from the task list. */
|
||||
@ -276,16 +315,13 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<void>;
|
||||
/** Returns the specified task. */
|
||||
@ -300,16 +336,13 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<Task>;
|
||||
/** Creates a new task on the specified task list. */
|
||||
@ -328,16 +361,38 @@ declare namespace gapi.client {
|
||||
prettyPrint?: boolean;
|
||||
/** Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. */
|
||||
previous?: string;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: Task;
|
||||
}): Request<Task>;
|
||||
insert(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. */
|
||||
parent?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. */
|
||||
previous?: string;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: Task): Request<Task>;
|
||||
/** Returns all tasks in the specified task list. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
@ -354,7 +409,7 @@ declare namespace gapi.client {
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Maximum number of task lists returned on one page. Optional. The default is 100. */
|
||||
/** Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). */
|
||||
maxResults?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
@ -362,10 +417,7 @@ declare namespace gapi.client {
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Flag indicating whether completed tasks are returned in the result. Optional. The default is True. */
|
||||
showCompleted?: boolean;
|
||||
@ -380,7 +432,7 @@ declare namespace gapi.client {
|
||||
* time.
|
||||
*/
|
||||
updatedMin?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<Tasks>;
|
||||
/**
|
||||
@ -402,16 +454,13 @@ declare namespace gapi.client {
|
||||
prettyPrint?: boolean;
|
||||
/** New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional. */
|
||||
previous?: string;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
}): Request<Task>;
|
||||
/** Updates the specified task. This method supports patch semantics. */
|
||||
@ -426,18 +475,38 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: Task;
|
||||
}): Request<Task>;
|
||||
patch(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: Task): Request<Task>;
|
||||
/** Updates the specified task. */
|
||||
update(request: {
|
||||
/** Data format for the response. */
|
||||
@ -450,18 +519,42 @@ declare namespace gapi.client {
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* 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.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
/** Request body */
|
||||
resource: Task;
|
||||
}): Request<Task>;
|
||||
update(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** An opaque string that represents a user for quota purposes. Must not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Task identifier. */
|
||||
task: string;
|
||||
/** Task list identifier. */
|
||||
tasklist: string;
|
||||
/** Deprecated. Please use quotaUser instead. */
|
||||
userIp?: string;
|
||||
},
|
||||
body: Task): Request<Task>;
|
||||
}
|
||||
|
||||
const tasklists: TasklistsResource;
|
||||
|
||||
const tasks: TasksResource;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# TypeScript typings for Tasks API v1
|
||||
Lets you manage your tasks and task lists.
|
||||
Manages your tasks and task lists.
|
||||
For detailed description please check [documentation](https://developers.google.com/google-apps/tasks/firstapp).
|
||||
|
||||
## Installing
|
||||
@ -33,7 +33,7 @@ Don't forget to authenticate your client before sending any request to resources
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage your tasks
|
||||
// Create, edit, organize, and delete all your tasks
|
||||
'https://www.googleapis.com/auth/tasks',
|
||||
|
||||
// View your tasks
|
||||
@ -44,7 +44,7 @@ var client_id = '',
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
/* handle successful authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
@ -124,4 +124,4 @@ await gapi.client.tasks.patch({ task: "task", tasklist: "tasklist", });
|
||||
Updates the specified task.
|
||||
*/
|
||||
await gapi.client.tasks.update({ task: "task", tasklist: "tasklist", });
|
||||
```
|
||||
```
|
||||
|
||||
@ -21,4 +21,4 @@
|
||||
"index.d.ts",
|
||||
"gapi.client.tasks-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user