"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.BalanceSheet$inboundSchema = exports.Reports$inboundSchema = exports.BalanceSheetUncategorizedItemsAccount$inboundSchema = exports.BalanceSheetEquityAccount$inboundSchema = exports.BalanceSheetLiabilitiesAccount$inboundSchema = exports.BalanceSheetAssetsAccount$inboundSchema = void 0;
exports.balanceSheetAssetsAccountFromJSON = balanceSheetAssetsAccountFromJSON;
exports.balanceSheetLiabilitiesAccountFromJSON = balanceSheetLiabilitiesAccountFromJSON;
exports.balanceSheetEquityAccountFromJSON = balanceSheetEquityAccountFromJSON;
exports.balanceSheetUncategorizedItemsAccountFromJSON = balanceSheetUncategorizedItemsAccountFromJSON;
exports.reportsFromJSON = reportsFromJSON;
exports.balanceSheetFromJSON = balanceSheetFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const currency_js_1 = require("./currency.js");
/** @internal */
exports.BalanceSheetAssetsAccount$inboundSchema = z.object({
    account_id: z.string().optional(),
    code: z.string().optional(),
    name: z.string().optional(),
    value: z.number().optional(),
    items: z.any().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
    });
});
function balanceSheetAssetsAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceSheetAssetsAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceSheetAssetsAccount' from JSON`);
}
/** @internal */
exports.BalanceSheetLiabilitiesAccount$inboundSchema = z.object({
    account_id: z.string().optional(),
    code: z.string().optional(),
    name: z.string().optional(),
    value: z.number().optional(),
    items: z.any().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
    });
});
function balanceSheetLiabilitiesAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceSheetLiabilitiesAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceSheetLiabilitiesAccount' from JSON`);
}
/** @internal */
exports.BalanceSheetEquityAccount$inboundSchema = z.object({
    account_id: z.string().optional(),
    code: z.string().optional(),
    name: z.string().optional(),
    value: z.number().optional(),
    items: z.any().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
    });
});
function balanceSheetEquityAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceSheetEquityAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceSheetEquityAccount' from JSON`);
}
/** @internal */
exports.BalanceSheetUncategorizedItemsAccount$inboundSchema = z.object({
    account_id: z.string().optional(),
    code: z.string().optional(),
    name: z.string().optional(),
    value: z.number().optional(),
    items: z.any().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
    });
});
function balanceSheetUncategorizedItemsAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceSheetUncategorizedItemsAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceSheetUncategorizedItemsAccount' from JSON`);
}
/** @internal */
exports.Reports$inboundSchema = z.object({
    id: z.string().optional(),
    report_name: z.string().optional(),
    start_date: z.string().optional(),
    end_date: z.string(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    assets: z.lazy(() => exports.BalanceSheetAssetsAccount$inboundSchema),
    liabilities: z.lazy(() => exports.BalanceSheetLiabilitiesAccount$inboundSchema),
    equity: z.lazy(() => exports.BalanceSheetEquityAccount$inboundSchema),
    net_assets: z.number().optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    uncategorized_items: z.lazy(() => exports.BalanceSheetUncategorizedItemsAccount$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "report_name": "reportName",
        "start_date": "startDate",
        "end_date": "endDate",
        "net_assets": "netAssets",
        "custom_mappings": "customMappings",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "uncategorized_items": "uncategorizedItems",
    });
});
function reportsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Reports$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Reports' from JSON`);
}
/** @internal */
exports.BalanceSheet$inboundSchema = z.object({
    reports: z.array(z.lazy(() => exports.Reports$inboundSchema)),
});
function balanceSheetFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceSheet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceSheet' from JSON`);
}
//# sourceMappingURL=balancesheet.js.map