/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { TimeUnit$inboundSchema, TimeUnit$outboundSchema, } from "./timeunit.js";
export const EventsTimeBasedGroupBySelectionField = {
    Id: "id",
    OrganizationId: "organizationId",
    MessageId: "messageId",
    ConversationId: "conversationId",
    CreatedAt: "createdAt",
    ProjectId: "projectId",
    IntegrationId: "integrationId",
    EventType: "eventType",
    Type: "type",
    SearchQuery: "searchQuery",
    Properties: "properties",
    UserProperties: "userProperties",
};
/** @internal */
export const EventsTimeBasedGroupBySelectionField$inboundSchema = z.nativeEnum(EventsTimeBasedGroupBySelectionField);
/** @internal */
export const EventsTimeBasedGroupBySelectionField$outboundSchema = EventsTimeBasedGroupBySelectionField$inboundSchema;
/** @internal */
export const EventsTimeBasedGroupBySelection$inboundSchema = z.object({
    type: z.literal("time"),
    timeUnit: TimeUnit$inboundSchema,
    field: EventsTimeBasedGroupBySelectionField$inboundSchema.optional(),
});
/** @internal */
export const EventsTimeBasedGroupBySelection$outboundSchema = z.object({
    type: z.literal("time"),
    timeUnit: TimeUnit$outboundSchema,
    field: EventsTimeBasedGroupBySelectionField$outboundSchema.optional(),
});
export function eventsTimeBasedGroupBySelectionToJSON(eventsTimeBasedGroupBySelection) {
    return JSON.stringify(EventsTimeBasedGroupBySelection$outboundSchema.parse(eventsTimeBasedGroupBySelection));
}
export function eventsTimeBasedGroupBySelectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => EventsTimeBasedGroupBySelection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventsTimeBasedGroupBySelection' from JSON`);
}
//# sourceMappingURL=eventstimebasedgroupbyselection.js.map