@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
882 lines • 84.9 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.ModelLabAPIApi = exports.ModelLabAPIApiResponseProcessor = exports.ModelLabAPIApiRequestFactory = 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 ModelLabAPIApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
deleteModelLabRun(runId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'deleteModelLabRun'");
if (!_config.unstableOperations["v2.deleteModelLabRun"]) {
throw new Error("Unstable operation 'deleteModelLabRun' is disabled");
}
// verify required parameter 'runId' is not null or undefined
if (runId === null || runId === undefined) {
throw new baseapi_1.RequiredError("runId", "deleteModelLabRun");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs/{run_id}".replace("{run_id}", encodeURIComponent(String(runId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.deleteModelLabRun")
.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;
});
}
getModelLabArtifactContent(projectId, artifactPath, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getModelLabArtifactContent'");
if (!_config.unstableOperations["v2.getModelLabArtifactContent"]) {
throw new Error("Unstable operation 'getModelLabArtifactContent' is disabled");
}
// verify required parameter 'projectId' is not null or undefined
if (projectId === null || projectId === undefined) {
throw new baseapi_1.RequiredError("projectId", "getModelLabArtifactContent");
}
// verify required parameter 'artifactPath' is not null or undefined
if (artifactPath === null || artifactPath === undefined) {
throw new baseapi_1.RequiredError("artifactPath", "getModelLabArtifactContent");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/artifacts/content";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.getModelLabArtifactContent")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/octet-stream, application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (projectId !== undefined) {
requestContext.setQueryParam("project_id", ObjectSerializer_1.ObjectSerializer.serialize(projectId, "string", ""), "");
}
if (artifactPath !== undefined) {
requestContext.setQueryParam("artifact_path", ObjectSerializer_1.ObjectSerializer.serialize(artifactPath, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
getModelLabProject(projectId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getModelLabProject'");
if (!_config.unstableOperations["v2.getModelLabProject"]) {
throw new Error("Unstable operation 'getModelLabProject' is disabled");
}
// verify required parameter 'projectId' is not null or undefined
if (projectId === null || projectId === undefined) {
throw new baseapi_1.RequiredError("projectId", "getModelLabProject");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/projects/{project_id}".replace("{project_id}", encodeURIComponent(String(projectId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.getModelLabProject")
.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;
});
}
getModelLabRun(runId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'getModelLabRun'");
if (!_config.unstableOperations["v2.getModelLabRun"]) {
throw new Error("Unstable operation 'getModelLabRun' is disabled");
}
// verify required parameter 'runId' is not null or undefined
if (runId === null || runId === undefined) {
throw new baseapi_1.RequiredError("runId", "getModelLabRun");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs/{run_id}".replace("{run_id}", encodeURIComponent(String(runId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.getModelLabRun")
.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;
});
}
listModelLabProjectArtifacts(projectId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabProjectArtifacts'");
if (!_config.unstableOperations["v2.listModelLabProjectArtifacts"]) {
throw new Error("Unstable operation 'listModelLabProjectArtifacts' is disabled");
}
// verify required parameter 'projectId' is not null or undefined
if (projectId === null || projectId === undefined) {
throw new baseapi_1.RequiredError("projectId", "listModelLabProjectArtifacts");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/projects/{project_id}/artifacts".replace("{project_id}", encodeURIComponent(String(projectId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabProjectArtifacts")
.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;
});
}
listModelLabProjectFacetKeys(_options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabProjectFacetKeys'");
if (!_config.unstableOperations["v2.listModelLabProjectFacetKeys"]) {
throw new Error("Unstable operation 'listModelLabProjectFacetKeys' is disabled");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/project-facet-keys";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabProjectFacetKeys")
.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;
});
}
listModelLabProjectFacetValues(facetType, facetName, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabProjectFacetValues'");
if (!_config.unstableOperations["v2.listModelLabProjectFacetValues"]) {
throw new Error("Unstable operation 'listModelLabProjectFacetValues' is disabled");
}
// verify required parameter 'facetType' is not null or undefined
if (facetType === null || facetType === undefined) {
throw new baseapi_1.RequiredError("facetType", "listModelLabProjectFacetValues");
}
// verify required parameter 'facetName' is not null or undefined
if (facetName === null || facetName === undefined) {
throw new baseapi_1.RequiredError("facetName", "listModelLabProjectFacetValues");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/project-facet-values";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabProjectFacetValues")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (facetType !== undefined) {
requestContext.setQueryParam("facet_type", ObjectSerializer_1.ObjectSerializer.serialize(facetType, "ModelLabProjectFacetType", ""), "");
}
if (facetName !== undefined) {
requestContext.setQueryParam("facet_name", ObjectSerializer_1.ObjectSerializer.serialize(facetName, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listModelLabProjects(filter, filterOwnerId, filterTags, sort, pageSize, pageNumber, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabProjects'");
if (!_config.unstableOperations["v2.listModelLabProjects"]) {
throw new Error("Unstable operation 'listModelLabProjects' is disabled");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/projects";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabProjects")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filter !== undefined) {
requestContext.setQueryParam("filter", ObjectSerializer_1.ObjectSerializer.serialize(filter, "string", ""), "");
}
if (filterOwnerId !== undefined) {
requestContext.setQueryParam("filter[owner_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterOwnerId, "string", "uuid"), "");
}
if (filterTags !== undefined) {
requestContext.setQueryParam("filter[tags]", ObjectSerializer_1.ObjectSerializer.serialize(filterTags, "string", ""), "");
}
if (sort !== undefined) {
requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "string", ""), "");
}
if (pageSize !== undefined) {
requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), "");
}
if (pageNumber !== undefined) {
requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listModelLabRunArtifacts(runId, path, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabRunArtifacts'");
if (!_config.unstableOperations["v2.listModelLabRunArtifacts"]) {
throw new Error("Unstable operation 'listModelLabRunArtifacts' is disabled");
}
// verify required parameter 'runId' is not null or undefined
if (runId === null || runId === undefined) {
throw new baseapi_1.RequiredError("runId", "listModelLabRunArtifacts");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs/{run_id}/artifacts".replace("{run_id}", encodeURIComponent(String(runId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabRunArtifacts")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (path !== undefined) {
requestContext.setQueryParam("path", ObjectSerializer_1.ObjectSerializer.serialize(path, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listModelLabRunFacetKeys(filterProjectId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabRunFacetKeys'");
if (!_config.unstableOperations["v2.listModelLabRunFacetKeys"]) {
throw new Error("Unstable operation 'listModelLabRunFacetKeys' is disabled");
}
// verify required parameter 'filterProjectId' is not null or undefined
if (filterProjectId === null || filterProjectId === undefined) {
throw new baseapi_1.RequiredError("filterProjectId", "listModelLabRunFacetKeys");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/facet-keys";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabRunFacetKeys")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterProjectId !== undefined) {
requestContext.setQueryParam("filter[project_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterProjectId, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listModelLabRunFacetValues(filterProjectId, facetType, facetName, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabRunFacetValues'");
if (!_config.unstableOperations["v2.listModelLabRunFacetValues"]) {
throw new Error("Unstable operation 'listModelLabRunFacetValues' is disabled");
}
// verify required parameter 'filterProjectId' is not null or undefined
if (filterProjectId === null || filterProjectId === undefined) {
throw new baseapi_1.RequiredError("filterProjectId", "listModelLabRunFacetValues");
}
// verify required parameter 'facetType' is not null or undefined
if (facetType === null || facetType === undefined) {
throw new baseapi_1.RequiredError("facetType", "listModelLabRunFacetValues");
}
// verify required parameter 'facetName' is not null or undefined
if (facetName === null || facetName === undefined) {
throw new baseapi_1.RequiredError("facetName", "listModelLabRunFacetValues");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/facet-values";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabRunFacetValues")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterProjectId !== undefined) {
requestContext.setQueryParam("filter[project_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterProjectId, "number", "int64"), "");
}
if (facetType !== undefined) {
requestContext.setQueryParam("facet_type", ObjectSerializer_1.ObjectSerializer.serialize(facetType, "ModelLabFacetType", ""), "");
}
if (facetName !== undefined) {
requestContext.setQueryParam("facet_name", ObjectSerializer_1.ObjectSerializer.serialize(facetName, "string", ""), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
listModelLabRuns(filterId, filter, filterOwnerId, filterStatus, filterProjectId, filterTags, filterParams, filterParentRunId, pinnedFirst, includePinned, includeDescendantMatches, sort, pageSize, pageNumber, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'listModelLabRuns'");
if (!_config.unstableOperations["v2.listModelLabRuns"]) {
throw new Error("Unstable operation 'listModelLabRuns' is disabled");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs";
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.listModelLabRuns")
.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);
// Query Params
if (filterId !== undefined) {
requestContext.setQueryParam("filter[id]", ObjectSerializer_1.ObjectSerializer.serialize(filterId, "string", ""), "");
}
if (filter !== undefined) {
requestContext.setQueryParam("filter", ObjectSerializer_1.ObjectSerializer.serialize(filter, "string", ""), "");
}
if (filterOwnerId !== undefined) {
requestContext.setQueryParam("filter[owner_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterOwnerId, "string", ""), "");
}
if (filterStatus !== undefined) {
requestContext.setQueryParam("filter[status]", ObjectSerializer_1.ObjectSerializer.serialize(filterStatus, "ModelLabRunStatus", ""), "");
}
if (filterProjectId !== undefined) {
requestContext.setQueryParam("filter[project_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterProjectId, "number", "int64"), "");
}
if (filterTags !== undefined) {
requestContext.setQueryParam("filter[tags]", ObjectSerializer_1.ObjectSerializer.serialize(filterTags, "string", ""), "");
}
if (filterParams !== undefined) {
requestContext.setQueryParam("filter[params]", ObjectSerializer_1.ObjectSerializer.serialize(filterParams, "string", ""), "");
}
if (filterParentRunId !== undefined) {
requestContext.setQueryParam("filter[parent_run_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterParentRunId, "string", ""), "");
}
if (pinnedFirst !== undefined) {
requestContext.setQueryParam("pinned_first", ObjectSerializer_1.ObjectSerializer.serialize(pinnedFirst, "boolean", ""), "");
}
if (includePinned !== undefined) {
requestContext.setQueryParam("include_pinned", ObjectSerializer_1.ObjectSerializer.serialize(includePinned, "boolean", ""), "");
}
if (includeDescendantMatches !== undefined) {
requestContext.setQueryParam("include_descendant_matches", ObjectSerializer_1.ObjectSerializer.serialize(includeDescendantMatches, "boolean", ""), "");
}
if (sort !== undefined) {
requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "string", ""), "");
}
if (pageSize !== undefined) {
requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), "");
}
if (pageNumber !== undefined) {
requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), "");
}
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
pinModelLabRun(runId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'pinModelLabRun'");
if (!_config.unstableOperations["v2.pinModelLabRun"]) {
throw new Error("Unstable operation 'pinModelLabRun' is disabled");
}
// verify required parameter 'runId' is not null or undefined
if (runId === null || runId === undefined) {
throw new baseapi_1.RequiredError("runId", "pinModelLabRun");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs/{run_id}/pin".replace("{run_id}", encodeURIComponent(String(runId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.pinModelLabRun")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
starModelLabProject(projectId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'starModelLabProject'");
if (!_config.unstableOperations["v2.starModelLabProject"]) {
throw new Error("Unstable operation 'starModelLabProject' is disabled");
}
// verify required parameter 'projectId' is not null or undefined
if (projectId === null || projectId === undefined) {
throw new baseapi_1.RequiredError("projectId", "starModelLabProject");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/projects/{project_id}/star".replace("{project_id}", encodeURIComponent(String(projectId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.starModelLabProject")
.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Accept", "*/*");
requestContext.setHttpConfig(_config.httpConfig);
// Apply auth methods
(0, configuration_1.applySecurityAuthentication)(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
return requestContext;
});
}
unpinModelLabRun(runId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'unpinModelLabRun'");
if (!_config.unstableOperations["v2.unpinModelLabRun"]) {
throw new Error("Unstable operation 'unpinModelLabRun' is disabled");
}
// verify required parameter 'runId' is not null or undefined
if (runId === null || runId === undefined) {
throw new baseapi_1.RequiredError("runId", "unpinModelLabRun");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/runs/{run_id}/pin".replace("{run_id}", encodeURIComponent(String(runId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.unpinModelLabRun")
.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;
});
}
unstarModelLabProject(projectId, _options) {
return __awaiter(this, void 0, void 0, function* () {
const _config = _options || this.configuration;
logger_1.logger.warn("Using unstable operation 'unstarModelLabProject'");
if (!_config.unstableOperations["v2.unstarModelLabProject"]) {
throw new Error("Unstable operation 'unstarModelLabProject' is disabled");
}
// verify required parameter 'projectId' is not null or undefined
if (projectId === null || projectId === undefined) {
throw new baseapi_1.RequiredError("projectId", "unstarModelLabProject");
}
// Path Params
const localVarPath = "/api/v2/model-lab-api/projects/{project_id}/star".replace("{project_id}", encodeURIComponent(String(projectId)));
// Make Request Context
const requestContext = _config
.getServer("v2.ModelLabAPIApi.unstarModelLabProject")
.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;
});
}
}
exports.ModelLabAPIApiRequestFactory = ModelLabAPIApiRequestFactory;
class ModelLabAPIApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to deleteModelLabRun
* @throws ApiException if the response code was not in [200, 299]
*/
deleteModelLabRun(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 204) {
return;
}
if (response.httpStatusCode === 400 ||
response.httpStatusCode === 404 ||
response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
return;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getModelLabArtifactContent
* @throws ApiException if the response code was not in [200, 299]
*/
getModelLabArtifactContent(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = (yield response.getBodyAsFile());
return body;
}
if (response.httpStatusCode === 400 || response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = (yield response.getBodyAsFile());
return body;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getModelLabProject
* @throws ApiException if the response code was not in [200, 299]
*/
getModelLabProject(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabProjectResponse");
return body;
}
if (response.httpStatusCode === 400 ||
response.httpStatusCode === 404 ||
response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabProjectResponse", "");
return body;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getModelLabRun
* @throws ApiException if the response code was not in [200, 299]
*/
getModelLabRun(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabRunResponse");
return body;
}
if (response.httpStatusCode === 400 ||
response.httpStatusCode === 404 ||
response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabRunResponse", "");
return body;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to listModelLabProjectArtifacts
* @throws ApiException if the response code was not in [200, 299]
*/
listModelLabProjectArtifacts(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabProjectArtifactsResponse");
return body;
}
if (response.httpStatusCode === 400 || response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabProjectArtifactsResponse", "");
return body;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to listModelLabProjectFacetKeys
* @throws ApiException if the response code was not in [200, 299]
*/
listModelLabProjectFacetKeys(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabFacetKeysResponse");
return body;
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabFacetKeysResponse", "");
return body;
}
const body = (yield response.body.text()) || "";
throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"');
});
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to listModelLabProjectFacetValues
* @throws ApiException if the response code was not in [200, 299]
*/
listModelLabProjectFacetValues(response) {
return __awaiter(this, void 0, void 0, function* () {
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (response.httpStatusCode === 200) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabFacetValuesResponse");
return body;
}
if (response.httpStatusCode === 400 || response.httpStatusCode === 500) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
if (response.httpStatusCode === 429) {
const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType);
let body;
try {
body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse");
}
catch (error) {
logger_1.logger.debug(`Got error deserializing error: ${error}`);
throw new exception_1.ApiException(response.httpStatusCode, bodyText);
}
throw new exception_1.ApiException(response.httpStatusCode, body);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ModelLabFacetValuesResponse", "");
return body;
}
const bod