@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
892 lines • 280 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
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.IncidentsApi = exports.IncidentsApiResponseProcessor = exports.IncidentsApiRequestFactory = 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 IncidentsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
createGlobalIncidentHandle(body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createGlobalIncidentHandle'");
if (!_config.unstableOperations["v2.createGlobalIncidentHandle"]) {
throw new Error("Unstable operation 'createGlobalIncidentHandle' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createGlobalIncidentHandle");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/global/incident-handles";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createGlobalIncidentHandle")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
// 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, "IncidentHandleRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
createIncident(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncident'");
if (!_config.unstableOperations["v2.createIncident"]) {
throw new Error("Unstable operation 'createIncident' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncident");
}
// Path Params
const localVarPath = "/api/v2/incidents";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncident")
.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, "IncidentCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentAttachment(incidentId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentAttachment'");
if (!_config.unstableOperations["v2.createIncidentAttachment"]) {
throw new Error("Unstable operation 'createIncidentAttachment' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "createIncidentAttachment");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentAttachment");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/attachments".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentAttachment")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
// 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, "CreateAttachmentRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentImpact(incidentId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "createIncidentImpact");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentImpact");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/impacts".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentImpact")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "Array<IncidentImpactRelatedObject>", ""), "csv");
}
// 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, "IncidentImpactCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentIntegration(incidentId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentIntegration'");
if (!_config.unstableOperations["v2.createIncidentIntegration"]) {
throw new Error("Unstable operation 'createIncidentIntegration' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "createIncidentIntegration");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentIntegration");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/relationships/integrations".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentIntegration")
.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, "IncidentIntegrationMetadataCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentNotificationRule(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentNotificationRule'");
if (!_config.unstableOperations["v2.createIncidentNotificationRule"]) {
throw new Error("Unstable operation 'createIncidentNotificationRule' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentNotificationRule");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-rules";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentNotificationRule")
.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, "CreateIncidentNotificationRuleRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentNotificationTemplate(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentNotificationTemplate'");
if (!_config.unstableOperations["v2.createIncidentNotificationTemplate"]) {
throw new Error("Unstable operation 'createIncidentNotificationTemplate' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentNotificationTemplate");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-templates";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentNotificationTemplate")
.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, "CreateIncidentNotificationTemplateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentPostmortemAttachment(incidentId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentPostmortemAttachment'");
if (!_config.unstableOperations["v2.createIncidentPostmortemAttachment"]) {
throw new Error("Unstable operation 'createIncidentPostmortemAttachment' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "createIncidentPostmortemAttachment");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentPostmortemAttachment");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/attachments/postmortems".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentPostmortemAttachment")
.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, "PostmortemAttachmentRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
createIncidentPostmortemTemplate(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentPostmortemTemplate'");
if (!_config.unstableOperations["v2.createIncidentPostmortemTemplate"]) {
throw new Error("Unstable operation 'createIncidentPostmortemTemplate' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentPostmortemTemplate");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/postmortem-templates";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentPostmortemTemplate")
.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, "PostmortemTemplateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
createIncidentTodo(incidentId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentTodo'");
if (!_config.unstableOperations["v2.createIncidentTodo"]) {
throw new Error("Unstable operation 'createIncidentTodo' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "createIncidentTodo");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentTodo");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/relationships/todos".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentTodo")
.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, "IncidentTodoCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentType(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentType'");
if (!_config.unstableOperations["v2.createIncidentType"]) {
throw new Error("Unstable operation 'createIncidentType' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentType");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/types";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentType")
.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, "IncidentTypeCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createIncidentUserDefinedField(body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'createIncidentUserDefinedField'");
if (!_config.unstableOperations["v2.createIncidentUserDefinedField"]) {
throw new Error("Unstable operation 'createIncidentUserDefinedField' is disabled");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createIncidentUserDefinedField");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/user-defined-fields";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.createIncidentUserDefinedField")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
// 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, "IncidentUserDefinedFieldCreateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteGlobalIncidentHandle(_options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteGlobalIncidentHandle'");
if (!_config.unstableOperations["v2.deleteGlobalIncidentHandle"]) {
throw new Error("Unstable operation 'deleteGlobalIncidentHandle' is disabled");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/global/incident-handles";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteGlobalIncidentHandle")
.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;
});
}
deleteIncident(incidentId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncident'");
if (!_config.unstableOperations["v2.deleteIncident"]) {
throw new Error("Unstable operation 'deleteIncident' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "deleteIncident");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncident")
.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;
});
}
deleteIncidentAttachment(incidentId, attachmentId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentAttachment'");
if (!_config.unstableOperations["v2.deleteIncidentAttachment"]) {
throw new Error("Unstable operation 'deleteIncidentAttachment' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "deleteIncidentAttachment");
}
// verify required parameter 'attachmentId' is not null or undefined
if (attachmentId === null || attachmentId === undefined) {
throw new baseapi_1.RequiredError("attachmentId", "deleteIncidentAttachment");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/attachments/{attachment_id}"
.replace("{incident_id}", encodeURIComponent(String(incidentId)))
.replace("{attachment_id}", encodeURIComponent(String(attachmentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentAttachment")
.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;
});
}
deleteIncidentImpact(incidentId, impactId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "deleteIncidentImpact");
}
// verify required parameter 'impactId' is not null or undefined
if (impactId === null || impactId === undefined) {
throw new baseapi_1.RequiredError("impactId", "deleteIncidentImpact");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/impacts/{impact_id}"
.replace("{incident_id}", encodeURIComponent(String(incidentId)))
.replace("{impact_id}", encodeURIComponent(String(impactId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentImpact")
.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;
});
}
deleteIncidentIntegration(incidentId, integrationMetadataId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentIntegration'");
if (!_config.unstableOperations["v2.deleteIncidentIntegration"]) {
throw new Error("Unstable operation 'deleteIncidentIntegration' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "deleteIncidentIntegration");
}
// verify required parameter 'integrationMetadataId' is not null or undefined
if (integrationMetadataId === null || integrationMetadataId === undefined) {
throw new baseapi_1.RequiredError("integrationMetadataId", "deleteIncidentIntegration");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}"
.replace("{incident_id}", encodeURIComponent(String(incidentId)))
.replace("{integration_metadata_id}", encodeURIComponent(String(integrationMetadataId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentIntegration")
.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;
});
}
deleteIncidentNotificationRule(id, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentNotificationRule'");
if (!_config.unstableOperations["v2.deleteIncidentNotificationRule"]) {
throw new Error("Unstable operation 'deleteIncidentNotificationRule' is disabled");
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new baseapi_1.RequiredError("id", "deleteIncidentNotificationRule");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-rules/{id}".replace("{id}", encodeURIComponent(String(id)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentNotificationRule")
.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteIncidentNotificationTemplate(id, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentNotificationTemplate'");
if (!_config.unstableOperations["v2.deleteIncidentNotificationTemplate"]) {
throw new Error("Unstable operation 'deleteIncidentNotificationTemplate' is disabled");
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new baseapi_1.RequiredError("id", "deleteIncidentNotificationTemplate");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-templates/{id}".replace("{id}", encodeURIComponent(String(id)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentNotificationTemplate")
.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteIncidentPostmortemTemplate(templateId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentPostmortemTemplate'");
if (!_config.unstableOperations["v2.deleteIncidentPostmortemTemplate"]) {
throw new Error("Unstable operation 'deleteIncidentPostmortemTemplate' is disabled");
}
// verify required parameter 'templateId' is not null or undefined
if (templateId === null || templateId === undefined) {
throw new baseapi_1.RequiredError("templateId", "deleteIncidentPostmortemTemplate");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/postmortem-templates/{template_id}".replace("{template_id}", encodeURIComponent(String(templateId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentPostmortemTemplate")
.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;
});
}
deleteIncidentTodo(incidentId, todoId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentTodo'");
if (!_config.unstableOperations["v2.deleteIncidentTodo"]) {
throw new Error("Unstable operation 'deleteIncidentTodo' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "deleteIncidentTodo");
}
// verify required parameter 'todoId' is not null or undefined
if (todoId === null || todoId === undefined) {
throw new baseapi_1.RequiredError("todoId", "deleteIncidentTodo");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}"
.replace("{incident_id}", encodeURIComponent(String(incidentId)))
.replace("{todo_id}", encodeURIComponent(String(todoId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentTodo")
.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;
});
}
deleteIncidentType(incidentTypeId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentType'");
if (!_config.unstableOperations["v2.deleteIncidentType"]) {
throw new Error("Unstable operation 'deleteIncidentType' is disabled");
}
// verify required parameter 'incidentTypeId' is not null or undefined
if (incidentTypeId === null || incidentTypeId === undefined) {
throw new baseapi_1.RequiredError("incidentTypeId", "deleteIncidentType");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/types/{incident_type_id}".replace("{incident_type_id}", encodeURIComponent(String(incidentTypeId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentType")
.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;
});
}
deleteIncidentUserDefinedField(fieldId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteIncidentUserDefinedField'");
if (!_config.unstableOperations["v2.deleteIncidentUserDefinedField"]) {
throw new Error("Unstable operation 'deleteIncidentUserDefinedField' is disabled");
}
// verify required parameter 'fieldId' is not null or undefined
if (fieldId === null || fieldId === undefined) {
throw new baseapi_1.RequiredError("fieldId", "deleteIncidentUserDefinedField");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/user-defined-fields/{field_id}".replace("{field_id}", encodeURIComponent(String(fieldId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.deleteIncidentUserDefinedField")
.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;
});
}
getGlobalIncidentSettings(_options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getGlobalIncidentSettings'");
if (!_config.unstableOperations["v2.getGlobalIncidentSettings"]) {
throw new Error("Unstable operation 'getGlobalIncidentSettings' is disabled");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/global/settings";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.getGlobalIncidentSettings")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
getIncident(incidentId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncident'");
if (!_config.unstableOperations["v2.getIncident"]) {
throw new Error("Unstable operation 'getIncident' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "getIncident");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}".replace("{incident_id}", encodeURIComponent(String(incidentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.getIncident")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "Array<IncidentRelatedObject>", ""), "csv");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getIncidentIntegration(incidentId, integrationMetadataId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncidentIntegration'");
if (!_config.unstableOperations["v2.getIncidentIntegration"]) {
throw new Error("Unstable operation 'getIncidentIntegration' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "getIncidentIntegration");
}
// verify required parameter 'integrationMetadataId' is not null or undefined
if (integrationMetadataId === null || integrationMetadataId === undefined) {
throw new baseapi_1.RequiredError("integrationMetadataId", "getIncidentIntegration");
}
// Path Params
const localVarPath = "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}"
.replace("{incident_id}", encodeURIComponent(String(incidentId)))
.replace("{integration_metadata_id}", encodeURIComponent(String(integrationMetadataId)));
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.getIncidentIntegration")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, re