"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.CreateOpenAIConversation$ = exports.CreateOpenAIConversation$outboundSchema = exports.CreateOpenAIConversation$inboundSchema = exports.Messages$ = exports.Messages$outboundSchema = exports.Messages$inboundSchema = exports.CreateOpenAIConversationLinks$ = exports.CreateOpenAIConversationLinks$outboundSchema = exports.CreateOpenAIConversationLinks$inboundSchema = exports.CreateOpenAIConversationType$ = exports.CreateOpenAIConversationType$outboundSchema = exports.CreateOpenAIConversationType$inboundSchema = exports.CreateOpenAIConversationType1$ = exports.CreateOpenAIConversationType1$outboundSchema = exports.CreateOpenAIConversationType1$inboundSchema = exports.CreateOpenAIConversationContent$ = exports.CreateOpenAIConversationContent$outboundSchema = exports.CreateOpenAIConversationContent$inboundSchema = exports.CreateOpenAIConversationRole$ = exports.CreateOpenAIConversationRole$outboundSchema = exports.CreateOpenAIConversationRole$inboundSchema = exports.Visibility$ = exports.Visibility$outboundSchema = exports.Visibility$inboundSchema = exports.Type$ = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.CreateOpenAIConversationType1 = exports.CreateOpenAIConversationRole = exports.Visibility = exports.Type = void 0;
exports.createOpenAIConversationContentToJSON = createOpenAIConversationContentToJSON;
exports.createOpenAIConversationContentFromJSON = createOpenAIConversationContentFromJSON;
exports.createOpenAIConversationTypeToJSON = createOpenAIConversationTypeToJSON;
exports.createOpenAIConversationTypeFromJSON = createOpenAIConversationTypeFromJSON;
exports.createOpenAIConversationLinksToJSON = createOpenAIConversationLinksToJSON;
exports.createOpenAIConversationLinksFromJSON = createOpenAIConversationLinksFromJSON;
exports.messagesToJSON = messagesToJSON;
exports.messagesFromJSON = messagesFromJSON;
exports.createOpenAIConversationToJSON = createOpenAIConversationToJSON;
exports.createOpenAIConversationFromJSON = createOpenAIConversationFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const openaicontentitem_js_1 = require("./openaicontentitem.js");
const openaitoolcall_js_1 = require("./openaitoolcall.js");
exports.Type = {
    Openai: "openai",
};
exports.Visibility = {
    Private: "private",
    Public: "public",
};
exports.CreateOpenAIConversationRole = {
    System: "system",
    User: "user",
    Assistant: "assistant",
};
exports.CreateOpenAIConversationType1 = {
    Documentation: "documentation",
    Site: "site",
    DiscoursePost: "discourse_post",
    GithubIssue: "github_issue",
    GithubDiscussion: "github_discussion",
    StackoverflowQuestion: "stackoverflow_question",
    DiscordForumPost: "discord_forum_post",
    DiscordMessage: "discord_message",
    CustomQuestionAnswer: "custom_question_answer",
};
/** @internal */
exports.Type$inboundSchema = z.nativeEnum(exports.Type);
/** @internal */
exports.Type$outboundSchema = exports.Type$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Type$;
(function (Type$) {
    /** @deprecated use `Type$inboundSchema` instead. */
    Type$.inboundSchema = exports.Type$inboundSchema;
    /** @deprecated use `Type$outboundSchema` instead. */
    Type$.outboundSchema = exports.Type$outboundSchema;
})(Type$ || (exports.Type$ = Type$ = {}));
/** @internal */
exports.Visibility$inboundSchema = z
    .nativeEnum(exports.Visibility);
