"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.BankFeedAccountInput$outboundSchema = exports.BankFeedAccount$inboundSchema = exports.FeedStatus$outboundSchema = exports.FeedStatus$inboundSchema = exports.BankAccountType$outboundSchema = exports.BankAccountType$inboundSchema = exports.FeedStatus = exports.BankAccountType = void 0;
exports.bankFeedAccountFromJSON = bankFeedAccountFromJSON;
exports.bankFeedAccountInputToJSON = bankFeedAccountInputToJSON;
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");
/**
 * Type of the bank account.
 */
exports.BankAccountType = {
    Bank: "bank",
    CreditCard: "credit_card",
};
/**
 * Current status of the bank feed.
 */
exports.FeedStatus = {
    Pending: "pending",
    Rejected: "rejected",
};
/** @internal */
exports.BankAccountType$inboundSchema = z.nativeEnum(exports.BankAccountType);
/** @internal */
exports.BankAccountType$outboundSchema = exports.BankAccountType$inboundSchema;
/** @internal */
exports.FeedStatus$inboundSchema = z
    .nativeEnum(exports.FeedStatus);
/** @internal */
exports.FeedStatus$outboundSchema = exports.FeedStatus$inboundSchema;
/** @internal */
exports.BankFeedAccount$inboundSchema = z.object({
    id: z.string(),
    bank_account_type: exports.BankAccountType$inboundSchema.optional(),
    source_account_id: z.string().optional(),
    target_account_id: z.string().optional(),
    target_account_name: z.string().optional(),
    target_account_number: z.string().optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    feed_status: exports.FeedStatus$inboundSchema.optional(),
    country: 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(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "bank_account_type": "bankAccountType",
        "source_account_id": "sourceAccountId",
        "target_account_id": "targetAccountId",
        "target_account_name": "targetAccountName",
        "target_account_number": "targetAccountNumber",
        "feed_status": "feedStatus",
        "custom_fields": "customFields",
        "custom_mappings": "customMappings",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
    });
});
function bankFeedAccountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BankFeedAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BankFeedAccount' from JSON`);
}
/** @internal */
exports.BankFeedAccountInput$outboundSchema = z.object({
    bankAccountType: exports.BankAccountType$outboundSchema.optional(),
    sourceAccountId: z.string().optional(),
    targetAccountId: z.string().optional(),
    targetAccountName: z.string().optional(),
    targetAccountNumber: z.string().optional(),
    currency: z.nullable(currency_js_1.Currency$outboundSchema).optional(),
    feedStatus: exports.FeedStatus$outboundSchema.optional(),
    country: z.nullable(z.string()).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        bankAccountType: "bank_account_type",
        sourceAccountId: "source_account_id",
        targetAccountId: "target_account_id",
        targetAccountName: "target_account_name",
        targetAccountNumber: "target_account_number",
        feedStatus: "feed_status",
        customFields: "custom_fields",
    });
});
function bankFeedAccountInputToJSON(bankFeedAccountInput) {
    return JSON.stringify(exports.BankFeedAccountInput$outboundSchema.parse(bankFeedAccountInput));
}
//# sourceMappingURL=bankfeedaccount.js.map