Skip to content

Commit

Permalink
Added: doc tweaks for getDatasetFileCounts use case
Browse files Browse the repository at this point in the history
  • Loading branch information
GPortas committed Feb 2, 2024
1 parent 4f19efd commit 4714b74
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions docs/useCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Returns an instance of [FileCounts](../src/files/domain/models/FileCounts.ts), c
- **Per content type**
- **Per category name**
- **Per tabular tag name**
- **Per access status** (Possible values: *Public*, *Restricted*, *EmbargoedThenRestricted*, *EmbargoedThenPublic*)
- **Per access status** (Possible values: _Public_, _Restricted_, _EmbargoedThenRestricted_, _EmbargoedThenPublic_)

##### Example call:

Expand All @@ -301,7 +301,7 @@ import { getDatasetFileCounts } from '@iqss/dataverse-client-javascript';
const datasetId = 2;
const datasetVersionId = '1.0';

getDatasetFileCounts.execute(datasetId, datasetVersionId).then((subset: FilesSubset) => {
getDatasetFileCounts.execute(datasetId, datasetVersionId).then((fileCounts: FileCounts) => {
/* ... */
});

Expand All @@ -314,6 +314,29 @@ There is a third optional parameter called `includeDeaccessioned`, which indicat

A fourth optional parameter `fileSearchCriteria` receives a [FileSearchCriteria](../src/files/domain/models/FileCriteria.ts) parameter to retrieve counts only for files that match the specified criteria.

##### Example call using optional parameters:

```typescript
import { getDatasetFileCounts } from '@iqss/dataverse-client-javascript';

/* ... */

const datasetId: number = 2;
const datasetVersionId: string = '1.0';
const includeDeaccessioned: boolean = true;
const searchCriteria: FileSearchCriteria = {
categoryName: 'Physics',
};

getDatasetFileCounts
.execute(datasetId, datasetVersionId, includeDeaccessioned, searchCriteria)
.then((fileCounts: FileCounts) => {
/* ... */
});

/* ... */
```

## Metadata Blocks

TODO
Expand Down

0 comments on commit 4714b74

Please sign in to comment.