/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const ConversationsAggregationSelectionType = {
    Aggregation: "aggregation",
};
export const Aggregation = {
    Sum: "sum",
    Count: "count",
    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 ConversationsAggregationSelectionType$inboundSchema = z.nativeEnum(ConversationsAggregationSelectionType);
/** @internal */
export const ConversationsAggregationSelectionType$outboundSchema = ConversationsAggregationSelectionType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ConversationsAggregationSelectionType$;
(function (ConversationsAggregationSelectionType$) {
    /** @deprecated use `ConversationsAggregationSelectionType$inboundSchema` instead. */
    ConversationsAggregationSelectionType$.inboundSchema = ConversationsAggregationSelectionType$inboundSchema;
    /** @deprecated use `ConversationsAggregationSelectionType$outboundSchema` instead. */
    ConversationsAggregationSelectionType$.outboundSchema = ConversationsAggregationSelectionType$outboundSchema;
})(ConversationsAggregationSelectionType$ || (ConversationsAggregationSelectionType$ = {}));
/** @internal */
export const Aggregation$inboundSchema = z
    .nativeEnum(Aggregation);
/** @internal */
export const Aggregation$outboundSchema = Aggregation$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Aggregation$;
(function (Aggregation$) {
    /** @deprecated use `Aggregation$inboundSchema` instead. */
    Aggregation$.inboundSchema = Aggregation$inboundSchema;
    /** @deprecated use `Aggregation$outboundSchema` instead. */
    Aggregation$.outboundSchema = Aggregation$outboundSchema;
})(Aggregation$ || (Aggregation$ = {}));
/** @internal */
export const Field$inboundSchema = z.nativeEnum(Field);
/** @internal */
export const Field$outboundSchema = Field$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Field$;
(function (Field$) {
    /** @deprecated use `Field$inboundSchema` instead. */
    Field$.inboundSchema = Field$inboundSchema;
    /** @deprecated use `Field$outboundSchema` instead. */
    Field$.outboundSchema = Field$outboundSchema;
})(Field$ || (Field$ = {}));
/** @internal */
export const ConversationsAggregationSelection$inboundSchema = z.object({
    type: ConversationsAggregationSelectionType$inboundSchema,
    aggregation: Aggregation$inboundSchema,
    field: Field$inboundSchema.optional(),
});
/** @internal */
export const ConversationsAggregationSelection$outboundSchema = z.object({
    type: ConversationsAggregationSelectionType$outboundSchema,
    aggregation: Aggregation$outboundSchema,
    field: Field$outboundSchema.optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ConversationsAggregationSelection$;
(function (ConversationsAggregationSelection$) {
    /** @deprecated use `ConversationsAggregationSelection$inboundSchema` instead. */
    ConversationsAggregationSelection$.inboundSchema = ConversationsAggregationSelection$inboundSchema;
    /** @deprecated use `ConversationsAggregationSelection$outboundSchema` instead. */
    ConversationsAggregationSelection$.outboundSchema = ConversationsAggregationSelection$outboundSchema;
})(ConversationsAggregationSelection$ || (ConversationsAggregationSelection$ = {}));
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