"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.ClearingCode$ = exports.ClearingCode$outboundSchema = exports.ClearingCode$inboundSchema = exports.ClearingCodeType$ = exports.ClearingCodeType$outboundSchema = exports.ClearingCodeType$inboundSchema = exports.ClearingCodeValue$ = exports.ClearingCodeValue$outboundSchema = exports.ClearingCodeValue$inboundSchema = exports.ClearingCodeSourceValue$ = exports.ClearingCodeSourceValue$outboundSchema = exports.ClearingCodeSourceValue$inboundSchema = exports.ClearingCode4$ = exports.ClearingCode4$outboundSchema = exports.ClearingCode4$inboundSchema = exports.ClearingCodeValue = void 0;
exports.clearingCode4ToJSON = clearingCode4ToJSON;
exports.clearingCode4FromJSON = clearingCode4FromJSON;
exports.clearingCodeSourceValueToJSON = clearingCodeSourceValueToJSON;
exports.clearingCodeSourceValueFromJSON = clearingCodeSourceValueFromJSON;
exports.clearingCodeTypeToJSON = clearingCodeTypeToJSON;
exports.clearingCodeTypeFromJSON = clearingCodeTypeFromJSON;
exports.clearingCodeToJSON = clearingCodeToJSON;
exports.clearingCodeFromJSON = clearingCodeFromJSON;
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");
/**
 * The type of clearing code
 */
