import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, PaginationRequestOptions, PaginationTypes, ShowExpanded, Sudo, } from '../infrastructure'; import { SimpleUserSchema } from './Users'; export interface CondensedEpicLinkSchema extends Record { id: number; iid: number; group_id: number; parent_id: number; title: string; has_children: boolean; has_issues: boolean; reference: string; url: string; relation_url: string; } export interface EpicLinkSchema extends Record { id: number; iid: number; group_id: number; parent_id: number; title: string; description: string; author: SimpleUserSchema; start_date?: string; start_date_is_fixed: boolean; start_date_fixed?: string; start_date_from_milestones?: string; start_date_from_inherited_source?: string; due_date: string; due_date_is_fixed: boolean; due_date_fixed?: string; due_date_from_milestones?: string; due_date_from_inherited_source: string; created_at: string; updated_at: string; labels?: string[]; } export class EpicLinks extends BaseResource { all( groupId: string | number, epicIId: number, options?: Sudo & ShowExpanded & PaginationRequestOptions

, ): Promise> { return RequestHelper.get()( this, endpoint`groups/${groupId}/epics/${epicIId}/links`, options, ); } assign( groupId: string | number, epicIId: number, childEpicId: number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.post()( this, endpoint`groups/${groupId}/epics/${epicIId}/links/${childEpicId}`, options, ); } create( groupId: string | number, epicIId: number, title: string, options?: { confidential?: boolean } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.post()( this, endpoint`groups/${groupId}/epics/${epicIId}/links`, { searchParams: { title, }, ...options, }, ); } reorder( groupId: string | number, epicIId: number, childEpicId: number, options?: { moveBeforeId?: number; moveAfterId?: number } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.put()( this, endpoint`groups/${groupId}/epics/${epicIId}/links/${childEpicId}`, options, ); } unassign( groupId: string | number, epicIId: number, childEpicId: number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.del()( this, endpoint`groups/${groupId}/epics/${epicIId}/links/${childEpicId}`, options, ); } }