"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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 __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getByOwnerAndRepo = getByOwnerAndRepo;
exports.getByOwnerAndRepoAndAnalysis_id = getByOwnerAndRepoAndAnalysis_id;
exports.eraseByOwnerAndRepoAndAnalysis_id = eraseByOwnerAndRepoAndAnalysis_id;
var PlainFetcher_1 = require("@nestia/fetcher/lib/PlainFetcher");
var typia_1 = __importDefault(require("typia"));
var NestiaSimulator_1 = require("@nestia/fetcher/lib/NestiaSimulator");
/**
 * List code scanning analyses for a repository.
 * Lists the details of all code scanning analyses for a repository,
 * starting with the most recent.
 * The response is paginated and you can use the `page` and `per_page` parameters
 * to list the analyses you're interested in.
 * By default 30 analyses are listed per page.
 *
 * The `rules_count` field in the response give the number of rules
 * that were run in the analysis.
 * For very old analyses this data is not available,
 * and `0` is returned in this field.
 *
 * > [!WARNING]
 * > **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.
 *
 * OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 *
 * @tag code-scanning
 * @path repos/:owner/:repo/code-scanning/analyses
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function getByOwnerAndRepo(connection, owner, repo, query) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? getByOwnerAndRepo.simulate(connection, owner, repo, query)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, getByOwnerAndRepo.METADATA), { path: getByOwnerAndRepo.path(owner, repo, query), status: null }))];
        });
    });
}
(function (getByOwnerAndRepo) {
    getByOwnerAndRepo.METADATA = {
        method: "GET",
        path: "/repos/:owner/:repo/code-scanning/analyses",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    getByOwnerAndRepo.path = function (owner, repo, query) {
        var e_1, _a;
        var variables = new URLSearchParams();
        var _loop_1 = function (key, value) {
            if (undefined === value)
                return "continue";
            else if (Array.isArray(value))
                value.forEach(function (elem) { return variables.append(key, String(elem)); });
            else
                variables.set(key, String(value));
        };
        try {
            for (var _b = __values(Object.entries(query)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
                _loop_1(key, value);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        var location = "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/code-scanning/analyses");
        return 0 === variables.size
            ? location
            : "".concat(location, "?").concat(variables.toString());
    };
    getByOwnerAndRepo.random = function (g) { return (function () { var $generator = typia_1.default.random.generator; var $pick = typia_1.default.random.pick; var $ro0 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            ref: (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(),
            commit_sha: (_j = (_h = (_g = ((_f = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _f !== void 0 ? _f : $generator.customs)) === null || _g === void 0 ? void 0 : _g.string) === null || _h === void 0 ? void 0 : _h.call(_g, [
                {
                    name: "MinLength<40>",
                    kind: "minLength",
                    value: 40
                },
                {
                    name: "MaxLength<40>",
                    kind: "maxLength",
                    value: 40
                },
                {
                    name: "Pattern<\"^[0-9a-fA-F]+$\">",
                    kind: "pattern",
                    value: "^[0-9a-fA-F]+$"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.pattern) !== null && _k !== void 0 ? _k : $generator.pattern)(/^[0-9a-fA-F]+$/),
            analysis_key: (_p = (_o = (_m = ((_l = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _l !== void 0 ? _l : $generator.customs)) === null || _m === void 0 ? void 0 : _m.string) === null || _o === void 0 ? void 0 : _o.call(_m, [])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _q !== void 0 ? _q : $generator.string)(),
            environment: (_u = (_t = (_s = ((_r = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _r !== void 0 ? _r : $generator.customs)) === null || _s === void 0 ? void 0 : _s.string) === null || _t === void 0 ? void 0 : _t.call(_s, [])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _v !== void 0 ? _v : $generator.string)(),
            category: $pick([
                function () { return undefined; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            error: (_z = (_y = (_x = ((_w = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _w !== void 0 ? _w : $generator.customs)) === null || _x === void 0 ? void 0 : _x.string) === null || _y === void 0 ? void 0 : _y.call(_x, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _z !== void 0 ? _z : ((_0 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _0 !== void 0 ? _0 : $generator.string)(),
            created_at: (_4 = (_3 = (_2 = ((_1 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _1 !== void 0 ? _1 : $generator.customs)) === null || _2 === void 0 ? void 0 : _2.string) === null || _3 === void 0 ? void 0 : _3.call(_2, [
                {
                    name: "Format<\"date-time\">",
                    kind: "format",
                    value: "date-time"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _4 !== void 0 ? _4 : ((_5 = _generator === null || _generator === void 0 ? void 0 : _generator.datetime) !== null && _5 !== void 0 ? _5 : $generator.datetime)(),
            results_count: (_9 = (_8 = (_7 = ((_6 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _6 !== void 0 ? _6 : $generator.customs)) === null || _7 === void 0 ? void 0 : _7.number) === null || _8 === void 0 ? void 0 : _8.call(_7, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _9 !== void 0 ? _9 : ((_10 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _10 !== void 0 ? _10 : $generator.integer)(0, 100),
            rules_count: (_14 = (_13 = (_12 = ((_11 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _11 !== void 0 ? _11 : $generator.customs)) === null || _12 === void 0 ? void 0 : _12.number) === null || _13 === void 0 ? void 0 : _13.call(_12, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _14 !== void 0 ? _14 : ((_15 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _15 !== void 0 ? _15 : $generator.integer)(0, 100),
            id: (_19 = (_18 = (_17 = ((_16 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _16 !== void 0 ? _16 : $generator.customs)) === null || _17 === void 0 ? void 0 : _17.number) === null || _18 === void 0 ? void 0 : _18.call(_17, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _19 !== void 0 ? _19 : ((_20 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _20 !== void 0 ? _20 : $generator.integer)(0, 100),
            url: (_24 = (_23 = (_22 = ((_21 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _21 !== void 0 ? _21 : $generator.customs)) === null || _22 === void 0 ? void 0 : _22.string) === null || _23 === void 0 ? void 0 : _23.call(_22, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _24 !== void 0 ? _24 : ((_25 = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _25 !== void 0 ? _25 : $generator.uri)(),
            sarif_id: (_29 = (_28 = (_27 = ((_26 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _26 !== void 0 ? _26 : $generator.customs)) === null || _27 === void 0 ? void 0 : _27.string) === null || _28 === void 0 ? void 0 : _28.call(_27, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _29 !== void 0 ? _29 : ((_30 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _30 !== void 0 ? _30 : $generator.string)(),
            tool: $ro1(_recursive, _recursive ? 1 + _depth : _depth),
            deletable: ((_31 = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _31 !== void 0 ? _31 : $generator.boolean)(),
            warning: (_35 = (_34 = (_33 = ((_32 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _32 !== void 0 ? _32 : $generator.customs)) === null || _33 === void 0 ? void 0 : _33.string) === null || _34 === void 0 ? void 0 : _34.call(_33, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _35 !== void 0 ? _35 : ((_36 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _36 !== void 0 ? _36 : $generator.string)()
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            name: $pick([
                function () { return undefined; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            version: $pick([
                function () { return undefined; },
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            guid: $pick([
                function () { return undefined; },
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        var _a;
        _generator = generator;
        return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.array) !== null && _a !== void 0 ? _a : $generator.array)(function () { return $ro0(); });
    }; })()(g); };
    getByOwnerAndRepo.simulate = function (connection, owner, repo, query) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: getByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: getByOwnerAndRepo.path(owner, repo, query),
            contentType: "application/json",
        });
        try {
            assert.param("owner")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(owner); });
            assert.param("repo")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(repo); });
            assert.query(function () { return (function () { var $guard = typia_1.default.assert.guard; var $io0 = function (input) { return true; }; var $ao0 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return true;
            }; var __is = function (input) { return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
                            path: _path + "",
                            expected: "IApiReposCodeScanningAnalyses.GetQuery",
                            value: input
                        }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
                            path: _path + "",
                            expected: "IApiReposCodeScanningAnalyses.GetQuery",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(query); });
        }
        catch (exp) {
            if (!(function () { var $io0 = function (input) { return ("HEAD" === input.method || "GET" === input.method || "DELETE" === input.method || "POST" === input.method || "PUT" === input.method || "PATCH" === input.method) && "string" === typeof input.path && "number" === typeof input.status && ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io1(input.headers)) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); }; var $io1 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null !== value && undefined !== value && ("string" === typeof value || Array.isArray(value) && value.every(function (elem) { return "string" === typeof elem; }));
            }); }; return function (input) { return "object" === typeof input && null !== input && $io0(input); }; })()(exp))
                throw exp;
            return {
                success: false,
                status: exp.status,
                headers: exp.headers,
                data: exp.toJSON().message,
            };
        }
        return getByOwnerAndRepo.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(getByOwnerAndRepo || (exports.getByOwnerAndRepo = getByOwnerAndRepo = {}));
/**
 * Get a code scanning analysis for a repository.
 * Gets a specified code scanning analysis for a repository.
 *
 * The default JSON response contains fields that describe the analysis.
 * This includes the Git reference and commit SHA to which the analysis relates,
 * the datetime of the analysis, the name of the code scanning tool,
 * and the number of alerts.
 *
 * The `rules_count` field in the default response give the number of rules
 * that were run in the analysis.
 * For very old analyses this data is not available,
 * and `0` is returned in this field.
 *
 * This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
 *
 * - **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.
 *
 * OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 *
 * @param analysis_id The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
 * @tag code-scanning
 * @path repos/:owner/:repo/code-scanning/analyses/:analysis_id
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function getByOwnerAndRepoAndAnalysis_id(connection, owner, repo, analysis_id) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? getByOwnerAndRepoAndAnalysis_id.simulate(connection, owner, repo, analysis_id)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, getByOwnerAndRepoAndAnalysis_id.METADATA), { path: getByOwnerAndRepoAndAnalysis_id.path(owner, repo, analysis_id), status: null }))];
        });
    });
}
(function (getByOwnerAndRepoAndAnalysis_id) {
    getByOwnerAndRepoAndAnalysis_id.METADATA = {
        method: "GET",
        path: "/repos/:owner/:repo/code-scanning/analyses/:analysis_id",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    getByOwnerAndRepoAndAnalysis_id.path = function (owner, repo, analysis_id) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/code-scanning/analyses/").concat(encodeURIComponent(analysis_id !== null && analysis_id !== void 0 ? analysis_id : "null"));
    };
    getByOwnerAndRepoAndAnalysis_id.random = function (g) { return (function () { var $generator = typia_1.default.random.generator; var $pick = typia_1.default.random.pick; var $ro0 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            ref: (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(),
            commit_sha: (_j = (_h = (_g = ((_f = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _f !== void 0 ? _f : $generator.customs)) === null || _g === void 0 ? void 0 : _g.string) === null || _h === void 0 ? void 0 : _h.call(_g, [
                {
                    name: "MinLength<40>",
                    kind: "minLength",
                    value: 40
                },
                {
                    name: "MaxLength<40>",
                    kind: "maxLength",
                    value: 40
                },
                {
                    name: "Pattern<\"^[0-9a-fA-F]+$\">",
                    kind: "pattern",
                    value: "^[0-9a-fA-F]+$"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.pattern) !== null && _k !== void 0 ? _k : $generator.pattern)(/^[0-9a-fA-F]+$/),
            analysis_key: (_p = (_o = (_m = ((_l = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _l !== void 0 ? _l : $generator.customs)) === null || _m === void 0 ? void 0 : _m.string) === null || _o === void 0 ? void 0 : _o.call(_m, [])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _q !== void 0 ? _q : $generator.string)(),
            environment: (_u = (_t = (_s = ((_r = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _r !== void 0 ? _r : $generator.customs)) === null || _s === void 0 ? void 0 : _s.string) === null || _t === void 0 ? void 0 : _t.call(_s, [])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _v !== void 0 ? _v : $generator.string)(),
            category: $pick([
                function () { return undefined; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            error: (_z = (_y = (_x = ((_w = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _w !== void 0 ? _w : $generator.customs)) === null || _x === void 0 ? void 0 : _x.string) === null || _y === void 0 ? void 0 : _y.call(_x, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _z !== void 0 ? _z : ((_0 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _0 !== void 0 ? _0 : $generator.string)(),
            created_at: (_4 = (_3 = (_2 = ((_1 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _1 !== void 0 ? _1 : $generator.customs)) === null || _2 === void 0 ? void 0 : _2.string) === null || _3 === void 0 ? void 0 : _3.call(_2, [
                {
                    name: "Format<\"date-time\">",
                    kind: "format",
                    value: "date-time"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _4 !== void 0 ? _4 : ((_5 = _generator === null || _generator === void 0 ? void 0 : _generator.datetime) !== null && _5 !== void 0 ? _5 : $generator.datetime)(),
            results_count: (_9 = (_8 = (_7 = ((_6 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _6 !== void 0 ? _6 : $generator.customs)) === null || _7 === void 0 ? void 0 : _7.number) === null || _8 === void 0 ? void 0 : _8.call(_7, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _9 !== void 0 ? _9 : ((_10 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _10 !== void 0 ? _10 : $generator.integer)(0, 100),
            rules_count: (_14 = (_13 = (_12 = ((_11 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _11 !== void 0 ? _11 : $generator.customs)) === null || _12 === void 0 ? void 0 : _12.number) === null || _13 === void 0 ? void 0 : _13.call(_12, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _14 !== void 0 ? _14 : ((_15 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _15 !== void 0 ? _15 : $generator.integer)(0, 100),
            id: (_19 = (_18 = (_17 = ((_16 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _16 !== void 0 ? _16 : $generator.customs)) === null || _17 === void 0 ? void 0 : _17.number) === null || _18 === void 0 ? void 0 : _18.call(_17, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _19 !== void 0 ? _19 : ((_20 = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _20 !== void 0 ? _20 : $generator.integer)(0, 100),
            url: (_24 = (_23 = (_22 = ((_21 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _21 !== void 0 ? _21 : $generator.customs)) === null || _22 === void 0 ? void 0 : _22.string) === null || _23 === void 0 ? void 0 : _23.call(_22, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _24 !== void 0 ? _24 : ((_25 = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _25 !== void 0 ? _25 : $generator.uri)(),
            sarif_id: (_29 = (_28 = (_27 = ((_26 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _26 !== void 0 ? _26 : $generator.customs)) === null || _27 === void 0 ? void 0 : _27.string) === null || _28 === void 0 ? void 0 : _28.call(_27, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _29 !== void 0 ? _29 : ((_30 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _30 !== void 0 ? _30 : $generator.string)(),
            tool: $ro1(_recursive, _recursive ? 1 + _depth : _depth),
            deletable: ((_31 = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _31 !== void 0 ? _31 : $generator.boolean)(),
            warning: (_35 = (_34 = (_33 = ((_32 = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _32 !== void 0 ? _32 : $generator.customs)) === null || _33 === void 0 ? void 0 : _33.string) === null || _34 === void 0 ? void 0 : _34.call(_33, [
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _35 !== void 0 ? _35 : ((_36 = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _36 !== void 0 ? _36 : $generator.string)()
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            name: $pick([
                function () { return undefined; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            version: $pick([
                function () { return undefined; },
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            guid: $pick([
                function () { return undefined; },
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    getByOwnerAndRepoAndAnalysis_id.simulate = function (connection, owner, repo, analysis_id) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: getByOwnerAndRepoAndAnalysis_id.METADATA.method,
            host: connection.host,
            path: getByOwnerAndRepoAndAnalysis_id.path(owner, repo, analysis_id),
            contentType: "application/json",
        });
        try {
            assert.param("owner")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(owner); });
            assert.param("repo")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(repo); });
            assert.param("analysis_id")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "number" === typeof input && (Math.floor(input) === input && -2147483648 <= input && input <= 2147483647); }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "number" === typeof input && (Math.floor(input) === input && -2147483648 <= input && input <= 2147483647 || $guard(true, {
                            path: _path + "",
                            expected: "number & Type<\"int32\">",
                            value: input
                        }, _errorFactory)) || $guard(true, {
                            path: _path + "",
                            expected: "(number & Type<\"int32\">)",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(analysis_id); });
        }
        catch (exp) {
            if (!(function () { var $io0 = function (input) { return ("HEAD" === input.method || "GET" === input.method || "DELETE" === input.method || "POST" === input.method || "PUT" === input.method || "PATCH" === input.method) && "string" === typeof input.path && "number" === typeof input.status && ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io1(input.headers)) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); }; var $io1 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null !== value && undefined !== value && ("string" === typeof value || Array.isArray(value) && value.every(function (elem) { return "string" === typeof elem; }));
            }); }; return function (input) { return "object" === typeof input && null !== input && $io0(input); }; })()(exp))
                throw exp;
            return {
                success: false,
                status: exp.status,
                headers: exp.headers,
                data: exp.toJSON().message,
            };
        }
        return getByOwnerAndRepoAndAnalysis_id.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(getByOwnerAndRepoAndAnalysis_id || (exports.getByOwnerAndRepoAndAnalysis_id = getByOwnerAndRepoAndAnalysis_id = {}));
/**
 * Delete a code scanning analysis from a repository.
 * Deletes a specified code scanning analysis from a repository.
 *
 * You can delete one analysis at a time.
 * To delete a series of analyses, start with the most recent analysis and work backwards.
 * Conceptually, the process is similar to the undo function in a text editor.
 *
 * When you list the analyses for a repository,
 * one or more will be identified as deletable in the response:
 *
 * ```
 * "deletable": true
 * ```
 *
 * An analysis is deletable when it's the most recent in a set of analyses.
 * Typically, a repository will have multiple sets of analyses
 * for each enabled code scanning tool,
 * where a set is determined by a unique combination of analysis values:
 *
 * * `ref`
 * * `tool`
 * * `category`
 *
 * If you attempt to delete an analysis that is not the most recent in a set,
 * you'll get a 400 response with the message:
 *
 * ```
 * Analysis specified is not deletable.
 * ```
 *
 * The response from a successful `DELETE` operation provides you with
 * two alternative URLs for deleting the next analysis in the set:
 * `next_analysis_url` and `confirm_delete_url`.
 * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis
 * in a set. This is a useful option if you want to preserve at least one analysis
 * for the specified tool in your repository.
 * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.
 * When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`
 * in the 200 response is `null`.
 *
 * As an example of the deletion process,
 * let's imagine that you added a workflow that configured a particular code scanning tool
 * to analyze the code in a repository. This tool has added 15 analyses:
 * 10 on the default branch, and another 5 on a topic branch.
 * You therefore have two separate sets of analyses for this tool.
 * You've now decided that you want to remove all of the analyses for the tool.
 * To do this you must make 15 separate deletion requests.
 * To start, you must find an analysis that's identified as deletable.
 * Each set of analyses always has one that's identified as deletable.
 * Having found the deletable analysis for one of the two sets,
 * delete this analysis and then continue deleting the next analysis in the set until they're all deleted.
 * Then repeat the process for the second set.
 * The procedure therefore consists of a nested loop:
 *
 * **Outer loop**:
 * * List the analyses for the repository, filtered by tool.
 * * Parse this list to find a deletable analysis. If found:
 *
 * **Inner loop**:
 * * Delete the identified analysis.
 * * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.
 *
 * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.
 *
 * OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 *
 * @param analysis_id The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
 * @tag code-scanning
 * @path repos/:owner/:repo/code-scanning/analyses/:analysis_id
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function eraseByOwnerAndRepoAndAnalysis_id(connection, owner, repo, analysis_id, query) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? eraseByOwnerAndRepoAndAnalysis_id.simulate(connection, owner, repo, analysis_id, query)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, eraseByOwnerAndRepoAndAnalysis_id.METADATA), { path: eraseByOwnerAndRepoAndAnalysis_id.path(owner, repo, analysis_id, query), status: null }))];
        });
    });
}
(function (eraseByOwnerAndRepoAndAnalysis_id) {
    eraseByOwnerAndRepoAndAnalysis_id.METADATA = {
        method: "DELETE",
        path: "/repos/:owner/:repo/code-scanning/analyses/:analysis_id",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    eraseByOwnerAndRepoAndAnalysis_id.path = function (owner, repo, analysis_id, query) {
        var e_2, _a;
        var variables = new URLSearchParams();
        var _loop_2 = function (key, value) {
            if (undefined === value)
                return "continue";
            else if (Array.isArray(value))
                value.forEach(function (elem) { return variables.append(key, String(elem)); });
            else
                variables.set(key, String(value));
        };
        try {
            for (var _b = __values(Object.entries(query)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
                _loop_2(key, value);
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_2) throw e_2.error; }
        }
        var location = "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/code-scanning/analyses/").concat(encodeURIComponent(analysis_id !== null && analysis_id !== void 0 ? analysis_id : "null"));
        return 0 === variables.size
            ? location
            : "".concat(location, "?").concat(variables.toString());
    };
    eraseByOwnerAndRepoAndAnalysis_id.random = function (g) { return (function () { var $generator = typia_1.default.random.generator; var $pick = typia_1.default.random.pick; var $ro0 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            next_analysis_url: $pick([
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])(),
            confirm_delete_url: $pick([
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    eraseByOwnerAndRepoAndAnalysis_id.simulate = function (connection, owner, repo, analysis_id, query) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: eraseByOwnerAndRepoAndAnalysis_id.METADATA.method,
            host: connection.host,
            path: eraseByOwnerAndRepoAndAnalysis_id.path(owner, repo, analysis_id, query),
            contentType: "application/json",
        });
        try {
            assert.param("owner")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(owner); });
            assert.param("repo")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "string" === typeof input; }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "string" === typeof input || $guard(true, {
                            path: _path + "",
                            expected: "string",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(repo); });
            assert.param("analysis_id")(function () { return (function () { var $guard = typia_1.default.assert.guard; var __is = function (input) { return "number" === typeof input && (Math.floor(input) === input && -2147483648 <= input && input <= 2147483647); }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return "number" === typeof input && (Math.floor(input) === input && -2147483648 <= input && input <= 2147483647 || $guard(true, {
                            path: _path + "",
                            expected: "number & Type<\"int32\">",
                            value: input
                        }, _errorFactory)) || $guard(true, {
                            path: _path + "",
                            expected: "(number & Type<\"int32\">)",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(analysis_id); });
            assert.query(function () { return (function () { var $guard = typia_1.default.assert.guard; var $io0 = function (input) { return true; }; var $ao0 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return true;
            }; var __is = function (input) { return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); }; var _errorFactory; return function (input, errorFactory) {
                if (false === __is(input)) {
                    _errorFactory = errorFactory;
                    (function (input, _path, _exceptionable) {
                        if (_exceptionable === void 0) { _exceptionable = true; }
                        return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
                            path: _path + "",
                            expected: "IApiReposCodeScanningAnalyses.DeleteQuery",
                            value: input
                        }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
                            path: _path + "",
                            expected: "IApiReposCodeScanningAnalyses.DeleteQuery",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(query); });
        }
        catch (exp) {
            if (!(function () { var $io0 = function (input) { return ("HEAD" === input.method || "GET" === input.method || "DELETE" === input.method || "POST" === input.method || "PUT" === input.method || "PATCH" === input.method) && "string" === typeof input.path && "number" === typeof input.status && ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io1(input.headers)) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); }; var $io1 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null !== value && undefined !== value && ("string" === typeof value || Array.isArray(value) && value.every(function (elem) { return "string" === typeof elem; }));
            }); }; return function (input) { return "object" === typeof input && null !== input && $io0(input); }; })()(exp))
                throw exp;
            return {
                success: false,
                status: exp.status,
                headers: exp.headers,
                data: exp.toJSON().message,
            };
        }
        return eraseByOwnerAndRepoAndAnalysis_id.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(eraseByOwnerAndRepoAndAnalysis_id || (exports.eraseByOwnerAndRepoAndAnalysis_id = eraseByOwnerAndRepoAndAnalysis_id = {}));
//# sourceMappingURL=index.js.map