import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure'; export interface RelationsExportStatusSchema extends Record { relation: string; status: number; error?: string; updated_at: string; } export class ProjectRelationsExport extends BaseResource { download( projectId: string | number, relation: string, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()( this, endpoint`projects/${projectId}/export_relations/download`, { relation, ...options, }, ); } showExportStatus(projectId: string | number, options?: Sudo) { return RequestHelper.get()( this, endpoint`projects/${projectId}/export_relations/status`, options, ); } scheduleExport( projectId: string | number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.post<{ message: string }>()( this, endpoint`projects/${projectId}/export_relations`, options, ); } }