UNPKG

@hubspot/api-client

Version:

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

500 lines 36.6 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.RowsApiResponseProcessor = exports.RowsApiRequestFactory = 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 RowsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { cloneDraftTableRow(tableIdOrName, rowId, name, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "cloneDraftTableRow", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "cloneDraftTableRow", "rowId"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft/clone' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (name !== undefined) { requestContext.setQueryParam("name", ObjectSerializer_1.ObjectSerializer.serialize(name, "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; }); } createTableRow(tableIdOrName, hubDbTableRowV3Request, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "createTableRow", "tableIdOrName"); } if (hubDbTableRowV3Request === null || hubDbTableRowV3Request === undefined) { throw new baseapi_1.RequiredError("RowsApi", "createTableRow", "hubDbTableRowV3Request"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))); 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(hubDbTableRowV3Request, "HubDbTableRowV3Request", ""), 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; }); } getDraftTableRowById(tableIdOrName, rowId, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "getDraftTableRowById", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "getDraftTableRowById", "rowId"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); 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", "")); } 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; }); } getTableRow(tableIdOrName, rowId, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "getTableRow", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "getTableRow", "rowId"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); 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", "")); } 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; }); } getTableRows(tableIdOrName, sort, after, limit, properties, offset, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "getTableRows", "tableIdOrName"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); 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 (properties !== undefined) { const serializedParams = ObjectSerializer_1.ObjectSerializer.serialize(properties, "Array<string>", ""); for (const serializedParam of serializedParams) { requestContext.appendQueryParam("properties", serializedParam); } } if (offset !== undefined) { requestContext.setQueryParam("offset", ObjectSerializer_1.ObjectSerializer.serialize(offset, "number", "int32")); } 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; }); } purgeDraftTableRow(tableIdOrName, rowId, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "purgeDraftTableRow", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "purgeDraftTableRow", "rowId"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); 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; }); } readDraftTableRows(tableIdOrName, sort, after, limit, properties, offset, archived, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "readDraftTableRows", "tableIdOrName"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/draft' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); 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 (properties !== undefined) { const serializedParams = ObjectSerializer_1.ObjectSerializer.serialize(properties, "Array<string>", ""); for (const serializedParam of serializedParams) { requestContext.appendQueryParam("properties", serializedParam); } } if (offset !== undefined) { requestContext.setQueryParam("offset", ObjectSerializer_1.ObjectSerializer.serialize(offset, "number", "int32")); } 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; }); } replaceDraftTableRow(tableIdOrName, rowId, hubDbTableRowV3Request, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "replaceDraftTableRow", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "replaceDraftTableRow", "rowId"); } if (hubDbTableRowV3Request === null || hubDbTableRowV3Request === undefined) { throw new baseapi_1.RequiredError("RowsApi", "replaceDraftTableRow", "hubDbTableRowV3Request"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); 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(hubDbTableRowV3Request, "HubDbTableRowV3Request", ""), 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; }); } updateDraftTableRow(tableIdOrName, rowId, hubDbTableRowV3Request, _options) { var _a; return __awaiter(this, void 0, void 0, function* () { let _config = _options || this.configuration; if (tableIdOrName === null || tableIdOrName === undefined) { throw new baseapi_1.RequiredError("RowsApi", "updateDraftTableRow", "tableIdOrName"); } if (rowId === null || rowId === undefined) { throw new baseapi_1.RequiredError("RowsApi", "updateDraftTableRow", "rowId"); } if (hubDbTableRowV3Request === null || hubDbTableRowV3Request === undefined) { throw new baseapi_1.RequiredError("RowsApi", "updateDraftTableRow", "hubDbTableRowV3Request"); } const localVarPath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft' .replace('{' + 'tableIdOrName' + '}', encodeURIComponent(String(tableIdOrName))) .replace('{' + 'rowId' + '}', encodeURIComponent(String(rowId))); const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH); 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(hubDbTableRowV3Request, "HubDbTableRowV3Request", ""), 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; }); } } exports.RowsApiRequestFactory = RowsApiRequestFactory; class RowsApiResponseProcessor { cloneDraftTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } createTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("201", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } getDraftTableRowByIdWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } getTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } getTableRowsWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } purgeDraftTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("204", response.httpStatusCode)) { return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "void", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } readDraftTableRowsWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } replaceDraftTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } updateDraftTableRowWithHttpInfo(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if ((0, util_1.isCodeInRange)("0", response.httpStatusCode)) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "Error", ""); throw new exception_1.ApiException(response.httpStatusCode, "An error occurred.", body, response.headers); } if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "HubDbTableRowV3", ""); return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers); }); } } exports.RowsApiResponseProcessor = RowsApiResponseProcessor; //# sourceMappingURL=RowsApi.js.map