"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.CreateSupportCopilotConversation$outboundSchema = exports.CreateSupportCopilotConversation$inboundSchema = exports.CreateSupportCopilotConversationMessages$outboundSchema = exports.CreateSupportCopilotConversationMessages$inboundSchema = exports.CreateSupportCopilotConversationMessagesUserProperties$outboundSchema = exports.CreateSupportCopilotConversationMessagesUserProperties$inboundSchema = exports.CreateSupportCopilotConversationMessagesUserId$outboundSchema = exports.CreateSupportCopilotConversationMessagesUserId$inboundSchema = exports.CreateSupportCopilotConversationMessagesId$outboundSchema = exports.CreateSupportCopilotConversationMessagesId$inboundSchema = exports.CreateSupportCopilotConversationLinks$outboundSchema = exports.CreateSupportCopilotConversationLinks$inboundSchema = exports.CreateSupportCopilotConversationMessagesType$outboundSchema = exports.CreateSupportCopilotConversationMessagesType$inboundSchema = exports.CreateSupportCopilotConversationType1$outboundSchema = exports.CreateSupportCopilotConversationType1$inboundSchema = exports.CreateSupportCopilotConversationVisibility$outboundSchema = exports.CreateSupportCopilotConversationVisibility$inboundSchema = exports.CreateSupportCopilotConversationUserProperties$outboundSchema = exports.CreateSupportCopilotConversationUserProperties$inboundSchema = exports.CreateSupportCopilotConversationUserId$outboundSchema = exports.CreateSupportCopilotConversationUserId$inboundSchema = exports.CreateSupportCopilotConversationId$outboundSchema = exports.CreateSupportCopilotConversationId$inboundSchema = exports.CreateSupportCopilotConversationType1 = exports.CreateSupportCopilotConversationVisibility = void 0;
exports.createSupportCopilotConversationIdToJSON = createSupportCopilotConversationIdToJSON;
exports.createSupportCopilotConversationIdFromJSON = createSupportCopilotConversationIdFromJSON;
exports.createSupportCopilotConversationUserIdToJSON = createSupportCopilotConversationUserIdToJSON;
exports.createSupportCopilotConversationUserIdFromJSON = createSupportCopilotConversationUserIdFromJSON;
exports.createSupportCopilotConversationUserPropertiesToJSON = createSupportCopilotConversationUserPropertiesToJSON;
exports.createSupportCopilotConversationUserPropertiesFromJSON = createSupportCopilotConversationUserPropertiesFromJSON;
exports.createSupportCopilotConversationMessagesTypeToJSON = createSupportCopilotConversationMessagesTypeToJSON;
exports.createSupportCopilotConversationMessagesTypeFromJSON = createSupportCopilotConversationMessagesTypeFromJSON;
exports.createSupportCopilotConversationLinksToJSON = createSupportCopilotConversationLinksToJSON;
exports.createSupportCopilotConversationLinksFromJSON = createSupportCopilotConversationLinksFromJSON;
exports.createSupportCopilotConversationMessagesIdToJSON = createSupportCopilotConversationMessagesIdToJSON;
exports.createSupportCopilotConversationMessagesIdFromJSON = createSupportCopilotConversationMessagesIdFromJSON;
exports.createSupportCopilotConversationMessagesUserIdToJSON = createSupportCopilotConversationMessagesUserIdToJSON;
exports.createSupportCopilotConversationMessagesUserIdFromJSON = createSupportCopilotConversationMessagesUserIdFromJSON;
exports.createSupportCopilotConversationMessagesUserPropertiesToJSON = createSupportCopilotConversationMessagesUserPropertiesToJSON;
exports.createSupportCopilotConversationMessagesUserPropertiesFromJSON = createSupportCopilotConversationMessagesUserPropertiesFromJSON;
exports.createSupportCopilotConversationMessagesToJSON = createSupportCopilotConversationMessagesToJSON;
exports.createSupportCopilotConversationMessagesFromJSON = createSupportCopilotConversationMessagesFromJSON;
exports.createSupportCopilotConversationToJSON = createSupportCopilotConversationToJSON;
exports.createSupportCopilotConversationFromJSON = createSupportCopilotConversationFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.CreateSupportCopilotConversationVisibility = {
    Private: "private",
    Public: "public",
};
exports.CreateSupportCopilotConversationType1 = {
    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.CreateSupportCopilotConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportCopilotConversationId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportCopilotConversationIdToJSON(createSupportCopilotConversationId) {
    return JSON.stringify(exports.CreateSupportCopilotConversationId$outboundSchema.parse(createSupportCopilotConversationId));
}
function createSupportCopilotConversationIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationId' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportCopilotConversationUserId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportCopilotConversationUserIdToJSON(createSupportCopilotConversationUserId) {
    return JSON.stringify(exports.CreateSupportCopilotConversationUserId$outboundSchema.parse(createSupportCopilotConversationUserId));
}
function createSupportCopilotConversationUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationUserId' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.CreateSupportCopilotConversationUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function createSupportCopilotConversationUserPropertiesToJSON(createSupportCopilotConversationUserProperties) {
    return JSON.stringify(exports.CreateSupportCopilotConversationUserProperties$outboundSchema.parse(createSupportCopilotConversationUserProperties));
}
function createSupportCopilotConversationUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationUserProperties' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationVisibility$inboundSchema = z
    .nativeEnum(exports.CreateSupportCopilotConversationVisibility);
