/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
export const EventsAggregationSelectionAggregation = {
    Sum: "sum",
    Count: "count",
    CountDistinct: "countDistinct",
    Avg: "avg",
    Min: "min",
    Max: "max",
};
export const EventsAggregationSelectionField = {
    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 EventsAggregationSelectionAggregation$inboundSchema = z.nativeEnum(EventsAggregationSelectionAggregation);
/** @internal */
export const EventsAggregationSelectionAggregation$outboundSchema = EventsAggregationSelectionAggregation$inboundSchema;
/** @internal */
export const EventsAggregationSelectionField$inboundSchema = z.nativeEnum(EventsAggregationSelectionField);
/** @internal */
export const EventsAggregationSelectionField$outboundSchema = EventsAggregationSelectionField$inboundSchema;
/** @internal */
export const EventsAggregationSelection$inboundSchema = z.object({
    type: z.literal("aggregation"),
    aggregation: EventsAggregationSelectionAggregation$inboundSchema,
    field: EventsAggregationSelectionField$inboundSchema.optional(),
    path: z.array(z.string()).optional(),
});
/** @internal */
export const EventsAggregationSelection$outboundSchema = z.object({
    type: z.literal("aggregation"),
    aggregation: EventsAggregationSelectionAggregation$outboundSchema,
    field: EventsAggregationSelectionField$outboundSchema.optional(),
    path: z.array(z.string()).optional(),
});
export function eventsAggregationSelectionToJSON(eventsAggregationSelection) {
    return JSON.stringify(EventsAggregationSelection$outboundSchema.parse(eventsAggregationSelection));
}
export function eventsAggregationSelectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => EventsAggregationSelection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventsAggregationSelection' from JSON`);
}
//# sourceMappingURL=eventsaggregationselection.js.map