UNPKG

@datadog/datadog-api-client

Version:
895 lines 169 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.StaticAnalysisApi = exports.StaticAnalysisApiResponseProcessor = exports.StaticAnalysisApiRequestFactory = 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 StaticAnalysisApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { createAiCustomRule(rulesetName, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createAiCustomRule'"); if (!_config.unstableOperations["v2.createAiCustomRule"]) { throw new Error("Unstable operation 'createAiCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "createAiCustomRule"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createAiCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createAiCustomRule") .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, "AiCustomRuleRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createAiCustomRuleRevision(rulesetName, ruleName, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createAiCustomRuleRevision'"); if (!_config.unstableOperations["v2.createAiCustomRuleRevision"]) { throw new Error("Unstable operation 'createAiCustomRuleRevision' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "createAiCustomRuleRevision"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "createAiCustomRuleRevision"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createAiCustomRuleRevision"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createAiCustomRuleRevision") .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, "AiCustomRuleRevisionRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createAiCustomRuleset(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createAiCustomRuleset'"); if (!_config.unstableOperations["v2.createAiCustomRuleset"]) { throw new Error("Unstable operation 'createAiCustomRuleset' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createAiCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createAiCustomRuleset") .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, "AiCustomRulesetRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createAiMemoryViolationResult(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createAiMemoryViolationResult'"); if (!_config.unstableOperations["v2.createAiMemoryViolationResult"]) { throw new Error("Unstable operation 'createAiMemoryViolationResult' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createAiMemoryViolationResult"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/memory"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createAiMemoryViolationResult") .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, "AiMemoryViolationResultRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createCustomRule(rulesetName, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCustomRule'"); if (!_config.unstableOperations["v2.createCustomRule"]) { throw new Error("Unstable operation 'createCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "createCustomRule"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createCustomRule") .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, "CustomRuleRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createCustomRuleRevision(rulesetName, ruleName, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCustomRuleRevision'"); if (!_config.unstableOperations["v2.createCustomRuleRevision"]) { throw new Error("Unstable operation 'createCustomRuleRevision' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "createCustomRuleRevision"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "createCustomRuleRevision"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCustomRuleRevision"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createCustomRuleRevision") .makeRequestContext(localVarPath, http_1.HttpMethod.PUT); 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, "CustomRuleRevisionRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createCustomRuleset(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createCustomRuleset'"); if (!_config.unstableOperations["v2.createCustomRuleset"]) { throw new Error("Unstable operation 'createCustomRuleset' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createCustomRuleset") .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, "CustomRulesetRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createSCAResolveVulnerableSymbols(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createSCAResolveVulnerableSymbols'"); if (!_config.unstableOperations["v2.createSCAResolveVulnerableSymbols"]) { throw new Error("Unstable operation 'createSCAResolveVulnerableSymbols' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createSCAResolveVulnerableSymbols"); } // Path Params const localVarPath = "/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createSCAResolveVulnerableSymbols") .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, "ResolveVulnerableSymbolsRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createSCAResult(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createSCAResult'"); if (!_config.unstableOperations["v2.createSCAResult"]) { throw new Error("Unstable operation 'createSCAResult' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createSCAResult"); } // Path Params const localVarPath = "/api/v2/static-analysis-sca/dependencies"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createSCAResult") .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, "ScaRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createSCAScan(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createSCAScan'"); if (!_config.unstableOperations["v2.createSCAScan"]) { throw new Error("Unstable operation 'createSCAScan' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createSCAScan"); } // Path Params const localVarPath = "/api/v2/static-analysis-sca/dependencies/scan"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.createSCAScan") .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, "McpScanRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteAiCustomRule(rulesetName, ruleName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteAiCustomRule'"); if (!_config.unstableOperations["v2.deleteAiCustomRule"]) { throw new Error("Unstable operation 'deleteAiCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "deleteAiCustomRule"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "deleteAiCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.deleteAiCustomRule") .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; }); } deleteAiCustomRuleset(rulesetName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteAiCustomRuleset'"); if (!_config.unstableOperations["v2.deleteAiCustomRuleset"]) { throw new Error("Unstable operation 'deleteAiCustomRuleset' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "deleteAiCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.deleteAiCustomRuleset") .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; }); } deleteAiMemoryViolationResult(id, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteAiMemoryViolationResult'"); if (!_config.unstableOperations["v2.deleteAiMemoryViolationResult"]) { throw new Error("Unstable operation 'deleteAiMemoryViolationResult' is disabled"); } // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new baseapi_1.RequiredError("id", "deleteAiMemoryViolationResult"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/memory/{id}".replace("{id}", encodeURIComponent(String(id))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.deleteAiMemoryViolationResult") .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; }); } deleteCustomRule(rulesetName, ruleName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteCustomRule'"); if (!_config.unstableOperations["v2.deleteCustomRule"]) { throw new Error("Unstable operation 'deleteCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "deleteCustomRule"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "deleteCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.deleteCustomRule") .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; }); } deleteCustomRuleset(rulesetName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteCustomRuleset'"); if (!_config.unstableOperations["v2.deleteCustomRuleset"]) { throw new Error("Unstable operation 'deleteCustomRuleset' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "deleteCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.deleteCustomRuleset") .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; }); } getAiCustomRule(rulesetName, ruleName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getAiCustomRule'"); if (!_config.unstableOperations["v2.getAiCustomRule"]) { throw new Error("Unstable operation 'getAiCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getAiCustomRule"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "getAiCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getAiCustomRule") .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; }); } getAiCustomRuleRevision(rulesetName, ruleName, id, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getAiCustomRuleRevision'"); if (!_config.unstableOperations["v2.getAiCustomRuleRevision"]) { throw new Error("Unstable operation 'getAiCustomRuleRevision' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getAiCustomRuleRevision"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "getAiCustomRuleRevision"); } // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new baseapi_1.RequiredError("id", "getAiCustomRuleRevision"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))) .replace("{id}", encodeURIComponent(String(id))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getAiCustomRuleRevision") .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; }); } getAiCustomRuleset(rulesetName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getAiCustomRuleset'"); if (!_config.unstableOperations["v2.getAiCustomRuleset"]) { throw new Error("Unstable operation 'getAiCustomRuleset' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getAiCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getAiCustomRuleset") .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; }); } getCustomRule(rulesetName, ruleName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getCustomRule'"); if (!_config.unstableOperations["v2.getCustomRule"]) { throw new Error("Unstable operation 'getCustomRule' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getCustomRule"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "getCustomRule"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getCustomRule") .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; }); } getCustomRuleRevision(rulesetName, ruleName, id, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getCustomRuleRevision'"); if (!_config.unstableOperations["v2.getCustomRuleRevision"]) { throw new Error("Unstable operation 'getCustomRuleRevision' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getCustomRuleRevision"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "getCustomRuleRevision"); } // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new baseapi_1.RequiredError("id", "getCustomRuleRevision"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))) .replace("{id}", encodeURIComponent(String(id))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getCustomRuleRevision") .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; }); } getCustomRuleset(rulesetName, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getCustomRuleset'"); if (!_config.unstableOperations["v2.getCustomRuleset"]) { throw new Error("Unstable operation 'getCustomRuleset' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "getCustomRuleset"); } // Path Params const localVarPath = "/api/v2/static-analysis/custom/rulesets/{ruleset_name}".replace("{ruleset_name}", encodeURIComponent(String(rulesetName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getCustomRuleset") .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; }); } getSCAScan(jobId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getSCAScan'"); if (!_config.unstableOperations["v2.getSCAScan"]) { throw new Error("Unstable operation 'getSCAScan' is disabled"); } // verify required parameter 'jobId' is not null or undefined if (jobId === null || jobId === undefined) { throw new baseapi_1.RequiredError("jobId", "getSCAScan"); } // Path Params const localVarPath = "/api/v2/static-analysis-sca/dependencies/scan/{job_id}".replace("{job_id}", encodeURIComponent(String(jobId))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.getSCAScan") .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; }); } listAiCustomRuleRevisions(rulesetName, ruleName, pageOffset, pageLimit, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listAiCustomRuleRevisions'"); if (!_config.unstableOperations["v2.listAiCustomRuleRevisions"]) { throw new Error("Unstable operation 'listAiCustomRuleRevisions' is disabled"); } // verify required parameter 'rulesetName' is not null or undefined if (rulesetName === null || rulesetName === undefined) { throw new baseapi_1.RequiredError("rulesetName", "listAiCustomRuleRevisions"); } // verify required parameter 'ruleName' is not null or undefined if (ruleName === null || ruleName === undefined) { throw new baseapi_1.RequiredError("ruleName", "listAiCustomRuleRevisions"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions" .replace("{ruleset_name}", encodeURIComponent(String(rulesetName))) .replace("{rule_name}", encodeURIComponent(String(ruleName))); // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.listAiCustomRuleRevisions") .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"), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } listAiCustomRulesets(pageOffset, pageLimit, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listAiCustomRulesets'"); if (!_config.unstableOperations["v2.listAiCustomRulesets"]) { throw new Error("Unstable operation 'listAiCustomRulesets' is disabled"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/rulesets"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.listAiCustomRulesets") .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"), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } listAiMemoryViolationResults(_options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listAiMemoryViolationResults'"); if (!_config.unstableOperations["v2.listAiMemoryViolationResults"]) { throw new Error("Unstable operation 'listAiMemoryViolationResults' is disabled"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/memory"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.listAiMemoryViolationResults") .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; }); } listAiPrompts(_options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listAiPrompts'"); if (!_config.unstableOperations["v2.listAiPrompts"]) { throw new Error("Unstable operation 'listAiPrompts' is disabled"); } // Path Params const localVarPath = "/api/v2/static-analysis/ai/prompts"; // Make Request Context const requestContext = _config .getServer("v2.StaticAnalysisApi.listAiPrompts") .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; }); } listCustomRuleRevisions(rulesetName, ruleName, pageOffset, pageLimit, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listCustomRuleRevisions'"); if (!_config.unstableOperations["v2.listCustomRuleRevisio