/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { powerPathLessonPlansAttachResource } from "../../funcs/powerPathLessonPlansAttachResource.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.AttachResourceRequest$inboundSchema,
};
export const tool$powerPathLessonPlansAttachResource = {
    name: "power-path-lesson-plans-attach-resource",
    description: `Create a lesson plan item to attach a resource to a lesson plan


    Creates a lessonPlanItem of type "resource" and attaches it to lesson plan with the given ID.
    The lessonPlanItem *must* reference a course component resource for the course associated with the lesson plan.

    The parent lessonPlanItem, if any, must be of type "component".
    `,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await powerPathLessonPlansAttachResource(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=powerPathLessonPlansAttachResource.js.map