"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.SelectConversationEvent$ = exports.SelectConversationEvent$outboundSchema = exports.SelectConversationEvent$inboundSchema = exports.SelectConversationEventEntityType$ = exports.SelectConversationEventEntityType$outboundSchema = exports.SelectConversationEventEntityType$inboundSchema = exports.SelectConversationEventUserProperties$ = exports.SelectConversationEventUserProperties$outboundSchema = exports.SelectConversationEventUserProperties$inboundSchema = exports.SelectConversationEventUserId$ = exports.SelectConversationEventUserId$outboundSchema = exports.SelectConversationEventUserId$inboundSchema = exports.SelectConversationEventId$ = exports.SelectConversationEventId$outboundSchema = exports.SelectConversationEventId$inboundSchema = exports.SelectConversationEventEntityType = void 0;
exports.selectConversationEventIdToJSON = selectConversationEventIdToJSON;
exports.selectConversationEventIdFromJSON = selectConversationEventIdFromJSON;
exports.selectConversationEventUserIdToJSON = selectConversationEventUserIdToJSON;
exports.selectConversationEventUserIdFromJSON = selectConversationEventUserIdFromJSON;
exports.selectConversationEventUserPropertiesToJSON = selectConversationEventUserPropertiesToJSON;
exports.selectConversationEventUserPropertiesFromJSON = selectConversationEventUserPropertiesFromJSON;
exports.selectConversationEventToJSON = selectConversationEventToJSON;
exports.selectConversationEventFromJSON = selectConversationEventFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.SelectConversationEventEntityType = {
    Conversation: "conversation",
};
/** @internal */
exports.SelectConversationEventId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SelectConversationEventId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SelectConversationEventId$;
(function (SelectConversationEventId$) {
    /** @deprecated use `SelectConversationEventId$inboundSchema` instead. */
    SelectConversationEventId$.inboundSchema = exports.SelectConversationEventId$inboundSchema;
    /** @deprecated use `SelectConversationEventId$outboundSchema` instead. */
    SelectConversationEventId$.outboundSchema = exports.SelectConversationEventId$outboundSchema;
})(SelectConversationEventId$ || (exports.SelectConversationEventId$ = SelectConversationEventId$ = {}));
function selectConversationEventIdToJSON(selectConversationEventId) {
    return JSON.stringify(exports.SelectConversationEventId$outboundSchema.parse(selectConversationEventId));
}
function selectConversationEventIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SelectConversationEventId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventId' from JSON`);
}
/** @internal */
exports.SelectConversationEventUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SelectConversationEventUserId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SelectConversationEventUserId$;
(function (SelectConversationEventUserId$) {
    /** @deprecated use `SelectConversationEventUserId$inboundSchema` instead. */
    SelectConversationEventUserId$.inboundSchema = exports.SelectConversationEventUserId$inboundSchema;
    /** @deprecated use `SelectConversationEventUserId$outboundSchema` instead. */
    SelectConversationEventUserId$.outboundSchema = exports.SelectConversationEventUserId$outboundSchema;
})(SelectConversationEventUserId$ || (exports.SelectConversationEventUserId$ = SelectConversationEventUserId$ = {}));
function selectConversationEventUserIdToJSON(selectConversationEventUserId) {
    return JSON.stringify(exports.SelectConversationEventUserId$outboundSchema.parse(selectConversationEventUserId));
}
function selectConversationEventUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SelectConversationEventUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventUserId' from JSON`);
}
/** @internal */
exports.SelectConversationEventUserProperties$inboundSchema = (0, schemas_js_1.collectExtraKeys)(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.SelectConversationEventUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SelectConversationEventUserProperties$;
(function (SelectConversationEventUserProperties$) {
    /** @deprecated use `SelectConversationEventUserProperties$inboundSchema` instead. */
    SelectConversationEventUserProperties$.inboundSchema = exports.SelectConversationEventUserProperties$inboundSchema;
    /** @deprecated use `SelectConversationEventUserProperties$outboundSchema` instead. */
    SelectConversationEventUserProperties$.outboundSchema = exports.SelectConversationEventUserProperties$outboundSchema;
})(SelectConversationEventUserProperties$ || (exports.SelectConversationEventUserProperties$ = SelectConversationEventUserProperties$ = {}));
function selectConversationEventUserPropertiesToJSON(selectConversationEventUserProperties) {
    return JSON.stringify(exports.SelectConversationEventUserProperties$outboundSchema.parse(selectConversationEventUserProperties));
}
function selectConversationEventUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SelectConversationEventUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventUserProperties' from JSON`);
}
/** @internal */
exports.SelectConversationEventEntityType$inboundSchema = z.nativeEnum(exports.SelectConversationEventEntityType);
/** @internal */
exports.SelectConversationEventEntityType$outboundSchema = exports.SelectConversationEventEntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SelectConversationEventEntityType$;
(function (SelectConversationEventEntityType$) {
    /** @deprecated use `SelectConversationEventEntityType$inboundSchema` instead. */
    SelectConversationEventEntityType$.inboundSchema = exports.SelectConversationEventEntityType$inboundSchema;
    /** @deprecated use `SelectConversationEventEntityType$outboundSchema` instead. */
    SelectConversationEventEntityType$.outboundSchema = exports.SelectConversationEventEntityType$outboundSchema;
})(SelectConversationEventEntityType$ || (exports.SelectConversationEventEntityType$ = SelectConversationEventEntityType$ = {}));
/** @internal */
exports.SelectConversationEvent$inboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SelectConversationEventUserProperties$inboundSchema)).optional(),
    entityType: exports.SelectConversationEventEntityType$inboundSchema,
});
/** @internal */
exports.SelectConversationEvent$outboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SelectConversationEventUserProperties$outboundSchema)).optional(),
    entityType: exports.SelectConversationEventEntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SelectConversationEvent$;
(function (SelectConversationEvent$) {
    /** @deprecated use `SelectConversationEvent$inboundSchema` instead. */
    SelectConversationEvent$.inboundSchema = exports.SelectConversationEvent$inboundSchema;
    /** @deprecated use `SelectConversationEvent$outboundSchema` instead. */
    SelectConversationEvent$.outboundSchema = exports.SelectConversationEvent$outboundSchema;
})(SelectConversationEvent$ || (exports.SelectConversationEvent$ = SelectConversationEvent$ = {}));
function selectConversationEventToJSON(selectConversationEvent) {
    return JSON.stringify(exports.SelectConversationEvent$outboundSchema.parse(selectConversationEvent));
}
function selectConversationEventFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SelectConversationEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEvent' from JSON`);
}
//# sourceMappingURL=selectconversationevent.js.map