import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosPromise,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace tasks_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
'$.xgafv'?: string;
access_token?: string;
alt?: string;
callback?: string;
fields?: string;
key?: string;
oauth_token?: string;
prettyPrint?: boolean;
quotaUser?: string;
uploadType?: string;
upload_protocol?: string;
}
export class Tasks {
context: APIRequestContext;
tasklists: Resource$Tasklists;
tasks: Resource$Tasks;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.tasklists = new Resource$Tasklists(this.context);
this.tasks = new Resource$Tasks(this.context);
}
}
export interface Schema$Task {
completed?: string | null;
deleted?: boolean | null;
due?: string | null;
etag?: string | null;
hidden?: boolean | null;
id?: string | null;
kind?: string | null;
links?: Array<{description?: string; link?: string; type?: string}> | null;
notes?: string | null;
parent?: string | null;
position?: string | null;
selfLink?: string | null;
status?: string | null;
title?: string | null;
updated?: string | null;
}
export interface Schema$TaskList {
etag?: string | null;
id?: string | null;
kind?: string | null;
selfLink?: string | null;
title?: string | null;
updated?: string | null;
}
export interface Schema$TaskLists {
etag?: string | null;
items?: Schema$TaskList[];
kind?: string | null;
nextPageToken?: string | null;
}
export interface Schema$Tasks {
etag?: string | null;
items?: Schema$Task[];
kind?: string | null;
nextPageToken?: string | null;
}
export class Resource$Tasklists {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
delete(
params: Params$Resource$Tasklists$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Tasklists$Delete,
options?: MethodOptions
): GaxiosPromise<void>;
delete(
params: Params$Resource$Tasklists$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Tasklists$Delete,
options: MethodOptions | BodyResponseCallback<void>,
callback: BodyResponseCallback<void>
): void;
delete(
params: Params$Resource$Tasklists$Delete,
callback: BodyResponseCallback<void>
): void;
delete(callback: BodyResponseCallback<void>): void;
delete(
paramsOrCallback?:
| Params$Resource$Tasklists$Delete
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
callback?: BodyResponseCallback<void> | BodyResponseCallback<Readable>
): void | GaxiosPromise<void> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'DELETE',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<void>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<void>(parameters);
}
}
get(
params: Params$Resource$Tasklists$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Tasklists$Get,
options?: MethodOptions
): GaxiosPromise<Schema$TaskList>;
get(
params: Params$Resource$Tasklists$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Tasklists$Get,
options: MethodOptions | BodyResponseCallback<Schema$TaskList>,
callback: BodyResponseCallback<Schema$TaskList>
): void;
get(
params: Params$Resource$Tasklists$Get,
callback: BodyResponseCallback<Schema$TaskList>
): void;
get(callback: BodyResponseCallback<Schema$TaskList>): void;
get(
paramsOrCallback?:
| Params$Resource$Tasklists$Get
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$TaskList> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TaskList>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TaskList>(parameters);
}
}
insert(
params: Params$Resource$Tasklists$Insert,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
insert(
params?: Params$Resource$Tasklists$Insert,
options?: MethodOptions
): GaxiosPromise<Schema$TaskList>;
insert(
params: Params$Resource$Tasklists$Insert,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
insert(
params: Params$Resource$Tasklists$Insert,
options: MethodOptions | BodyResponseCallback<Schema$TaskList>,
callback: BodyResponseCallback<Schema$TaskList>
): void;
insert(
params: Params$Resource$Tasklists$Insert,
callback: BodyResponseCallback<Schema$TaskList>
): void;
insert(callback: BodyResponseCallback<Schema$TaskList>): void;
insert(
paramsOrCallback?:
| Params$Resource$Tasklists$Insert
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$TaskList> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$Insert;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$Insert;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TaskList>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TaskList>(parameters);
}
}
list(
params: Params$Resource$Tasklists$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Tasklists$List,
options?: MethodOptions
): GaxiosPromise<Schema$TaskLists>;
list(
params: Params$Resource$Tasklists$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Tasklists$List,
options: MethodOptions | BodyResponseCallback<Schema$TaskLists>,
callback: BodyResponseCallback<Schema$TaskLists>
): void;
list(
params: Params$Resource$Tasklists$List,
callback: BodyResponseCallback<Schema$TaskLists>
): void;
list(callback: BodyResponseCallback<Schema$TaskLists>): void;
list(
paramsOrCallback?:
| Params$Resource$Tasklists$List
| BodyResponseCallback<Schema$TaskLists>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TaskLists>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TaskLists>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$TaskLists> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TaskLists>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TaskLists>(parameters);
}
}
patch(
params: Params$Resource$Tasklists$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Tasklists$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$TaskList>;
patch(
params: Params$Resource$Tasklists$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Tasklists$Patch,
options: MethodOptions | BodyResponseCallback<Schema$TaskList>,
callback: BodyResponseCallback<Schema$TaskList>
): void;
patch(
params: Params$Resource$Tasklists$Patch,
callback: BodyResponseCallback<Schema$TaskList>
): void;
patch(callback: BodyResponseCallback<Schema$TaskList>): void;
patch(
paramsOrCallback?:
| Params$Resource$Tasklists$Patch
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$TaskList> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'PATCH',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TaskList>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TaskList>(parameters);
}
}
update(
params: Params$Resource$Tasklists$Update,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
update(
params?: Params$Resource$Tasklists$Update,
options?: MethodOptions
): GaxiosPromise<Schema$TaskList>;
update(
params: Params$Resource$Tasklists$Update,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
update(
params: Params$Resource$Tasklists$Update,
options: MethodOptions | BodyResponseCallback<Schema$TaskList>,
callback: BodyResponseCallback<Schema$TaskList>
): void;
update(
params: Params$Resource$Tasklists$Update,
callback: BodyResponseCallback<Schema$TaskList>
): void;
update(callback: BodyResponseCallback<Schema$TaskList>): void;
update(
paramsOrCallback?:
| Params$Resource$Tasklists$Update
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TaskList>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$TaskList> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasklists$Update;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasklists$Update;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'PUT',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TaskList>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TaskList>(parameters);
}
}
}
export interface Params$Resource$Tasklists$Delete extends StandardParameters {
tasklist?: string;
}
export interface Params$Resource$Tasklists$Get extends StandardParameters {
tasklist?: string;
}
export interface Params$Resource$Tasklists$Insert extends StandardParameters {
requestBody?: Schema$TaskList;
}
export interface Params$Resource$Tasklists$List extends StandardParameters {
maxResults?: number;
pageToken?: string;
}
export interface Params$Resource$Tasklists$Patch extends StandardParameters {
tasklist?: string;
requestBody?: Schema$TaskList;
}
export interface Params$Resource$Tasklists$Update extends StandardParameters {
tasklist?: string;
requestBody?: Schema$TaskList;
}
export class Resource$Tasks {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
clear(
params: Params$Resource$Tasks$Clear,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
clear(
params?: Params$Resource$Tasks$Clear,
options?: MethodOptions
): GaxiosPromise<void>;
clear(
params: Params$Resource$Tasks$Clear,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
clear(
params: Params$Resource$Tasks$Clear,
options: MethodOptions | BodyResponseCallback<void>,
callback: BodyResponseCallback<void>
): void;
clear(
params: Params$Resource$Tasks$Clear,
callback: BodyResponseCallback<void>
): void;
clear(callback: BodyResponseCallback<void>): void;
clear(
paramsOrCallback?:
| Params$Resource$Tasks$Clear
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
callback?: BodyResponseCallback<void> | BodyResponseCallback<Readable>
): void | GaxiosPromise<void> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Clear;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Clear;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/clear').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<void>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<void>(parameters);
}
}
delete(
params: Params$Resource$Tasks$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Tasks$Delete,
options?: MethodOptions
): GaxiosPromise<void>;
delete(
params: Params$Resource$Tasks$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Tasks$Delete,
options: MethodOptions | BodyResponseCallback<void>,
callback: BodyResponseCallback<void>
): void;
delete(
params: Params$Resource$Tasks$Delete,
callback: BodyResponseCallback<void>
): void;
delete(callback: BodyResponseCallback<void>): void;
delete(
paramsOrCallback?:
| Params$Resource$Tasks$Delete
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
callback?: BodyResponseCallback<void> | BodyResponseCallback<Readable>
): void | GaxiosPromise<void> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'DELETE',
},
options
),
params,
requiredParams: ['tasklist', 'task'],
pathParams: ['task', 'tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<void>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<void>(parameters);
}
}
get(
params: Params$Resource$Tasks$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Tasks$Get,
options?: MethodOptions
): GaxiosPromise<Schema$Task>;
get(
params: Params$Resource$Tasks$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Tasks$Get,
options: MethodOptions | BodyResponseCallback<Schema$Task>,
callback: BodyResponseCallback<Schema$Task>
): void;
get(
params: Params$Resource$Tasks$Get,
callback: BodyResponseCallback<Schema$Task>
): void;
get(callback: BodyResponseCallback<Schema$Task>): void;
get(
paramsOrCallback?:
| Params$Resource$Tasks$Get
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Task> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['tasklist', 'task'],
pathParams: ['task', 'tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Task>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Task>(parameters);
}
}
insert(
params: Params$Resource$Tasks$Insert,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
insert(
params?: Params$Resource$Tasks$Insert,
options?: MethodOptions
): GaxiosPromise<Schema$Task>;
insert(
params: Params$Resource$Tasks$Insert,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
insert(
params: Params$Resource$Tasks$Insert,
options: MethodOptions | BodyResponseCallback<Schema$Task>,
callback: BodyResponseCallback<Schema$Task>
): void;
insert(
params: Params$Resource$Tasks$Insert,
callback: BodyResponseCallback<Schema$Task>
): void;
insert(callback: BodyResponseCallback<Schema$Task>): void;
insert(
paramsOrCallback?:
| Params$Resource$Tasks$Insert
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Task> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Insert;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Insert;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Task>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Task>(parameters);
}
}
list(
params: Params$Resource$Tasks$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Tasks$List,
options?: MethodOptions
): GaxiosPromise<Schema$Tasks>;
list(
params: Params$Resource$Tasks$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Tasks$List,
options: MethodOptions | BodyResponseCallback<Schema$Tasks>,
callback: BodyResponseCallback<Schema$Tasks>
): void;
list(
params: Params$Resource$Tasks$List,
callback: BodyResponseCallback<Schema$Tasks>
): void;
list(callback: BodyResponseCallback<Schema$Tasks>): void;
list(
paramsOrCallback?:
| Params$Resource$Tasks$List
| BodyResponseCallback<Schema$Tasks>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Tasks>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Tasks>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Tasks> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['tasklist'],
pathParams: ['tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Tasks>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Tasks>(parameters);
}
}
move(
params: Params$Resource$Tasks$Move,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
move(
params?: Params$Resource$Tasks$Move,
options?: MethodOptions
): GaxiosPromise<Schema$Task>;
move(
params: Params$Resource$Tasks$Move,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
move(
params: Params$Resource$Tasks$Move,
options: MethodOptions | BodyResponseCallback<Schema$Task>,
callback: BodyResponseCallback<Schema$Task>
): void;
move(
params: Params$Resource$Tasks$Move,
callback: BodyResponseCallback<Schema$Task>
): void;
move(callback: BodyResponseCallback<Schema$Task>): void;
move(
paramsOrCallback?:
| Params$Resource$Tasks$Move
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Task> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Move;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Move;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (
rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}/move'
).replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: ['tasklist', 'task'],
pathParams: ['task', 'tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Task>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Task>(parameters);
}
}
patch(
params: Params$Resource$Tasks$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Tasks$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Task>;
patch(
params: Params$Resource$Tasks$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Tasks$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Task>,
callback: BodyResponseCallback<Schema$Task>
): void;
patch(
params: Params$Resource$Tasks$Patch,
callback: BodyResponseCallback<Schema$Task>
): void;
patch(callback: BodyResponseCallback<Schema$Task>): void;
patch(
paramsOrCallback?:
| Params$Resource$Tasks$Patch
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Task> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'PATCH',
},
options
),
params,
requiredParams: ['tasklist', 'task'],
pathParams: ['task', 'tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Task>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Task>(parameters);
}
}
update(
params: Params$Resource$Tasks$Update,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
update(
params?: Params$Resource$Tasks$Update,
options?: MethodOptions
): GaxiosPromise<Schema$Task>;
update(
params: Params$Resource$Tasks$Update,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
update(
params: Params$Resource$Tasks$Update,
options: MethodOptions | BodyResponseCallback<Schema$Task>,
callback: BodyResponseCallback<Schema$Task>
): void;
update(
params: Params$Resource$Tasks$Update,
callback: BodyResponseCallback<Schema$Task>
): void;
update(callback: BodyResponseCallback<Schema$Task>): void;
update(
paramsOrCallback?:
| Params$Resource$Tasks$Update
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Task>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Task> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Tasks$Update;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Tasks$Update;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://tasks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'PUT',
},
options
),
params,
requiredParams: ['tasklist', 'task'],
pathParams: ['task', 'tasklist'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Task>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Task>(parameters);
}
}
}
export interface Params$Resource$Tasks$Clear extends StandardParameters {
tasklist?: string;
}
export interface Params$Resource$Tasks$Delete extends StandardParameters {
task?: string;
tasklist?: string;
}
export interface Params$Resource$Tasks$Get extends StandardParameters {
task?: string;
tasklist?: string;
}
export interface Params$Resource$Tasks$Insert extends StandardParameters {
parent?: string;
previous?: string;
tasklist?: string;
requestBody?: Schema$Task;
}
export interface Params$Resource$Tasks$List extends StandardParameters {
completedMax?: string;
completedMin?: string;
dueMax?: string;
dueMin?: string;
maxResults?: number;
pageToken?: string;
showCompleted?: boolean;
showDeleted?: boolean;
showHidden?: boolean;
tasklist?: string;
updatedMin?: string;
}
export interface Params$Resource$Tasks$Move extends StandardParameters {
parent?: string;
previous?: string;
task?: string;
tasklist?: string;
}
export interface Params$Resource$Tasks$Patch extends StandardParameters {
task?: string;
tasklist?: string;
requestBody?: Schema$Task;
}
export interface Params$Resource$Tasks$Update extends StandardParameters {
task?: string;
tasklist?: string;
requestBody?: Schema$Task;
}
}