"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 __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.postByOwnerAndRepo = postByOwnerAndRepo;
var PlainFetcher_1 = require("@nestia/fetcher/lib/PlainFetcher");
var typia_1 = __importDefault(require("typia"));
var NestiaSimulator_1 = require("@nestia/fetcher/lib/NestiaSimulator");
/**
 * Create a snapshot of dependencies for a repository.
 * Create a new snapshot of a repository's dependencies.
 *
 * The authenticated user must have access to the repository.
 *
 * OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 *
 * @tag dependency-graph
 * @path repos/:owner/:repo/dependency-graph/snapshots
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function postByOwnerAndRepo(connection, owner, repo, body) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? postByOwnerAndRepo.simulate(connection, owner, repo, body)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, postByOwnerAndRepo.METADATA), { path: postByOwnerAndRepo.path(owner, repo), status: null }), body)];
        });
    });
}
(function (postByOwnerAndRepo) {
    postByOwnerAndRepo.METADATA = {
        method: "POST",
        path: "/repos/:owner/:repo/dependency-graph/snapshots",
        request: {
            type: "application/json",
            encrypted: false,
        },
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    postByOwnerAndRepo.path = function (owner, repo) {
        return "/repos/".concat(encodeURIComponent(owner !== null && owner !== void 0 ? owner : "null"), "/").concat(encodeURIComponent(repo !== null && repo !== void 0 ? repo : "null"), "/dependency-graph/snapshots");
    };
    postByOwnerAndRepo.random = function (g) { return (function () { var $pick = typia_1.default.random.pick; var $generator = typia_1.default.random.generator; var $ro0 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return {};
    }; var $ro1 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            limit: $pick([
                function () { return "existing_users"; },
                function () { return "contributors_only"; },
                function () { return "collaborators_only"; }
            ])(),
            origin: (_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: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.string) !== null && _e !== void 0 ? _e : $generator.string)(),
            expires_at: (_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<\"date-time\">",
                    kind: "format",
                    value: "date-time"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.datetime) !== null && _k !== void 0 ? _k : $generator.datetime)()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $pick([
            function () { return $ro0(); },
            function () { return $ro1(); }
        ])();
    }; })()(g); };
    postByOwnerAndRepo.simulate = function (connection, owner, repo, body) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: postByOwnerAndRepo.METADATA.method,
            host: connection.host,
            path: postByOwnerAndRepo.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 $join = typia_1.default.assert.join; var $io0 = function (input) { return "number" === typeof input.version && (Math.floor(input.version) === input.version && -2147483648 <= input.version && input.version <= 2147483647) && ("object" === typeof input.job && null !== input.job && $io1(input.job)) && ("string" === typeof input.sha && (40 <= input.sha.length && input.sha.length <= 40)) && ("string" === typeof input.ref && /^refs/ / .test(input.ref)) && ("object" === typeof input.detector && null !== input.detector && $io2(input.detector)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && $io3(input.metadata)) && (undefined === input.manifests || "object" === typeof input.manifests && null !== input.manifests && false === Array.isArray(input.manifests) && $io4(input.manifests)) && ("string" === typeof input.scanned && /^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test(input.scanned)); }; var $io1 = function (input) { return "string" === typeof input.id && "string" === typeof input.correlator && (undefined === input.html_url || "string" === typeof input.html_url); }; var $io2 = function (input) { return "string" === typeof input.name && "string" === typeof input.version && "string" === typeof input.url; }; var $io3 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null === value || "string" === typeof value || "number" === typeof value || "boolean" === typeof value;
            }); }; var $io4 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return "object" === typeof value && null !== value && $io5(value);
            }); }; var $io5 = function (input) { return "string" === typeof input.name && (undefined === input.file || "object" === typeof input.file && null !== input.file && false === Array.isArray(input.file) && $io6(input.file)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && $io3(input.metadata)) && (undefined === input.resolved || "object" === typeof input.resolved && null !== input.resolved && false === Array.isArray(input.resolved) && $io7(input.resolved)); }; var $io6 = function (input) { return undefined === input.source_location || "string" === typeof input.source_location; }; var $io7 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return "object" === typeof value && null !== value && false === Array.isArray(value) && $io8(value);
            }); }; var $io8 = function (input) { return (undefined === input.package_url || "string" === typeof input.package_url && /^pkg/.test(input.package_url)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && $io3(input.metadata)) && (undefined === input.relationship || "direct" === input.relationship || "indirect" === input.relationship) && (undefined === input.scope || "development" === input.scope || "runtime" === input.scope) && (undefined === input.dependencies || Array.isArray(input.dependencies) && input.dependencies.every(function (elem) { return "string" === typeof elem; })); }; var $ao0 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return ("number" === typeof input.version && (Math.floor(input.version) === input.version && -2147483648 <= input.version && input.version <= 2147483647 || $guard(_exceptionable, {
                    path: _path + ".version",
                    expected: "number & Type<\"int32\">",
                    value: input.version
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".version",
                    expected: "(number & Type<\"int32\">)",
                    value: input.version
                }, _errorFactory)) && (("object" === typeof input.job && null !== input.job || $guard(_exceptionable, {
                    path: _path + ".job",
                    expected: "__type",
                    value: input.job
                }, _errorFactory)) && $ao1(input.job, _path + ".job", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".job",
                    expected: "__type",
                    value: input.job
                }, _errorFactory)) && ("string" === typeof input.sha && (40 <= input.sha.length || $guard(_exceptionable, {
                    path: _path + ".sha",
                    expected: "string & MinLength<40>",
                    value: input.sha
                }, _errorFactory)) && (input.sha.length <= 40 || $guard(_exceptionable, {
                    path: _path + ".sha",
                    expected: "string & MaxLength<40>",
                    value: input.sha
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".sha",
                    expected: "(string & MinLength<40> & MaxLength<40> & JsonSchemaPlugin<__type>)",
                    value: input.sha
                }, _errorFactory)) && ("string" === typeof input.ref && (/^refs/ / .test(input.ref) || $guard(_exceptionable, {
                    path: _path + ".ref",
                    expected: "string & Pattern<\"^refs/\">",
                    value: input.ref
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".ref",
                    expected: "(string & Pattern<\"^refs/\"> & JsonSchemaPlugin<__type>)",
                    value: input.ref
                }, _errorFactory)) && (("object" === typeof input.detector && null !== input.detector || $guard(_exceptionable, {
                    path: _path + ".detector",
                    expected: "__type.o17",
                    value: input.detector
                }, _errorFactory)) && $ao2(input.detector, _path + ".detector", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".detector",
                    expected: "__type.o17",
                    value: input.detector
                }, _errorFactory)) && (undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && $ao3(input.metadata, _path + ".metadata", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && (undefined === input.manifests || ("object" === typeof input.manifests && null !== input.manifests && false === Array.isArray(input.manifests) || $guard(_exceptionable, {
                    path: _path + ".manifests",
                    expected: "(__type.o24 | undefined)",
                    value: input.manifests
                }, _errorFactory)) && $ao4(input.manifests, _path + ".manifests", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".manifests",
                    expected: "(__type.o24 | undefined)",
                    value: input.manifests
                }, _errorFactory)) && ("string" === typeof input.scanned && (/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test(input.scanned) || $guard(_exceptionable, {
                    path: _path + ".scanned",
                    expected: "string & Format<\"date-time\">",
                    value: input.scanned
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".scanned",
                    expected: "(string & Format<\"date-time\"> & JsonSchemaPlugin<__type>)",
                    value: input.scanned
                }, _errorFactory));
            }; var $ao1 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return ("string" === typeof input.id || $guard(_exceptionable, {
                    path: _path + ".id",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.id
                }, _errorFactory)) && ("string" === typeof input.correlator || $guard(_exceptionable, {
                    path: _path + ".correlator",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.correlator
                }, _errorFactory)) && (undefined === input.html_url || "string" === typeof input.html_url || $guard(_exceptionable, {
                    path: _path + ".html_url",
                    expected: "((string & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.html_url
                }, _errorFactory));
            }; var $ao2 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return ("string" === typeof input.name || $guard(_exceptionable, {
                    path: _path + ".name",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.name
                }, _errorFactory)) && ("string" === typeof input.version || $guard(_exceptionable, {
                    path: _path + ".version",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.version
                }, _errorFactory)) && ("string" === typeof input.url || $guard(_exceptionable, {
                    path: _path + ".url",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.url
                }, _errorFactory));
            }; var $ao3 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return false === _exceptionable || Object.keys(input).every(function (key) {
                    var value = input[key];
                    if (undefined === value)
                        return true;
                    return null === value || "string" === typeof value || "number" === typeof value || "boolean" === typeof value || $guard(_exceptionable, {
                        path: _path + $join(key),
                        expected: "(boolean | null | number | string)",
                        value: value
                    }, _errorFactory);
                });
            }; var $ao4 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return false === _exceptionable || Object.keys(input).every(function (key) {
                    var value = input[key];
                    if (undefined === value)
                        return true;
                    return ("object" === typeof value && null !== value || $guard(_exceptionable, {
                        path: _path + $join(key),
                        expected: "manifest",
                        value: value
                    }, _errorFactory)) && $ao5(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
                        path: _path + $join(key),
                        expected: "manifest",
                        value: value
                    }, _errorFactory);
                });
            }; var $ao5 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return ("string" === typeof input.name || $guard(_exceptionable, {
                    path: _path + ".name",
                    expected: "(string & JsonSchemaPlugin<__type>)",
                    value: input.name
                }, _errorFactory)) && (undefined === input.file || ("object" === typeof input.file && null !== input.file && false === Array.isArray(input.file) || $guard(_exceptionable, {
                    path: _path + ".file",
                    expected: "(__type.o27 | undefined)",
                    value: input.file
                }, _errorFactory)) && $ao6(input.file, _path + ".file", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".file",
                    expected: "(__type.o27 | undefined)",
                    value: input.file
                }, _errorFactory)) && (undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && $ao3(input.metadata, _path + ".metadata", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && (undefined === input.resolved || ("object" === typeof input.resolved && null !== input.resolved && false === Array.isArray(input.resolved) || $guard(_exceptionable, {
                    path: _path + ".resolved",
                    expected: "(__type.o30 | undefined)",
                    value: input.resolved
                }, _errorFactory)) && $ao7(input.resolved, _path + ".resolved", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".resolved",
                    expected: "(__type.o30 | undefined)",
                    value: input.resolved
                }, _errorFactory));
            }; var $ao6 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return undefined === input.source_location || "string" === typeof input.source_location || $guard(_exceptionable, {
                    path: _path + ".source_location",
                    expected: "((string & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.source_location
                }, _errorFactory);
            }; var $ao7 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return false === _exceptionable || Object.keys(input).every(function (key) {
                    var value = input[key];
                    if (undefined === value)
                        return true;
                    return ("object" === typeof value && null !== value && false === Array.isArray(value) || $guard(_exceptionable, {
                        path: _path + $join(key),
                        expected: "dependency",
                        value: value
                    }, _errorFactory)) && $ao8(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
                        path: _path + $join(key),
                        expected: "dependency",
                        value: value
                    }, _errorFactory);
                });
            }; var $ao8 = function (input, _path, _exceptionable) {
                if (_exceptionable === void 0) { _exceptionable = true; }
                return (undefined === input.package_url || "string" === typeof input.package_url && (/^pkg/.test(input.package_url) || $guard(_exceptionable, {
                    path: _path + ".package_url",
                    expected: "string & Pattern<\"^pkg\">",
                    value: input.package_url
                }, _errorFactory)) || $guard(_exceptionable, {
                    path: _path + ".package_url",
                    expected: "((string & Pattern<\"^pkg\"> & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.package_url
                }, _errorFactory)) && (undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && $ao3(input.metadata, _path + ".metadata", true && _exceptionable) || $guard(_exceptionable, {
                    path: _path + ".metadata",
                    expected: "(metadata | undefined)",
                    value: input.metadata
                }, _errorFactory)) && (undefined === input.relationship || "direct" === input.relationship || "indirect" === input.relationship || $guard(_exceptionable, {
                    path: _path + ".relationship",
                    expected: "(\"direct\" | \"indirect\" | undefined)",
                    value: input.relationship
                }, _errorFactory)) && (undefined === input.scope || "development" === input.scope || "runtime" === input.scope || $guard(_exceptionable, {
                    path: _path + ".scope",
                    expected: "(\"development\" | \"runtime\" | undefined)",
                    value: input.scope
                }, _errorFactory)) && (undefined === input.dependencies || (Array.isArray(input.dependencies) || $guard(_exceptionable, {
                    path: _path + ".dependencies",
                    expected: "((Array<string> & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.dependencies
                }, _errorFactory)) && input.dependencies.every(function (elem, _index2) { return "string" === typeof elem || $guard(_exceptionable, {
                    path: _path + ".dependencies[" + _index2 + "]",
                    expected: "string",
                    value: elem
                }, _errorFactory); }) || $guard(_exceptionable, {
                    path: _path + ".dependencies",
                    expected: "((Array<string> & JsonSchemaPlugin<__type>) | undefined)",
                    value: input.dependencies
                }, _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: "snapshot",
                            value: input
                        }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
                            path: _path + "",
                            expected: "snapshot",
                            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 postByOwnerAndRepo.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(postByOwnerAndRepo || (exports.postByOwnerAndRepo = postByOwnerAndRepo = {}));
//# sourceMappingURL=index.js.map