"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.get = get;
var PlainFetcher_1 = require("@nestia/fetcher/lib/PlainFetcher");
var typia_1 = __importDefault(require("typia"));
/**
 * Get rate limit status for the authenticated user.
 * > [!NOTE]
 * > Accessing this endpoint does not count against your REST API rate limit.
 *
 * Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:
 * * The `core` object provides your rate limit status for all non-search-related resources in the REST API.
 * * The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search/search)."
 * * The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)."
 * * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)."
 * * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."
 * * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)."
 * * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."
 * * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)."
 * * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)."
 *
 * > [!NOTE]
 * > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.
 *
 * @tag rate-limit
 * @path rate_limit
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
function get(connection) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            return [2 /*return*/, !!connection.simulate
                    ? get.simulate(connection)
                    : PlainFetcher_1.PlainFetcher.fetch(__assign(__assign({}, connection), { headers: __assign(__assign({}, connection.headers), { "Content-Type": "application/json" }) }), __assign(__assign({}, get.METADATA), { path: get.path(), status: null }))];
        });
    });
}
(function (get) {
    get.METADATA = {
        method: "GET",
        path: "/rate_limit",
        request: null,
        response: {
            type: "application/json",
            encrypted: false,
        },
    };
    get.path = function () { return "/rate_limit"; };
    get.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 ({
            resources: $ro1(_recursive, _recursive ? 1 + _depth : _depth),
            rate: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
        });
    }; var $ro1 = function (_recursive, _depth) {
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            core: $ro2(_recursive, _recursive ? 1 + _depth : _depth),
            graphql: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            search: $ro2(_recursive, _recursive ? 1 + _depth : _depth),
            code_search: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            source_import: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            integration_manifest: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            code_scanning_upload: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            actions_runner_registration: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            scim: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])(),
            dependency_snapshots: $pick([
                function () { return undefined; },
                function () { return $ro2(_recursive, _recursive ? 1 + _depth : _depth); }
            ])()
        });
    }; var $ro2 = function (_recursive, _depth) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
        if (_recursive === void 0) { _recursive = false; }
        if (_depth === void 0) { _depth = 0; }
        return ({
            limit: (_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),
            remaining: (_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.number) === null || _h === void 0 ? void 0 : _h.call(_g, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _j !== void 0 ? _j : ((_k = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _k !== void 0 ? _k : $generator.integer)(0, 100),
            reset: (_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.number) === null || _o === void 0 ? void 0 : _o.call(_m, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _p !== void 0 ? _p : ((_q = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _q !== void 0 ? _q : $generator.integer)(0, 100),
            used: (_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.number) === null || _t === void 0 ? void 0 : _t.call(_s, [
                {
                    name: "Type<\"int32\">",
                    kind: "type",
                    value: "int32"
                }
            ])) !== null && _u !== void 0 ? _u : ((_v = _generator === null || _generator === void 0 ? void 0 : _generator.integer) !== null && _v !== void 0 ? _v : $generator.integer)(0, 100)
        });
    }; var _generator; return function (generator) {
        _generator = generator;
        return $ro0();
    }; })()(g); };
    get.simulate = function (connection) {
        return get.random("object" === typeof connection.simulate && null !== connection.simulate
            ? connection.simulate
            : undefined);
    };
})(get || (exports.get = get = {}));
//# sourceMappingURL=index.js.map