/*
 * 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 ConversationsTimeBasedGroupBySelectionField = {
    Id: "id",
    UserMessageCount: "userMessageCount",
    OrganizationId: "organizationId",
    ProjectId: "projectId",
    IntegrationId: "integrationId",
    FirstMessageTime: "firstMessageTime",
    Type: "type",
    Properties: "properties",
    UserProperties: "userProperties",
};
/** @internal */
export const ConversationsTimeBasedGroupBySelectionField$inboundSchema = z
    .nativeEnum(ConversationsTimeBasedGroupBySelectionField);
/** @internal */
export const ConversationsTimeBasedGroupBySelectionField$outboundSchema = ConversationsTimeBasedGroupBySelectionField$inboundSchema;
/** @internal */
export const ConversationsTimeBasedGroupBySelection$inboundSchema = z.object({
    type: z.literal("time"),
    timeUnit: TimeUnit$inboundSchema,
    field: ConversationsTimeBasedGroupBySelectionField$inboundSchema.optional(),
});
/** @internal */
export const ConversationsTimeBasedGroupBySelection$outboundSchema = z.object({
    type: z.literal("time"),
    timeUnit: TimeUnit$outboundSchema,
    field: ConversationsTimeBasedGroupBySelectionField$outboundSchema.optional(),
});
export function conversationsTimeBasedGroupBySelectionToJSON(conversationsTimeBasedGroupBySelection) {
    return JSON.stringify(ConversationsTimeBasedGroupBySelection$outboundSchema.parse(conversationsTimeBasedGroupBySelection));
}
export function conversationsTimeBasedGroupBySelectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationsTimeBasedGroupBySelection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationsTimeBasedGroupBySelection' from JSON`);
}
//# sourceMappingURL=conversationstimebasedgroupbyselection.js.map