UNPKG

@hubspot/api-client

Version:

NodeJS v3 [HubSpot API](https://developers.hubspot.com/docs/api/overview) SDK(Client) files

730 lines 143 kB
"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.LandingPagesApiResponseProcessor = exports.LandingPagesApiRequestFactory = 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 LandingPagesApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { archive(objectId, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "archive", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "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; }); } archiveBatch(batchInputString, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (batchInputString === null || batchInputString === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "archiveBatch", "batchInputString"); } const localVarPath = '/cms/v3/pages/landing-pages/batch/archive'; 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(batchInputString, "BatchInputString", ""), 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; }); } archiveFolder(objectId, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "archiveFolder", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/{objectId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "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; }); } archiveFolders(batchInputString, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (batchInputString === null || batchInputString === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "archiveFolders", "batchInputString"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/batch/archive'; 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(batchInputString, "BatchInputString", ""), 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; }); } attachToLangGroup(attachToLangPrimaryRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (attachToLangPrimaryRequestVNext === null || attachToLangPrimaryRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "attachToLangGroup", "attachToLangPrimaryRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group'; 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(attachToLangPrimaryRequestVNext, "AttachToLangPrimaryRequestVNext", ""), 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; }); } clone(contentCloneRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (contentCloneRequestVNext === null || contentCloneRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "clone", "contentCloneRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/clone'; 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(contentCloneRequestVNext, "ContentCloneRequestVNext", ""), 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; }); } create(page, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (page === null || page === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "create", "page"); } const localVarPath = '/cms/v3/pages/landing-pages'; 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(page, "Page", ""), 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; }); } createABTestVariation(abTestCreateRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (abTestCreateRequestVNext === null || abTestCreateRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "createABTestVariation", "abTestCreateRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/ab-test/create-variation'; 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(abTestCreateRequestVNext, "AbTestCreateRequestVNext", ""), 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; }); } createBatch(batchInputPage, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (batchInputPage === null || batchInputPage === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "createBatch", "batchInputPage"); } const localVarPath = '/cms/v3/pages/landing-pages/batch/create'; 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(batchInputPage, "BatchInputPage", ""), 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; }); } createFolder(contentFolder, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (contentFolder === null || contentFolder === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "createFolder", "contentFolder"); } const localVarPath = '/cms/v3/pages/landing-pages/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(contentFolder, "ContentFolder", ""), 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; }); } createFolders(batchInputContentFolder, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (batchInputContentFolder === null || batchInputContentFolder === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "createFolders", "batchInputContentFolder"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/batch/create'; 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(batchInputContentFolder, "BatchInputContentFolder", ""), 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; }); } createLangVariation(contentLanguageCloneRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (contentLanguageCloneRequestVNext === null || contentLanguageCloneRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "createLangVariation", "contentLanguageCloneRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/multi-language/create-language-variation'; 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(contentLanguageCloneRequestVNext, "ContentLanguageCloneRequestVNext", ""), 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; }); } detachFromLangGroup(detachFromLangGroupRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (detachFromLangGroupRequestVNext === null || detachFromLangGroupRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "detachFromLangGroup", "detachFromLangGroupRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group'; 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(detachFromLangGroupRequestVNext, "DetachFromLangGroupRequestVNext", ""), 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; }); } endActiveABTest(abTestEndRequestVNext, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (abTestEndRequestVNext === null || abTestEndRequestVNext === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "endActiveABTest", "abTestEndRequestVNext"); } const localVarPath = '/cms/v3/pages/landing-pages/ab-test/end'; 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(abTestEndRequestVNext, "AbTestEndRequestVNext", ""), 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; }); } getById(objectId, archived, property, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getById", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "boolean", "")); } if (property !== undefined) { requestContext.setQueryParam("property", ObjectSerializer_1.ObjectSerializer.serialize(property, "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; }); } getDraftById(objectId, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getDraftById", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}/draft' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); 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; }); } getFolderById(objectId, archived, property, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getFolderById", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/{objectId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "boolean", "")); } if (property !== undefined) { requestContext.setQueryParam("property", ObjectSerializer_1.ObjectSerializer.serialize(property, "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; }); } getFolderPreviousVersion(objectId, revisionId, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getFolderPreviousVersion", "objectId"); } if (revisionId === null || revisionId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getFolderPreviousVersion", "revisionId"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/{objectId}/revisions/{revisionId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))) .replace('{' + 'revisionId' + '}', encodeURIComponent(String(revisionId))); 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; }); } getFolderPreviousVersions(objectId, after, before, limit, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getFolderPreviousVersions", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/folders/{objectId}/revisions' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); 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; }); } getFoldersPage(createdAt, createdAfter, createdBefore, updatedAt, updatedAfter, updatedBefore, sort, after, limit, archived, property, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; const localVarPath = '/cms/v3/pages/landing-pages/folders'; const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (createdAt !== undefined) { requestContext.setQueryParam("createdAt", ObjectSerializer_1.ObjectSerializer.serialize(createdAt, "Date", "date-time")); } if (createdAfter !== undefined) { requestContext.setQueryParam("createdAfter", ObjectSerializer_1.ObjectSerializer.serialize(createdAfter, "Date", "date-time")); } if (createdBefore !== undefined) { requestContext.setQueryParam("createdBefore", ObjectSerializer_1.ObjectSerializer.serialize(createdBefore, "Date", "date-time")); } if (updatedAt !== undefined) { requestContext.setQueryParam("updatedAt", ObjectSerializer_1.ObjectSerializer.serialize(updatedAt, "Date", "date-time")); } if (updatedAfter !== undefined) { requestContext.setQueryParam("updatedAfter", ObjectSerializer_1.ObjectSerializer.serialize(updatedAfter, "Date", "date-time")); } if (updatedBefore !== undefined) { requestContext.setQueryParam("updatedBefore", ObjectSerializer_1.ObjectSerializer.serialize(updatedBefore, "Date", "date-time")); } if (sort !== undefined) { const serializedParams = ObjectSerializer_1.ObjectSerializer.serialize(sort, "Array<string>", ""); for (const serializedParam of serializedParams) { requestContext.appendQueryParam("sort", serializedParam); } } if (after !== undefined) { requestContext.setQueryParam("after", ObjectSerializer_1.ObjectSerializer.serialize(after, "string", "")); } if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int32")); } if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "boolean", "")); } if (property !== undefined) { requestContext.setQueryParam("property", ObjectSerializer_1.ObjectSerializer.serialize(property, "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; }); } getPage(createdAt, createdAfter, createdBefore, updatedAt, updatedAfter, updatedBefore, sort, after, limit, archived, property, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; const localVarPath = '/cms/v3/pages/landing-pages'; const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (createdAt !== undefined) { requestContext.setQueryParam("createdAt", ObjectSerializer_1.ObjectSerializer.serialize(createdAt, "Date", "date-time")); } if (createdAfter !== undefined) { requestContext.setQueryParam("createdAfter", ObjectSerializer_1.ObjectSerializer.serialize(createdAfter, "Date", "date-time")); } if (createdBefore !== undefined) { requestContext.setQueryParam("createdBefore", ObjectSerializer_1.ObjectSerializer.serialize(createdBefore, "Date", "date-time")); } if (updatedAt !== undefined) { requestContext.setQueryParam("updatedAt", ObjectSerializer_1.ObjectSerializer.serialize(updatedAt, "Date", "date-time")); } if (updatedAfter !== undefined) { requestContext.setQueryParam("updatedAfter", ObjectSerializer_1.ObjectSerializer.serialize(updatedAfter, "Date", "date-time")); } if (updatedBefore !== undefined) { requestContext.setQueryParam("updatedBefore", ObjectSerializer_1.ObjectSerializer.serialize(updatedBefore, "Date", "date-time")); } if (sort !== undefined) { const serializedParams = ObjectSerializer_1.ObjectSerializer.serialize(sort, "Array<string>", ""); for (const serializedParam of serializedParams) { requestContext.appendQueryParam("sort", serializedParam); } } if (after !== undefined) { requestContext.setQueryParam("after", ObjectSerializer_1.ObjectSerializer.serialize(after, "string", "")); } if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int32")); } if (archived !== undefined) { requestContext.setQueryParam("archived", ObjectSerializer_1.ObjectSerializer.serialize(archived, "boolean", "")); } if (property !== undefined) { requestContext.setQueryParam("property", ObjectSerializer_1.ObjectSerializer.serialize(property, "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; }); } getPreviousVersion(objectId, revisionId, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getPreviousVersion", "objectId"); } if (revisionId === null || revisionId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getPreviousVersion", "revisionId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}/revisions/{revisionId}' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))) .replace('{' + 'revisionId' + '}', encodeURIComponent(String(revisionId))); 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; }); } getPreviousVersions(objectId, after, before, limit, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "getPreviousVersions", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}/revisions' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); 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; }); } pushLive(objectId, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (objectId === null || objectId === undefined) { throw new baseapi_1.RequiredError("LandingPagesApi", "pushLive", "objectId"); } const localVarPath = '/cms/v3/pages/landing-pages/{objectId}/draft/push-live' .replace('{' + 'objectId' + '}', encodeURIComponent(String(objectId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST); 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.app