import { BaseResource , BaseResourceOptions } from '@gitbeaker/requester-utils' ; import { endpoint , PaginatedRequestOptions , RequestHelper , Sudo } from '../infrastructure' ; export interface CustomAttributeSchema extends Record < string , unknown > { key : string ; value : string ; } export class ResourceCustomAttributes < C extends boolean = false > extends BaseResource < C > { constructor ( resourceType , options ) { super ( { prefixUrl : resourceType , ... options } ) ; } all ( resourceId , options ? ) { return RequestHelper . get < CustomAttributeSchema [ ] > ( ) ( this , endpoint `${ resourceId }/custom_attributes` , options ) ; } set ( resourceId , customAttributeId , value , options ? ) { return RequestHelper . put < CustomAttributeSchema > ( ) ( this , endpoint `${ resourceId }/custom_attributes/${ customAttributeId }` , { value , ... options , } ) ; } remove ( resourceId , customAttributeId , options ? ) { return RequestHelper . del ( ) ( this , endpoint `${ resourceId }/custom_attributes/${ customAttributeId }` , options ) ; } show ( resourceId , customAttributeId , options ? ) { return RequestHelper . get < CustomAttributeSchema > ( ) ( this , endpoint `${ resourceId }/custom_attributes/${ customAttributeId }` , options ) ; } }