UNPKG

@datadog/datadog-api-client

Version:
920 lines (919 loc) 313 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()); }); }; var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CaseManagementApi = exports.CaseManagementApiResponseProcessor = exports.CaseManagementApiRequestFactory = void 0; const baseapi_1 = require("../../datadog-api-client-common/baseapi"); const configuration_1 = require("../../datadog-api-client-common/configuration"); const http_1 = require("../../datadog-api-client-common/http/http"); const logger_1 = require("../../../logger"); const ObjectSerializer_1 = require("../models/ObjectSerializer"); const exception_1 = require("../../datadog-api-client-common/exception"); class CaseManagementApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { addCaseInsights(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'addCaseInsights'"); if (!_config.unstableOperations["v2.addCaseInsights"]) { throw new Error("Unstable operation 'addCaseInsights' is disabled"); } // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "addCaseInsights"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "addCaseInsights"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/insights".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.addCaseInsights") .makeRequestContext(localVarPath, http_1.HttpMethod.PUT); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseInsightsRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } aggregateCases(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'aggregateCases'"); if (!_config.unstableOperations["v2.aggregateCases"]) { throw new Error("Unstable operation 'aggregateCases' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "aggregateCases"); } // Path Params const localVarPath = "/api/v2/cases/aggregate"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.aggregateCases") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseAggregateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } archiveCase(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "archiveCase"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "archiveCase"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/archive".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.archiveCase") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseEmptyRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } assignCase(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "assignCase"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "assignCase"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/assign".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.assignCase") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseAssignRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } bulkUpdateCases(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'bulkUpdateCases'"); if (!_config.unstableOperations["v2.bulkUpdateCases"]) { throw new Error("Unstable operation 'bulkUpdateCases' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "bulkUpdateCases"); } // Path Params const localVarPath = "/api/v2/cases/bulk"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.bulkUpdateCases") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseBulkUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } commentCase(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "commentCase"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "commentCase"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/comment".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.commentCase") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseCommentRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } countCases(queryFilter, groupBys, limit, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'countCases'"); if (!_config.unstableOperations["v2.countCases"]) { throw new Error("Unstable operation 'countCases' is disabled"); } // Path Params const localVarPath = "/api/v2/cases/count"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.countCases") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (queryFilter !== undefined) { requestContext.setQueryParam("query_filter", ObjectSerializer_1.ObjectSerializer.serialize(queryFilter, "string", ""), ""); } if (groupBys !== undefined) { requestContext.setQueryParam("group_bys", ObjectSerializer_1.ObjectSerializer.serialize(groupBys, "string", ""), ""); } if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int64"), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCase(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCase"); } // Path Params const localVarPath = "/api/v2/cases"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCase") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseAutomationRule(projectId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseAutomationRule'"); if (!_config.unstableOperations["v2.createCaseAutomationRule"]) { throw new Error("Unstable operation 'createCaseAutomationRule' is disabled"); } // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "createCaseAutomationRule"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseAutomationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/rules".replace("{project_id}", encodeURIComponent(String(projectId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseAutomationRule") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "AutomationRuleCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseJiraIssue(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseJiraIssue'"); if (!_config.unstableOperations["v2.createCaseJiraIssue"]) { throw new Error("Unstable operation 'createCaseJiraIssue' is disabled"); } // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "createCaseJiraIssue"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseJiraIssue"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/relationships/jira_issues".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseJiraIssue") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "JiraIssueCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseLink(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseLink'"); if (!_config.unstableOperations["v2.createCaseLink"]) { throw new Error("Unstable operation 'createCaseLink' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseLink"); } // Path Params const localVarPath = "/api/v2/cases/link"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseLink") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseLinkCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseNotebook(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseNotebook'"); if (!_config.unstableOperations["v2.createCaseNotebook"]) { throw new Error("Unstable operation 'createCaseNotebook' is disabled"); } // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "createCaseNotebook"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseNotebook"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/relationships/notebook".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseNotebook") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "NotebookCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseServiceNowTicket(caseId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseServiceNowTicket'"); if (!_config.unstableOperations["v2.createCaseServiceNowTicket"]) { throw new Error("Unstable operation 'createCaseServiceNowTicket' is disabled"); } // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "createCaseServiceNowTicket"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseServiceNowTicket"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/relationships/servicenow_tickets".replace("{case_id}", encodeURIComponent(String(caseId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseServiceNowTicket") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "ServiceNowTicketCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createCaseView(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCaseView'"); if (!_config.unstableOperations["v2.createCaseView"]) { throw new Error("Unstable operation 'createCaseView' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCaseView"); } // Path Params const localVarPath = "/api/v2/cases/views"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createCaseView") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseViewCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createMaintenanceWindow(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createMaintenanceWindow'"); if (!_config.unstableOperations["v2.createMaintenanceWindow"]) { throw new Error("Unstable operation 'createMaintenanceWindow' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createMaintenanceWindow"); } // Path Params const localVarPath = "/api/v2/maintenance_windows"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createMaintenanceWindow") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "MaintenanceWindowCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createProject(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createProject"); } // Path Params const localVarPath = "/api/v2/cases/projects"; // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createProject") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "ProjectCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createProjectNotificationRule(projectId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "createProjectNotificationRule"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createProjectNotificationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/notification_rules".replace("{project_id}", encodeURIComponent(String(projectId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.createProjectNotificationRule") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "CaseNotificationRuleCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteCaseAutomationRule(projectId, ruleId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteCaseAutomationRule'"); if (!_config.unstableOperations["v2.deleteCaseAutomationRule"]) { throw new Error("Unstable operation 'deleteCaseAutomationRule' is disabled"); } // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "deleteCaseAutomationRule"); } // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new baseapi_1.RequiredError("ruleId", "deleteCaseAutomationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/rules/{rule_id}" .replace("{project_id}", encodeURIComponent(String(projectId))) .replace("{rule_id}", encodeURIComponent(String(ruleId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteCaseAutomationRule") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteCaseComment(caseId, cellId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "deleteCaseComment"); } // verify required parameter 'cellId' is not null or undefined if (cellId === null || cellId === undefined) { throw new baseapi_1.RequiredError("cellId", "deleteCaseComment"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/comment/{cell_id}" .replace("{case_id}", encodeURIComponent(String(caseId))) .replace("{cell_id}", encodeURIComponent(String(cellId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteCaseComment") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } deleteCaseCustomAttribute(caseId, customAttributeKey, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'caseId' is not null or undefined if (caseId === null || caseId === undefined) { throw new baseapi_1.RequiredError("caseId", "deleteCaseCustomAttribute"); } // verify required parameter 'customAttributeKey' is not null or undefined if (customAttributeKey === null || customAttributeKey === undefined) { throw new baseapi_1.RequiredError("customAttributeKey", "deleteCaseCustomAttribute"); } // Path Params const localVarPath = "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" .replace("{case_id}", encodeURIComponent(String(caseId))) .replace("{custom_attribute_key}", encodeURIComponent(String(customAttributeKey))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteCaseCustomAttribute") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteCaseLink(linkId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteCaseLink'"); if (!_config.unstableOperations["v2.deleteCaseLink"]) { throw new Error("Unstable operation 'deleteCaseLink' is disabled"); } // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "deleteCaseLink"); } // Path Params const localVarPath = "/api/v2/cases/link/{link_id}".replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteCaseLink") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteCaseView(viewId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteCaseView'"); if (!_config.unstableOperations["v2.deleteCaseView"]) { throw new Error("Unstable operation 'deleteCaseView' is disabled"); } // verify required parameter 'viewId' is not null or undefined if (viewId === null || viewId === undefined) { throw new baseapi_1.RequiredError("viewId", "deleteCaseView"); } // Path Params const localVarPath = "/api/v2/cases/views/{view_id}".replace("{view_id}", encodeURIComponent(String(viewId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteCaseView") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteMaintenanceWindow(maintenanceWindowId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteMaintenanceWindow'"); if (!_config.unstableOperations["v2.deleteMaintenanceWindow"]) { throw new Error("Unstable operation 'deleteMaintenanceWindow' is disabled"); } // verify required parameter 'maintenanceWindowId' is not null or undefined if (maintenanceWindowId === null || maintenanceWindowId === undefined) { throw new baseapi_1.RequiredError("maintenanceWindowId", "deleteMaintenanceWindow"); } // Path Params const localVarPath = "/api/v2/maintenance_windows/{maintenance_window_id}".replace("{maintenance_window_id}", encodeURIComponent(String(maintenanceWindowId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteMaintenanceWindow") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteProject(projectId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "deleteProject"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}".replace("{project_id}", encodeURIComponent(String(projectId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteProject") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteProjectNotificationRule(projectId, notificationRuleId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "deleteProjectNotificationRule"); } // verify required parameter 'notificationRuleId' is not null or undefined if (notificationRuleId === null || notificationRuleId === undefined) { throw new baseapi_1.RequiredError("notificationRuleId", "deleteProjectNotificationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" .replace("{project_id}", encodeURIComponent(String(projectId))) .replace("{notification_rule_id}", encodeURIComponent(String(notificationRuleId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.deleteProjectNotificationRule") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } disableCaseAutomationRule(projectId, ruleId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'disableCaseAutomationRule'"); if (!_config.unstableOperations["v2.disableCaseAutomationRule"]) { throw new Error("Unstable operation 'disableCaseAutomationRule' is disabled"); } // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "disableCaseAutomationRule"); } // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new baseapi_1.RequiredError("ruleId", "disableCaseAutomationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable" .replace("{project_id}", encodeURIComponent(String(projectId))) .replace("{rule_id}", encodeURIComponent(String(ruleId))); // Make Request Context const requestContext = _config .getServer("v2.CaseManagementApi.disableCaseAutomationRule") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } enableCaseAutomationRule(projectId, ruleId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'enableCaseAutomationRule'"); if (!_config.unstableOperations["v2.enableCaseAutomationRule"]) { throw new Error("Unstable operation 'enableCaseAutomationRule' is disabled"); } // verify required parameter 'projectId' is not null or undefined if (projectId === null || projectId === undefined) { throw new baseapi_1.RequiredError("projectId", "enableCaseAutomationRule"); } // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new baseapi_1.RequiredError("ruleId", "enableCaseAutomationRule"); } // Path Params const localVarPath = "/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable" .replace("{project_id}", encodeURIComponent(String(projectId)))