"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.AccountingAccountResult$ = exports.AccountingAccountResult$outboundSchema = exports.AccountingAccountResult$inboundSchema = exports.Data$ = exports.Data$outboundSchema = exports.Data$inboundSchema = exports.AccountingAccountResultType$ = exports.AccountingAccountResultType$outboundSchema = exports.AccountingAccountResultType$inboundSchema = exports.AccountingAccountResultValue$ = exports.AccountingAccountResultValue$outboundSchema = exports.AccountingAccountResultValue$inboundSchema = exports.AccountingAccountResultSourceValue$ = exports.AccountingAccountResultSourceValue$outboundSchema = exports.AccountingAccountResultSourceValue$inboundSchema = exports.AccountingAccountResult4$ = exports.AccountingAccountResult4$outboundSchema = exports.AccountingAccountResult4$inboundSchema = exports.AccountingAccountResultActive$ = exports.AccountingAccountResultActive$outboundSchema = exports.AccountingAccountResultActive$inboundSchema = exports.AccountingAccountResult2$ = exports.AccountingAccountResult2$outboundSchema = exports.AccountingAccountResult2$inboundSchema = exports.AccountingAccountResultValue = exports.AccountingAccountResult2 = void 0;
exports.accountingAccountResultActiveToJSON = accountingAccountResultActiveToJSON;
exports.accountingAccountResultActiveFromJSON = accountingAccountResultActiveFromJSON;
exports.accountingAccountResult4ToJSON = accountingAccountResult4ToJSON;
exports.accountingAccountResult4FromJSON = accountingAccountResult4FromJSON;
exports.accountingAccountResultSourceValueToJSON = accountingAccountResultSourceValueToJSON;
exports.accountingAccountResultSourceValueFromJSON = accountingAccountResultSourceValueFromJSON;
exports.accountingAccountResultTypeToJSON = accountingAccountResultTypeToJSON;
exports.accountingAccountResultTypeFromJSON = accountingAccountResultTypeFromJSON;
exports.dataToJSON = dataToJSON;
exports.dataFromJSON = dataFromJSON;
exports.accountingAccountResultToJSON = accountingAccountResultToJSON;
exports.accountingAccountResultFromJSON = accountingAccountResultFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const enums_js_1 = require("../../types/enums.js");
const rawresponse_js_1 = require("./rawresponse.js");
var AccountingAccountResult2;
(function (AccountingAccountResult2) {
    AccountingAccountResult2["True"] = "true";
    AccountingAccountResult2["False"] = "false";
})(AccountingAccountResult2 || (exports.AccountingAccountResult2 = AccountingAccountResult2 = {}));
/**
 * Type of account
 */
