/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { powerPathCourseMasteryTestOut } from "../../funcs/powerPathCourseMasteryTestOut.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.TestOutRequest$inboundSchema,
};
export const tool$powerPathCourseMasteryTestOut = {
    name: "power-path-course-mastery-test-out",
    description: `Test out

Returns the testOut lesson reference for the given student and course.

- TestOut is a lesson that represents the end-of-course test, covering the entire course content.
- The testOut should be specified by a Resource with metadata.lessonType = "test-out".

Details:
- Returns a null lessonId in case no Resource with metadata.lessonType = "test-out" is found in the course.
- In case student has already taken the TestOut, this will return the "finalized" flag set to true.
- In case this is an external TestOut, also return external access credentials, if available (i.e. test was previously assigned to student).

A 'Lesson' in this context is a ComponentResource object which has a Resource object with metadata.lessonType = "test-out" associated with it.
`,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await powerPathCourseMasteryTestOut(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=powerPathCourseMasteryTestOut.js.map