"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.accountFromJSON = exports.accountToJSON = exports.Account$ = exports.Account$outboundSchema = exports.Account$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 accountaddress_js_1 = require("./accountaddress.js");
/** @internal */
exports.Account$inboundSchema = z.object({
    addresses: z.nullable(z.array(accountaddress_js_1.AccountAddress$inboundSchema)).optional(),
    annual_revenue: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    industries: z.nullable(z.array(z.string())).optional(),
    name: z.nullable(z.string()).optional(),
    owner_id: z.nullable(z.string()).optional(),
    phone_numbers: z.nullable(z.array(z.string())).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_owner_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(),
    website: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "annual_revenue": "annualRevenue",
        "created_at": "createdAt",
        "owner_id": "ownerId",
        "phone_numbers": "phoneNumbers",
        "remote_id": "remoteId",
        "remote_owner_id": "remoteOwnerId",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.Account$outboundSchema = z.object({
    addresses: z.nullable(z.array(accountaddress_js_1.AccountAddress$outboundSchema)).optional(),
    annualRevenue: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    industries: z.nullable(z.array(z.string())).optional(),
    name: z.nullable(z.string()).optional(),
    ownerId: z.nullable(z.string()).optional(),
    phoneNumbers: z.nullable(z.array(z.string())).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteOwnerId: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    website: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        annualRevenue: "annual_revenue",
        createdAt: "created_at",
        ownerId: "owner_id",
        phoneNumbers: "phone_numbers",
        remoteId: "remote_id",
        remoteOwnerId: "remote_owner_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 Account$;
(function (Account$) {
    /** @deprecated use `Account$inboundSchema` instead. */
    Account$.inboundSchema = exports.Account$inboundSchema;
    /** @deprecated use `Account$outboundSchema` instead. */
    Account$.outboundSchema = exports.Account$outboundSchema;
})(Account$ || (exports.Account$ = Account$ = {}));
function accountToJSON(account) {
    return JSON.stringify(exports.Account$outboundSchema.parse(account));
}
exports.accountToJSON = accountToJSON;
function accountFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Account$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Account' from JSON`);
}
exports.accountFromJSON = accountFromJSON;
//# sourceMappingURL=account.js.map