// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import { APIPromise } from '../../../core/api-promise'; import { buildHeaders } from '../../../internal/headers'; import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; export class RubricTemplates extends APIResource { /** * Create a new rubric template * * @example * ```ts * const rubricTemplateResponse = * await client.v1.assignmentGrader.rubricTemplates.create({ * criteria: [{ pointsPossible: 0, title: 'title' }], * name: 'name', * }); * ``` */ create(body: RubricTemplateCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/api/v1/assignment-grader/rubric-templates', { body, ...options }); } /** * Get all rubric templates * * @example * ```ts * const rubricTemplateResponses = * await client.v1.assignmentGrader.rubricTemplates.list(); * ``` */ list(options?: RequestOptions): APIPromise { return this._client.get('/api/v1/assignment-grader/rubric-templates', options); } /** * Delete a rubric template by ID * * @example * ```ts * await client.v1.assignmentGrader.rubricTemplates.delete( * 'id', * ); * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/api/v1/assignment-grader/rubric-templates/${id}`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } /** * Get a rubric template by ID * * @example * ```ts * const rubricTemplateResponse = * await client.v1.assignmentGrader.rubricTemplates.getByID( * 'id', * ); * ``` */ getByID(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/api/v1/assignment-grader/rubric-templates/${id}`, options); } } export interface RubricCriterion { /** * Points possible for this criterion */ pointsPossible: number; /** * Title of the criterion */ title: string; /** * Description of the criterion */ description?: string; } export interface RubricTemplateResponse { /** * Template ID */ _id: string; /** * Creation timestamp */ createdAt: string; /** * Created by user ID */ createdBy: string; /** * Grading criteria */ criteria: Array; /** * Template name */ name: string; /** * Organization ID */ organizationId: string; /** * Update timestamp */ updatedAt: string; /** * Template description */ description?: string; /** * Assignment content/context provided for grading */ assignmentContent?: string; } export type RubricTemplateListResponse = Array; export interface RubricTemplateCreateParams { /** * Grading criteria */ criteria: Array; /** * Name of the rubric template */ name: string; /** * Additional context for the assignment such as a reading passage, source material, or instructions */ assignmentContent?: string; /** * Description of the rubric template */ description?: string; } export declare namespace RubricTemplates { export { type RubricCriterion as RubricCriterion, type RubricTemplateResponse as RubricTemplateResponse, type RubricTemplateListResponse as RubricTemplateListResponse, type RubricTemplateCreateParams as RubricTemplateCreateParams, }; }