/** @internal */
exports.CreateSupportCopilotConversationVisibility$outboundSchema = exports.CreateSupportCopilotConversationVisibility$inboundSchema;
/** @internal */
exports.CreateSupportCopilotConversationType1$inboundSchema = z.nativeEnum(exports.CreateSupportCopilotConversationType1);
/** @internal */
exports.CreateSupportCopilotConversationType1$outboundSchema = exports.CreateSupportCopilotConversationType1$inboundSchema;
/** @internal */
exports.CreateSupportCopilotConversationMessagesType$inboundSchema = z.union([
    exports.CreateSupportCopilotConversationType1$inboundSchema,
    z.string(),
]);
/** @internal */
exports.CreateSupportCopilotConversationMessagesType$outboundSchema = z.union([
    exports.CreateSupportCopilotConversationType1$outboundSchema,
    z.string(),
]);
function createSupportCopilotConversationMessagesTypeToJSON(createSupportCopilotConversationMessagesType) {
    return JSON.stringify(exports.CreateSupportCopilotConversationMessagesType$outboundSchema.parse(createSupportCopilotConversationMessagesType));
}
function createSupportCopilotConversationMessagesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationMessagesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationMessagesType' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationLinks$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.CreateSupportCopilotConversationType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
exports.CreateSupportCopilotConversationLinks$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.CreateSupportCopilotConversationType1$outboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
function createSupportCopilotConversationLinksToJSON(createSupportCopilotConversationLinks) {
    return JSON.stringify(exports.CreateSupportCopilotConversationLinks$outboundSchema.parse(createSupportCopilotConversationLinks));
}
function createSupportCopilotConversationLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationLinks' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationMessagesId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportCopilotConversationMessagesId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportCopilotConversationMessagesIdToJSON(createSupportCopilotConversationMessagesId) {
    return JSON.stringify(exports.CreateSupportCopilotConversationMessagesId$outboundSchema.parse(createSupportCopilotConversationMessagesId));
}
function createSupportCopilotConversationMessagesIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationMessagesId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationMessagesId' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationMessagesUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportCopilotConversationMessagesUserId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportCopilotConversationMessagesUserIdToJSON(createSupportCopilotConversationMessagesUserId) {
    return JSON.stringify(exports.CreateSupportCopilotConversationMessagesUserId$outboundSchema.parse(createSupportCopilotConversationMessagesUserId));
}
function createSupportCopilotConversationMessagesUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationMessagesUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationMessagesUserId' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationMessagesUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.CreateSupportCopilotConversationMessagesUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function createSupportCopilotConversationMessagesUserPropertiesToJSON(createSupportCopilotConversationMessagesUserProperties) {
    return JSON.stringify(exports.CreateSupportCopilotConversationMessagesUserProperties$outboundSchema.parse(createSupportCopilotConversationMessagesUserProperties));
}
function createSupportCopilotConversationMessagesUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationMessagesUserProperties$inboundSchema
        .parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationMessagesUserProperties' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversationMessages$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: z.string(),
    content: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateSupportCopilotConversationLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportCopilotConversationMessagesUserProperties$inboundSchema)).optional(),
});
/** @internal */
exports.CreateSupportCopilotConversationMessages$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: z.string(),
    content: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateSupportCopilotConversationLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportCopilotConversationMessagesUserProperties$outboundSchema)).optional(),
});
function createSupportCopilotConversationMessagesToJSON(createSupportCopilotConversationMessages) {
    return JSON.stringify(exports.CreateSupportCopilotConversationMessages$outboundSchema.parse(createSupportCopilotConversationMessages));
}
function createSupportCopilotConversationMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversationMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversationMessages' from JSON`);
}
/** @internal */
exports.CreateSupportCopilotConversation$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: z.literal("support_copilot"),
    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.lazy(() => exports.CreateSupportCopilotConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.CreateSupportCopilotConversationVisibility$inboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.CreateSupportCopilotConversationMessages$inboundSchema)),
});
/** @internal */
exports.CreateSupportCopilotConversation$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: z.literal("support_copilot"),
    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.lazy(() => exports.CreateSupportCopilotConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.CreateSupportCopilotConversationVisibility$outboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.CreateSupportCopilotConversationMessages$outboundSchema)),
});
function createSupportCopilotConversationToJSON(createSupportCopilotConversation) {
    return JSON.stringify(exports.CreateSupportCopilotConversation$outboundSchema.parse(createSupportCopilotConversation));
}
function createSupportCopilotConversationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportCopilotConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportCopilotConversation' from JSON`);
}
//# sourceMappingURL=createsupportcopilotconversation.js.map