@hubspot/api-client
Version:
NodeJS v3 [HubSpot API](https://developers.hubspot.com/docs/api/overview) SDK(Client) files
728 lines • 97.5 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicApiResponseProcessor = exports.BasicApiRequestFactory = void 0;
const baseapi_1 = require("./baseapi");
const http_1 = require("../http/http");
const ObjectSerializer_1 = require("../models/ObjectSerializer");
const exception_1 = require("./exception");
const util_1 = require("../util");
class BasicApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
crmV3Lists(includeFilters, listIds, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
const localVarPath = '/crm/v3/lists';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (includeFilters !== undefined) {
requestContext.setQueryParam("includeFilters", ObjectSerializer_1.ObjectSerializer.serialize(includeFilters, "boolean", ""));
}
if (listIds !== undefined) {
const serializedParams = ObjectSerializer_1.ObjectSerializer.serialize(listIds, "Array<string>", "");
for (const serializedParam of serializedParams) {
requestContext.appendQueryParam("listIds", serializedParam);
}
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFolders(folderId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
const localVarPath = '/crm/v3/lists/folders';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (folderId !== undefined) {
requestContext.setQueryParam("folderId", ObjectSerializer_1.ObjectSerializer.serialize(folderId, "string", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFoldersFolderId(folderId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (folderId === null || folderId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFoldersFolderId", "folderId");
}
const localVarPath = '/crm/v3/lists/folders/{folderId}'
.replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFoldersFolderIdMoveNewParentFolderId(folderId, newParentFolderId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (folderId === null || folderId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFoldersFolderIdMoveNewParentFolderId", "folderId");
}
if (newParentFolderId === null || newParentFolderId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFoldersFolderIdMoveNewParentFolderId", "newParentFolderId");
}
const localVarPath = '/crm/v3/lists/folders/{folderId}/move/{newParentFolderId}'
.replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId)))
.replace('{' + 'newParentFolderId' + '}', encodeURIComponent(String(newParentFolderId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFoldersFolderIdRename(folderId, newFolderName, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (folderId === null || folderId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFoldersFolderIdRename", "folderId");
}
const localVarPath = '/crm/v3/lists/folders/{folderId}/rename'
.replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (newFolderName !== undefined) {
requestContext.setQueryParam("newFolderName", ObjectSerializer_1.ObjectSerializer.serialize(newFolderName, "string", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFoldersMoveList(listMoveRequest, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listMoveRequest === null || listMoveRequest === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFoldersMoveList", "listMoveRequest");
}
const localVarPath = '/crm/v3/lists/folders/move-list';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(listMoveRequest, "ListMoveRequest", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsFolders_1(listFolderCreateRequest, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listFolderCreateRequest === null || listFolderCreateRequest === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsFolders_1", "listFolderCreateRequest");
}
const localVarPath = '/crm/v3/lists/folders';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(listFolderCreateRequest, "ListFolderCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsIdmapping(legacyListId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
const localVarPath = '/crm/v3/lists/idmapping';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (legacyListId !== undefined) {
requestContext.setQueryParam("legacyListId", ObjectSerializer_1.ObjectSerializer.serialize(legacyListId, "string", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsIdmapping_2(requestBody, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (requestBody === null || requestBody === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsIdmapping_2", "requestBody");
}
const localVarPath = '/crm/v3/lists/idmapping';
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(requestBody, "Array<string>", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListId(listId, includeFilters, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListId", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (includeFilters !== undefined) {
requestContext.setQueryParam("includeFilters", ObjectSerializer_1.ObjectSerializer.serialize(includeFilters, "boolean", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMemberships(listId, after, before, limit, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMemberships", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (after !== undefined) {
requestContext.setQueryParam("after", ObjectSerializer_1.ObjectSerializer.serialize(after, "string", ""));
}
if (before !== undefined) {
requestContext.setQueryParam("before", ObjectSerializer_1.ObjectSerializer.serialize(before, "string", ""));
}
if (limit !== undefined) {
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int32"));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMembershipsAdd(listId, requestBody, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAdd", "listId");
}
if (requestBody === null || requestBody === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAdd", "requestBody");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships/add'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(requestBody, "Array<string>", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMembershipsAddAndRemove(listId, membershipChangeRequest, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAddAndRemove", "listId");
}
if (membershipChangeRequest === null || membershipChangeRequest === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAddAndRemove", "membershipChangeRequest");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships/add-and-remove'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(membershipChangeRequest, "MembershipChangeRequest", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMembershipsAddFromSourceListId(listId, sourceListId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAddFromSourceListId", "listId");
}
if (sourceListId === null || sourceListId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsAddFromSourceListId", "sourceListId");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships/add-from/{sourceListId}'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)))
.replace('{' + 'sourceListId' + '}', encodeURIComponent(String(sourceListId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMembershipsJoinOrder(listId, after, before, limit, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsJoinOrder", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships/join-order'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (after !== undefined) {
requestContext.setQueryParam("after", ObjectSerializer_1.ObjectSerializer.serialize(after, "string", ""));
}
if (before !== undefined) {
requestContext.setQueryParam("before", ObjectSerializer_1.ObjectSerializer.serialize(before, "string", ""));
}
if (limit !== undefined) {
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int32"));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMembershipsRemove(listId, requestBody, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsRemove", "listId");
}
if (requestBody === null || requestBody === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMembershipsRemove", "requestBody");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships/remove'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(requestBody, "Array<string>", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdMemberships_3(listId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdMemberships_3", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/memberships'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdRestore(listId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdRestore", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/restore'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdScheduleConversion(listId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdScheduleConversion", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/schedule-conversion'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdScheduleConversion_4(listId, publicListConversionTime, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdScheduleConversion_4", "listId");
}
if (publicListConversionTime === null || publicListConversionTime === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdScheduleConversion_4", "publicListConversionTime");
}
const localVarPath = '/crm/v3/lists/{listId}/schedule-conversion'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(publicListConversionTime, "PublicListConversionTime", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdScheduleConversion_5(listId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdScheduleConversion_5", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/schedule-conversion'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdSizeAndEditsHistoryBetween(listId, endDate, startDate, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdSizeAndEditsHistoryBetween", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/size-and-edits-history/between'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (endDate !== undefined) {
requestContext.setQueryParam("endDate", ObjectSerializer_1.ObjectSerializer.serialize(endDate, "Date", "date-time"));
}
if (startDate !== undefined) {
requestContext.setQueryParam("startDate", ObjectSerializer_1.ObjectSerializer.serialize(startDate, "Date", "date-time"));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdUpdateListFilters(listId, listFilterUpdateRequest, enrollObjectsInWorkflows, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdUpdateListFilters", "listId");
}
if (listFilterUpdateRequest === null || listFilterUpdateRequest === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdUpdateListFilters", "listFilterUpdateRequest");
}
const localVarPath = '/crm/v3/lists/{listId}/update-list-filters'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (enrollObjectsInWorkflows !== undefined) {
requestContext.setQueryParam("enrollObjectsInWorkflows", ObjectSerializer_1.ObjectSerializer.serialize(enrollObjectsInWorkflows, "boolean", ""));
}
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(listFilterUpdateRequest, "ListFilterUpdateRequest", ""), contentType);
requestContext.setBody(serializedBody);
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListIdUpdateListName(listId, includeFilters, listName, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListIdUpdateListName", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}/update-list-name'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (includeFilters !== undefined) {
requestContext.setQueryParam("includeFilters", ObjectSerializer_1.ObjectSerializer.serialize(includeFilters, "boolean", ""));
}
if (listName !== undefined) {
requestContext.setQueryParam("listName", ObjectSerializer_1.ObjectSerializer.serialize(listName, "string", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsListId_6(listId, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listId === null || listId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsListId_6", "listId");
}
const localVarPath = '/crm/v3/lists/{listId}'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
}
return requestContext;
});
}
crmV3ListsObjectTypeIdObjectTypeIdNameListName(listName, objectTypeId, includeFilters, _options) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let _config = _options || this.configuration;
if (listName === null || listName === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsObjectTypeIdObjectTypeIdNameListName", "listName");
}
if (objectTypeId === null || objectTypeId === undefined) {
throw new baseapi_1.RequiredError("BasicApi", "crmV3ListsObjectTypeIdObjectTypeIdNameListName", "objectTypeId");
}
const localVarPath = '/crm/v3/lists/object-type-id/{objectTypeId}/name/{listName}'
.replace('{' + 'listName' + '}', encodeURIComponent(String(listName)))
.replace('{' + 'objectTypeId' + '}', encodeURIComponent(String(objectTypeId)));
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
if (includeFilters !== undefined) {
requestContext.setQueryParam("includeFilters", ObjectSerializer_1.ObjectSerializer.serialize(includeFilters, "boolean", ""));
}
let authMethod;
authMethod = _config.authMethods["oauth2"];
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
}
const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default;
if (defaultAuth === null