var ClearingCodeValue;
(function (ClearingCodeValue) {
    ClearingCodeValue["SortCode"] = "sort_code";
    ClearingCodeValue["BuildingSocietyReference"] = "building_society_reference";
    ClearingCodeValue["AbaRouting"] = "aba_routing";
    ClearingCodeValue["ChipsParticipantId"] = "chips_participant_id";
    ClearingCodeValue["TransitNumber"] = "transit_number";
    ClearingCodeValue["InstitutionNumber"] = "institution_number";
    ClearingCodeValue["BsbCode"] = "bsb_code";
    ClearingCodeValue["IfscCode"] = "ifsc_code";
    ClearingCodeValue["MicrCode"] = "micr_code";
    ClearingCodeValue["Clabe"] = "clabe";
    ClearingCodeValue["CnapsCode"] = "cnaps_code";
    ClearingCodeValue["ChBankClearingCode"] = "ch_bank_clearing_code";
    ClearingCodeValue["ChSicCode"] = "ch_sic_code";
    ClearingCodeValue["ZenginCode"] = "zengin_code";
    ClearingCodeValue["NzClearingCode"] = "nz_clearing_code";
    ClearingCodeValue["HkBankCode"] = "hk_bank_code";
    ClearingCodeValue["Blz"] = "blz";
    ClearingCodeValue["AtBankleitzahl"] = "at_bankleitzahl";
    ClearingCodeValue["Nuban"] = "nuban";
    ClearingCodeValue["SeBankgiroCode"] = "se_bankgiro_code";
    ClearingCodeValue["UnmappedValue"] = "unmapped_value";
})(ClearingCodeValue || (exports.ClearingCodeValue = ClearingCodeValue = {}));
/** @internal */
exports.ClearingCode4$inboundSchema = z.object({});
/** @internal */
exports.ClearingCode4$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 ClearingCode4$;
(function (ClearingCode4$) {
    /** @deprecated use `ClearingCode4$inboundSchema` instead. */
    ClearingCode4$.inboundSchema = exports.ClearingCode4$inboundSchema;
    /** @deprecated use `ClearingCode4$outboundSchema` instead. */
    ClearingCode4$.outboundSchema = exports.ClearingCode4$outboundSchema;
})(ClearingCode4$ || (exports.ClearingCode4$ = ClearingCode4$ = {}));
function clearingCode4ToJSON(clearingCode4) {
    return JSON.stringify(exports.ClearingCode4$outboundSchema.parse(clearingCode4));
}
function clearingCode4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClearingCode4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClearingCode4' from JSON`);
}
/** @internal */
exports.ClearingCodeSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.ClearingCode4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.ClearingCodeSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.ClearingCode4$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 ClearingCodeSourceValue$;
(function (ClearingCodeSourceValue$) {
    /** @deprecated use `ClearingCodeSourceValue$inboundSchema` instead. */
    ClearingCodeSourceValue$.inboundSchema = exports.ClearingCodeSourceValue$inboundSchema;
    /** @deprecated use `ClearingCodeSourceValue$outboundSchema` instead. */
    ClearingCodeSourceValue$.outboundSchema = exports.ClearingCodeSourceValue$outboundSchema;
})(ClearingCodeSourceValue$ || (exports.ClearingCodeSourceValue$ = ClearingCodeSourceValue$ = {}));
function clearingCodeSourceValueToJSON(clearingCodeSourceValue) {
    return JSON.stringify(exports.ClearingCodeSourceValue$outboundSchema.parse(clearingCodeSourceValue));
}
function clearingCodeSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClearingCodeSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClearingCodeSourceValue' from JSON`);
}
/** @internal */
exports.ClearingCodeValue$inboundSchema = z
    .union([
    z.nativeEnum(ClearingCodeValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.ClearingCodeValue$outboundSchema = z.union([
    z.nativeEnum(ClearingCodeValue),
    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 ClearingCodeValue$;
(function (ClearingCodeValue$) {
    /** @deprecated use `ClearingCodeValue$inboundSchema` instead. */
    ClearingCodeValue$.inboundSchema = exports.ClearingCodeValue$inboundSchema;
    /** @deprecated use `ClearingCodeValue$outboundSchema` instead. */
    ClearingCodeValue$.outboundSchema = exports.ClearingCodeValue$outboundSchema;
})(ClearingCodeValue$ || (exports.ClearingCodeValue$ = ClearingCodeValue$ = {}));
/** @internal */
exports.ClearingCodeType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.ClearingCode4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ClearingCodeValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.ClearingCodeType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.ClearingCode4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ClearingCodeValue$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 ClearingCodeType$;
(function (ClearingCodeType$) {
    /** @deprecated use `ClearingCodeType$inboundSchema` instead. */
    ClearingCodeType$.inboundSchema = exports.ClearingCodeType$inboundSchema;
    /** @deprecated use `ClearingCodeType$outboundSchema` instead. */
    ClearingCodeType$.outboundSchema = exports.ClearingCodeType$outboundSchema;
})(ClearingCodeType$ || (exports.ClearingCodeType$ = ClearingCodeType$ = {}));
function clearingCodeTypeToJSON(clearingCodeType) {
    return JSON.stringify(exports.ClearingCodeType$outboundSchema.parse(clearingCodeType));
}
function clearingCodeTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClearingCodeType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClearingCodeType' from JSON`);
}
/** @internal */
exports.ClearingCode$inboundSchema = z.object({
    type: z.nullable(z.lazy(() => exports.ClearingCodeType$inboundSchema)).optional(),
    value: z.nullable(z.string()).optional(),
});
/** @internal */
exports.ClearingCode$outboundSchema = z.object({
    type: z.nullable(z.lazy(() => exports.ClearingCodeType$outboundSchema)).optional(),
    value: z.nullable(z.string()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ClearingCode$;
(function (ClearingCode$) {
    /** @deprecated use `ClearingCode$inboundSchema` instead. */
    ClearingCode$.inboundSchema = exports.ClearingCode$inboundSchema;
    /** @deprecated use `ClearingCode$outboundSchema` instead. */
    ClearingCode$.outboundSchema = exports.ClearingCode$outboundSchema;
})(ClearingCode$ || (exports.ClearingCode$ = ClearingCode$ = {}));
function clearingCodeToJSON(clearingCode) {
    return JSON.stringify(exports.ClearingCode$outboundSchema.parse(clearingCode));
}
function clearingCodeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClearingCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClearingCode' from JSON`);
}
//# sourceMappingURL=clearingcode.js.map