"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.contactFromJSON = exports.contactToJSON = exports.Contact$ = exports.Contact$outboundSchema = exports.Contact$inboundSchema = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const customfields_js_1 = require("./customfields.js");
/** @internal */
exports.Contact$inboundSchema = z.object({
    account_ids: z.nullable(z.array(z.string())).optional(),
    company_name: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    custom_fields: z.nullable(z.array(customfields_js_1.CustomFields$inboundSchema)).optional(),
    deal_ids: z.nullable(z.array(z.string())).optional(),
    emails: z.nullable(z.array(z.string())).optional(),
    first_name: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    last_name: z.nullable(z.string()).optional(),
    phone_numbers: z.nullable(z.array(z.string())).optional(),
    remote_account_ids: z.nullable(z.array(z.string())).optional(),
    remote_deal_ids: z.nullable(z.array(z.string())).optional(),
    remote_id: z.nullable(z.string()).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_ids": "accountIds",
        "company_name": "companyName",
        "created_at": "createdAt",
        "custom_fields": "customFields",
        "deal_ids": "dealIds",
        "first_name": "firstName",
        "last_name": "lastName",
        "phone_numbers": "phoneNumbers",
        "remote_account_ids": "remoteAccountIds",
        "remote_deal_ids": "remoteDealIds",
        "remote_id": "remoteId",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.Contact$outboundSchema = z.object({
    accountIds: z.nullable(z.array(z.string())).optional(),
    companyName: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    customFields: z.nullable(z.array(customfields_js_1.CustomFields$outboundSchema)).optional(),
    dealIds: z.nullable(z.array(z.string())).optional(),
    emails: z.nullable(z.array(z.string())).optional(),
    firstName: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    phoneNumbers: z.nullable(z.array(z.string())).optional(),
    remoteAccountIds: z.nullable(z.array(z.string())).optional(),
    remoteDealIds: z.nullable(z.array(z.string())).optional(),
    remoteId: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        accountIds: "account_ids",
        companyName: "company_name",
        createdAt: "created_at",
        customFields: "custom_fields",
        dealIds: "deal_ids",
        firstName: "first_name",
        lastName: "last_name",
        phoneNumbers: "phone_numbers",
        remoteAccountIds: "remote_account_ids",
        remoteDealIds: "remote_deal_ids",
        remoteId: "remote_id",
        unifiedCustomFields: "unified_custom_fields",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Contact$;
(function (Contact$) {
    /** @deprecated use `Contact$inboundSchema` instead. */
    Contact$.inboundSchema = exports.Contact$inboundSchema;
    /** @deprecated use `Contact$outboundSchema` instead. */
    Contact$.outboundSchema = exports.Contact$outboundSchema;
})(Contact$ || (exports.Contact$ = Contact$ = {}));
function contactToJSON(contact) {
    return JSON.stringify(exports.Contact$outboundSchema.parse(contact));
}
exports.contactToJSON = contactToJSON;
function contactFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Contact$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Contact' from JSON`);
}
exports.contactFromJSON = contactFromJSON;
//# sourceMappingURL=contact.js.map