"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.PaymentInput$outboundSchema = void 0;
exports.paymentInputToJSON = paymentInputToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const allocation_js_1 = require("./allocation.js");
const currency_js_1 = require("./currency.js");
const customfield_js_1 = require("./customfield.js");
const deprecatedlinkedsupplierinput_js_1 = require("./deprecatedlinkedsupplierinput.js");
const linkedcustomerinput_js_1 = require("./linkedcustomerinput.js");
const linkedledgeraccount_js_1 = require("./linkedledgeraccount.js");
const linkedtrackingcategory_js_1 = require("./linkedtrackingcategory.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
const paymentstatus_js_1 = require("./paymentstatus.js");
const paymenttype_js_1 = require("./paymenttype.js");
/** @internal */
exports.PaymentInput$outboundSchema = z.object({
    currency: z.nullable(currency_js_1.Currency$outboundSchema).optional(),
    currencyRate: z.nullable(z.number()).optional(),
    totalAmount: z.nullable(z.number()),
    reference: z.nullable(z.string()).optional(),
    paymentMethod: z.nullable(z.string()).optional(),
    paymentMethodReference: z.nullable(z.string()).optional(),
    paymentMethodId: z.nullable(z.string()).optional(),
    accountsReceivableAccountType: z.nullable(z.string()).optional(),
    accountsReceivableAccountId: z.nullable(z.string()).optional(),
    account: z.nullable(linkedledgeraccount_js_1.LinkedLedgerAccount$outboundSchema).optional(),
    transactionDate: z.nullable(z.date().transform(v => v.toISOString())),
    customer: z.nullable(linkedcustomerinput_js_1.LinkedCustomerInput$outboundSchema).optional(),
    supplier: z.nullable(deprecatedlinkedsupplierinput_js_1.DeprecatedLinkedSupplierInput$outboundSchema).optional(),
    companyId: z.nullable(z.string()).optional(),
    reconciled: z.nullable(z.boolean()).optional(),
    status: paymentstatus_js_1.PaymentStatus$outboundSchema.optional(),
    type: paymenttype_js_1.PaymentType$outboundSchema.optional(),
    allocations: z.array(allocation_js_1.AllocationInput$outboundSchema).optional(),
    note: z.nullable(z.string()).optional(),
    number: z.nullable(z.string()).optional(),
    trackingCategories: z.nullable(z.array(z.nullable(linkedtrackingcategory_js_1.LinkedTrackingCategory$outboundSchema))).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
    rowVersion: z.nullable(z.string()).optional(),
    displayId: z.nullable(z.string()).optional(),
    passThrough: z.array(passthroughbody_js_1.PassThroughBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        currencyRate: "currency_rate",
        totalAmount: "total_amount",
        paymentMethod: "payment_method",
        paymentMethodReference: "payment_method_reference",
        paymentMethodId: "payment_method_id",
        accountsReceivableAccountType: "accounts_receivable_account_type",
        accountsReceivableAccountId: "accounts_receivable_account_id",
        transactionDate: "transaction_date",
        companyId: "company_id",
        trackingCategories: "tracking_categories",
        customFields: "custom_fields",
        rowVersion: "row_version",
        displayId: "display_id",
        passThrough: "pass_through",
    });
});
function paymentInputToJSON(paymentInput) {
    return JSON.stringify(exports.PaymentInput$outboundSchema.parse(paymentInput));
}
//# sourceMappingURL=paymentinput.js.map