import { BaseResource } from '@gitbeaker/requester-utils' ; import { RequestHelper , PaginatedRequestOptions , Sudo , endpoint } from '../infrastructure' ; export interface ReleaseLinkSchema extends Record < string , unknown > { id : number ; name : string ; url : string ; external : boolean ; link_type : string ; } export class ReleaseLinks < C extends boolean = false > extends BaseResource < C > { all ( projectId , tagName , options ? ) { return RequestHelper . get < ReleaseLinkSchema [ ] > ( ) ( this , endpoint `projects/${ projectId }/releases/${ tagName }/assets/links` , options ) ; } create ( projectId , tagName , name , url , options ? ) { return RequestHelper . post < ReleaseLinkSchema > ( ) ( this , endpoint `projects/${ projectId }/releases/${ tagName }/assets/links` , { name , url , ... options , } ) ; } edit ( projectId , tagName , linkId , options ? ) { return RequestHelper . put < ReleaseLinkSchema > ( ) ( this , endpoint `projects/${ projectId }/releases/${ tagName }/assets/links/${ linkId }` , options ) ; } remove ( projectId , tagName , linkId , options ? ) { return RequestHelper . del ( ) ( this , endpoint `projects/${ projectId }/releases/${ tagName }/assets/links/${ linkId }` , options ) ; } show ( projectId , tagName , linkId , options ? ) { return RequestHelper . get < ReleaseLinkSchema > ( ) ( this , endpoint `projects/${ projectId }/releases/${ tagName }/assets/links/${ linkId }` , options ) ; } }