"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
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 () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.JournalLine$inboundSchema = exports.JournalLineCurrencyCode$inboundSchema = exports.JournalLineSchemasValue$inboundSchema = exports.JournalLineSchemasSourceValue$inboundSchema = exports.JournalLineSchemas4$inboundSchema = exports.JournalLineAccountType$inboundSchema = exports.JournalLineValue$inboundSchema = exports.JournalLineSourceValue$inboundSchema = exports.JournalLine4$inboundSchema = exports.JournalLineSchemasValue = exports.JournalLineValue = void 0;
exports.journalLine4FromJSON = journalLine4FromJSON;
exports.journalLineSourceValueFromJSON = journalLineSourceValueFromJSON;
exports.journalLineAccountTypeFromJSON = journalLineAccountTypeFromJSON;
exports.journalLineSchemas4FromJSON = journalLineSchemas4FromJSON;
exports.journalLineSchemasSourceValueFromJSON = journalLineSchemasSourceValueFromJSON;
exports.journalLineCurrencyCodeFromJSON = journalLineCurrencyCodeFromJSON;
exports.journalLineFromJSON = journalLineFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
/**
 * Type of account
 */
var JournalLineValue;
(function (JournalLineValue) {
    JournalLineValue["Asset"] = "asset";
    JournalLineValue["Liability"] = "liability";
    JournalLineValue["Equity"] = "equity";
    JournalLineValue["Revenue"] = "revenue";
    JournalLineValue["Expense"] = "expense";
    JournalLineValue["UnmappedValue"] = "unmapped_value";
})(JournalLineValue || (exports.JournalLineValue = JournalLineValue = {}));
/**
 * Default currency for the company
 */
