"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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
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 __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.lfs = exports.large_files = exports.authors = void 0;
exports.getByOwnerAndRepo = getByOwnerAndRepo;
exports.putByOwnerAndRepo = putByOwnerAndRepo;
exports.patchByOwnerAndRepo = patchByOwnerAndRepo;
exports.eraseByOwnerAndRepo = eraseByOwnerAndRepo;
var NestiaSimulator_1 = require("@nestia/fetcher/lib/NestiaSimulator");
var PlainFetcher_1 = require("@nestia/fetcher/lib/PlainFetcher");
var typia_1 = __importDefault(require("typia"));
exports.authors = __importStar(require("./authors"));
exports.large_files = __importStar(require("./large_files"));
exports.lfs = __importStar(require("./lfs"));
/**
 * Get an import status.
 * View the progress of an import.
 *
 * > [!WARNING]
 * > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 *
 * **Import status**
 *
 * This section includes details about the possible values of the `status` field of the Import Progress response.
 *
 * An import that does not have errors will progress through these steps:
 *
 * *   `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL.
 * *   `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import).
 * *   `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.
 * *   `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects".
 * *   `complete` - the import is complete, and the repository is ready on GitHub.
 *
 * If there are problems, you will see one of these in the `status` field:
 *
 * *   `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
 * *   `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api) for more information.
 * *   `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
 * *   `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) and [retry](https://docs.github.com/rest/migrations/source-imports#start-an-import) with the correct URL.
 * *   `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
 *
 * **The project_choices field**
 *
 * When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.
 *
 * **Git LFS related fields**
 *
 * This section includes details about Git LFS related fields that may be present in the Import Progress response.
 *
 * *   `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.
 * *   `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.
 * *   `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.
 * *   `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.
 *
 * @tag migrations
 * @deprecated
 * @path repos/:owner/:repo/import
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function getByOwnerAndRepo(connection, owner, repo) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? getByOwnerAndRepo.simulate(connection, owner, repo)
                    : 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), status: null }))];
        });
    });
}
(function (getByOwnerAndRepo) {
    getByOwnerAndRepo.METADATA = {
        method: "GET",
        path: "/repos/:owner/:repo/import",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    getByOwnerAndRepo.path = function (owner, repo) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/import");
    };
    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;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            use_lfs: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            vcs_url: (_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)(),
            svc_root: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            status: $pick([
                function () { return "unknown"; },
                function () { return "none"; },
                function () { return "error"; },
                function () { return "complete"; },
                function () { return "auth"; },
                function () { return "detecting"; },
                function () { return "choose"; },
                function () { return "auth_failed"; },
                function () { return "importing"; },
                function () { return "mapping"; },
                function () { return "waiting_to_push"; },
                function () { return "pushing"; },
                function () { return "setup"; },
                function () { return "detection_found_multiple"; },
                function () { return "detection_found_nothing"; },
                function () { return "detection_needs_auth"; }
            ])(),
            status_text: $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)(); }
            ])(),
            failed_step: $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)(); }
            ])(),
            error_message: $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)(); }
            ])(),
            import_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            commit_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            push_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            has_large_files: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            large_files_size: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            large_files_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            project_choices: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.array) !== null && _a !== void 0 ? _a : $generator.array)(function () { return $ro1(_recursive, _recursive ? 1 + _depth : _depth); }); }
            ])(),
            message: $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)(); }
            ])(),
            authors_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _k !== void 0 ? _k : $generator.uri)(),
            html_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _q !== void 0 ? _q : $generator.uri)(),
            authors_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _v !== void 0 ? _v : $generator.uri)(),
            repository_url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _z !== void 0 ? _z : ((_0 = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _0 !== void 0 ? _0 : $generator.uri)(),
            svn_root: $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)(); }
            ])()
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            human_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)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    getByOwnerAndRepo.simulate = function (connection, owner, repo) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: getByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: getByOwnerAndRepo.path(owner, repo),
            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); });
        }
        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 = {}));
/**
 * Start an import.
 * Start a source import to a GitHub repository using GitHub Importer.
 * Importing into a GitHub repository with GitHub Actions enabled is not supported and will
 * return a status `422 Unprocessable Entity` response.
 *
 * > [!WARNING]
 * > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 *
 * @tag migrations
 * @deprecated
 * @path repos/:owner/:repo/import
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function putByOwnerAndRepo(connection, owner, repo, body) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? putByOwnerAndRepo.simulate(connection, owner, repo, body)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, putByOwnerAndRepo.METADATA), { path: putByOwnerAndRepo.path(owner, repo), status: null }), body)];
        });
    });
}
(function (putByOwnerAndRepo) {
    putByOwnerAndRepo.METADATA = {
        method: "PUT",
        path: "/repos/:owner/:repo/import",
        request: {
            type: "application/json",
            encrypted: false,
        },
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    putByOwnerAndRepo.path = function (owner, repo) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/import");
    };
    putByOwnerAndRepo.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;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            use_lfs: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            vcs_url: (_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)(),
            svc_root: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            status: $pick([
                function () { return "unknown"; },
                function () { return "none"; },
                function () { return "error"; },
                function () { return "complete"; },
                function () { return "auth"; },
                function () { return "detecting"; },
                function () { return "choose"; },
                function () { return "auth_failed"; },
                function () { return "importing"; },
                function () { return "mapping"; },
                function () { return "waiting_to_push"; },
                function () { return "pushing"; },
                function () { return "setup"; },
                function () { return "detection_found_multiple"; },
                function () { return "detection_found_nothing"; },
                function () { return "detection_needs_auth"; }
            ])(),
            status_text: $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)(); }
            ])(),
            failed_step: $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)(); }
            ])(),
            error_message: $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)(); }
            ])(),
            import_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            commit_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            push_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            has_large_files: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            large_files_size: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            large_files_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            project_choices: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.array) !== null && _a !== void 0 ? _a : $generator.array)(function () { return $ro1(_recursive, _recursive ? 1 + _depth : _depth); }); }
            ])(),
            message: $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)(); }
            ])(),
            authors_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _k !== void 0 ? _k : $generator.uri)(),
            html_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _q !== void 0 ? _q : $generator.uri)(),
            authors_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _v !== void 0 ? _v : $generator.uri)(),
            repository_url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _z !== void 0 ? _z : ((_0 = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _0 !== void 0 ? _0 : $generator.uri)(),
            svn_root: $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)(); }
            ])()
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            human_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)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    putByOwnerAndRepo.simulate = function (connection, owner, repo, body) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: putByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: putByOwnerAndRepo.path(owner, repo),
            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.body(function () { return (function () { var $guard = typia_1.default.assert.guard; var $io0 = function (input) { return (undefined === input.title || "string" === typeof input.title) && ("string" === typeof input.key && /^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com /.test(input.key)); }; var $ao0 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
                    path: _path + ".title",
                    expected: "((string & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.title
                }, _errorFactory)) && ("string" === typeof input.key && (/^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com /.test(input.key) || $guard(_exceptionable, {
                    path: _path + ".key",
                    expected: "string & Pattern<\"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com \">",
                    value: input.key
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".key",
                    expected: "(string & Pattern<\"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com \">)",
                    value: input.key
                }, _errorFactory));
            }; var __is = function (input) { return "object" === typeof input && null !== 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 || $guard(true, {
                            path: _path + "",
                            expected: "body",
                            value: input
                        }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
                            path: _path + "",
                            expected: "body",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(body); });
        }
        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 putByOwnerAndRepo.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(putByOwnerAndRepo || (exports.putByOwnerAndRepo = putByOwnerAndRepo = {}));
/**
 * Update an import.
 * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API
 * request. If no parameters are provided, the import will be restarted.
 *
 * Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will
 * have the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.
 * You can select the project to import by providing one of the objects in the `project_choices` array in the update request.
 *
 * > [!WARNING]
 * > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 *
 * @tag migrations
 * @deprecated
 * @path repos/:owner/:repo/import
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function patchByOwnerAndRepo(connection, owner, repo, body) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? patchByOwnerAndRepo.simulate(connection, owner, repo, body)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, patchByOwnerAndRepo.METADATA), { path: patchByOwnerAndRepo.path(owner, repo), status: null }), body)];
        });
    });
}
(function (patchByOwnerAndRepo) {
    patchByOwnerAndRepo.METADATA = {
        method: "PATCH",
        path: "/repos/:owner/:repo/import",
        request: {
            type: "application/json",
            encrypted: false,
        },
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    patchByOwnerAndRepo.path = function (owner, repo) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/import");
    };
    patchByOwnerAndRepo.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;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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, [])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(); }
            ])(),
            use_lfs: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            vcs_url: (_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)(),
            svc_root: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            status: $pick([
                function () { return "unknown"; },
                function () { return "none"; },
                function () { return "error"; },
                function () { return "complete"; },
                function () { return "auth"; },
                function () { return "detecting"; },
                function () { return "choose"; },
                function () { return "auth_failed"; },
                function () { return "importing"; },
                function () { return "mapping"; },
                function () { return "waiting_to_push"; },
                function () { return "pushing"; },
                function () { return "setup"; },
                function () { return "detection_found_multiple"; },
                function () { return "detection_found_nothing"; },
                function () { return "detection_needs_auth"; }
            ])(),
            status_text: $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)(); }
            ])(),
            failed_step: $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)(); }
            ])(),
            error_message: $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)(); }
            ])(),
            import_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            commit_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            push_percent: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            has_large_files: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(); }
            ])(),
            large_files_size: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            large_files_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            project_choices: $pick([
                function () { return undefined; },
                function () { var _a; return ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.array) !== null && _a !== void 0 ? _a : $generator.array)(function () { return $ro1(_recursive, _recursive ? 1 + _depth : _depth); }); }
            ])(),
            message: $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)(); }
            ])(),
            authors_count: $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.number) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Type<\"int32\">",
                        kind: "type",
                        value: "int32"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _e !== void 0 ? _e : $generator.integer)(0, 100); }
            ])(),
            url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _k !== void 0 ? _k : $generator.uri)(),
            html_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _q !== void 0 ? _q : $generator.uri)(),
            authors_url: (_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, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _v !== void 0 ? _v : $generator.uri)(),
            repository_url: (_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: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                }
            ])) !== null && _z !== void 0 ? _z : ((_0 = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _0 !== void 0 ? _0 : $generator.uri)(),
            svn_root: $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)(); }
            ])()
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            vcs: $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)(); }
            ])(),
            tfvc_project: $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)(); }
            ])(),
            human_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)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    patchByOwnerAndRepo.simulate = function (connection, owner, repo, body) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: patchByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: patchByOwnerAndRepo.path(owner, repo),
            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.body(function () { return (function () { var $guard = typia_1.default.assert.guard; var $io0 = function (input) { return (undefined === input.title || "string" === typeof input.title) && ("string" === typeof input.key && /^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com /.test(input.key)); }; var $ao0 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
                    path: _path + ".title",
                    expected: "((string & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.title
                }, _errorFactory)) && ("string" === typeof input.key && (/^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com /.test(input.key) || $guard(_exceptionable, {
                    path: _path + ".key",
                    expected: "string & Pattern<\"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com \">",
                    value: input.key
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".key",
                    expected: "(string & Pattern<\"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) |^(sk-ssh-ed25519|sk-ecdsa-sha2-nistp256)@openssh.com \">)",
                    value: input.key
                }, _errorFactory));
            }; var __is = function (input) { return "object" === typeof input && null !== 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 || $guard(true, {
                            path: _path + "",
                            expected: "body",
                            value: input
                        }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
                            path: _path + "",
                            expected: "body",
                            value: input
                        }, _errorFactory);
                    })(input, "$input", true);
                }
                return input;
            }; })()(body); });
        }
        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 patchByOwnerAndRepo.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(patchByOwnerAndRepo || (exports.patchByOwnerAndRepo = patchByOwnerAndRepo = {}));
/**
 * Cancel an import.
 * Stop an import for a repository.
 *
 * > [!WARNING]
 * > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 *
 * @tag migrations
 * @deprecated
 * @path repos/:owner/:repo/import
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function eraseByOwnerAndRepo(connection, owner, repo) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? eraseByOwnerAndRepo.simulate(connection, owner, repo)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, eraseByOwnerAndRepo.METADATA), { path: eraseByOwnerAndRepo.path(owner, repo), status: null }))];
        });
    });
}
(function (eraseByOwnerAndRepo) {
    eraseByOwnerAndRepo.METADATA = {
        method: "DELETE",
        path: "/repos/:owner/:repo/import",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    eraseByOwnerAndRepo.path = function (owner, repo) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/import");
    };
    eraseByOwnerAndRepo.random = function (g) { return (function () { var _generator; return function (generator) {
        _generator = generator;
        return undefined;
    }; })()(g); };
    eraseByOwnerAndRepo.simulate = function (connection, owner, repo) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: eraseByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: eraseByOwnerAndRepo.path(owner, repo),
            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); });
        }
        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 eraseByOwnerAndRepo.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(eraseByOwnerAndRepo || (exports.eraseByOwnerAndRepo = eraseByOwnerAndRepo = {}));
//# sourceMappingURL=index.js.map