import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, PaginationRequestOptions, PaginationTypes, ShowExpanded, Sudo, } from '../infrastructure'; export interface ReleaseLinkSchema extends Record { id: number; name: string; url: string; external: boolean; link_type: string; } export class ReleaseLinks extends BaseResource { all( projectId: string | number, tagName: string, options?: Sudo & ShowExpanded & PaginationRequestOptions

, ): Promise> { return RequestHelper.get()( this, endpoint`projects/${projectId}/releases/${tagName}/assets/links`, options, ); } create( projectId: string | number, tagName: string, name: string, url: string, options?: Sudo & { filePath?: string; linkType?: string; directAssetPath?: string }, ): Promise> { return RequestHelper.post()( this, endpoint`projects/${projectId}/releases/${tagName}/assets/links`, { name, url, ...options, }, ); } edit( projectId: string | number, tagName: string, linkId: number, options?: Sudo & ShowExpanded & { name?: string; url?: string; filePath?: string; linkType?: string; directAssetPath?: string; }, ): Promise> { return RequestHelper.put()( this, endpoint`projects/${projectId}/releases/${tagName}/assets/links/${linkId}`, options, ); } remove( projectId: string | number, tagName: string, linkId: number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.del()( this, endpoint`projects/${projectId}/releases/${tagName}/assets/links/${linkId}`, options, ); } show( projectId: string | number, tagName: string, linkId: number, options?: Sudo & ShowExpanded, ) { return RequestHelper.get()( this, endpoint`projects/${projectId}/releases/${tagName}/assets/links/${linkId}`, options, ); } }