-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRestrictFile.ts
More file actions
20 lines (17 loc) · 1.04 KB
/
RestrictFile.ts
File metadata and controls
20 lines (17 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { IFilesRepository } from '../repositories/IFilesRepository'
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { RestrictFileDTO } from '../dtos/RestrictFileDTO'
export class RestrictFile implements UseCase<void> {
constructor(private readonly filesRepository: IFilesRepository) {}
/**
* Restrict or unrestrict an existing file.
* More detailed information about the file restriction behavior can be found in https://guides.dataverse.org/en/latest/api/native-api.html#restrict-files
*
* @param {number | string} [fileId] - The File identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @param {RestrictFileDTO} [restrictFileDTO] - The DTO containing the file restriction information.
* @returns {Promise<void>} -This method does not return anything upon successful completion.
*/
async execute(fileId: number | string, restrictFileDTO: RestrictFileDTO): Promise<void> {
return await this.filesRepository.restrictFile(fileId, restrictFileDTO)
}
}