@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
905 lines (904 loc) • 177 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 {
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;
});
}
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;
});
}
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;
});
}
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;
});
}
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;
});
}
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;
});
}
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, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getIncidentNotificationRule(id, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncidentNotificationRule'");
if (!_config.unstableOperations["v2.getIncidentNotificationRule"]) {
throw new Error("Unstable operation 'getIncidentNotificationRule' is disabled");
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new baseapi_1.RequiredError("id", "getIncidentNotificationRule");
}
// 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.getIncidentNotificationRule")
.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, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getIncidentNotificationTemplate(id, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncidentNotificationTemplate'");
if (!_config.unstableOperations["v2.getIncidentNotificationTemplate"]) {
throw new Error("Unstable operation 'getIncidentNotificationTemplate' is disabled");
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new baseapi_1.RequiredError("id", "getIncidentNotificationTemplate");
}
// 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.getIncidentNotificationTemplate")
.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, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getIncidentTodo(incidentId, todoId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncidentTodo'");
if (!_config.unstableOperations["v2.getIncidentTodo"]) {
throw new Error("Unstable operation 'getIncidentTodo' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "getIncidentTodo");
}
// verify required parameter 'todoId' is not null or undefined
if (todoId === null || todoId === undefined) {
throw new baseapi_1.RequiredError("todoId", "getIncidentTodo");
}
// 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.getIncidentTodo")
.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",
"AuthZ",
]);
return requestContext;
});
}
getIncidentType(incidentTypeId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getIncidentType'");
if (!_config.unstableOperations["v2.getIncidentType"]) {
throw new Error("Unstable operation 'getIncidentType' is disabled");
}
// verify required parameter 'incidentTypeId' is not null or undefined
if (incidentTypeId === null || incidentTypeId === undefined) {
throw new baseapi_1.RequiredError("incidentTypeId", "getIncidentType");
}
// 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.getIncidentType")
.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",
"AuthZ",
]);
return requestContext;
});
}
listIncidentAttachments(incidentId, include, filterAttachmentType, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidentAttachments'");
if (!_config.unstableOperations["v2.listIncidentAttachments"]) {
throw new Error("Unstable operation 'listIncidentAttachments' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "listIncidentAttachments");
}
// 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.listIncidentAttachments")
.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<IncidentAttachmentRelatedObject>", ""), "csv");
}
if (filterAttachmentType !== undefined) {
requestContext.setQueryParam("filter[attachment_type]", ObjectSerializer_1.ObjectSerializer.serialize(filterAttachmentType, "Array<IncidentAttachmentAttachmentType>", ""), "csv");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listIncidentImpacts(incidentId, 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", "listIncidentImpacts");
}
// 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.listIncidentImpacts")
.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<IncidentImpactRelatedObject>", ""), "csv");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listIncidentIntegrations(incidentId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidentIntegrations'");
if (!_config.unstableOperations["v2.listIncidentIntegrations"]) {
throw new Error("Unstable operation 'listIncidentIntegrations' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "listIncidentIntegrations");
}
// 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.listIncidentIntegrations")
.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",
"AuthZ",
]);
return requestContext;
});
}
listIncidentNotificationRules(include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidentNotificationRules'");
if (!_config.unstableOperations["v2.listIncidentNotificationRules"]) {
throw new Error("Unstable operation 'listIncidentNotificationRules' is disabled");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-rules";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.listIncidentNotificationRules")
.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, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listIncidentNotificationTemplates(filterIncidentType, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidentNotificationTemplates'");
if (!_config.unstableOperations["v2.listIncidentNotificationTemplates"]) {
throw new Error("Unstable operation 'listIncidentNotificationTemplates' is disabled");
}
// Path Params
const localVarPath = "/api/v2/incidents/config/notification-templates";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.listIncidentNotificationTemplates")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterIncidentType !== undefined) {
requestContext.setQueryParam("filter[incident-type]", ObjectSerializer_1.ObjectSerializer.serialize(filterIncidentType, "string", "uuid"), "");
}
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;
});
}
listIncidents(include, pageSize, pageOffset, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidents'");
if (!_config.unstableOperations["v2.listIncidents"]) {
throw new Error("Unstable operation 'listIncidents' is disabled");
}
// Path Params
const localVarPath = "/api/v2/incidents";
// Make Request Context
const requestContext = _config
.getServer("v2.IncidentsApi.listIncidents")
.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");
}
if (pageSize !== undefined) {
requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), "");
}
if (pageOffset !== undefined) {
requestContext.setQueryParam("page[offset]", ObjectSerializer_1.ObjectSerializer.serialize(pageOffset, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listIncidentTodos(incidentId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listIncidentTodos'");
if (!_config.unstableOperations["v2.listIncidentTodos"]) {
throw new Error("Unstable operation 'listIncidentTodos' is disabled");
}
// verify required parameter 'incidentId' is not null or undefined
if (incidentId === null || incidentId === undefined) {
throw new baseapi_1.RequiredError("incidentId", "listIncidentTodos");
}
// 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.listIncidentTodos")
.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",