"use strict";
// Generated by bynkc — do not edit by hand.
// commons shortener.analytics
Object.defineProperty(exports, "__esModule", { value: true });
exports.LongUrl = exports.ShortCode = void 0;
const runtime_js_1 = require("../runtime.js");
exports.ShortCode = {
    of(value) {
        if (!(value.length >= 3)) {
            return (0, runtime_js_1.Err)({ field: "ShortCode", message: "length must be at least 3", value });
        }
        if (!(value.length <= 16)) {
            return (0, runtime_js_1.Err)({ field: "ShortCode", message: "length must be at most 16", value });
        }
        return (0, runtime_js_1.Ok)(value);
    },
    unsafe(value) {
        return value;
    },
    fromString(s) {
        return exports.ShortCode.of(s);
    },
};
exports.LongUrl = {
    of(value) {
        if (!(value.length >= 1)) {
            return (0, runtime_js_1.Err)({ field: "LongUrl", message: "length must be at least 1", value });
        }
        if (!(value.length <= 2048)) {
            return (0, runtime_js_1.Err)({ field: "LongUrl", message: "length must be at most 2048", value });
        }
        return (0, runtime_js_1.Ok)(value);
    },
    unsafe(value) {
        return value;
    },
    fromString(s) {
        return exports.LongUrl.of(s);
    },
};
