Skip to content

Commit 8faf1ba

Browse files
committed
docs: add use case docs
1 parent aa8d7b2 commit 8faf1ba

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/useCases.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The different use cases currently available in the package are classified below,
5151
- [Files write use cases](#files-write-use-cases)
5252
- [File Uploading Use Cases](#file-uploading-use-cases)
5353
- [Delete a File](#delete-a-file)
54+
- [Restrict or Unrestrict a File](#restrict-or-unrestrict-a-file)
5455
- [Metadata Blocks](#metadata-blocks)
5556
- [Metadata Blocks read use cases](#metadata-blocks-read-use-cases)
5657
- [Get All Facetable Metadata Fields](#get-all-facetable-metadata-fields)
@@ -1264,6 +1265,28 @@ Note that the behavior of deleting files depends on if the dataset has ever been
12641265
- If the dataset has published, the file is deleted from the draft (and future published versions).
12651266
- If the dataset has published, the deleted file can still be downloaded because it was part of a published version.
12661267

1268+
#### Restrict or Unrestrict a File
1269+
1270+
Restrict or unrestrict an existing file.
1271+
1272+
##### Example call:
1273+
1274+
```typescript
1275+
import { restrictFile } from '@iqss/dataverse-client-javascript'
1276+
1277+
/* ... */
1278+
1279+
const fileId = 12345
1280+
1281+
restrictFile.execute(fileId)
1282+
1283+
/* ... */
1284+
```
1285+
1286+
_See [use case](../src/files/domain/useCases/RestrictFile.ts) implementation_.
1287+
1288+
The `fileId` parameter can be a string, for persistent identifiers, or a number, for numeric identifiers.
1289+
12671290
## Metadata Blocks
12681291

12691292
### Metadata Blocks read use cases

0 commit comments

Comments
 (0)