testrail-modern-client
Version:
A modern TypeScript client for TestRail API
38 lines (37 loc) • 1.33 kB
TypeScript
import { AddTemplate, Template } from '../models/templates';
import { BaseService } from './base';
/**
* Service for interacting with TestRail templates (field layouts).
* @since TestRail 5.2
*/
export declare class TemplateService extends BaseService {
/**
* Returns a list of available templates for a project.
* @param projectId - The ID of the project
* @param offset - Optional pagination offset
* @param limit - Optional pagination limit
* @returns List of templates
* @throws {Error} - If the project is invalid or unknown (400)
* @throws {Error} - If there is no access to the project (403)
* @throws {Error} - If too many requests are made (429) - TestRail Cloud only
*/
list(projectId: number): Promise<Template[]>;
/**
* Returns an existing template.
* @param templateId - The ID of the template
* @returns The requested template
*/
get(templateId: number): Promise<Template>;
/**
* Creates a new template.
*/
add(projectId: number, template: AddTemplate): Promise<Template>;
/**
* Updates an existing template.
*/
update(templateId: number, template: Partial<AddTemplate>): Promise<Template>;
/**
* Deletes an existing template.
*/
delete(templateId: number): Promise<void>;
}