/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
export const Aggregation = {
    Sum: "sum",
    Count: "count",
    CountDistinct: "countDistinct",
    Avg: "avg",
    Min: "min",
    Max: "max",
};
export const Field = {
    Id: "id",
    UserMessageCount: "userMessageCount",
    OrganizationId: "organizationId",
    ProjectId: "projectId",
    IntegrationId: "integrationId",
    FirstMessageTime: "firstMessageTime",
    Type: "type",
    Properties: "properties",
    UserProperties: "userProperties",
};
/** @internal */
export const Aggregation$inboundSchema = z
    .nativeEnum(Aggregation);
/** @internal */
export const Aggregation$outboundSchema = Aggregation$inboundSchema;
/** @internal */
export const Field$inboundSchema = z.nativeEnum(Field);
/** @internal */
export const Field$outboundSchema = Field$inboundSchema;
/** @internal */
export const ConversationsAggregationSelection$inboundSchema = z.object({
    type: z.literal("aggregation"),
    aggregation: Aggregation$inboundSchema,
    field: Field$inboundSchema.optional(),
    path: z.array(z.string()).optional(),
});
/** @internal */
export const ConversationsAggregationSelection$outboundSchema = z.object({
    type: z.literal("aggregation"),
    aggregation: Aggregation$outboundSchema,
    field: Field$outboundSchema.optional(),
    path: z.array(z.string()).optional(),
});
export function conversationsAggregationSelectionToJSON(conversationsAggregationSelection) {
    return JSON.stringify(ConversationsAggregationSelection$outboundSchema.parse(conversationsAggregationSelection));
}
export function conversationsAggregationSelectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationsAggregationSelection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationsAggregationSelection' from JSON`);
}
//# sourceMappingURL=conversationsaggregationselection.js.map