"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryEventsResponseData$ = exports.QueryEventsResponseData$outboundSchema = exports.QueryEventsResponseData$inboundSchema = exports.EventsResultItem$ = exports.EventsResultItem$outboundSchema = exports.EventsResultItem$inboundSchema = void 0;
exports.eventsResultItemToJSON = eventsResultItemToJSON;
exports.eventsResultItemFromJSON = eventsResultItemFromJSON;
exports.queryEventsResponseDataToJSON = queryEventsResponseDataToJSON;
exports.queryEventsResponseDataFromJSON = queryEventsResponseDataFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.EventsResultItem$inboundSchema = z.object({
    id: z.string().optional(),
    organizationId: z.string().optional(),
    messageId: z.string().optional(),
    conversationId: z.string().optional(),
    createdAt: z.string().optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    eventType: z.string().optional(),
    type: z.string().optional(),
    searchQuery: z.string().optional(),
    properties: z.nullable(z.record(z.string())).optional(),
    userProperties: z.nullable(z.record(z.string())).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(),
    organizationId_hour: z.string().optional(),
    organizationId_day: z.string().optional(),
    organizationId_week: z.string().optional(),
    organizationId_month: z.string().optional(),
    messageId_hour: z.string().optional(),
    messageId_day: z.string().optional(),
    messageId_week: z.string().optional(),
    messageId_month: z.string().optional(),
    conversationId_hour: z.string().optional(),
    conversationId_day: z.string().optional(),
    conversationId_week: z.string().optional(),
    conversationId_month: z.string().optional(),
    createdAt_hour: z.string().optional(),
    createdAt_day: z.string().optional(),
    createdAt_week: z.string().optional(),
    createdAt_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(),
    eventType_hour: z.string().optional(),
    eventType_day: z.string().optional(),
    eventType_week: z.string().optional(),
    eventType_month: z.string().optional(),
    type_hour: z.string().optional(),
    type_day: z.string().optional(),
    type_week: z.string().optional(),
    type_month: z.string().optional(),
    searchQuery_hour: z.string().optional(),
    searchQuery_day: z.string().optional(),
    searchQuery_week: z.string().optional(),
    searchQuery_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_organizationId: z.number().optional(),
    sum_messageId: z.number().optional(),
    sum_conversationId: z.number().optional(),
    sum_createdAt: z.number().optional(),
    sum_projectId: z.number().optional(),
    sum_integrationId: z.number().optional(),
    sum_eventType: z.number().optional(),
    sum_type: z.number().optional(),
    sum_searchQuery: z.number().optional(),
    sum_properties: z.number().optional(),
    sum_userProperties: z.number().optional(),
    count_id: z.number().optional(),
    count_organizationId: z.number().optional(),
    count_messageId: z.number().optional(),
    count_conversationId: z.number().optional(),
    count_createdAt: z.number().optional(),
    count_projectId: z.number().optional(),
    count_integrationId: z.number().optional(),
    count_eventType: z.number().optional(),
    count_type: z.number().optional(),
    count_searchQuery: z.number().optional(),
    count_properties: z.number().optional(),
    count_userProperties: z.number().optional(),
    avg_id: z.number().optional(),
    avg_organizationId: z.number().optional(),
    avg_messageId: z.number().optional(),
    avg_conversationId: z.number().optional(),
    avg_createdAt: z.number().optional(),
    avg_projectId: z.number().optional(),
    avg_integrationId: z.number().optional(),
    avg_eventType: z.number().optional(),
    avg_type: z.number().optional(),
    avg_searchQuery: z.number().optional(),
    avg_properties: z.number().optional(),
    avg_userProperties: z.number().optional(),
    min_id: z.number().optional(),
    min_organizationId: z.number().optional(),
    min_messageId: z.number().optional(),
    min_conversationId: z.number().optional(),
    min_createdAt: z.number().optional(),
    min_projectId: z.number().optional(),
    min_integrationId: z.number().optional(),
    min_eventType: z.number().optional(),
    min_type: z.number().optional(),
    min_searchQuery: z.number().optional(),
    min_properties: z.number().optional(),
    min_userProperties: z.number().optional(),
    max_id: z.number().optional(),
    max_organizationId: z.number().optional(),
    max_messageId: z.number().optional(),
    max_conversationId: z.number().optional(),
    max_createdAt: z.number().optional(),
    max_projectId: z.number().optional(),
    max_integrationId: z.number().optional(),
    max_eventType: z.number().optional(),
    max_type: z.number().optional(),
    max_searchQuery: z.number().optional(),
    max_properties: z.number().optional(),
    max_userProperties: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "id_hour": "idHour",
        "id_day": "idDay",
        "id_week": "idWeek",
        "id_month": "idMonth",
        "organizationId_hour": "organizationIdHour",
        "organizationId_day": "organizationIdDay",
        "organizationId_week": "organizationIdWeek",
        "organizationId_month": "organizationIdMonth",
        "messageId_hour": "messageIdHour",
        "messageId_day": "messageIdDay",
        "messageId_week": "messageIdWeek",
        "messageId_month": "messageIdMonth",
        "conversationId_hour": "conversationIdHour",
        "conversationId_day": "conversationIdDay",
        "conversationId_week": "conversationIdWeek",
        "conversationId_month": "conversationIdMonth",
        "createdAt_hour": "createdAtHour",
        "createdAt_day": "createdAtDay",
        "createdAt_week": "createdAtWeek",
        "createdAt_month": "createdAtMonth",
        "projectId_hour": "projectIdHour",
        "projectId_day": "projectIdDay",
        "projectId_week": "projectIdWeek",
        "projectId_month": "projectIdMonth",
        "integrationId_hour": "integrationIdHour",
        "integrationId_day": "integrationIdDay",
        "integrationId_week": "integrationIdWeek",
        "integrationId_month": "integrationIdMonth",
        "eventType_hour": "eventTypeHour",
        "eventType_day": "eventTypeDay",
        "eventType_week": "eventTypeWeek",
        "eventType_month": "eventTypeMonth",
        "type_hour": "typeHour",
        "type_day": "typeDay",
        "type_week": "typeWeek",
        "type_month": "typeMonth",
        "searchQuery_hour": "searchQueryHour",
        "searchQuery_day": "searchQueryDay",
        "searchQuery_week": "searchQueryWeek",
        "searchQuery_month": "searchQueryMonth",
        "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_organizationId": "sumOrganizationId",
        "sum_messageId": "sumMessageId",
        "sum_conversationId": "sumConversationId",
        "sum_createdAt": "sumCreatedAt",
        "sum_projectId": "sumProjectId",
        "sum_integrationId": "sumIntegrationId",
        "sum_eventType": "sumEventType",
        "sum_type": "sumType",
        "sum_searchQuery": "sumSearchQuery",
        "sum_properties": "sumProperties",
        "sum_userProperties": "sumUserProperties",
        "count_id": "countId",
        "count_organizationId": "countOrganizationId",
        "count_messageId": "countMessageId",
        "count_conversationId": "countConversationId",
        "count_createdAt": "countCreatedAt",
        "count_projectId": "countProjectId",
        "count_integrationId": "countIntegrationId",
        "count_eventType": "countEventType",
        "count_type": "countType",
        "count_searchQuery": "countSearchQuery",
        "count_properties": "countProperties",
        "count_userProperties": "countUserProperties",
        "avg_id": "avgId",
        "avg_organizationId": "avgOrganizationId",
        "avg_messageId": "avgMessageId",
        "avg_conversationId": "avgConversationId",
        "avg_createdAt": "avgCreatedAt",
        "avg_projectId": "avgProjectId",
        "avg_integrationId": "avgIntegrationId",
        "avg_eventType": "avgEventType",
        "avg_type": "avgType",
        "avg_searchQuery": "avgSearchQuery",
        "avg_properties": "avgProperties",
        "avg_userProperties": "avgUserProperties",
        "min_id": "minId",
        "min_organizationId": "minOrganizationId",
        "min_messageId": "minMessageId",
        "min_conversationId": "minConversationId",
        "min_createdAt": "minCreatedAt",
        "min_projectId": "minProjectId",
        "min_integrationId": "minIntegrationId",
        "min_eventType": "minEventType",
        "min_type": "minType",
        "min_searchQuery": "minSearchQuery",
        "min_properties": "minProperties",
        "min_userProperties": "minUserProperties",
        "max_id": "maxId",
        "max_organizationId": "maxOrganizationId",
        "max_messageId": "maxMessageId",
        "max_conversationId": "maxConversationId",
        "max_createdAt": "maxCreatedAt",
        "max_projectId": "maxProjectId",
        "max_integrationId": "maxIntegrationId",
        "max_eventType": "maxEventType",
        "max_type": "maxType",
        "max_searchQuery": "maxSearchQuery",
        "max_properties": "maxProperties",
        "max_userProperties": "maxUserProperties",
    });
});
/** @internal */
exports.EventsResultItem$outboundSchema = z.object({
    id: z.string().optional(),
    organizationId: z.string().optional(),
    messageId: z.string().optional(),
    conversationId: z.string().optional(),
    createdAt: z.string().optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    eventType: z.string().optional(),
    type: z.string().optional(),
    searchQuery: z.string().optional(),
    properties: z.nullable(z.record(z.string())).optional(),
    userProperties: z.nullable(z.record(z.string())).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(),
    organizationIdHour: z.string().optional(),
    organizationIdDay: z.string().optional(),
    organizationIdWeek: z.string().optional(),
    organizationIdMonth: z.string().optional(),
    messageIdHour: z.string().optional(),
    messageIdDay: z.string().optional(),
    messageIdWeek: z.string().optional(),
    messageIdMonth: z.string().optional(),
    conversationIdHour: z.string().optional(),
    conversationIdDay: z.string().optional(),
    conversationIdWeek: z.string().optional(),
    conversationIdMonth: z.string().optional(),
    createdAtHour: z.string().optional(),
    createdAtDay: z.string().optional(),
    createdAtWeek: z.string().optional(),
    createdAtMonth: 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(),
    eventTypeHour: z.string().optional(),
    eventTypeDay: z.string().optional(),
    eventTypeWeek: z.string().optional(),
    eventTypeMonth: z.string().optional(),
    typeHour: z.string().optional(),
    typeDay: z.string().optional(),
    typeWeek: z.string().optional(),
    typeMonth: z.string().optional(),
    searchQueryHour: z.string().optional(),
    searchQueryDay: z.string().optional(),
    searchQueryWeek: z.string().optional(),
    searchQueryMonth: 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(),
    sumOrganizationId: z.number().optional(),
    sumMessageId: z.number().optional(),
    sumConversationId: z.number().optional(),
    sumCreatedAt: z.number().optional(),
    sumProjectId: z.number().optional(),
    sumIntegrationId: z.number().optional(),
    sumEventType: z.number().optional(),
    sumType: z.number().optional(),
    sumSearchQuery: z.number().optional(),
    sumProperties: z.number().optional(),
    sumUserProperties: z.number().optional(),
    countId: z.number().optional(),
    countOrganizationId: z.number().optional(),
    countMessageId: z.number().optional(),
    countConversationId: z.number().optional(),
    countCreatedAt: z.number().optional(),
    countProjectId: z.number().optional(),
    countIntegrationId: z.number().optional(),
    countEventType: z.number().optional(),
    countType: z.number().optional(),
    countSearchQuery: z.number().optional(),
    countProperties: z.number().optional(),
    countUserProperties: z.number().optional(),
    avgId: z.number().optional(),
    avgOrganizationId: z.number().optional(),
    avgMessageId: z.number().optional(),
    avgConversationId: z.number().optional(),
    avgCreatedAt: z.number().optional(),
    avgProjectId: z.number().optional(),
    avgIntegrationId: z.number().optional(),
    avgEventType: z.number().optional(),
    avgType: z.number().optional(),
    avgSearchQuery: z.number().optional(),
    avgProperties: z.number().optional(),
    avgUserProperties: z.number().optional(),
    minId: z.number().optional(),
    minOrganizationId: z.number().optional(),
    minMessageId: z.number().optional(),
    minConversationId: z.number().optional(),
    minCreatedAt: z.number().optional(),
    minProjectId: z.number().optional(),
    minIntegrationId: z.number().optional(),
    minEventType: z.number().optional(),
    minType: z.number().optional(),
    minSearchQuery: z.number().optional(),
    minProperties: z.number().optional(),
    minUserProperties: z.number().optional(),
    maxId: z.number().optional(),
    maxOrganizationId: z.number().optional(),
    maxMessageId: z.number().optional(),
    maxConversationId: z.number().optional(),
    maxCreatedAt: z.number().optional(),
    maxProjectId: z.number().optional(),
    maxIntegrationId: z.number().optional(),
    maxEventType: z.number().optional(),
    maxType: z.number().optional(),
    maxSearchQuery: z.number().optional(),
    maxProperties: z.number().optional(),
    maxUserProperties: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        idHour: "id_hour",
        idDay: "id_day",
        idWeek: "id_week",
        idMonth: "id_month",
        organizationIdHour: "organizationId_hour",
        organizationIdDay: "organizationId_day",
        organizationIdWeek: "organizationId_week",
        organizationIdMonth: "organizationId_month",
        messageIdHour: "messageId_hour",
        messageIdDay: "messageId_day",
        messageIdWeek: "messageId_week",
        messageIdMonth: "messageId_month",
        conversationIdHour: "conversationId_hour",
        conversationIdDay: "conversationId_day",
        conversationIdWeek: "conversationId_week",
        conversationIdMonth: "conversationId_month",
        createdAtHour: "createdAt_hour",
        createdAtDay: "createdAt_day",
        createdAtWeek: "createdAt_week",
        createdAtMonth: "createdAt_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",
        eventTypeHour: "eventType_hour",
        eventTypeDay: "eventType_day",
        eventTypeWeek: "eventType_week",
        eventTypeMonth: "eventType_month",
        typeHour: "type_hour",
        typeDay: "type_day",
        typeWeek: "type_week",
        typeMonth: "type_month",
        searchQueryHour: "searchQuery_hour",
        searchQueryDay: "searchQuery_day",
        searchQueryWeek: "searchQuery_week",
        searchQueryMonth: "searchQuery_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",
        sumOrganizationId: "sum_organizationId",
        sumMessageId: "sum_messageId",
        sumConversationId: "sum_conversationId",
        sumCreatedAt: "sum_createdAt",
        sumProjectId: "sum_projectId",
        sumIntegrationId: "sum_integrationId",
        sumEventType: "sum_eventType",
        sumType: "sum_type",
        sumSearchQuery: "sum_searchQuery",
        sumProperties: "sum_properties",
        sumUserProperties: "sum_userProperties",
        countId: "count_id",
        countOrganizationId: "count_organizationId",
        countMessageId: "count_messageId",
        countConversationId: "count_conversationId",
        countCreatedAt: "count_createdAt",
        countProjectId: "count_projectId",
        countIntegrationId: "count_integrationId",
        countEventType: "count_eventType",
        countType: "count_type",
        countSearchQuery: "count_searchQuery",
        countProperties: "count_properties",
        countUserProperties: "count_userProperties",
        avgId: "avg_id",
        avgOrganizationId: "avg_organizationId",
        avgMessageId: "avg_messageId",
        avgConversationId: "avg_conversationId",
        avgCreatedAt: "avg_createdAt",
        avgProjectId: "avg_projectId",
        avgIntegrationId: "avg_integrationId",
        avgEventType: "avg_eventType",
        avgType: "avg_type",
        avgSearchQuery: "avg_searchQuery",
        avgProperties: "avg_properties",
        avgUserProperties: "avg_userProperties",
        minId: "min_id",
        minOrganizationId: "min_organizationId",
        minMessageId: "min_messageId",
        minConversationId: "min_conversationId",
        minCreatedAt: "min_createdAt",
        minProjectId: "min_projectId",
        minIntegrationId: "min_integrationId",
        minEventType: "min_eventType",
        minType: "min_type",
        minSearchQuery: "min_searchQuery",
        minProperties: "min_properties",
        minUserProperties: "min_userProperties",
        maxId: "max_id",
        maxOrganizationId: "max_organizationId",
        maxMessageId: "max_messageId",
        maxConversationId: "max_conversationId",
        maxCreatedAt: "max_createdAt",
        maxProjectId: "max_projectId",
        maxIntegrationId: "max_integrationId",
        maxEventType: "max_eventType",
        maxType: "max_type",
        maxSearchQuery: "max_searchQuery",
        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.
 */
var EventsResultItem$;
(function (EventsResultItem$) {
    /** @deprecated use `EventsResultItem$inboundSchema` instead. */
    EventsResultItem$.inboundSchema = exports.EventsResultItem$inboundSchema;
    /** @deprecated use `EventsResultItem$outboundSchema` instead. */
    EventsResultItem$.outboundSchema = exports.EventsResultItem$outboundSchema;
})(EventsResultItem$ || (exports.EventsResultItem$ = EventsResultItem$ = {}));
function eventsResultItemToJSON(eventsResultItem) {
    return JSON.stringify(exports.EventsResultItem$outboundSchema.parse(eventsResultItem));
}
function eventsResultItemFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EventsResultItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventsResultItem' from JSON`);
}
/** @internal */
exports.QueryEventsResponseData$inboundSchema = z.object({
    result: z.array(z.lazy(() => exports.EventsResultItem$inboundSchema)),
    total: z.number(),
    pageSize: z.number(),
    count: z.number(),
});
/** @internal */
exports.QueryEventsResponseData$outboundSchema = z.object({
    result: z.array(z.lazy(() => exports.EventsResultItem$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.
 */
var QueryEventsResponseData$;
(function (QueryEventsResponseData$) {
    /** @deprecated use `QueryEventsResponseData$inboundSchema` instead. */
    QueryEventsResponseData$.inboundSchema = exports.QueryEventsResponseData$inboundSchema;
    /** @deprecated use `QueryEventsResponseData$outboundSchema` instead. */
    QueryEventsResponseData$.outboundSchema = exports.QueryEventsResponseData$outboundSchema;
})(QueryEventsResponseData$ || (exports.QueryEventsResponseData$ = QueryEventsResponseData$ = {}));
function queryEventsResponseDataToJSON(queryEventsResponseData) {
    return JSON.stringify(exports.QueryEventsResponseData$outboundSchema.parse(queryEventsResponseData));
}
function queryEventsResponseDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QueryEventsResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QueryEventsResponseData' from JSON`);
}
//# sourceMappingURL=queryeventsresponsedata.js.map