/** @internal */
exports.Visibility$outboundSchema = exports.Visibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Visibility$;
(function (Visibility$) {
    /** @deprecated use `Visibility$inboundSchema` instead. */
    Visibility$.inboundSchema = exports.Visibility$inboundSchema;
    /** @deprecated use `Visibility$outboundSchema` instead. */
    Visibility$.outboundSchema = exports.Visibility$outboundSchema;
})(Visibility$ || (exports.Visibility$ = Visibility$ = {}));
/** @internal */
exports.CreateOpenAIConversationRole$inboundSchema = z.nativeEnum(exports.CreateOpenAIConversationRole);
/** @internal */
exports.CreateOpenAIConversationRole$outboundSchema = exports.CreateOpenAIConversationRole$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversationRole$;
(function (CreateOpenAIConversationRole$) {
    /** @deprecated use `CreateOpenAIConversationRole$inboundSchema` instead. */
    CreateOpenAIConversationRole$.inboundSchema = exports.CreateOpenAIConversationRole$inboundSchema;
    /** @deprecated use `CreateOpenAIConversationRole$outboundSchema` instead. */
    CreateOpenAIConversationRole$.outboundSchema = exports.CreateOpenAIConversationRole$outboundSchema;
})(CreateOpenAIConversationRole$ || (exports.CreateOpenAIConversationRole$ = CreateOpenAIConversationRole$ = {}));
/** @internal */
exports.CreateOpenAIConversationContent$inboundSchema = z.union([z.string(), z.array(openaicontentitem_js_1.OpenAIContentItem$inboundSchema)]);
/** @internal */
exports.CreateOpenAIConversationContent$outboundSchema = z.union([z.string(), z.array(openaicontentitem_js_1.OpenAIContentItem$outboundSchema)]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversationContent$;
(function (CreateOpenAIConversationContent$) {
    /** @deprecated use `CreateOpenAIConversationContent$inboundSchema` instead. */
    CreateOpenAIConversationContent$.inboundSchema = exports.CreateOpenAIConversationContent$inboundSchema;
    /** @deprecated use `CreateOpenAIConversationContent$outboundSchema` instead. */
    CreateOpenAIConversationContent$.outboundSchema = exports.CreateOpenAIConversationContent$outboundSchema;
})(CreateOpenAIConversationContent$ || (exports.CreateOpenAIConversationContent$ = CreateOpenAIConversationContent$ = {}));
function createOpenAIConversationContentToJSON(createOpenAIConversationContent) {
    return JSON.stringify(exports.CreateOpenAIConversationContent$outboundSchema.parse(createOpenAIConversationContent));
}
function createOpenAIConversationContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateOpenAIConversationContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateOpenAIConversationContent' from JSON`);
}
/** @internal */
exports.CreateOpenAIConversationType1$inboundSchema = z.nativeEnum(exports.CreateOpenAIConversationType1);
/** @internal */
exports.CreateOpenAIConversationType1$outboundSchema = exports.CreateOpenAIConversationType1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversationType1$;
(function (CreateOpenAIConversationType1$) {
    /** @deprecated use `CreateOpenAIConversationType1$inboundSchema` instead. */
    CreateOpenAIConversationType1$.inboundSchema = exports.CreateOpenAIConversationType1$inboundSchema;
    /** @deprecated use `CreateOpenAIConversationType1$outboundSchema` instead. */
    CreateOpenAIConversationType1$.outboundSchema = exports.CreateOpenAIConversationType1$outboundSchema;
})(CreateOpenAIConversationType1$ || (exports.CreateOpenAIConversationType1$ = CreateOpenAIConversationType1$ = {}));
/** @internal */
exports.CreateOpenAIConversationType$inboundSchema = z.union([exports.CreateOpenAIConversationType1$inboundSchema, z.string()]);
/** @internal */
exports.CreateOpenAIConversationType$outboundSchema = z.union([exports.CreateOpenAIConversationType1$outboundSchema, z.string()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversationType$;
(function (CreateOpenAIConversationType$) {
    /** @deprecated use `CreateOpenAIConversationType$inboundSchema` instead. */
    CreateOpenAIConversationType$.inboundSchema = exports.CreateOpenAIConversationType$inboundSchema;
    /** @deprecated use `CreateOpenAIConversationType$outboundSchema` instead. */
    CreateOpenAIConversationType$.outboundSchema = exports.CreateOpenAIConversationType$outboundSchema;
})(CreateOpenAIConversationType$ || (exports.CreateOpenAIConversationType$ = CreateOpenAIConversationType$ = {}));
function createOpenAIConversationTypeToJSON(createOpenAIConversationType) {
    return JSON.stringify(exports.CreateOpenAIConversationType$outboundSchema.parse(createOpenAIConversationType));
}
function createOpenAIConversationTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateOpenAIConversationType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateOpenAIConversationType' from JSON`);
}
/** @internal */
exports.CreateOpenAIConversationLinks$inboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    url: z.string(),
    title: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(z.union([exports.CreateOpenAIConversationType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
exports.CreateOpenAIConversationLinks$outboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    url: z.string(),
    title: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(z.union([exports.CreateOpenAIConversationType1$outboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversationLinks$;
(function (CreateOpenAIConversationLinks$) {
    /** @deprecated use `CreateOpenAIConversationLinks$inboundSchema` instead. */
    CreateOpenAIConversationLinks$.inboundSchema = exports.CreateOpenAIConversationLinks$inboundSchema;
    /** @deprecated use `CreateOpenAIConversationLinks$outboundSchema` instead. */
    CreateOpenAIConversationLinks$.outboundSchema = exports.CreateOpenAIConversationLinks$outboundSchema;
})(CreateOpenAIConversationLinks$ || (exports.CreateOpenAIConversationLinks$ = CreateOpenAIConversationLinks$ = {}));
function createOpenAIConversationLinksToJSON(createOpenAIConversationLinks) {
    return JSON.stringify(exports.CreateOpenAIConversationLinks$outboundSchema.parse(createOpenAIConversationLinks));
}
function createOpenAIConversationLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateOpenAIConversationLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateOpenAIConversationLinks' from JSON`);
}
/** @internal */
exports.Messages$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updatedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    role: exports.CreateOpenAIConversationRole$inboundSchema,
    content: z.union([z.string(), z.array(openaicontentitem_js_1.OpenAIContentItem$inboundSchema)]),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateOpenAIConversationLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    tool_calls: z.nullable(z.array(openaitoolcall_js_1.OpenAIToolCall$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tool_calls": "toolCalls",
    });
});
/** @internal */
exports.Messages$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    role: exports.CreateOpenAIConversationRole$outboundSchema,
    content: z.union([z.string(), z.array(openaicontentitem_js_1.OpenAIContentItem$outboundSchema)]),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateOpenAIConversationLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    toolCalls: z.nullable(z.array(openaitoolcall_js_1.OpenAIToolCall$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCalls: "tool_calls",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Messages$;
(function (Messages$) {
    /** @deprecated use `Messages$inboundSchema` instead. */
    Messages$.inboundSchema = exports.Messages$inboundSchema;
    /** @deprecated use `Messages$outboundSchema` instead. */
    Messages$.outboundSchema = exports.Messages$outboundSchema;
})(Messages$ || (exports.Messages$ = Messages$ = {}));
function messagesToJSON(messages) {
    return JSON.stringify(exports.Messages$outboundSchema.parse(messages));
}
function messagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Messages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Messages' from JSON`);
}
/** @internal */
exports.CreateOpenAIConversation$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: exports.Type$inboundSchema,
    supportTicketConversationId: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updatedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.Visibility$inboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.Messages$inboundSchema)),
});
/** @internal */
exports.CreateOpenAIConversation$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: exports.Type$outboundSchema,
    supportTicketConversationId: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.Visibility$outboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.Messages$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateOpenAIConversation$;
(function (CreateOpenAIConversation$) {
    /** @deprecated use `CreateOpenAIConversation$inboundSchema` instead. */
    CreateOpenAIConversation$.inboundSchema = exports.CreateOpenAIConversation$inboundSchema;
    /** @deprecated use `CreateOpenAIConversation$outboundSchema` instead. */
    CreateOpenAIConversation$.outboundSchema = exports.CreateOpenAIConversation$outboundSchema;
})(CreateOpenAIConversation$ || (exports.CreateOpenAIConversation$ = CreateOpenAIConversation$ = {}));
function createOpenAIConversationToJSON(createOpenAIConversation) {
    return JSON.stringify(exports.CreateOpenAIConversation$outboundSchema.parse(createOpenAIConversation));
}
function createOpenAIConversationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateOpenAIConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateOpenAIConversation' from JSON`);
}
//# sourceMappingURL=createopenaiconversation.js.map