/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js";
export const SelectSearchEventEntityType = {
    Search: "search",
};
/** @internal */
export const SelectSearchEventId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectSearchEventId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectSearchEventId$;
(function (SelectSearchEventId$) {
    /** @deprecated use `SelectSearchEventId$inboundSchema` instead. */
    SelectSearchEventId$.inboundSchema = SelectSearchEventId$inboundSchema;
    /** @deprecated use `SelectSearchEventId$outboundSchema` instead. */
    SelectSearchEventId$.outboundSchema = SelectSearchEventId$outboundSchema;
})(SelectSearchEventId$ || (SelectSearchEventId$ = {}));
export function selectSearchEventIdToJSON(selectSearchEventId) {
    return JSON.stringify(SelectSearchEventId$outboundSchema.parse(selectSearchEventId));
}
export function selectSearchEventIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectSearchEventId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectSearchEventId' from JSON`);
}
/** @internal */
export const SelectSearchEventUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectSearchEventUserId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectSearchEventUserId$;
(function (SelectSearchEventUserId$) {
    /** @deprecated use `SelectSearchEventUserId$inboundSchema` instead. */
    SelectSearchEventUserId$.inboundSchema = SelectSearchEventUserId$inboundSchema;
    /** @deprecated use `SelectSearchEventUserId$outboundSchema` instead. */
    SelectSearchEventUserId$.outboundSchema = SelectSearchEventUserId$outboundSchema;
})(SelectSearchEventUserId$ || (SelectSearchEventUserId$ = {}));
export function selectSearchEventUserIdToJSON(selectSearchEventUserId) {
    return JSON.stringify(SelectSearchEventUserId$outboundSchema.parse(selectSearchEventUserId));
}
export function selectSearchEventUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectSearchEventUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectSearchEventUserId' from JSON`);
}
/** @internal */
export const SelectSearchEventUserProperties$inboundSchema = collectExtraKeys$(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const SelectSearchEventUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectSearchEventUserProperties$;
(function (SelectSearchEventUserProperties$) {
    /** @deprecated use `SelectSearchEventUserProperties$inboundSchema` instead. */
    SelectSearchEventUserProperties$.inboundSchema = SelectSearchEventUserProperties$inboundSchema;
    /** @deprecated use `SelectSearchEventUserProperties$outboundSchema` instead. */
    SelectSearchEventUserProperties$.outboundSchema = SelectSearchEventUserProperties$outboundSchema;
})(SelectSearchEventUserProperties$ || (SelectSearchEventUserProperties$ = {}));
export function selectSearchEventUserPropertiesToJSON(selectSearchEventUserProperties) {
    return JSON.stringify(SelectSearchEventUserProperties$outboundSchema.parse(selectSearchEventUserProperties));
}
export function selectSearchEventUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectSearchEventUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectSearchEventUserProperties' from JSON`);
}
/** @internal */
export const SelectSearchEventEntityType$inboundSchema = z.nativeEnum(SelectSearchEventEntityType);
/** @internal */
export const SelectSearchEventEntityType$outboundSchema = SelectSearchEventEntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectSearchEventEntityType$;
(function (SelectSearchEventEntityType$) {
    /** @deprecated use `SelectSearchEventEntityType$inboundSchema` instead. */
    SelectSearchEventEntityType$.inboundSchema = SelectSearchEventEntityType$inboundSchema;
    /** @deprecated use `SelectSearchEventEntityType$outboundSchema` instead. */
    SelectSearchEventEntityType$.outboundSchema = SelectSearchEventEntityType$outboundSchema;
})(SelectSearchEventEntityType$ || (SelectSearchEventEntityType$ = {}));
/** @internal */
export const SelectSearchEvent$inboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    searchQuery: z.string(),
    createdAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SelectSearchEventUserProperties$inboundSchema)).optional(),
    entityType: SelectSearchEventEntityType$inboundSchema,
});
/** @internal */
export const SelectSearchEvent$outboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    searchQuery: z.string(),
    createdAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SelectSearchEventUserProperties$outboundSchema)).optional(),
    entityType: SelectSearchEventEntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectSearchEvent$;
(function (SelectSearchEvent$) {
    /** @deprecated use `SelectSearchEvent$inboundSchema` instead. */
    SelectSearchEvent$.inboundSchema = SelectSearchEvent$inboundSchema;
    /** @deprecated use `SelectSearchEvent$outboundSchema` instead. */
    SelectSearchEvent$.outboundSchema = SelectSearchEvent$outboundSchema;
})(SelectSearchEvent$ || (SelectSearchEvent$ = {}));
export function selectSearchEventToJSON(selectSearchEvent) {
    return JSON.stringify(SelectSearchEvent$outboundSchema.parse(selectSearchEvent));
}
export function selectSearchEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectSearchEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectSearchEvent' from JSON`);
}
//# sourceMappingURL=selectsearchevent.js.map