var JournalLineSchemasValue;
(function (JournalLineSchemasValue) {
    JournalLineSchemasValue["Aed"] = "AED";
    JournalLineSchemasValue["Afn"] = "AFN";
    JournalLineSchemasValue["All"] = "ALL";
    JournalLineSchemasValue["Amd"] = "AMD";
    JournalLineSchemasValue["Ang"] = "ANG";
    JournalLineSchemasValue["Aoa"] = "AOA";
    JournalLineSchemasValue["Ars"] = "ARS";
    JournalLineSchemasValue["Aud"] = "AUD";
    JournalLineSchemasValue["Awg"] = "AWG";
    JournalLineSchemasValue["Azn"] = "AZN";
    JournalLineSchemasValue["Bam"] = "BAM";
    JournalLineSchemasValue["Bbd"] = "BBD";
    JournalLineSchemasValue["Bdt"] = "BDT";
    JournalLineSchemasValue["Bgn"] = "BGN";
    JournalLineSchemasValue["Bhd"] = "BHD";
    JournalLineSchemasValue["Bif"] = "BIF";
    JournalLineSchemasValue["Bmd"] = "BMD";
    JournalLineSchemasValue["Bnd"] = "BND";
    JournalLineSchemasValue["Bob"] = "BOB";
    JournalLineSchemasValue["Brl"] = "BRL";
    JournalLineSchemasValue["Bsd"] = "BSD";
    JournalLineSchemasValue["Btn"] = "BTN";
    JournalLineSchemasValue["Bwp"] = "BWP";
    JournalLineSchemasValue["Byn"] = "BYN";
    JournalLineSchemasValue["Bzd"] = "BZD";
    JournalLineSchemasValue["Cad"] = "CAD";
    JournalLineSchemasValue["Cdf"] = "CDF";
    JournalLineSchemasValue["Chf"] = "CHF";
    JournalLineSchemasValue["Clp"] = "CLP";
    JournalLineSchemasValue["Cny"] = "CNY";
    JournalLineSchemasValue["Cop"] = "COP";
    JournalLineSchemasValue["Crc"] = "CRC";
    JournalLineSchemasValue["Cuc"] = "CUC";
    JournalLineSchemasValue["Cup"] = "CUP";
    JournalLineSchemasValue["Cve"] = "CVE";
    JournalLineSchemasValue["Czk"] = "CZK";
    JournalLineSchemasValue["Djf"] = "DJF";
    JournalLineSchemasValue["Dkk"] = "DKK";
    JournalLineSchemasValue["Dop"] = "DOP";
    JournalLineSchemasValue["Dzd"] = "DZD";
    JournalLineSchemasValue["Egp"] = "EGP";
    JournalLineSchemasValue["Ern"] = "ERN";
    JournalLineSchemasValue["Etb"] = "ETB";
    JournalLineSchemasValue["Eur"] = "EUR";
    JournalLineSchemasValue["Fjd"] = "FJD";
    JournalLineSchemasValue["Fkp"] = "FKP";
    JournalLineSchemasValue["Gbp"] = "GBP";
    JournalLineSchemasValue["Gel"] = "GEL";
    JournalLineSchemasValue["Ghs"] = "GHS";
    JournalLineSchemasValue["Gip"] = "GIP";
    JournalLineSchemasValue["Gmd"] = "GMD";
    JournalLineSchemasValue["Gnf"] = "GNF";
    JournalLineSchemasValue["Gtq"] = "GTQ";
    JournalLineSchemasValue["Gyd"] = "GYD";
    JournalLineSchemasValue["Hkd"] = "HKD";
    JournalLineSchemasValue["Hnl"] = "HNL";
    JournalLineSchemasValue["Hrk"] = "HRK";
    JournalLineSchemasValue["Htg"] = "HTG";
    JournalLineSchemasValue["Huf"] = "HUF";
    JournalLineSchemasValue["Idr"] = "IDR";
    JournalLineSchemasValue["Ils"] = "ILS";
    JournalLineSchemasValue["Inr"] = "INR";
    JournalLineSchemasValue["Iqd"] = "IQD";
    JournalLineSchemasValue["Irr"] = "IRR";
    JournalLineSchemasValue["Isk"] = "ISK";
    JournalLineSchemasValue["Jmd"] = "JMD";
    JournalLineSchemasValue["Jod"] = "JOD";
    JournalLineSchemasValue["Jpy"] = "JPY";
    JournalLineSchemasValue["Kes"] = "KES";
    JournalLineSchemasValue["Kgs"] = "KGS";
    JournalLineSchemasValue["Khr"] = "KHR";
    JournalLineSchemasValue["Kmf"] = "KMF";
    JournalLineSchemasValue["Kpw"] = "KPW";
    JournalLineSchemasValue["Krw"] = "KRW";
    JournalLineSchemasValue["Kwd"] = "KWD";
    JournalLineSchemasValue["Kyd"] = "KYD";
    JournalLineSchemasValue["Kzt"] = "KZT";
    JournalLineSchemasValue["Lak"] = "LAK";
    JournalLineSchemasValue["Lbp"] = "LBP";
    JournalLineSchemasValue["Lkr"] = "LKR";
    JournalLineSchemasValue["Lrd"] = "LRD";
    JournalLineSchemasValue["Lsl"] = "LSL";
    JournalLineSchemasValue["Lyd"] = "LYD";
    JournalLineSchemasValue["Mad"] = "MAD";
    JournalLineSchemasValue["Mdl"] = "MDL";
    JournalLineSchemasValue["Mga"] = "MGA";
    JournalLineSchemasValue["Mkd"] = "MKD";
    JournalLineSchemasValue["Mmk"] = "MMK";
    JournalLineSchemasValue["Mnt"] = "MNT";
    JournalLineSchemasValue["Mop"] = "MOP";
    JournalLineSchemasValue["Mru"] = "MRU";
    JournalLineSchemasValue["Mur"] = "MUR";
    JournalLineSchemasValue["Mvr"] = "MVR";
    JournalLineSchemasValue["Mwk"] = "MWK";
    JournalLineSchemasValue["Mxn"] = "MXN";
    JournalLineSchemasValue["Myr"] = "MYR";
    JournalLineSchemasValue["Mzn"] = "MZN";
    JournalLineSchemasValue["Nad"] = "NAD";
    JournalLineSchemasValue["Ngn"] = "NGN";
    JournalLineSchemasValue["Nio"] = "NIO";
    JournalLineSchemasValue["Nok"] = "NOK";
    JournalLineSchemasValue["Npr"] = "NPR";
    JournalLineSchemasValue["Nzd"] = "NZD";
    JournalLineSchemasValue["Omr"] = "OMR";
    JournalLineSchemasValue["Pab"] = "PAB";
    JournalLineSchemasValue["Pen"] = "PEN";
    JournalLineSchemasValue["Pgk"] = "PGK";
    JournalLineSchemasValue["Php"] = "PHP";
    JournalLineSchemasValue["Pkr"] = "PKR";
    JournalLineSchemasValue["Pln"] = "PLN";
    JournalLineSchemasValue["Pyg"] = "PYG";
    JournalLineSchemasValue["Qar"] = "QAR";
    JournalLineSchemasValue["Ron"] = "RON";
    JournalLineSchemasValue["Rsd"] = "RSD";
    JournalLineSchemasValue["Rub"] = "RUB";
    JournalLineSchemasValue["Rwf"] = "RWF";
    JournalLineSchemasValue["Sar"] = "SAR";
    JournalLineSchemasValue["Sbd"] = "SBD";
    JournalLineSchemasValue["Scr"] = "SCR";
    JournalLineSchemasValue["Sdg"] = "SDG";
    JournalLineSchemasValue["Sek"] = "SEK";
    JournalLineSchemasValue["Sgd"] = "SGD";
    JournalLineSchemasValue["Shp"] = "SHP";
    JournalLineSchemasValue["Sll"] = "SLL";
    JournalLineSchemasValue["Sos"] = "SOS";
    JournalLineSchemasValue["Srd"] = "SRD";
    JournalLineSchemasValue["Ssp"] = "SSP";
    JournalLineSchemasValue["Stn"] = "STN";
    JournalLineSchemasValue["Syp"] = "SYP";
    JournalLineSchemasValue["Szl"] = "SZL";
    JournalLineSchemasValue["Thb"] = "THB";
    JournalLineSchemasValue["Tjs"] = "TJS";
    JournalLineSchemasValue["Tmt"] = "TMT";
    JournalLineSchemasValue["Tnd"] = "TND";
    JournalLineSchemasValue["Top"] = "TOP";
    JournalLineSchemasValue["Try"] = "TRY";
    JournalLineSchemasValue["Ttd"] = "TTD";
    JournalLineSchemasValue["Twd"] = "TWD";
    JournalLineSchemasValue["Tzs"] = "TZS";
    JournalLineSchemasValue["Uah"] = "UAH";
    JournalLineSchemasValue["Ugx"] = "UGX";
    JournalLineSchemasValue["Usd"] = "USD";
    JournalLineSchemasValue["Uyu"] = "UYU";
    JournalLineSchemasValue["Uzs"] = "UZS";
    JournalLineSchemasValue["Ves"] = "VES";
    JournalLineSchemasValue["Vnd"] = "VND";
    JournalLineSchemasValue["Vuv"] = "VUV";
    JournalLineSchemasValue["Wst"] = "WST";
    JournalLineSchemasValue["Xaf"] = "XAF";
    JournalLineSchemasValue["Xcd"] = "XCD";
    JournalLineSchemasValue["Xdr"] = "XDR";
    JournalLineSchemasValue["Xof"] = "XOF";
    JournalLineSchemasValue["Xpf"] = "XPF";
    JournalLineSchemasValue["Yer"] = "YER";
    JournalLineSchemasValue["Zar"] = "ZAR";
    JournalLineSchemasValue["Zmw"] = "ZMW";
    JournalLineSchemasValue["Zwl"] = "ZWL";
    JournalLineSchemasValue["UnmappedValue"] = "unmapped_value";
})(JournalLineSchemasValue || (exports.JournalLineSchemasValue = JournalLineSchemasValue = {}));
/** @internal */
exports.JournalLine4$inboundSchema = z.object({});
function journalLine4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLine4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLine4' from JSON`);
}
/** @internal */
exports.JournalLineSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.JournalLine4$inboundSchema),
    z.array(z.any()),
]);
function journalLineSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLineSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLineSourceValue' from JSON`);
}
/** @internal */
exports.JournalLineValue$inboundSchema = openEnums.inboundSchema(JournalLineValue);
/** @internal */
exports.JournalLineAccountType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.JournalLine4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.JournalLineValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function journalLineAccountTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLineAccountType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLineAccountType' from JSON`);
}
/** @internal */
exports.JournalLineSchemas4$inboundSchema = z.object({});
function journalLineSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLineSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLineSchemas4' from JSON`);
}
/** @internal */
exports.JournalLineSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.JournalLineSchemas4$inboundSchema),
    z.array(z.any()),
]);
function journalLineSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLineSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLineSchemasSourceValue' from JSON`);
}
/** @internal */
exports.JournalLineSchemasValue$inboundSchema = openEnums.inboundSchema(JournalLineSchemasValue);
/** @internal */
exports.JournalLineCurrencyCode$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.JournalLineSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.JournalLineSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function journalLineCurrencyCodeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLineCurrencyCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLineCurrencyCode' from JSON`);
}
/** @internal */
exports.JournalLine$inboundSchema = z.object({
    account_id: z.nullable(z.string()).optional(),
    account_type: z.nullable(z.lazy(() => exports.JournalLineAccountType$inboundSchema))
        .optional(),
    amount: z.nullable(z.number()).optional(),
    currency_code: z.nullable(z.lazy(() => exports.JournalLineCurrencyCode$inboundSchema))
        .optional(),
    description: z.nullable(z.string()).optional(),
    exchange_rate: z.nullable(z.number()).optional(),
    id: z.nullable(z.string()).optional(),
    tax_amount: z.nullable(z.number()).optional(),
    tax_rate_percentage: z.nullable(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
        "account_type": "accountType",
        "currency_code": "currencyCode",
        "exchange_rate": "exchangeRate",
        "tax_amount": "taxAmount",
        "tax_rate_percentage": "taxRatePercentage",
    });
});
function journalLineFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JournalLine$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JournalLine' from JSON`);
}
//# sourceMappingURL=journalline.js.map