"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.OpenAIConversation$ = exports.OpenAIConversation$outboundSchema = exports.OpenAIConversation$inboundSchema = exports.OpenAIConversationVisibility$ = exports.OpenAIConversationVisibility$outboundSchema = exports.OpenAIConversationVisibility$inboundSchema = exports.OpenAIConversationUserProperties$ = exports.OpenAIConversationUserProperties$outboundSchema = exports.OpenAIConversationUserProperties$inboundSchema = exports.OpenAIConversationUserId$ = exports.OpenAIConversationUserId$outboundSchema = exports.OpenAIConversationUserId$inboundSchema = exports.OpenAIConversationId$ = exports.OpenAIConversationId$outboundSchema = exports.OpenAIConversationId$inboundSchema = exports.OpenAIConversationType$ = exports.OpenAIConversationType$outboundSchema = exports.OpenAIConversationType$inboundSchema = exports.OpenAIConversationVisibility = exports.OpenAIConversationType = void 0;
exports.openAIConversationIdToJSON = openAIConversationIdToJSON;
exports.openAIConversationIdFromJSON = openAIConversationIdFromJSON;
exports.openAIConversationUserIdToJSON = openAIConversationUserIdToJSON;
exports.openAIConversationUserIdFromJSON = openAIConversationUserIdFromJSON;
exports.openAIConversationUserPropertiesToJSON = openAIConversationUserPropertiesToJSON;
exports.openAIConversationUserPropertiesFromJSON = openAIConversationUserPropertiesFromJSON;
exports.openAIConversationToJSON = openAIConversationToJSON;
exports.openAIConversationFromJSON = openAIConversationFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const openaichatcompletionmessage_js_1 = require("./openaichatcompletionmessage.js");
const openaiextendedmessage_js_1 = require("./openaiextendedmessage.js");
exports.OpenAIConversationType = {
    Openai: "openai",
};
exports.OpenAIConversationVisibility = {
    Private: "private",
    Public: "public",
};
/** @internal */
exports.OpenAIConversationType$inboundSchema = z.nativeEnum(exports.OpenAIConversationType);
/** @internal */
exports.OpenAIConversationType$outboundSchema = exports.OpenAIConversationType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OpenAIConversationType$;
(function (OpenAIConversationType$) {
    /** @deprecated use `OpenAIConversationType$inboundSchema` instead. */
    OpenAIConversationType$.inboundSchema = exports.OpenAIConversationType$inboundSchema;
    /** @deprecated use `OpenAIConversationType$outboundSchema` instead. */
    OpenAIConversationType$.outboundSchema = exports.OpenAIConversationType$outboundSchema;
})(OpenAIConversationType$ || (exports.OpenAIConversationType$ = OpenAIConversationType$ = {}));
/** @internal */
exports.OpenAIConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.OpenAIConversationId$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 OpenAIConversationId$;
(function (OpenAIConversationId$) {
    /** @deprecated use `OpenAIConversationId$inboundSchema` instead. */
    OpenAIConversationId$.inboundSchema = exports.OpenAIConversationId$inboundSchema;
    /** @deprecated use `OpenAIConversationId$outboundSchema` instead. */
    OpenAIConversationId$.outboundSchema = exports.OpenAIConversationId$outboundSchema;
})(OpenAIConversationId$ || (exports.OpenAIConversationId$ = OpenAIConversationId$ = {}));
function openAIConversationIdToJSON(openAIConversationId) {
    return JSON.stringify(exports.OpenAIConversationId$outboundSchema.parse(openAIConversationId));
}
function openAIConversationIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OpenAIConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationId' from JSON`);
}
/** @internal */
exports.OpenAIConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.OpenAIConversationUserId$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 OpenAIConversationUserId$;
(function (OpenAIConversationUserId$) {
    /** @deprecated use `OpenAIConversationUserId$inboundSchema` instead. */
    OpenAIConversationUserId$.inboundSchema = exports.OpenAIConversationUserId$inboundSchema;
    /** @deprecated use `OpenAIConversationUserId$outboundSchema` instead. */
    OpenAIConversationUserId$.outboundSchema = exports.OpenAIConversationUserId$outboundSchema;
})(OpenAIConversationUserId$ || (exports.OpenAIConversationUserId$ = OpenAIConversationUserId$ = {}));
function openAIConversationUserIdToJSON(openAIConversationUserId) {
    return JSON.stringify(exports.OpenAIConversationUserId$outboundSchema.parse(openAIConversationUserId));
}
function openAIConversationUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OpenAIConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationUserId' from JSON`);
}
/** @internal */
exports.OpenAIConversationUserProperties$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.OpenAIConversationUserProperties$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 OpenAIConversationUserProperties$;
(function (OpenAIConversationUserProperties$) {
    /** @deprecated use `OpenAIConversationUserProperties$inboundSchema` instead. */
    OpenAIConversationUserProperties$.inboundSchema = exports.OpenAIConversationUserProperties$inboundSchema;
    /** @deprecated use `OpenAIConversationUserProperties$outboundSchema` instead. */
    OpenAIConversationUserProperties$.outboundSchema = exports.OpenAIConversationUserProperties$outboundSchema;
})(OpenAIConversationUserProperties$ || (exports.OpenAIConversationUserProperties$ = OpenAIConversationUserProperties$ = {}));
function openAIConversationUserPropertiesToJSON(openAIConversationUserProperties) {
    return JSON.stringify(exports.OpenAIConversationUserProperties$outboundSchema.parse(openAIConversationUserProperties));
}
function openAIConversationUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OpenAIConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationUserProperties' from JSON`);
}
/** @internal */
exports.OpenAIConversationVisibility$inboundSchema = z.nativeEnum(exports.OpenAIConversationVisibility);
/** @internal */
exports.OpenAIConversationVisibility$outboundSchema = exports.OpenAIConversationVisibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OpenAIConversationVisibility$;
(function (OpenAIConversationVisibility$) {
    /** @deprecated use `OpenAIConversationVisibility$inboundSchema` instead. */
    OpenAIConversationVisibility$.inboundSchema = exports.OpenAIConversationVisibility$inboundSchema;
    /** @deprecated use `OpenAIConversationVisibility$outboundSchema` instead. */
    OpenAIConversationVisibility$.outboundSchema = exports.OpenAIConversationVisibility$outboundSchema;
})(OpenAIConversationVisibility$ || (exports.OpenAIConversationVisibility$ = OpenAIConversationVisibility$ = {}));
/** @internal */
exports.OpenAIConversation$inboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: exports.OpenAIConversationType$inboundSchema,
    supportTicketConversationId: z.nullable(z.string()),
    createdAt: z.string(),
    updatedAt: 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.OpenAIConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.OpenAIConversationVisibility$inboundSchema),
    messages: z.array(openaiextendedmessage_js_1.OpenAIExtendedMessage$inboundSchema),
    messagesOpenAIFormat: z.array(openaichatcompletionmessage_js_1.OpenAIChatCompletionMessage$inboundSchema),
});
/** @internal */
exports.OpenAIConversation$outboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: exports.OpenAIConversationType$outboundSchema,
    supportTicketConversationId: z.nullable(z.string()),
    createdAt: z.string(),
    updatedAt: 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.OpenAIConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.OpenAIConversationVisibility$outboundSchema),
    messages: z.array(openaiextendedmessage_js_1.OpenAIExtendedMessage$outboundSchema),
    messagesOpenAIFormat: z.array(openaichatcompletionmessage_js_1.OpenAIChatCompletionMessage$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OpenAIConversation$;
(function (OpenAIConversation$) {
    /** @deprecated use `OpenAIConversation$inboundSchema` instead. */
    OpenAIConversation$.inboundSchema = exports.OpenAIConversation$inboundSchema;
    /** @deprecated use `OpenAIConversation$outboundSchema` instead. */
    OpenAIConversation$.outboundSchema = exports.OpenAIConversation$outboundSchema;
})(OpenAIConversation$ || (exports.OpenAIConversation$ = OpenAIConversation$ = {}));
function openAIConversationToJSON(openAIConversation) {
    return JSON.stringify(exports.OpenAIConversation$outboundSchema.parse(openAIConversation));
}
function openAIConversationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OpenAIConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversation' from JSON`);
}
//# sourceMappingURL=openaiconversation.js.map