/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const InsertSearchEventEntityType = {
    Search: "search",
};
/** @internal */
export const InsertSearchEventEntityType$inboundSchema = z.nativeEnum(InsertSearchEventEntityType);
/** @internal */
export const InsertSearchEventEntityType$outboundSchema = InsertSearchEventEntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InsertSearchEventEntityType$;
(function (InsertSearchEventEntityType$) {
    /** @deprecated use `InsertSearchEventEntityType$inboundSchema` instead. */
    InsertSearchEventEntityType$.inboundSchema = InsertSearchEventEntityType$inboundSchema;
    /** @deprecated use `InsertSearchEventEntityType$outboundSchema` instead. */
    InsertSearchEventEntityType$.outboundSchema = InsertSearchEventEntityType$outboundSchema;
})(InsertSearchEventEntityType$ || (InsertSearchEventEntityType$ = {}));
/** @internal */
export const InsertSearchEvent$inboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    searchQuery: z.string(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    entityType: InsertSearchEventEntityType$inboundSchema,
});
/** @internal */
export const InsertSearchEvent$outboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    searchQuery: z.string(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    entityType: InsertSearchEventEntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InsertSearchEvent$;
(function (InsertSearchEvent$) {
    /** @deprecated use `InsertSearchEvent$inboundSchema` instead. */
    InsertSearchEvent$.inboundSchema = InsertSearchEvent$inboundSchema;
    /** @deprecated use `InsertSearchEvent$outboundSchema` instead. */
    InsertSearchEvent$.outboundSchema = InsertSearchEvent$outboundSchema;
})(InsertSearchEvent$ || (InsertSearchEvent$ = {}));
export function insertSearchEventToJSON(insertSearchEvent) {
    return JSON.stringify(InsertSearchEvent$outboundSchema.parse(insertSearchEvent));
}
export function insertSearchEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertSearchEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertSearchEvent' from JSON`);
}
//# sourceMappingURL=insertsearchevent.js.map