/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
export const QueryConversationsResponseDataType = {
    Openai: "openai",
    SupportTicket: "support_ticket",
    SupportCopilot: "support_copilot",
};
/** @internal */
export const QueryConversationsResponseDataType$inboundSchema = z.nativeEnum(QueryConversationsResponseDataType);
/** @internal */
export const QueryConversationsResponseDataType$outboundSchema = QueryConversationsResponseDataType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var QueryConversationsResponseDataType$;
(function (QueryConversationsResponseDataType$) {
    /** @deprecated use `QueryConversationsResponseDataType$inboundSchema` instead. */
    QueryConversationsResponseDataType$.inboundSchema = QueryConversationsResponseDataType$inboundSchema;
    /** @deprecated use `QueryConversationsResponseDataType$outboundSchema` instead. */
    QueryConversationsResponseDataType$.outboundSchema = QueryConversationsResponseDataType$outboundSchema;
})(QueryConversationsResponseDataType$ || (QueryConversationsResponseDataType$ = {}));
/** @internal */
export const ConversationsResultItem$inboundSchema = z.object({
    id: z.string().optional(),
    userMessageCount: z.number().optional(),
    organizationId: z.nullable(z.string()).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    firstMessageTime: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    type: z.nullable(QueryConversationsResponseDataType$inboundSchema).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    sum: z.number().optional(),
    count: z.number().optional(),
    avg: z.number().optional(),
    min: z.number().optional(),
    max: z.number().optional(),
    id_hour: z.string().optional(),
    id_day: z.string().optional(),
    id_week: z.string().optional(),
    id_month: z.string().optional(),
    userMessageCount_hour: z.string().optional(),
    userMessageCount_day: z.string().optional(),
    userMessageCount_week: z.string().optional(),
    userMessageCount_month: z.string().optional(),
    organizationId_hour: z.string().optional(),
    organizationId_day: z.string().optional(),
    organizationId_week: z.string().optional(),
    organizationId_month: z.string().optional(),
    projectId_hour: z.string().optional(),
    projectId_day: z.string().optional(),
    projectId_week: z.string().optional(),
    projectId_month: z.string().optional(),
    integrationId_hour: z.string().optional(),
    integrationId_day: z.string().optional(),
    integrationId_week: z.string().optional(),
    integrationId_month: z.string().optional(),
    firstMessageTime_hour: z.string().optional(),
    firstMessageTime_day: z.string().optional(),
    firstMessageTime_week: z.string().optional(),
    firstMessageTime_month: z.string().optional(),
    type_hour: z.string().optional(),
    type_day: z.string().optional(),
    type_week: z.string().optional(),
    type_month: z.string().optional(),
    properties_hour: z.string().optional(),
    properties_day: z.string().optional(),
    properties_week: z.string().optional(),
    properties_month: z.string().optional(),
    userProperties_hour: z.string().optional(),
    userProperties_day: z.string().optional(),
    userProperties_week: z.string().optional(),
    userProperties_month: z.string().optional(),
    sum_id: z.number().optional(),
    sum_userMessageCount: z.number().optional(),
    sum_organizationId: z.number().optional(),
    sum_projectId: z.number().optional(),
    sum_integrationId: z.number().optional(),
    sum_firstMessageTime: z.number().optional(),
    sum_type: z.number().optional(),
    sum_properties: z.number().optional(),
    sum_userProperties: z.number().optional(),
    count_id: z.number().optional(),
    count_userMessageCount: z.number().optional(),
    count_organizationId: z.number().optional(),
    count_projectId: z.number().optional(),
    count_integrationId: z.number().optional(),
    count_firstMessageTime: z.number().optional(),
    count_type: z.number().optional(),
    count_properties: z.number().optional(),
    count_userProperties: z.number().optional(),
    avg_id: z.number().optional(),
    avg_userMessageCount: z.number().optional(),
    avg_organizationId: z.number().optional(),
    avg_projectId: z.number().optional(),
    avg_integrationId: z.number().optional(),
    avg_firstMessageTime: z.number().optional(),
    avg_type: z.number().optional(),
    avg_properties: z.number().optional(),
    avg_userProperties: z.number().optional(),
    min_id: z.number().optional(),
    min_userMessageCount: z.number().optional(),
    min_organizationId: z.number().optional(),
    min_projectId: z.number().optional(),
    min_integrationId: z.number().optional(),
    min_firstMessageTime: z.number().optional(),
    min_type: z.number().optional(),
    min_properties: z.number().optional(),
    min_userProperties: z.number().optional(),
    max_id: z.number().optional(),
    max_userMessageCount: z.number().optional(),
    max_organizationId: z.number().optional(),
    max_projectId: z.number().optional(),
    max_integrationId: z.number().optional(),
    max_firstMessageTime: z.number().optional(),
    max_type: z.number().optional(),
    max_properties: z.number().optional(),
    max_userProperties: z.number().optional(),
}).transform((v) => {
    return remap$(v, {
        "id_hour": "idHour",
        "id_day": "idDay",
        "id_week": "idWeek",
        "id_month": "idMonth",
        "userMessageCount_hour": "userMessageCountHour",
        "userMessageCount_day": "userMessageCountDay",
        "userMessageCount_week": "userMessageCountWeek",
        "userMessageCount_month": "userMessageCountMonth",
        "organizationId_hour": "organizationIdHour",
        "organizationId_day": "organizationIdDay",
        "organizationId_week": "organizationIdWeek",
        "organizationId_month": "organizationIdMonth",
        "projectId_hour": "projectIdHour",
        "projectId_day": "projectIdDay",
        "projectId_week": "projectIdWeek",
        "projectId_month": "projectIdMonth",
        "integrationId_hour": "integrationIdHour",
        "integrationId_day": "integrationIdDay",
        "integrationId_week": "integrationIdWeek",
        "integrationId_month": "integrationIdMonth",
        "firstMessageTime_hour": "firstMessageTimeHour",
        "firstMessageTime_day": "firstMessageTimeDay",
        "firstMessageTime_week": "firstMessageTimeWeek",
        "firstMessageTime_month": "firstMessageTimeMonth",
        "type_hour": "typeHour",
        "type_day": "typeDay",
        "type_week": "typeWeek",
        "type_month": "typeMonth",
        "properties_hour": "propertiesHour",
        "properties_day": "propertiesDay",
        "properties_week": "propertiesWeek",
        "properties_month": "propertiesMonth",
        "userProperties_hour": "userPropertiesHour",
        "userProperties_day": "userPropertiesDay",
        "userProperties_week": "userPropertiesWeek",
        "userProperties_month": "userPropertiesMonth",
        "sum_id": "sumId",
        "sum_userMessageCount": "sumUserMessageCount",
        "sum_organizationId": "sumOrganizationId",
        "sum_projectId": "sumProjectId",
        "sum_integrationId": "sumIntegrationId",
        "sum_firstMessageTime": "sumFirstMessageTime",
        "sum_type": "sumType",
        "sum_properties": "sumProperties",
        "sum_userProperties": "sumUserProperties",
        "count_id": "countId",
        "count_userMessageCount": "countUserMessageCount",
        "count_organizationId": "countOrganizationId",
        "count_projectId": "countProjectId",
        "count_integrationId": "countIntegrationId",
        "count_firstMessageTime": "countFirstMessageTime",
        "count_type": "countType",
        "count_properties": "countProperties",
        "count_userProperties": "countUserProperties",
        "avg_id": "avgId",
        "avg_userMessageCount": "avgUserMessageCount",
        "avg_organizationId": "avgOrganizationId",
        "avg_projectId": "avgProjectId",
        "avg_integrationId": "avgIntegrationId",
        "avg_firstMessageTime": "avgFirstMessageTime",
        "avg_type": "avgType",
        "avg_properties": "avgProperties",
        "avg_userProperties": "avgUserProperties",
        "min_id": "minId",
        "min_userMessageCount": "minUserMessageCount",
        "min_organizationId": "minOrganizationId",
        "min_projectId": "minProjectId",
        "min_integrationId": "minIntegrationId",
        "min_firstMessageTime": "minFirstMessageTime",
        "min_type": "minType",
        "min_properties": "minProperties",
        "min_userProperties": "minUserProperties",
        "max_id": "maxId",
        "max_userMessageCount": "maxUserMessageCount",
        "max_organizationId": "maxOrganizationId",
        "max_projectId": "maxProjectId",
        "max_integrationId": "maxIntegrationId",
        "max_firstMessageTime": "maxFirstMessageTime",
        "max_type": "maxType",
        "max_properties": "maxProperties",
        "max_userProperties": "maxUserProperties",
    });
});
/** @internal */
export const ConversationsResultItem$outboundSchema = z.object({
    id: z.string().optional(),
    userMessageCount: z.number().optional(),
    organizationId: z.nullable(z.string()).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    firstMessageTime: z.date().transform(v => v.toISOString()).optional(),
    type: z.nullable(QueryConversationsResponseDataType$outboundSchema)
        .optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    sum: z.number().optional(),
    count: z.number().optional(),
    avg: z.number().optional(),
    min: z.number().optional(),
    max: z.number().optional(),
    idHour: z.string().optional(),
    idDay: z.string().optional(),
    idWeek: z.string().optional(),
    idMonth: z.string().optional(),
    userMessageCountHour: z.string().optional(),
    userMessageCountDay: z.string().optional(),
    userMessageCountWeek: z.string().optional(),
    userMessageCountMonth: z.string().optional(),
    organizationIdHour: z.string().optional(),
    organizationIdDay: z.string().optional(),
    organizationIdWeek: z.string().optional(),
    organizationIdMonth: z.string().optional(),
    projectIdHour: z.string().optional(),
    projectIdDay: z.string().optional(),
    projectIdWeek: z.string().optional(),
    projectIdMonth: z.string().optional(),
    integrationIdHour: z.string().optional(),
    integrationIdDay: z.string().optional(),
    integrationIdWeek: z.string().optional(),
    integrationIdMonth: z.string().optional(),
    firstMessageTimeHour: z.string().optional(),
    firstMessageTimeDay: z.string().optional(),
    firstMessageTimeWeek: z.string().optional(),
    firstMessageTimeMonth: z.string().optional(),
    typeHour: z.string().optional(),
    typeDay: z.string().optional(),
    typeWeek: z.string().optional(),
    typeMonth: z.string().optional(),
    propertiesHour: z.string().optional(),
    propertiesDay: z.string().optional(),
    propertiesWeek: z.string().optional(),
    propertiesMonth: z.string().optional(),
    userPropertiesHour: z.string().optional(),
    userPropertiesDay: z.string().optional(),
    userPropertiesWeek: z.string().optional(),
    userPropertiesMonth: z.string().optional(),
    sumId: z.number().optional(),
    sumUserMessageCount: z.number().optional(),
    sumOrganizationId: z.number().optional(),
    sumProjectId: z.number().optional(),
    sumIntegrationId: z.number().optional(),
    sumFirstMessageTime: z.number().optional(),
    sumType: z.number().optional(),
    sumProperties: z.number().optional(),
    sumUserProperties: z.number().optional(),
    countId: z.number().optional(),
    countUserMessageCount: z.number().optional(),
    countOrganizationId: z.number().optional(),
    countProjectId: z.number().optional(),
    countIntegrationId: z.number().optional(),
    countFirstMessageTime: z.number().optional(),
    countType: z.number().optional(),
    countProperties: z.number().optional(),
    countUserProperties: z.number().optional(),
    avgId: z.number().optional(),
    avgUserMessageCount: z.number().optional(),
    avgOrganizationId: z.number().optional(),
    avgProjectId: z.number().optional(),
    avgIntegrationId: z.number().optional(),
    avgFirstMessageTime: z.number().optional(),
    avgType: z.number().optional(),
    avgProperties: z.number().optional(),
    avgUserProperties: z.number().optional(),
    minId: z.number().optional(),
    minUserMessageCount: z.number().optional(),
    minOrganizationId: z.number().optional(),
    minProjectId: z.number().optional(),
    minIntegrationId: z.number().optional(),
    minFirstMessageTime: z.number().optional(),
    minType: z.number().optional(),
    minProperties: z.number().optional(),
    minUserProperties: z.number().optional(),
    maxId: z.number().optional(),
    maxUserMessageCount: z.number().optional(),
    maxOrganizationId: z.number().optional(),
    maxProjectId: z.number().optional(),
    maxIntegrationId: z.number().optional(),
    maxFirstMessageTime: z.number().optional(),
    maxType: z.number().optional(),
    maxProperties: z.number().optional(),
    maxUserProperties: z.number().optional(),
}).transform((v) => {
    return remap$(v, {
        idHour: "id_hour",
        idDay: "id_day",
        idWeek: "id_week",
        idMonth: "id_month",
        userMessageCountHour: "userMessageCount_hour",
        userMessageCountDay: "userMessageCount_day",
        userMessageCountWeek: "userMessageCount_week",
        userMessageCountMonth: "userMessageCount_month",
        organizationIdHour: "organizationId_hour",
        organizationIdDay: "organizationId_day",
        organizationIdWeek: "organizationId_week",
        organizationIdMonth: "organizationId_month",
        projectIdHour: "projectId_hour",
        projectIdDay: "projectId_day",
        projectIdWeek: "projectId_week",
        projectIdMonth: "projectId_month",
        integrationIdHour: "integrationId_hour",
        integrationIdDay: "integrationId_day",
        integrationIdWeek: "integrationId_week",
        integrationIdMonth: "integrationId_month",
        firstMessageTimeHour: "firstMessageTime_hour",
        firstMessageTimeDay: "firstMessageTime_day",
        firstMessageTimeWeek: "firstMessageTime_week",
        firstMessageTimeMonth: "firstMessageTime_month",
        typeHour: "type_hour",
        typeDay: "type_day",
        typeWeek: "type_week",
        typeMonth: "type_month",
        propertiesHour: "properties_hour",
        propertiesDay: "properties_day",
        propertiesWeek: "properties_week",
        propertiesMonth: "properties_month",
        userPropertiesHour: "userProperties_hour",
        userPropertiesDay: "userProperties_day",
        userPropertiesWeek: "userProperties_week",
        userPropertiesMonth: "userProperties_month",
        sumId: "sum_id",
        sumUserMessageCount: "sum_userMessageCount",
        sumOrganizationId: "sum_organizationId",
        sumProjectId: "sum_projectId",
        sumIntegrationId: "sum_integrationId",
        sumFirstMessageTime: "sum_firstMessageTime",
        sumType: "sum_type",
        sumProperties: "sum_properties",
        sumUserProperties: "sum_userProperties",
        countId: "count_id",
        countUserMessageCount: "count_userMessageCount",
        countOrganizationId: "count_organizationId",
        countProjectId: "count_projectId",
        countIntegrationId: "count_integrationId",
        countFirstMessageTime: "count_firstMessageTime",
        countType: "count_type",
        countProperties: "count_properties",
        countUserProperties: "count_userProperties",
        avgId: "avg_id",
        avgUserMessageCount: "avg_userMessageCount",
        avgOrganizationId: "avg_organizationId",
        avgProjectId: "avg_projectId",
        avgIntegrationId: "avg_integrationId",
        avgFirstMessageTime: "avg_firstMessageTime",
        avgType: "avg_type",
        avgProperties: "avg_properties",
        avgUserProperties: "avg_userProperties",
        minId: "min_id",
        minUserMessageCount: "min_userMessageCount",
        minOrganizationId: "min_organizationId",
        minProjectId: "min_projectId",
        minIntegrationId: "min_integrationId",
        minFirstMessageTime: "min_firstMessageTime",
        minType: "min_type",
        minProperties: "min_properties",
        minUserProperties: "min_userProperties",
        maxId: "max_id",
        maxUserMessageCount: "max_userMessageCount",
        maxOrganizationId: "max_organizationId",
        maxProjectId: "max_projectId",
        maxIntegrationId: "max_integrationId",
        maxFirstMessageTime: "max_firstMessageTime",
        maxType: "max_type",
        maxProperties: "max_properties",
        maxUserProperties: "max_userProperties",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ConversationsResultItem$;
(function (ConversationsResultItem$) {
    /** @deprecated use `ConversationsResultItem$inboundSchema` instead. */
    ConversationsResultItem$.inboundSchema = ConversationsResultItem$inboundSchema;
    /** @deprecated use `ConversationsResultItem$outboundSchema` instead. */
    ConversationsResultItem$.outboundSchema = ConversationsResultItem$outboundSchema;
})(ConversationsResultItem$ || (ConversationsResultItem$ = {}));
export function conversationsResultItemToJSON(conversationsResultItem) {
    return JSON.stringify(ConversationsResultItem$outboundSchema.parse(conversationsResultItem));
}
export function conversationsResultItemFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationsResultItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationsResultItem' from JSON`);
}
/** @internal */
export const QueryConversationsResponseData$inboundSchema = z.object({
    result: z.array(z.lazy(() => ConversationsResultItem$inboundSchema)),
    total: z.number(),
    pageSize: z.number(),
    count: z.number(),
});
/** @internal */
export const QueryConversationsResponseData$outboundSchema = z.object({
    result: z.array(z.lazy(() => ConversationsResultItem$outboundSchema)),
    total: z.number(),
    pageSize: z.number(),
    count: z.number(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var QueryConversationsResponseData$;
(function (QueryConversationsResponseData$) {
    /** @deprecated use `QueryConversationsResponseData$inboundSchema` instead. */
    QueryConversationsResponseData$.inboundSchema = QueryConversationsResponseData$inboundSchema;
    /** @deprecated use `QueryConversationsResponseData$outboundSchema` instead. */
    QueryConversationsResponseData$.outboundSchema = QueryConversationsResponseData$outboundSchema;
})(QueryConversationsResponseData$ || (QueryConversationsResponseData$ = {}));
export function queryConversationsResponseDataToJSON(queryConversationsResponseData) {
    return JSON.stringify(QueryConversationsResponseData$outboundSchema.parse(queryConversationsResponseData));
}
export function queryConversationsResponseDataFromJSON(jsonString) {
    return safeParse(jsonString, (x) => QueryConversationsResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QueryConversationsResponseData' from JSON`);
}
//# sourceMappingURL=queryconversationsresponsedata.js.map