import { BaseResource } from '@gitbeaker/requester-utils' ; import { BaseRequestOptions , PaginatedRequestOptions , RequestHelper } from '../infrastructure' ; export interface UserGPGKeySchema extends Record < string , unknown > { id : number ; key : string ; created_at : string ; } const url = ( userId ? ) => ( userId ? `users/${ userId }/gpg_keys` : 'user/gpg_keys' ) ; export class UserGPGKeys < C extends boolean = false > extends BaseResource < C > { all ( { userId , ... options } = { } ) { return RequestHelper . get < UserGPGKeySchema [ ] > ( ) ( this , url ( userId ) , options ) ; } add ( key , { userId , ... options } = { } ) { return RequestHelper . post < UserGPGKeySchema > ( ) ( this , url ( userId ) , { key , ... options , } ) ; } show ( keyId , { userId , ... options } = { } ) { const kId = encodeURIComponent ( keyId ) ; return RequestHelper . get < UserGPGKeySchema > ( ) ( this , `${ url ( userId ) }/${ kId }` , options ) ; } remove ( keyId , { userId , ... options } = { } ) { const kId = encodeURIComponent ( keyId ) ; return RequestHelper . del ( ) ( this , `${ url ( userId ) }/${ kId }` , options ) ; } }