"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.SupportCopilotMessage$ = exports.SupportCopilotMessage$outboundSchema = exports.SupportCopilotMessage$inboundSchema = exports.SupportCopilotMessageUserProperties$ = exports.SupportCopilotMessageUserProperties$outboundSchema = exports.SupportCopilotMessageUserProperties$inboundSchema = exports.SupportCopilotMessageUserId$ = exports.SupportCopilotMessageUserId$outboundSchema = exports.SupportCopilotMessageUserId$inboundSchema = exports.SupportCopilotMessageId$ = exports.SupportCopilotMessageId$outboundSchema = exports.SupportCopilotMessageId$inboundSchema = exports.SupportCopilotMessageLinks$ = exports.SupportCopilotMessageLinks$outboundSchema = exports.SupportCopilotMessageLinks$inboundSchema = exports.SupportCopilotMessageLinksType$ = exports.SupportCopilotMessageLinksType$outboundSchema = exports.SupportCopilotMessageLinksType$inboundSchema = exports.SupportCopilotMessageType1$ = exports.SupportCopilotMessageType1$outboundSchema = exports.SupportCopilotMessageType1$inboundSchema = exports.SupportCopilotMessageType$ = exports.SupportCopilotMessageType$outboundSchema = exports.SupportCopilotMessageType$inboundSchema = exports.SupportCopilotMessageType1 = exports.SupportCopilotMessageType = void 0;
exports.supportCopilotMessageLinksTypeToJSON = supportCopilotMessageLinksTypeToJSON;
exports.supportCopilotMessageLinksTypeFromJSON = supportCopilotMessageLinksTypeFromJSON;
exports.supportCopilotMessageLinksToJSON = supportCopilotMessageLinksToJSON;
exports.supportCopilotMessageLinksFromJSON = supportCopilotMessageLinksFromJSON;
exports.supportCopilotMessageIdToJSON = supportCopilotMessageIdToJSON;
exports.supportCopilotMessageIdFromJSON = supportCopilotMessageIdFromJSON;
exports.supportCopilotMessageUserIdToJSON = supportCopilotMessageUserIdToJSON;
exports.supportCopilotMessageUserIdFromJSON = supportCopilotMessageUserIdFromJSON;
exports.supportCopilotMessageUserPropertiesToJSON = supportCopilotMessageUserPropertiesToJSON;
exports.supportCopilotMessageUserPropertiesFromJSON = supportCopilotMessageUserPropertiesFromJSON;
exports.supportCopilotMessageToJSON = supportCopilotMessageToJSON;
exports.supportCopilotMessageFromJSON = supportCopilotMessageFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.SupportCopilotMessageType = {
    SupportCopilot: "support_copilot",
};
exports.SupportCopilotMessageType1 = {
    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.SupportCopilotMessageType$inboundSchema = z.nativeEnum(exports.SupportCopilotMessageType);
/** @internal */
exports.SupportCopilotMessageType$outboundSchema = exports.SupportCopilotMessageType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SupportCopilotMessageType$;
(function (SupportCopilotMessageType$) {
    /** @deprecated use `SupportCopilotMessageType$inboundSchema` instead. */
    SupportCopilotMessageType$.inboundSchema = exports.SupportCopilotMessageType$inboundSchema;
    /** @deprecated use `SupportCopilotMessageType$outboundSchema` instead. */
    SupportCopilotMessageType$.outboundSchema = exports.SupportCopilotMessageType$outboundSchema;
})(SupportCopilotMessageType$ || (exports.SupportCopilotMessageType$ = SupportCopilotMessageType$ = {}));
/** @internal */
exports.SupportCopilotMessageType1$inboundSchema = z.nativeEnum(exports.SupportCopilotMessageType1);
/** @internal */
exports.SupportCopilotMessageType1$outboundSchema = exports.SupportCopilotMessageType1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SupportCopilotMessageType1$;
(function (SupportCopilotMessageType1$) {
    /** @deprecated use `SupportCopilotMessageType1$inboundSchema` instead. */
    SupportCopilotMessageType1$.inboundSchema = exports.SupportCopilotMessageType1$inboundSchema;
    /** @deprecated use `SupportCopilotMessageType1$outboundSchema` instead. */
    SupportCopilotMessageType1$.outboundSchema = exports.SupportCopilotMessageType1$outboundSchema;
})(SupportCopilotMessageType1$ || (exports.SupportCopilotMessageType1$ = SupportCopilotMessageType1$ = {}));
/** @internal */
exports.SupportCopilotMessageLinksType$inboundSchema = z.union([exports.SupportCopilotMessageType1$inboundSchema, z.string()]);
/** @internal */
exports.SupportCopilotMessageLinksType$outboundSchema = z.union([exports.SupportCopilotMessageType1$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 SupportCopilotMessageLinksType$;
(function (SupportCopilotMessageLinksType$) {
    /** @deprecated use `SupportCopilotMessageLinksType$inboundSchema` instead. */
    SupportCopilotMessageLinksType$.inboundSchema = exports.SupportCopilotMessageLinksType$inboundSchema;
    /** @deprecated use `SupportCopilotMessageLinksType$outboundSchema` instead. */
    SupportCopilotMessageLinksType$.outboundSchema = exports.SupportCopilotMessageLinksType$outboundSchema;
})(SupportCopilotMessageLinksType$ || (exports.SupportCopilotMessageLinksType$ = SupportCopilotMessageLinksType$ = {}));
function supportCopilotMessageLinksTypeToJSON(supportCopilotMessageLinksType) {
    return JSON.stringify(exports.SupportCopilotMessageLinksType$outboundSchema.parse(supportCopilotMessageLinksType));
}
function supportCopilotMessageLinksTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessageLinksType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageLinksType' from JSON`);
}
/** @internal */
exports.SupportCopilotMessageLinks$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.SupportCopilotMessageType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
exports.SupportCopilotMessageLinks$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.SupportCopilotMessageType1$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 SupportCopilotMessageLinks$;
(function (SupportCopilotMessageLinks$) {
    /** @deprecated use `SupportCopilotMessageLinks$inboundSchema` instead. */
    SupportCopilotMessageLinks$.inboundSchema = exports.SupportCopilotMessageLinks$inboundSchema;
    /** @deprecated use `SupportCopilotMessageLinks$outboundSchema` instead. */
    SupportCopilotMessageLinks$.outboundSchema = exports.SupportCopilotMessageLinks$outboundSchema;
})(SupportCopilotMessageLinks$ || (exports.SupportCopilotMessageLinks$ = SupportCopilotMessageLinks$ = {}));
function supportCopilotMessageLinksToJSON(supportCopilotMessageLinks) {
    return JSON.stringify(exports.SupportCopilotMessageLinks$outboundSchema.parse(supportCopilotMessageLinks));
}
function supportCopilotMessageLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessageLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageLinks' from JSON`);
}
/** @internal */
exports.SupportCopilotMessageId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SupportCopilotMessageId$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 SupportCopilotMessageId$;
(function (SupportCopilotMessageId$) {
    /** @deprecated use `SupportCopilotMessageId$inboundSchema` instead. */
    SupportCopilotMessageId$.inboundSchema = exports.SupportCopilotMessageId$inboundSchema;
    /** @deprecated use `SupportCopilotMessageId$outboundSchema` instead. */
    SupportCopilotMessageId$.outboundSchema = exports.SupportCopilotMessageId$outboundSchema;
})(SupportCopilotMessageId$ || (exports.SupportCopilotMessageId$ = SupportCopilotMessageId$ = {}));
function supportCopilotMessageIdToJSON(supportCopilotMessageId) {
    return JSON.stringify(exports.SupportCopilotMessageId$outboundSchema.parse(supportCopilotMessageId));
}
function supportCopilotMessageIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessageId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageId' from JSON`);
}
/** @internal */
exports.SupportCopilotMessageUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SupportCopilotMessageUserId$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 SupportCopilotMessageUserId$;
(function (SupportCopilotMessageUserId$) {
    /** @deprecated use `SupportCopilotMessageUserId$inboundSchema` instead. */
    SupportCopilotMessageUserId$.inboundSchema = exports.SupportCopilotMessageUserId$inboundSchema;
    /** @deprecated use `SupportCopilotMessageUserId$outboundSchema` instead. */
    SupportCopilotMessageUserId$.outboundSchema = exports.SupportCopilotMessageUserId$outboundSchema;
})(SupportCopilotMessageUserId$ || (exports.SupportCopilotMessageUserId$ = SupportCopilotMessageUserId$ = {}));
function supportCopilotMessageUserIdToJSON(supportCopilotMessageUserId) {
    return JSON.stringify(exports.SupportCopilotMessageUserId$outboundSchema.parse(supportCopilotMessageUserId));
}
function supportCopilotMessageUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessageUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageUserId' from JSON`);
}
/** @internal */
exports.SupportCopilotMessageUserProperties$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.SupportCopilotMessageUserProperties$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 SupportCopilotMessageUserProperties$;
(function (SupportCopilotMessageUserProperties$) {
    /** @deprecated use `SupportCopilotMessageUserProperties$inboundSchema` instead. */
    SupportCopilotMessageUserProperties$.inboundSchema = exports.SupportCopilotMessageUserProperties$inboundSchema;
    /** @deprecated use `SupportCopilotMessageUserProperties$outboundSchema` instead. */
    SupportCopilotMessageUserProperties$.outboundSchema = exports.SupportCopilotMessageUserProperties$outboundSchema;
})(SupportCopilotMessageUserProperties$ || (exports.SupportCopilotMessageUserProperties$ = SupportCopilotMessageUserProperties$ = {}));
function supportCopilotMessageUserPropertiesToJSON(supportCopilotMessageUserProperties) {
    return JSON.stringify(exports.SupportCopilotMessageUserProperties$outboundSchema.parse(supportCopilotMessageUserProperties));
}
function supportCopilotMessageUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessageUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageUserProperties' from JSON`);
}
/** @internal */
exports.SupportCopilotMessage$inboundSchema = z.object({
    id: z.string(),
    type: exports.SupportCopilotMessageType$inboundSchema,
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    conversationId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    role: z.string(),
    content: z.nullable(z.string()),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.SupportCopilotMessageLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SupportCopilotMessageUserProperties$inboundSchema)).optional(),
});
/** @internal */
exports.SupportCopilotMessage$outboundSchema = z.object({
    id: z.string(),
    type: exports.SupportCopilotMessageType$outboundSchema,
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    conversationId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    role: z.string(),
    content: z.nullable(z.string()),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.SupportCopilotMessageLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SupportCopilotMessageUserProperties$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SupportCopilotMessage$;
(function (SupportCopilotMessage$) {
    /** @deprecated use `SupportCopilotMessage$inboundSchema` instead. */
    SupportCopilotMessage$.inboundSchema = exports.SupportCopilotMessage$inboundSchema;
    /** @deprecated use `SupportCopilotMessage$outboundSchema` instead. */
    SupportCopilotMessage$.outboundSchema = exports.SupportCopilotMessage$outboundSchema;
})(SupportCopilotMessage$ || (exports.SupportCopilotMessage$ = SupportCopilotMessage$ = {}));
function supportCopilotMessageToJSON(supportCopilotMessage) {
    return JSON.stringify(exports.SupportCopilotMessage$outboundSchema.parse(supportCopilotMessage));
}
function supportCopilotMessageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportCopilotMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessage' from JSON`);
}
//# sourceMappingURL=supportcopilotmessage.js.map