"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.getByThread_id = getByThread_id;
exports.putByThread_id = putByThread_id;
exports.eraseByThread_id = eraseByThread_id;
var PlainFetcher_1 = require("@nestia/fetcher/lib/PlainFetcher");
var typia_1 = __importDefault(require("typia"));
var NestiaSimulator_1 = require("@nestia/fetcher/lib/NestiaSimulator");
/**
 * Get a thread subscription for the authenticated user.
 * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).
 *
 * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.
 *
 * @tag activity
 * @path notifications/threads/:thread_id/subscription
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function getByThread_id(connection, thread_id) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? getByThread_id.simulate(connection, thread_id)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, getByThread_id.METADATA), { path: getByThread_id.path(thread_id), status: null }))];
        });
    });
}
(function (getByThread_id) {
    getByThread_id.METADATA = {
        method: "GET",
        path: "/notifications/threads/:thread_id/subscription",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    getByThread_id.path = function (thread_id) {
        return "/notifications/threads/".concat(encodeURIComponent(thread_id !== null && thread_id !== void 0 ? thread_id : "null"), "/subscription");
    };
    getByThread_id.random = function (g) { return (function () { var $generator = typia_1.default.random.generator; var $pick = typia_1.default.random.pick; var $ro0 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            subscribed: ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(),
            ignored: ((_b = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _b !== void 0 ? _b : $generator.boolean)(),
            reason: $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)(); }
            ])(),
            created_at: $pick([
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Format<\"date-time\">",
                        kind: "format",
                        value: "date-time"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.datetime) !== null && _e !== void 0 ? _e : $generator.datetime)(); }
            ])(),
            url: (_f = (_e = (_d = ((_c = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _c !== void 0 ? _c : $generator.customs)) === null || _d === void 0 ? void 0 : _d.string) === null || _e === void 0 ? void 0 : _e.call(_d, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _f !== void 0 ? _f : ((_g = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _g !== void 0 ? _g : $generator.uri)(),
            thread_url: $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, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])(),
            repository_url: $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, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    getByThread_id.simulate = function (connection, thread_id) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: getByThread_id.METADATA.method,
            host: connection.host,
            path: getByThread_id.path(thread_id),
            contentType: "application/json",
        });
        try {
            assert.param("thread_id")(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;
            }; })()(thread_id); });
        }
        catch (exp) {
            if (!(function () { var $io0 = function (input) { return ("HEAD" === input.method || "GET" === input.method || "DELETE" === input.method || "POST" === input.method || "PUT" === input.method || "PATCH" === input.method) && "string" === typeof input.path && "number" === typeof input.status && ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io1(input.headers)) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); }; var $io1 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null !== value && undefined !== value && ("string" === typeof value || Array.isArray(value) && value.every(function (elem) { return "string" === typeof elem; }));
            }); }; return function (input) { return "object" === typeof input && null !== input && $io0(input); }; })()(exp))
                throw exp;
            return {
                success: false,
                status: exp.status,
                headers: exp.headers,
                data: exp.toJSON().message,
            };
        }
        return getByThread_id.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(getByThread_id || (exports.getByThread_id = getByThread_id = {}));
/**
 * Set a thread subscription.
 * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.
 *
 * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.
 *
 * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint.
 *
 * @tag activity
 * @path notifications/threads/:thread_id/subscription
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function putByThread_id(connection, thread_id, body) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? putByThread_id.simulate(connection, thread_id, body)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, putByThread_id.METADATA), { path: putByThread_id.path(thread_id), status: null }), body)];
        });
    });
}
(function (putByThread_id) {
    putByThread_id.METADATA = {
        method: "PUT",
        path: "/notifications/threads/:thread_id/subscription",
        request: {
            type: "application/json",
            encrypted: false,
        },
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    putByThread_id.path = function (thread_id) {
        return "/notifications/threads/".concat(encodeURIComponent(thread_id !== null && thread_id !== void 0 ? thread_id : "null"), "/subscription");
    };
    putByThread_id.random = function (g) { return (function () { var $generator = typia_1.default.random.generator; var $pick = typia_1.default.random.pick; var $ro0 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            subscribed: ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _a !== void 0 ? _a : $generator.boolean)(),
            ignored: ((_b = _generator === null || _generator === void 0 ? void 0 : _generator.boolean) !== null && _b !== void 0 ? _b : $generator.boolean)(),
            reason: $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)(); }
            ])(),
            created_at: $pick([
                function () { return null; },
                function () { var _a, _b, _c, _d, _e; return (_d = (_c = (_b = ((_a = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _a !== void 0 ? _a : $generator.customs)) === null || _b === void 0 ? void 0 : _b.string) === null || _c === void 0 ? void 0 : _c.call(_b, [
                    {
                        name: "Format<\"date-time\">",
                        kind: "format",
                        value: "date-time"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.datetime) !== null && _e !== void 0 ? _e : $generator.datetime)(); }
            ])(),
            url: (_f = (_e = (_d = ((_c = _generator === null || _generator === void 0 ? void 0 : _generator.customs) !== null && _c !== void 0 ? _c : $generator.customs)) === null || _d === void 0 ? void 0 : _d.string) === null || _e === void 0 ? void 0 : _e.call(_d, [
                {
                    name: "Format<\"uri\">",
                    kind: "format",
                    value: "uri"
                },
                {
                    name: "JsonSchemaPlugin<__type>",
                    kind: "jsonPlugin"
                }
            ])) !== null && _f !== void 0 ? _f : ((_g = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _g !== void 0 ? _g : $generator.uri)(),
            thread_url: $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, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])(),
            repository_url: $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, [
                    {
                        name: "Format<\"uri\">",
                        kind: "format",
                        value: "uri"
                    },
                    {
                        name: "JsonSchemaPlugin<__type>",
                        kind: "jsonPlugin"
                    }
                ])) !== null && _d !== void 0 ? _d : ((_e = _generator === null || _generator === void 0 ? void 0 : _generator.uri) !== null && _e !== void 0 ? _e : $generator.uri)(); }
            ])()
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    putByThread_id.simulate = function (connection, thread_id, body) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: putByThread_id.METADATA.method,
            host: connection.host,
            path: putByThread_id.path(thread_id),
            contentType: "application/json",
        });
        try {
            assert.param("thread_id")(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;
            }; })()(thread_id); });
            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 putByThread_id.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(putByThread_id || (exports.putByThread_id = putByThread_id = {}));
/**
 * Delete a thread subscription.
 * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`.
 *
 * @tag activity
 * @path notifications/threads/:thread_id/subscription
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function eraseByThread_id(connection, thread_id) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? eraseByThread_id.simulate(connection, thread_id)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, eraseByThread_id.METADATA), { path: eraseByThread_id.path(thread_id), status: null }))];
        });
    });
}
(function (eraseByThread_id) {
    eraseByThread_id.METADATA = {
        method: "DELETE",
        path: "/notifications/threads/:thread_id/subscription",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    eraseByThread_id.path = function (thread_id) {
        return "/notifications/threads/".concat(encodeURIComponent(thread_id !== null && thread_id !== void 0 ? thread_id : "null"), "/subscription");
    };
    eraseByThread_id.random = function (g) { return (function () { var _generator; return function (generator) {
        _generator = generator;
        return undefined;
    }; })()(g); };
    eraseByThread_id.simulate = function (connection, thread_id) {
        var assert = NestiaSimulator_1.NestiaSimulator.assert({
            method: eraseByThread_id.METADATA.method,
            host: connection.host,
            path: eraseByThread_id.path(thread_id),
            contentType: "application/json",
        });
        try {
            assert.param("thread_id")(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;
            }; })()(thread_id); });
        }
        catch (exp) {
            if (!(function () { var $io0 = function (input) { return ("HEAD" === input.method || "GET" === input.method || "DELETE" === input.method || "POST" === input.method || "PUT" === input.method || "PATCH" === input.method) && "string" === typeof input.path && "number" === typeof input.status && ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io1(input.headers)) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); }; var $io1 = function (input) { return Object.keys(input).every(function (key) {
                var value = input[key];
                if (undefined === value)
                    return true;
                return null !== value && undefined !== value && ("string" === typeof value || Array.isArray(value) && value.every(function (elem) { return "string" === typeof elem; }));
            }); }; return function (input) { return "object" === typeof input && null !== input && $io0(input); }; })()(exp))
                throw exp;
            return {
                success: false,
                status: exp.status,
                headers: exp.headers,
                data: exp.toJSON().message,
            };
        }
        return eraseByThread_id.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(eraseByThread_id || (exports.eraseByThread_id = eraseByThread_id = {}));
//# sourceMappingURL=index.js.map