@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
916 lines • 117 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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusPagesApi = exports.StatusPagesApiResponseProcessor = exports.StatusPagesApiRequestFactory = 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 StatusPagesApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
createBackfilledDegradation(pageId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "createBackfilledDegradation");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createBackfilledDegradation");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/backfill".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createBackfilledDegradation")
.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, "CreateBackfilledDegradationRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createBackfilledMaintenance(pageId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "createBackfilledMaintenance");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createBackfilledMaintenance");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/maintenances/backfill".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createBackfilledMaintenance")
.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, "CreateBackfilledMaintenanceRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createComponent(pageId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "createComponent");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createComponent");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/components".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createComponent")
.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, "CreateComponentRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createDegradation(pageId, body, notifySubscribers, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "createDegradation");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createDegradation");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createDegradation")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (notifySubscribers !== undefined) {
requestContext.setQueryParam("notify_subscribers", ObjectSerializer_1.ObjectSerializer.serialize(notifySubscribers, "boolean", ""), "");
}
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, "CreateDegradationRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createMaintenance(pageId, body, notifySubscribers, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "createMaintenance");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createMaintenance");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/maintenances".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createMaintenance")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (notifySubscribers !== undefined) {
requestContext.setQueryParam("notify_subscribers", ObjectSerializer_1.ObjectSerializer.serialize(notifySubscribers, "boolean", ""), "");
}
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, "CreateMaintenanceRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createStatusPage(body, include, _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", "createStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages";
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.createStatusPage")
.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, "CreateStatusPageRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteComponent(pageId, componentId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "deleteComponent");
}
// verify required parameter 'componentId' is not null or undefined
if (componentId === null || componentId === undefined) {
throw new baseapi_1.RequiredError("componentId", "deleteComponent");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/components/{component_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{component_id}", encodeURIComponent(String(componentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.deleteComponent")
.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;
});
}
deleteDegradation(pageId, degradationId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "deleteDegradation");
}
// verify required parameter 'degradationId' is not null or undefined
if (degradationId === null || degradationId === undefined) {
throw new baseapi_1.RequiredError("degradationId", "deleteDegradation");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/{degradation_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{degradation_id}", encodeURIComponent(String(degradationId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.deleteDegradation")
.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;
});
}
deleteStatusPage(pageId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "deleteStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.deleteStatusPage")
.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;
});
}
editDegradationUpdate(degradationId, pageId, updateId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'degradationId' is not null or undefined
if (degradationId === null || degradationId === undefined) {
throw new baseapi_1.RequiredError("degradationId", "editDegradationUpdate");
}
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "editDegradationUpdate");
}
// verify required parameter 'updateId' is not null or undefined
if (updateId === null || updateId === undefined) {
throw new baseapi_1.RequiredError("updateId", "editDegradationUpdate");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "editDegradationUpdate");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}"
.replace("{degradation_id}", encodeURIComponent(String(degradationId)))
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{update_id}", encodeURIComponent(String(updateId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.editDegradationUpdate")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
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, "PatchDegradationUpdateRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getComponent(pageId, componentId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "getComponent");
}
// verify required parameter 'componentId' is not null or undefined
if (componentId === null || componentId === undefined) {
throw new baseapi_1.RequiredError("componentId", "getComponent");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/components/{component_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{component_id}", encodeURIComponent(String(componentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.getComponent")
.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;
});
}
getDegradation(pageId, degradationId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "getDegradation");
}
// verify required parameter 'degradationId' is not null or undefined
if (degradationId === null || degradationId === undefined) {
throw new baseapi_1.RequiredError("degradationId", "getDegradation");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/{degradation_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{degradation_id}", encodeURIComponent(String(degradationId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.getDegradation")
.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;
});
}
getMaintenance(pageId, maintenanceId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "getMaintenance");
}
// verify required parameter 'maintenanceId' is not null or undefined
if (maintenanceId === null || maintenanceId === undefined) {
throw new baseapi_1.RequiredError("maintenanceId", "getMaintenance");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{maintenance_id}", encodeURIComponent(String(maintenanceId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.getMaintenance")
.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;
});
}
getStatusPage(pageId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "getStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.getStatusPage")
.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;
});
}
listComponents(pageId, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "listComponents");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/components".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.listComponents")
.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;
});
}
listDegradations(filterPageId, pageOffset, pageLimit, include, filterStatus, sort, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// Path Params
const localVarPath = "/api/v2/statuspages/degradations";
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.listDegradations")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterPageId !== undefined) {
requestContext.setQueryParam("filter[page_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterPageId, "string", ""), "");
}
if (pageOffset !== undefined) {
requestContext.setQueryParam("page[offset]", ObjectSerializer_1.ObjectSerializer.serialize(pageOffset, "number", "int64"), "");
}
if (pageLimit !== undefined) {
requestContext.setQueryParam("page[limit]", ObjectSerializer_1.ObjectSerializer.serialize(pageLimit, "number", "int64"), "");
}
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
if (filterStatus !== undefined) {
requestContext.setQueryParam("filter[status]", ObjectSerializer_1.ObjectSerializer.serialize(filterStatus, "string", ""), "");
}
if (sort !== undefined) {
requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listMaintenances(filterPageId, pageOffset, pageLimit, include, filterStatus, sort, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// Path Params
const localVarPath = "/api/v2/statuspages/maintenances";
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.listMaintenances")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterPageId !== undefined) {
requestContext.setQueryParam("filter[page_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterPageId, "string", ""), "");
}
if (pageOffset !== undefined) {
requestContext.setQueryParam("page[offset]", ObjectSerializer_1.ObjectSerializer.serialize(pageOffset, "number", "int64"), "");
}
if (pageLimit !== undefined) {
requestContext.setQueryParam("page[limit]", ObjectSerializer_1.ObjectSerializer.serialize(pageLimit, "number", "int64"), "");
}
if (include !== undefined) {
requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "string", ""), "");
}
if (filterStatus !== undefined) {
requestContext.setQueryParam("filter[status]", ObjectSerializer_1.ObjectSerializer.serialize(filterStatus, "string", ""), "");
}
if (sort !== undefined) {
requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listStatusPages(pageOffset, pageLimit, filterDomainPrefix, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// Path Params
const localVarPath = "/api/v2/statuspages";
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.listStatusPages")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (pageOffset !== undefined) {
requestContext.setQueryParam("page[offset]", ObjectSerializer_1.ObjectSerializer.serialize(pageOffset, "number", "int64"), "");
}
if (pageLimit !== undefined) {
requestContext.setQueryParam("page[limit]", ObjectSerializer_1.ObjectSerializer.serialize(pageLimit, "number", "int64"), "");
}
if (filterDomainPrefix !== undefined) {
requestContext.setQueryParam("filter[domain_prefix]", ObjectSerializer_1.ObjectSerializer.serialize(filterDomainPrefix, "string", ""), "");
}
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;
});
}
publishStatusPage(pageId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "publishStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/publish".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.publishStatusPage")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
softDeleteDegradationUpdate(degradationId, pageId, updateId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'degradationId' is not null or undefined
if (degradationId === null || degradationId === undefined) {
throw new baseapi_1.RequiredError("degradationId", "softDeleteDegradationUpdate");
}
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "softDeleteDegradationUpdate");
}
// verify required parameter 'updateId' is not null or undefined
if (updateId === null || updateId === undefined) {
throw new baseapi_1.RequiredError("updateId", "softDeleteDegradationUpdate");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}"
.replace("{degradation_id}", encodeURIComponent(String(degradationId)))
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{update_id}", encodeURIComponent(String(updateId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.softDeleteDegradationUpdate")
.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;
});
}
unpublishStatusPage(pageId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "unpublishStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/unpublish".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.unpublishStatusPage")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
updateComponent(pageId, componentId, body, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "updateComponent");
}
// verify required parameter 'componentId' is not null or undefined
if (componentId === null || componentId === undefined) {
throw new baseapi_1.RequiredError("componentId", "updateComponent");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "updateComponent");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/components/{component_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{component_id}", encodeURIComponent(String(componentId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.updateComponent")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
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, "PatchComponentRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
updateDegradation(pageId, degradationId, body, notifySubscribers, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "updateDegradation");
}
// verify required parameter 'degradationId' is not null or undefined
if (degradationId === null || degradationId === undefined) {
throw new baseapi_1.RequiredError("degradationId", "updateDegradation");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "updateDegradation");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/degradations/{degradation_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{degradation_id}", encodeURIComponent(String(degradationId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.updateDegradation")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (notifySubscribers !== undefined) {
requestContext.setQueryParam("notify_subscribers", ObjectSerializer_1.ObjectSerializer.serialize(notifySubscribers, "boolean", ""), "");
}
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, "PatchDegradationRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
updateMaintenance(pageId, maintenanceId, body, notifySubscribers, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "updateMaintenance");
}
// verify required parameter 'maintenanceId' is not null or undefined
if (maintenanceId === null || maintenanceId === undefined) {
throw new baseapi_1.RequiredError("maintenanceId", "updateMaintenance");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "updateMaintenance");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}"
.replace("{page_id}", encodeURIComponent(String(pageId)))
.replace("{maintenance_id}", encodeURIComponent(String(maintenanceId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.updateMaintenance")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (notifySubscribers !== undefined) {
requestContext.setQueryParam("notify_subscribers", ObjectSerializer_1.ObjectSerializer.serialize(notifySubscribers, "boolean", ""), "");
}
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, "PatchMaintenanceRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
updateStatusPage(pageId, body, deleteSubscribers, include, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'pageId' is not null or undefined
if (pageId === null || pageId === undefined) {
throw new baseapi_1.RequiredError("pageId", "updateStatusPage");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "updateStatusPage");
}
// Path Params
const localVarPath = "/api/v2/statuspages/{page_id}".replace("{page_id}", encodeURIComponent(String(pageId)));
// Make Request Context
const requestContext = _config
.getServer("v2.StatusPagesApi.updateStatusPage")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (deleteSubscribers !== undefined) {
requestContext.setQueryParam("delete_subscribers", ObjectSerializer_1.ObjectSerializer.serialize(deleteSubscribers, "boolean", ""), "");
}
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, "PatchStatusPageRequest", ""), contentType);
requestContext.setBody(serializedBody);
//