"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.Address$outboundSchema = exports.Address$inboundSchema = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.Type = void 0;
exports.addressToJSON = addressToJSON;
exports.addressFromJSON = addressFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The type of address.
 */
exports.Type = {
    Primary: "primary",
    Secondary: "secondary",
    Home: "home",
    Office: "office",
    Shipping: "shipping",
    Billing: "billing",
    Work: "work",
    Other: "other",
};
/** @internal */
exports.Type$inboundSchema = z.nativeEnum(exports.Type);
/** @internal */
exports.Type$outboundSchema = exports.Type$inboundSchema;
/** @internal */
exports.Address$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    type: z.nullable(exports.Type$inboundSchema).optional(),
    string: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    line1: z.nullable(z.string()).optional(),
    line2: z.nullable(z.string()).optional(),
    line3: z.nullable(z.string()).optional(),
    line4: z.nullable(z.string()).optional(),
    line5: z.nullable(z.string()).optional(),
    street_number: z.nullable(z.string()).optional(),
    city: z.nullable(z.string()).optional(),
    state: z.nullable(z.string()).optional(),
    postal_code: z.nullable(z.string()).optional(),
    country: z.nullable(z.string()).optional(),
    latitude: z.nullable(z.string()).optional(),
    longitude: z.nullable(z.string()).optional(),
    county: z.nullable(z.string()).optional(),
    contact_name: z.nullable(z.string()).optional(),
    salutation: z.nullable(z.string()).optional(),
    phone_number: z.nullable(z.string()).optional(),
    fax: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    website: z.nullable(z.string()).optional(),
    notes: z.nullable(z.string()).optional(),
    row_version: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "street_number": "streetNumber",
        "postal_code": "postalCode",
        "contact_name": "contactName",
        "phone_number": "phoneNumber",
        "row_version": "rowVersion",
    });
});
/** @internal */
exports.Address$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    type: z.nullable(exports.Type$outboundSchema).optional(),
    string: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    line1: z.nullable(z.string()).optional(),
    line2: z.nullable(z.string()).optional(),
    line3: z.nullable(z.string()).optional(),
    line4: z.nullable(z.string()).optional(),
    line5: z.nullable(z.string()).optional(),
    streetNumber: z.nullable(z.string()).optional(),
    city: z.nullable(z.string()).optional(),
    state: z.nullable(z.string()).optional(),
    postalCode: z.nullable(z.string()).optional(),
    country: z.nullable(z.string()).optional(),
    latitude: z.nullable(z.string()).optional(),
    longitude: z.nullable(z.string()).optional(),
    county: z.nullable(z.string()).optional(),
    contactName: z.nullable(z.string()).optional(),
    salutation: z.nullable(z.string()).optional(),
    phoneNumber: z.nullable(z.string()).optional(),
    fax: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    website: z.nullable(z.string()).optional(),
    notes: z.nullable(z.string()).optional(),
    rowVersion: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        streetNumber: "street_number",
        postalCode: "postal_code",
        contactName: "contact_name",
        phoneNumber: "phone_number",
        rowVersion: "row_version",
    });
});
function addressToJSON(address) {
    return JSON.stringify(exports.Address$outboundSchema.parse(address));
}
function addressFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Address$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Address' from JSON`);
}
//# sourceMappingURL=address.js.map