googleapis
Version:
Google APIs Client Library for Node.js
1,247 lines (1,246 loc) • 110 kB
JavaScript
"use strict";
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.gmail_v1 = void 0;
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
const googleapis_common_1 = require("googleapis-common");
var gmail_v1;
(function (gmail_v1) {
/**
* Gmail API
*
* The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.
*
* @example
* ```js
* const {google} = require('googleapis');
* const gmail = google.gmail('v1');
* ```
*/
class Gmail {
context;
users;
constructor(options, google) {
this.context = {
_options: options || {},
google,
};
this.users = new Resource$Users(this.context);
}
}
gmail_v1.Gmail = Gmail;
class Resource$Users {
context;
drafts;
history;
labels;
messages;
settings;
threads;
constructor(context) {
this.context = context;
this.drafts = new Resource$Users$Drafts(this.context);
this.history = new Resource$Users$History(this.context);
this.labels = new Resource$Users$Labels(this.context);
this.messages = new Resource$Users$Messages(this.context);
this.settings = new Resource$Users$Settings(this.context);
this.threads = new Resource$Users$Threads(this.context);
}
getProfile(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback || {});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/profile').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
stop(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback || {});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/stop').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
watch(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback || {});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/watch').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users = Resource$Users;
class Resource$Users$Drafts {
context;
constructor(context) {
this.context = context;
}
create(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
delete(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
get(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback || {});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
list(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
send(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts/send').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/send').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
update(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/{id}').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users$Drafts = Resource$Users$Drafts;
class Resource$Users$History {
context;
constructor(context) {
this.context = context;
}
list(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/history').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users$History = Resource$Users$History;
class Resource$Users$Labels {
context;
constructor(context) {
this.context = context;
}
create(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
delete(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
get(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback || {});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
list(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
patch(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
update(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users$Labels = Resource$Users$Labels;
class Resource$Users$Messages {
context;
attachments;
constructor(context) {
this.context = context;
this.attachments = new Resource$Users$Messages$Attachments(this.context);
}
batchDelete(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchDelete').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
batchModify(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchModify').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
delete(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
get(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
import(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
insert(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
list(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
modify(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/modify').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
send(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/send').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/send').replace(/([^:]\/)\/+/g, '$1'),
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
trash(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/trash').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
untrash(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/untrash').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'id'],
pathParams: ['id', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users$Messages = Resource$Users$Messages;
class Resource$Users$Messages$Attachments {
context;
constructor(context) {
this.context = context;
}
get(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl +
'/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId', 'messageId', 'id'],
pathParams: ['id', 'messageId', 'userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
}
gmail_v1.Resource$Users$Messages$Attachments = Resource$Users$Messages$Attachments;
class Resource$Users$Settings {
context;
cse;
delegates;
filters;
forwardingAddresses;
sendAs;
constructor(context) {
this.context = context;
this.cse = new Resource$Users$Settings$Cse(this.context);
this.delegates = new Resource$Users$Settings$Delegates(this.context);
this.filters = new Resource$Users$Settings$Filters(this.context);
this.forwardingAddresses =
new Resource$Users$Settings$Forwardingaddresses(this.context);
this.sendAs = new Resource$Users$Settings$Sendas(this.context);
}
getAutoForwarding(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
getImap(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
getLanguage(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/language').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
getPop(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/pop').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
getVacation(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/vacation').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
updateAutoForwarding(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
updateImap(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {};
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://gmail.googleapis.com/';
const parameters = {
options: Object.assign({
url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap').replace(/([^:]\/)\/+/g, '$1'),
method: 'PUT',
apiVersion: '',
}, options),
params,
requiredParams: ['userId'],
pathParams: ['userId'],
context: this.context,
};
if (callback) {
(0, googleapis_common_1.createAPIRequest)(parameters, callback);
}
else {
return (0, googleapis_common_1.createAPIRequest)(parameters);
}
}
updateLanguage(paramsOrCallback, optionsOrCallback, callback) {
let params = (paramsOrCallback ||
{});
let options = (optionsOrCallback || {});
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;