var AccountingAccountResultValue;
(function (AccountingAccountResultValue) {
    AccountingAccountResultValue["Asset"] = "asset";
    AccountingAccountResultValue["Liability"] = "liability";
    AccountingAccountResultValue["Equity"] = "equity";
    AccountingAccountResultValue["Revenue"] = "revenue";
    AccountingAccountResultValue["Expense"] = "expense";
    AccountingAccountResultValue["UnmappedValue"] = "unmapped_value";
})(AccountingAccountResultValue || (exports.AccountingAccountResultValue = AccountingAccountResultValue = {}));
/** @internal */
exports.AccountingAccountResult2$inboundSchema = z.nativeEnum(AccountingAccountResult2);
/** @internal */
exports.AccountingAccountResult2$outboundSchema = exports.AccountingAccountResult2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResult2$;
(function (AccountingAccountResult2$) {
    /** @deprecated use `AccountingAccountResult2$inboundSchema` instead. */
    AccountingAccountResult2$.inboundSchema = exports.AccountingAccountResult2$inboundSchema;
    /** @deprecated use `AccountingAccountResult2$outboundSchema` instead. */
    AccountingAccountResult2$.outboundSchema = exports.AccountingAccountResult2$outboundSchema;
})(AccountingAccountResult2$ || (exports.AccountingAccountResult2$ = AccountingAccountResult2$ = {}));
/** @internal */
exports.AccountingAccountResultActive$inboundSchema = z.union([z.boolean(), exports.AccountingAccountResult2$inboundSchema]);
/** @internal */
exports.AccountingAccountResultActive$outboundSchema = z.union([z.boolean(), exports.AccountingAccountResult2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResultActive$;
(function (AccountingAccountResultActive$) {
    /** @deprecated use `AccountingAccountResultActive$inboundSchema` instead. */
    AccountingAccountResultActive$.inboundSchema = exports.AccountingAccountResultActive$inboundSchema;
    /** @deprecated use `AccountingAccountResultActive$outboundSchema` instead. */
    AccountingAccountResultActive$.outboundSchema = exports.AccountingAccountResultActive$outboundSchema;
})(AccountingAccountResultActive$ || (exports.AccountingAccountResultActive$ = AccountingAccountResultActive$ = {}));
function accountingAccountResultActiveToJSON(accountingAccountResultActive) {
    return JSON.stringify(exports.AccountingAccountResultActive$outboundSchema.parse(accountingAccountResultActive));
}
function accountingAccountResultActiveFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingAccountResultActive$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAccountResultActive' from JSON`);
}
/** @internal */
exports.AccountingAccountResult4$inboundSchema = z.object({});
/** @internal */
exports.AccountingAccountResult4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResult4$;
(function (AccountingAccountResult4$) {
    /** @deprecated use `AccountingAccountResult4$inboundSchema` instead. */
    AccountingAccountResult4$.inboundSchema = exports.AccountingAccountResult4$inboundSchema;
    /** @deprecated use `AccountingAccountResult4$outboundSchema` instead. */
    AccountingAccountResult4$.outboundSchema = exports.AccountingAccountResult4$outboundSchema;
})(AccountingAccountResult4$ || (exports.AccountingAccountResult4$ = AccountingAccountResult4$ = {}));
function accountingAccountResult4ToJSON(accountingAccountResult4) {
    return JSON.stringify(exports.AccountingAccountResult4$outboundSchema.parse(accountingAccountResult4));
}
function accountingAccountResult4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingAccountResult4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAccountResult4' from JSON`);
}
/** @internal */
exports.AccountingAccountResultSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.AccountingAccountResult4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.AccountingAccountResultSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.AccountingAccountResult4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResultSourceValue$;
(function (AccountingAccountResultSourceValue$) {
    /** @deprecated use `AccountingAccountResultSourceValue$inboundSchema` instead. */
    AccountingAccountResultSourceValue$.inboundSchema = exports.AccountingAccountResultSourceValue$inboundSchema;
    /** @deprecated use `AccountingAccountResultSourceValue$outboundSchema` instead. */
    AccountingAccountResultSourceValue$.outboundSchema = exports.AccountingAccountResultSourceValue$outboundSchema;
})(AccountingAccountResultSourceValue$ || (exports.AccountingAccountResultSourceValue$ = AccountingAccountResultSourceValue$ = {}));
function accountingAccountResultSourceValueToJSON(accountingAccountResultSourceValue) {
    return JSON.stringify(exports.AccountingAccountResultSourceValue$outboundSchema.parse(accountingAccountResultSourceValue));
}
function accountingAccountResultSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingAccountResultSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAccountResultSourceValue' from JSON`);
}
/** @internal */
exports.AccountingAccountResultValue$inboundSchema = z
    .union([
    z.nativeEnum(AccountingAccountResultValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.AccountingAccountResultValue$outboundSchema = z.union([
    z.nativeEnum(AccountingAccountResultValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResultValue$;
(function (AccountingAccountResultValue$) {
    /** @deprecated use `AccountingAccountResultValue$inboundSchema` instead. */
    AccountingAccountResultValue$.inboundSchema = exports.AccountingAccountResultValue$inboundSchema;
    /** @deprecated use `AccountingAccountResultValue$outboundSchema` instead. */
    AccountingAccountResultValue$.outboundSchema = exports.AccountingAccountResultValue$outboundSchema;
})(AccountingAccountResultValue$ || (exports.AccountingAccountResultValue$ = AccountingAccountResultValue$ = {}));
/** @internal */
exports.AccountingAccountResultType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.AccountingAccountResult4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AccountingAccountResultValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.AccountingAccountResultType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.AccountingAccountResult4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AccountingAccountResultValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResultType$;
(function (AccountingAccountResultType$) {
    /** @deprecated use `AccountingAccountResultType$inboundSchema` instead. */
    AccountingAccountResultType$.inboundSchema = exports.AccountingAccountResultType$inboundSchema;
    /** @deprecated use `AccountingAccountResultType$outboundSchema` instead. */
    AccountingAccountResultType$.outboundSchema = exports.AccountingAccountResultType$outboundSchema;
})(AccountingAccountResultType$ || (exports.AccountingAccountResultType$ = AccountingAccountResultType$ = {}));
function accountingAccountResultTypeToJSON(accountingAccountResultType) {
    return JSON.stringify(exports.AccountingAccountResultType$outboundSchema.parse(accountingAccountResultType));
}
function accountingAccountResultTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingAccountResultType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAccountResultType' from JSON`);
}
/** @internal */
exports.Data$inboundSchema = z
    .object({
    active: z.nullable(z.union([z.boolean(), exports.AccountingAccountResult2$inboundSchema])).optional(),
    code: z.nullable(z.string()).optional(),
    company_id: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.AccountingAccountResultType$inboundSchema))
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "company_id": "companyId",
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.Data$outboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.AccountingAccountResult2$outboundSchema])).optional(),
    code: z.nullable(z.string()).optional(),
    companyId: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.AccountingAccountResultType$outboundSchema))
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        companyId: "company_id",
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Data$;
(function (Data$) {
    /** @deprecated use `Data$inboundSchema` instead. */
    Data$.inboundSchema = exports.Data$inboundSchema;
    /** @deprecated use `Data$outboundSchema` instead. */
    Data$.outboundSchema = exports.Data$outboundSchema;
})(Data$ || (exports.Data$ = Data$ = {}));
function dataToJSON(data) {
    return JSON.stringify(exports.Data$outboundSchema.parse(data));
}
function dataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
}
/** @internal */
exports.AccountingAccountResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.Data$inboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
/** @internal */
exports.AccountingAccountResult$outboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.Data$outboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AccountingAccountResult$;
(function (AccountingAccountResult$) {
    /** @deprecated use `AccountingAccountResult$inboundSchema` instead. */
    AccountingAccountResult$.inboundSchema = exports.AccountingAccountResult$inboundSchema;
    /** @deprecated use `AccountingAccountResult$outboundSchema` instead. */
    AccountingAccountResult$.outboundSchema = exports.AccountingAccountResult$outboundSchema;
})(AccountingAccountResult$ || (exports.AccountingAccountResult$ = AccountingAccountResult$ = {}));
function accountingAccountResultToJSON(accountingAccountResult) {
    return JSON.stringify(exports.AccountingAccountResult$outboundSchema.parse(accountingAccountResult));
}
function accountingAccountResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountingAccountResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAccountResult' from JSON`);
}
//# sourceMappingURL=accountingaccountresult.js.map