/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 30a0bf3d72fd
 */
import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
import { AudioContent$inboundSchema } from "./audiocontent.js";
import { ConnectorToolCallMetadata$inboundSchema, } from "./connectortoolcallmetadata.js";
import { EmbeddedResource$inboundSchema, } from "./embeddedresource.js";
import { ImageContent$inboundSchema } from "./imagecontent.js";
import { ResourceLink$inboundSchema } from "./resourcelink.js";
import { TextContent$inboundSchema } from "./textcontent.js";
/** @internal */
export const ConnectorToolCallResponseContent$inboundSchema = discriminatedUnion("type", {
    text: TextContent$inboundSchema,
    image: ImageContent$inboundSchema,
    audio: AudioContent$inboundSchema,
    resource_link: ResourceLink$inboundSchema,
    resource: EmbeddedResource$inboundSchema,
});
export function connectorToolCallResponseContentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConnectorToolCallResponseContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorToolCallResponseContent' from JSON`);
}
/** @internal */
export const ConnectorToolCallResponse$inboundSchema = z.object({
    content: z.array(discriminatedUnion("type", {
        text: TextContent$inboundSchema,
        image: ImageContent$inboundSchema,
        audio: AudioContent$inboundSchema,
        resource_link: ResourceLink$inboundSchema,
        resource: EmbeddedResource$inboundSchema,
    })),
    metadata: z.nullable(ConnectorToolCallMetadata$inboundSchema).optional(),
}).catchall(z.any());
export function connectorToolCallResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConnectorToolCallResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorToolCallResponse' from JSON`);
}
//# sourceMappingURL=connectortoolcallresponse.js.map