@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
919 lines (918 loc) • 164 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.SyntheticsApi = exports.SyntheticsApiResponseProcessor = exports.SyntheticsApiRequestFactory = 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 SyntheticsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
abortTestFileMultipartUpload(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "abortTestFileMultipartUpload");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "abortTestFileMultipartUpload");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-abort".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.abortTestFileMultipartUpload")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Body Params
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json",
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "SyntheticsTestFileAbortMultipartUploadRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
addTestToSyntheticsDowntime(downtimeId, testId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'downtimeId' is not null or undefined
if (downtimeId === null || downtimeId === undefined) {
throw new baseapi_1.RequiredError("downtimeId", "addTestToSyntheticsDowntime");
}
// verify required parameter 'testId' is not null or undefined
if (testId === null || testId === undefined) {
throw new baseapi_1.RequiredError("testId", "addTestToSyntheticsDowntime");
}
// Path Params
const localVarPath = "/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}"
.replace("{downtime_id}", encodeURIComponent(String(downtimeId)))
.replace("{test_id}", encodeURIComponent(String(testId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.addTestToSyntheticsDowntime")
.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
completeTestFileMultipartUpload(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "completeTestFileMultipartUpload");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "completeTestFileMultipartUpload");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-complete".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.completeTestFileMultipartUpload")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Body Params
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json",
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "SyntheticsTestFileCompleteMultipartUploadRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createSyntheticsDowntime(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createSyntheticsDowntime");
}
// Path Params
const localVarPath = "/api/v2/synthetics/downtimes";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.createSyntheticsDowntime")
.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, "SyntheticsDowntimeRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
createSyntheticsNetworkTest(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createSyntheticsNetworkTest");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/network";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.createSyntheticsNetworkTest")
.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, "SyntheticsNetworkTestEditRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
createSyntheticsSuite(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "createSyntheticsSuite");
}
// Path Params
const localVarPath = "/api/v2/synthetics/suites";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.createSyntheticsSuite")
.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, "SuiteCreateEditRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteSyntheticsDowntime(downtimeId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'downtimeId' is not null or undefined
if (downtimeId === null || downtimeId === undefined) {
throw new baseapi_1.RequiredError("downtimeId", "deleteSyntheticsDowntime");
}
// Path Params
const localVarPath = "/api/v2/synthetics/downtimes/{downtime_id}".replace("{downtime_id}", encodeURIComponent(String(downtimeId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.deleteSyntheticsDowntime")
.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;
});
}
deleteSyntheticsSuites(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "deleteSyntheticsSuites");
}
// Path Params
const localVarPath = "/api/v2/synthetics/suites/bulk-delete";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.deleteSyntheticsSuites")
.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, "DeletedSuitesRequestDeleteRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
deleteSyntheticsTests(body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "deleteSyntheticsTests");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/bulk-delete";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.deleteSyntheticsTests")
.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, "DeletedTestsRequestDeleteRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
editSyntheticsSuite(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "editSyntheticsSuite");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "editSyntheticsSuite");
}
// Path Params
const localVarPath = "/api/v2/synthetics/suites/{public_id}".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.editSyntheticsSuite")
.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Body Params
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
"application/json",
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "SuiteCreateEditRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getApiMultistepSubtestParents(publicId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getApiMultistepSubtestParents");
}
// Path Params
const localVarPath = "/api/v2/synthetics/api-multistep/subtests/{public_id}/parents".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getApiMultistepSubtestParents")
.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;
});
}
getApiMultistepSubtests(publicId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getApiMultistepSubtests");
}
// Path Params
const localVarPath = "/api/v2/synthetics/api-multistep/subtests/{public_id}".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getApiMultistepSubtests")
.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;
});
}
getOnDemandConcurrencyCap(_options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// Path Params
const localVarPath = "/api/v2/synthetics/settings/on_demand_concurrency_cap";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getOnDemandConcurrencyCap")
.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;
});
}
getSyntheticsBrowserTestResult(publicId, resultId, eventId, timestamp, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getSyntheticsBrowserTestResult");
}
// verify required parameter 'resultId' is not null or undefined
if (resultId === null || resultId === undefined) {
throw new baseapi_1.RequiredError("resultId", "getSyntheticsBrowserTestResult");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/browser/{public_id}/results/{result_id}"
.replace("{public_id}", encodeURIComponent(String(publicId)))
.replace("{result_id}", encodeURIComponent(String(resultId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsBrowserTestResult")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (eventId !== undefined) {
requestContext.setQueryParam("event_id", ObjectSerializer_1.ObjectSerializer.serialize(eventId, "string", ""), "");
}
if (timestamp !== undefined) {
requestContext.setQueryParam("timestamp", ObjectSerializer_1.ObjectSerializer.serialize(timestamp, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getSyntheticsDowntime(downtimeId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'downtimeId' is not null or undefined
if (downtimeId === null || downtimeId === undefined) {
throw new baseapi_1.RequiredError("downtimeId", "getSyntheticsDowntime");
}
// Path Params
const localVarPath = "/api/v2/synthetics/downtimes/{downtime_id}".replace("{downtime_id}", encodeURIComponent(String(downtimeId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsDowntime")
.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;
});
}
getSyntheticsFastTestResult(id, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new baseapi_1.RequiredError("id", "getSyntheticsFastTestResult");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/fast/{id}".replace("{id}", encodeURIComponent(String(id)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsFastTestResult")
.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;
});
}
getSyntheticsNetworkTest(publicId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getSyntheticsNetworkTest");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/network/{public_id}".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsNetworkTest")
.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;
});
}
getSyntheticsSuite(publicId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getSyntheticsSuite");
}
// Path Params
const localVarPath = "/api/v2/synthetics/suites/{public_id}".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsSuite")
.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;
});
}
getSyntheticsTestResult(publicId, resultId, eventId, timestamp, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getSyntheticsTestResult");
}
// verify required parameter 'resultId' is not null or undefined
if (resultId === null || resultId === undefined) {
throw new baseapi_1.RequiredError("resultId", "getSyntheticsTestResult");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/results/{result_id}"
.replace("{public_id}", encodeURIComponent(String(publicId)))
.replace("{result_id}", encodeURIComponent(String(resultId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsTestResult")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (eventId !== undefined) {
requestContext.setQueryParam("event_id", ObjectSerializer_1.ObjectSerializer.serialize(eventId, "string", ""), "");
}
if (timestamp !== undefined) {
requestContext.setQueryParam("timestamp", ObjectSerializer_1.ObjectSerializer.serialize(timestamp, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getSyntheticsTestVersion(publicId, versionNumber, includeChangeMetadata, onlyCheckExistence, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getSyntheticsTestVersion");
}
// verify required parameter 'versionNumber' is not null or undefined
if (versionNumber === null || versionNumber === undefined) {
throw new baseapi_1.RequiredError("versionNumber", "getSyntheticsTestVersion");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/version_history/{version_number}"
.replace("{public_id}", encodeURIComponent(String(publicId)))
.replace("{version_number}", encodeURIComponent(String(versionNumber)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getSyntheticsTestVersion")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (includeChangeMetadata !== undefined) {
requestContext.setQueryParam("include_change_metadata", ObjectSerializer_1.ObjectSerializer.serialize(includeChangeMetadata, "boolean", ""), "");
}
if (onlyCheckExistence !== undefined) {
requestContext.setQueryParam("only_check_existence", ObjectSerializer_1.ObjectSerializer.serialize(onlyCheckExistence, "boolean", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getTestFileDownloadUrl(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getTestFileDownloadUrl");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "getTestFileDownloadUrl");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/files/download".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getTestFileDownloadUrl")
.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, "SyntheticsTestFileDownloadRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getTestFileMultipartPresignedUrls(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getTestFileMultipartPresignedUrls");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "getTestFileMultipartPresignedUrls");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getTestFileMultipartPresignedUrls")
.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, "SyntheticsTestFileMultipartPresignedUrlsRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
getTestParentSuites(publicId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "getTestParentSuites");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/parent-suites".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.getTestParentSuites")
.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;
});
}
listSyntheticsBrowserTestLatestResults(publicId, fromTs, toTs, status, runType, probeDc, deviceId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "listSyntheticsBrowserTestLatestResults");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/browser/{public_id}/results".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.listSyntheticsBrowserTestLatestResults")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (fromTs !== undefined) {
requestContext.setQueryParam("from_ts", ObjectSerializer_1.ObjectSerializer.serialize(fromTs, "number", "int64"), "");
}
if (toTs !== undefined) {
requestContext.setQueryParam("to_ts", ObjectSerializer_1.ObjectSerializer.serialize(toTs, "number", "int64"), "");
}
if (status !== undefined) {
requestContext.setQueryParam("status", ObjectSerializer_1.ObjectSerializer.serialize(status, "SyntheticsTestResultStatus", ""), "");
}
if (runType !== undefined) {
requestContext.setQueryParam("runType", ObjectSerializer_1.ObjectSerializer.serialize(runType, "SyntheticsTestResultRunType", ""), "");
}
if (probeDc !== undefined) {
requestContext.setQueryParam("probe_dc", ObjectSerializer_1.ObjectSerializer.serialize(probeDc, "Array<string>", ""), "multi");
}
if (deviceId !== undefined) {
requestContext.setQueryParam("device_id", ObjectSerializer_1.ObjectSerializer.serialize(deviceId, "Array<string>", ""), "multi");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listSyntheticsDowntimes(filterTestIds, filterActive, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// Path Params
const localVarPath = "/api/v2/synthetics/downtimes";
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.listSyntheticsDowntimes")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterTestIds !== undefined) {
requestContext.setQueryParam("filter[test_ids]", ObjectSerializer_1.ObjectSerializer.serialize(filterTestIds, "string", ""), "");
}
if (filterActive !== undefined) {
requestContext.setQueryParam("filter[active]", ObjectSerializer_1.ObjectSerializer.serialize(filterActive, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listSyntheticsTestLatestResults(publicId, fromTs, toTs, status, runType, probeDc, deviceId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "listSyntheticsTestLatestResults");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/results".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.listSyntheticsTestLatestResults")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (fromTs !== undefined) {
requestContext.setQueryParam("from_ts", ObjectSerializer_1.ObjectSerializer.serialize(fromTs, "number", "int64"), "");
}
if (toTs !== undefined) {
requestContext.setQueryParam("to_ts", ObjectSerializer_1.ObjectSerializer.serialize(toTs, "number", "int64"), "");
}
if (status !== undefined) {
requestContext.setQueryParam("status", ObjectSerializer_1.ObjectSerializer.serialize(status, "SyntheticsTestResultStatus", ""), "");
}
if (runType !== undefined) {
requestContext.setQueryParam("runType", ObjectSerializer_1.ObjectSerializer.serialize(runType, "SyntheticsTestResultRunType", ""), "");
}
if (probeDc !== undefined) {
requestContext.setQueryParam("probe_dc", ObjectSerializer_1.ObjectSerializer.serialize(probeDc, "Array<string>", ""), "multi");
}
if (deviceId !== undefined) {
requestContext.setQueryParam("device_id", ObjectSerializer_1.ObjectSerializer.serialize(deviceId, "Array<string>", ""), "multi");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
listSyntheticsTestVersions(publicId, lastVersionNumber, limit, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "listSyntheticsTestVersions");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/{public_id}/version_history".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.listSyntheticsTestVersions")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (lastVersionNumber !== undefined) {
requestContext.setQueryParam("last_version_number", ObjectSerializer_1.ObjectSerializer.serialize(lastVersionNumber, "number", "int64"), "");
}
if (limit !== undefined) {
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
patchGlobalVariable(variableId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'variableId' is not null or undefined
if (variableId === null || variableId === undefined) {
throw new baseapi_1.RequiredError("variableId", "patchGlobalVariable");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "patchGlobalVariable");
}
// Path Params
const localVarPath = "/api/v2/synthetics/variables/{variable_id}/jsonpatch".replace("{variable_id}", encodeURIComponent(String(variableId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.patchGlobalVariable")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
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, "GlobalVariableJsonPatchRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
patchTestSuite(publicId, body, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'publicId' is not null or undefined
if (publicId === null || publicId === undefined) {
throw new baseapi_1.RequiredError("publicId", "patchTestSuite");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new baseapi_1.RequiredError("body", "patchTestSuite");
}
// Path Params
const localVarPath = "/api/v2/synthetics/suites/{public_id}/jsonpatch".replace("{public_id}", encodeURIComponent(String(publicId)));
// Make Request Context
const requestContext = _config
.getServer("v2.SyntheticsApi.patchTestSuite")
.makeRequestContext(localVarPath, http_1.HttpMethod.PATCH);
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, "SuiteJsonPatchRequest", ""), contentType);
requestContext.setBody(serializedBody);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);
return requestContext;
});
}
pollSyntheticsTestResults(resultIds, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
// verify required parameter 'resultIds' is not null or undefined
if (resultIds === null || resultIds === undefined) {
throw new baseapi_1.RequiredError("resultIds", "pollSyntheticsTestResults");
}
// Path Params
const localVarPath = "/api/v2/synthetics/tests/poll_results";