"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.AccountingBankAccountInput$outboundSchema = exports.AccountingBankAccount$inboundSchema = exports.AccountingBankAccountStatus$outboundSchema = exports.AccountingBankAccountStatus$inboundSchema = exports.AccountingBankAccountAccountType$outboundSchema = exports.AccountingBankAccountAccountType$inboundSchema = exports.AccountingBankAccountStatus = exports.AccountingBankAccountAccountType = void 0;
exports.accountingBankAccountFromJSON = accountingBankAccountFromJSON;
exports.accountingBankAccountInputToJSON = accountingBankAccountInputToJSON;
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");
const customfield_js_1 = require("./customfield.js");
const linkedledgeraccount_js_1 = require("./linkedledgeraccount.js");
/**
 * The type of bank account
 */
exports.AccountingBankAccountAccountType = {
    Checking: "checking",
    Savings: "savings",
    CreditCard: "credit_card",
    MoneyMarket: "money_market",
    LineOfCredit: "line_of_credit",
    Other: "other",
    Cash: "cash",
};
/**
 * The status of the bank account
 */
exports.AccountingBankAccountStatus = {
    Active: "active",
    Inactive: "inactive",
    Closed: "closed",
};
/** @internal */
exports.AccountingBankAccountAccountType$inboundSchema = z.nativeEnum(exports.AccountingBankAccountAccountType);
/** @internal */
exports.AccountingBankAccountAccountType$outboundSchema = exports.AccountingBankAccountAccountType$inboundSchema;
/** @internal */
exports.AccountingBankAccountStatus$inboundSchema = z.nativeEnum(exports.AccountingBankAccountStatus);
/** @internal */
exports.AccountingBankAccountStatus$outboundSchema = exports.AccountingBankAccountStatus$inboundSchema;
/** @internal */
exports.AccountingBankAccount$inboundSchema = z.object({
    id: z.string(),
    display_id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    account_number: z.nullable(z.string()).optional(),
    account_type: exports.AccountingBankAccountAccountType$inboundSchema.optional(),
    ledger_account: z.nullable(linkedledgeraccount_js_1.LinkedLedgerAccount$inboundSchema).optional(),
    bank_name: z.nullable(z.string()).optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    balance: z.nullable(z.number()).optional(),
    available_balance: z.nullable(z.number()).optional(),
    overdraft_limit: z.nullable(z.number()).optional(),
    routing_number: z.nullable(z.string()).optional(),
    iban: z.nullable(z.string()).optional(),
    bic: z.nullable(z.string()).optional(),
    bsb_number: z.nullable(z.string()).optional(),
    branch_identifier: z.nullable(z.string()).optional(),
    bank_code: z.nullable(z.string()).optional(),
    country: z.nullable(z.string()).optional(),
    status: z.nullable(exports.AccountingBankAccountStatus$inboundSchema).optional(),
    description: z.nullable(z.string()).optional(),
    custom_fields: z.array(customfield_js_1.CustomField$inboundSchema).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_by: z.nullable(z.string()).optional(),
    updated_by: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "display_id": "displayId",
        "account_number": "accountNumber",
        "account_type": "accountType",
        "ledger_account": "ledgerAccount",
        "bank_name": "bankName",
        "available_balance": "availableBalance",
        "overdraft_limit": "overdraftLimit",
        "routing_number": "routingNumber",
        "bsb_number": "bsbNumber",
        "branch_identifier": "branchIdentifier",
        "bank_code": "bankCode",
        "custom_fields": "customFields",
        "custom_mappings": "customMappings",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
        "created_by": "createdBy",
        "updated_by": "updatedBy",
    });
});
function accountingBankAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingBankAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBankAccount' from JSON`);
}
/** @internal */
exports.AccountingBankAccountInput$outboundSchema = z.object({
    displayId: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    accountNumber: z.nullable(z.string()).optional(),
    accountType: exports.AccountingBankAccountAccountType$outboundSchema.optional(),
    ledgerAccount: z.nullable(linkedledgeraccount_js_1.LinkedLedgerAccount$outboundSchema).optional(),
    bankName: z.nullable(z.string()).optional(),
    currency: z.nullable(currency_js_1.Currency$outboundSchema).optional(),
    balance: z.nullable(z.number()).optional(),
    availableBalance: z.nullable(z.number()).optional(),
    overdraftLimit: z.nullable(z.number()).optional(),
    routingNumber: z.nullable(z.string()).optional(),
    iban: z.nullable(z.string()).optional(),
    bic: z.nullable(z.string()).optional(),
    bsbNumber: z.nullable(z.string()).optional(),
    branchIdentifier: z.nullable(z.string()).optional(),
    bankCode: z.nullable(z.string()).optional(),
    country: z.nullable(z.string()).optional(),
    status: z.nullable(exports.AccountingBankAccountStatus$outboundSchema).optional(),
    description: z.nullable(z.string()).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayId: "display_id",
        accountNumber: "account_number",
        accountType: "account_type",
        ledgerAccount: "ledger_account",
        bankName: "bank_name",
        availableBalance: "available_balance",
        overdraftLimit: "overdraft_limit",
        routingNumber: "routing_number",
        bsbNumber: "bsb_number",
        branchIdentifier: "branch_identifier",
        bankCode: "bank_code",
        customFields: "custom_fields",
    });
});
function accountingBankAccountInputToJSON(accountingBankAccountInput) {
    return JSON.stringify(exports.AccountingBankAccountInput$outboundSchema.parse(accountingBankAccountInput));
}
//# sourceMappingURL=accountingbankaccount.js.map