# Platform resources

Canonical page: https://docs.ovok.com/flutter-sdk/reference/ovok_sdk/platform-resources

{/* Generated by scripts/generate_reference.dart; do not edit. */}

## AccountsResource [#accountsresource]

```dart
class AccountsResource
```

Accounts the signed-in user belongs to. Reached through `ovok.accounts`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors]

#### AccountsResource.new [#accountsresourcenew]

```dart
AccountsResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.accounts` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods]

#### AccountsResource.list [#accountsresourcelist]

```dart
Future<List<JsonMap>> list()
```

Lists the signed-in user's accounts. Calls `GET accounts`.

Returns `Future<List<Map<String, dynamic>>>`.


## EmailResource [#emailresource]

```dart
class EmailResource
```

The project's email setup. Reached through `ovok.email`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-1]

#### EmailResource.new [#emailresourcenew]

```dart
EmailResource(HttpClient http)
```

Built by `Ovok`; use `ovok.email` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `http` | `HttpClient` | positional |  |

### Properties [#properties]

#### EmailResource.templates [#emailresourcetemplates]

```dart
final EmailTemplatesResource templates
```

The project's email templates.


## EmailTemplatesResource [#emailtemplatesresource]

```dart
class EmailTemplatesResource
```

The project's email templates. Reached through `ovok.email.templates`.

### Constructors [#constructors-2]

#### EmailTemplatesResource.new [#emailtemplatesresourcenew]

```dart
EmailTemplatesResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.email.templates` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-1]

#### EmailTemplatesResource.list [#emailtemplatesresourcelist]

```dart
Future<JsonMap> list()
```

Lists the email templates. Calls `GET v1/email/templates`.

Returns `Future<Map<String, dynamic>>`.


## I18nextResource [#i18nextresource]

```dart
class I18nextResource
```

A language's strings as one i18next document.

Reached through `ovok.localizations.i18next`.

### Constructors [#constructors-3]

#### I18nextResource.new [#i18nextresourcenew]

```dart
I18nextResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.localizations.i18next` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-2]

#### I18nextResource.retrieve [#i18nextresourceretrieve]

```dart
Future<JsonMap> retrieve(String language)
```

Retrieves `language` as an i18next document.

Calls `GET localization/i18next/{language}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### I18nextResource.update [#i18nextresourceupdate]

```dart
Future<void> update(String language, JsonMap document)
```

Merges `document` into `language`.

Calls `PATCH localization/i18next/{language}`. The server queues the
write (202), so a read right after may not show it yet.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |
| `document` | `JsonMap` | positional |  |

Returns `Future<void>`.


## InviteFlowResource [#inviteflowresource]

```dart
class InviteFlowResource
```

One invite kind: [`create`](#inviteflowresourcecreate) sends it, [`accept`](#inviteflowresourceaccept) redeems it at `{path}/accept`.

Reached through the fields of `ovok.invites`.

### Constructors [#constructors-4]

#### InviteFlowResource.new [#inviteflowresourcenew]

```dart
InviteFlowResource(HttpClient _http, String _path)
```

Built by `Ovok`; use a field of `ovok.invites` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |
| `_path` | `String` | positional |  |

### Methods [#methods-3]

#### InviteFlowResource.create [#inviteflowresourcecreate]

```dart
Future<JsonMap> create(JsonMap body)
```

Sends an invite. Calls `POST {path}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### InviteFlowResource.accept [#inviteflowresourceaccept]

```dart
Future<JsonMap> accept(JsonMap body)
```

Accepts an invite. Calls `POST {path}/accept`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## InvitesResource [#invitesresource]

```dart
class InvitesResource
```

Invites between patients, practitioners and carers. Reached through `ovok.invites`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-5]

#### InvitesResource.new [#invitesresourcenew]

```dart
InvitesResource(HttpClient http, UserSession session)
```

Built by `Ovok`; use `ovok.invites` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `http` | `HttpClient` | positional |  |
| `session` | `UserSession` | positional |  |

### Properties [#properties-1]

#### InvitesResource.recordShares [#invitesresourcerecordshares]

```dart
final InviteFlowResource recordShares
```

A patient shares their record with a practitioner, or some codes with a carer.

Routes under `v1/invites/record-share`.

#### InvitesResource.care [#invitesresourcecare]

```dart
final InviteFlowResource care
```

A practitioner invites a patient into their care.

Routes under `v1/invites/care`.

#### InvitesResource.practitioners [#invitesresourcepractitioners]

```dart
final InviteFlowResource practitioners
```

Practitioner invites; use [`recordShares`](#invitesresourcerecordshares) instead.

Routes under `v1/invites/practitioner`, which sunset on 2026-12-01.

#### InvitesResource.patients [#invitesresourcepatients]

```dart
final InviteFlowResource patients
```

Patient invites; use [`care`](#invitesresourcecare) instead.

Routes under `v1/invites/patient`, which sunset on 2026-12-01.

### Methods [#methods-4]

#### InvitesResource.accept [#invitesresourceaccept]

```dart
Future<JsonMap> accept(JsonMap body)
```

Accepts a record share as a practitioner or a care invite as a patient.

Picks [`recordShares`](#invitesresourcerecordshares) or [`care`](#invitesresourcecare) from the signed-in profile's type.
Throws [`OvokConfigException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokconfigexception) when no Patient or Practitioner is signed in.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## LocalesResource [#localesresource]

```dart
class LocalesResource
```

Languages the project offers. Reached through `ovok.locales`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-6]

#### LocalesResource.new [#localesresourcenew]

```dart
LocalesResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.locales` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-5]

#### LocalesResource.retrieve [#localesresourceretrieve]

```dart
Future<JsonMap> retrieve()
```

Retrieves the project's locales. Calls `GET locales`.

Returns `Future<Map<String, dynamic>>`.

#### LocalesResource.update [#localesresourceupdate]

```dart
Future<JsonMap> update(JsonMap locales)
```

Updates the project's locales. Calls `PATCH locales`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `locales` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## LocalizationsResource [#localizationsresource]

```dart
class LocalizationsResource
```

Translated strings, by language and key. Reached through `ovok.localizations`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-7]

#### LocalizationsResource.new [#localizationsresourcenew]

```dart
LocalizationsResource(HttpClient http)
```

Built by `Ovok`; use `ovok.localizations` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `http` | `HttpClient` | positional |  |

### Properties [#properties-2]

#### LocalizationsResource.i18next [#localizationsresourcei18next]

```dart
final I18nextResource i18next
```

Whole-language documents in i18next format.

### Methods [#methods-6]

#### LocalizationsResource.list [#localizationsresourcelist]

```dart
Future<JsonMap> list(String language, [QueryParams query = const {}])
```

Lists the strings of `language`. Calls `GET localization/{language}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |
| `query` | `QueryParams` | optional positional | `const {}` |

Returns `Future<Map<String, dynamic>>`.

#### LocalizationsResource.retrieve [#localizationsresourceretrieve]

```dart
Future<JsonMap> retrieve(String language, String key)
```

Retrieves one string. Calls `GET localization/{language}/{key}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |
| `key` | `String` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### LocalizationsResource.update [#localizationsresourceupdate]

```dart
Future<JsonMap> update(
  String language,
  String key,
  JsonMap body,
)
```

Updates one string. Calls `PUT localization/{language}/{key}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |
| `key` | `String` | positional |  |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### LocalizationsResource.delete [#localizationsresourcedelete]

```dart
Future<void> delete(String language, String key)
```

Deletes one string. Calls `DELETE localization/{language}/{key}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `language` | `String` | positional |  |
| `key` | `String` | positional |  |

Returns `Future<void>`.


## ProjectFeaturesResource [#projectfeaturesresource]

```dart
class ProjectFeaturesResource
```

Features enabled on the current project. Reached through `ovok.projects.features`.

### Constructors [#constructors-8]

#### ProjectFeaturesResource.new [#projectfeaturesresourcenew]

```dart
ProjectFeaturesResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.projects.features` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-7]

#### ProjectFeaturesResource.retrieve [#projectfeaturesresourceretrieve]

```dart
Future<JsonMap> retrieve()
```

Retrieves the project's features. Calls `GET v1/projects/me/features`.

Returns `Future<Map<String, dynamic>>`.

#### ProjectFeaturesResource.update [#projectfeaturesresourceupdate]

```dart
Future<JsonMap> update(List<String> features)
```

Sets the project's features. Calls `PATCH v1/projects/me/features`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `features` | `List<String>` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## ProjectMembersResource [#projectmembersresource]

```dart
class ProjectMembersResource
```

Memberships of the current project. Reached through `ovok.projects.members`.

### Constructors [#constructors-9]

#### ProjectMembersResource.new [#projectmembersresourcenew]

```dart
ProjectMembersResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.projects.members` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-8]

#### ProjectMembersResource.list [#projectmembersresourcelist]

```dart
Future<Page<JsonMap>> list([QueryParams query = const {}])
```

Lists the project's members. Calls `GET v1/projects/me/members` with `query`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `query` | `QueryParams` | optional positional | `const {}` |

Returns `Future<Page<Map<String, dynamic>>>`.

#### ProjectMembersResource.invite [#projectmembersresourceinvite]

```dart
Future<JsonMap> invite(JsonMap body)
```

Invites a member into the project. Calls `POST v1/projects/me/members`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### ProjectMembersResource.update [#projectmembersresourceupdate]

```dart
Future<JsonMap> update(String membershipId, JsonMap body)
```

Updates a membership.

Calls `PATCH v1/projects/me/members/{membershipId}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `membershipId` | `String` | positional |  |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### ProjectMembersResource.remove [#projectmembersresourceremove]

```dart
Future<JsonMap> remove(String membershipId)
```

Removes a member from the project.

Calls `DELETE v1/projects/me/members/{membershipId}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `membershipId` | `String` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## ProjectSettingsResource [#projectsettingsresource]

```dart
class ProjectSettingsResource
```

Settings of the current project. Reached through `ovok.projects.settings`.

### Constructors [#constructors-10]

#### ProjectSettingsResource.new [#projectsettingsresourcenew]

```dart
ProjectSettingsResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.projects.settings` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-9]

#### ProjectSettingsResource.retrieve [#projectsettingsresourceretrieve]

```dart
Future<JsonMap> retrieve()
```

Retrieves the project's settings. Calls `GET v1/project/settings`.

Returns `Future<Map<String, dynamic>>`.

#### ProjectSettingsResource.update [#projectsettingsresourceupdate]

```dart
Future<JsonMap> update(String key, bool enabled)
```

Turns the on/off setting `key` on or off.

Calls `PUT v1/project/settings/{key}` with `{enabled}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `key` | `String` | positional |  |
| `enabled` | `bool` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### ProjectSettingsResource.updateText [#projectsettingsresourceupdatetext]

```dart
Future<JsonMap> updateText(String key, String? value)
```

Sets the text setting `key` to `value`; null clears it.

Calls `PUT v1/project/settings/values/{key}` with `{value}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `key` | `String` | positional |  |
| `value` | `String?` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## ProjectsResource [#projectsresource]

```dart
class ProjectsResource
```

Projects, their members, settings and features. Reached through `ovok.projects`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-11]

#### ProjectsResource.new [#projectsresourcenew]

```dart
ProjectsResource(HttpClient http)
```

Built by `Ovok`; use `ovok.projects` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `http` | `HttpClient` | positional |  |

### Properties [#properties-3]

#### ProjectsResource.members [#projectsresourcemembers]

```dart
final ProjectMembersResource members
```

Members of the current project.

#### ProjectsResource.settings [#projectsresourcesettings]

```dart
final ProjectSettingsResource settings
```

Settings of the current project.

#### ProjectsResource.features [#projectsresourcefeatures]

```dart
final ProjectFeaturesResource features
```

Features enabled on the current project.

### Methods [#methods-10]

#### ProjectsResource.list [#projectsresourcelist]

```dart
Future<Page<JsonMap>> list([QueryParams query = const {}])
```

Lists the projects the caller administers, wherever they are signed in.

Calls `GET v1/projects` with `query`; the [`Page`](/flutter-sdk/reference/ovok_sdk/page#page) fetches later pages.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `query` | `QueryParams` | optional positional | `const {}` |

Returns `Future<Page<Map<String, dynamic>>>`.


## SharingInvitesResource [#sharinginvitesresource]

```dart
class SharingInvitesResource
```

Sharing invites. Reached through `ovok.sharing.invites`.

### Constructors [#constructors-12]

#### SharingInvitesResource.new [#sharinginvitesresourcenew]

```dart
SharingInvitesResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.sharing.invites` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-11]

#### SharingInvitesResource.create [#sharinginvitesresourcecreate]

```dart
Future<JsonMap> create(JsonMap body)
```

Creates a sharing invite. Calls `POST v1/patient-sharing/invites`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.

#### SharingInvitesResource.redeem [#sharinginvitesresourceredeem]

```dart
Future<JsonMap> redeem(JsonMap body)
```

Redeems a sharing invite.

Calls `POST v1/patient-sharing/invites/redeem`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `body` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## SharingResource [#sharingresource]

```dart
class SharingResource
```

A patient's record sharing. Reached through `ovok.sharing`.

Every request throws an [`OvokException`](/flutter-sdk/reference/ovok_sdk/ovok-exception#ovokexception) subclass when it fails.

### Constructors [#constructors-13]

#### SharingResource.new [#sharingresourcenew]

```dart
SharingResource(HttpClient http)
```

Built by `Ovok`; use `ovok.sharing` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `http` | `HttpClient` | positional |  |

### Properties [#properties-4]

#### SharingResource.invites [#sharingresourceinvites]

```dart
final SharingInvitesResource invites
```

Sharing invites the patient sends and redeems.

#### SharingResource.shares [#sharingresourceshares]

```dart
final SharingSharesResource shares
```

Shares the patient has given and received.

#### SharingResource.settings [#sharingresourcesettings]

```dart
final SharingSettingsResource settings
```

The patient's sharing settings.


## SharingSettingsResource [#sharingsettingsresource]

```dart
class SharingSettingsResource
```

The patient's sharing settings. Reached through `ovok.sharing.settings`.

### Constructors [#constructors-14]

#### SharingSettingsResource.new [#sharingsettingsresourcenew]

```dart
SharingSettingsResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.sharing.settings` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-12]

#### SharingSettingsResource.retrieve [#sharingsettingsresourceretrieve]

```dart
Future<JsonMap> retrieve()
```

Retrieves the sharing settings. Calls `GET v1/patient-sharing/settings`.

Returns `Future<Map<String, dynamic>>`.

#### SharingSettingsResource.update [#sharingsettingsresourceupdate]

```dart
Future<JsonMap> update(JsonMap settings)
```

Replaces the sharing settings. Calls `PUT v1/patient-sharing/settings`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `settings` | `JsonMap` | positional |  |

Returns `Future<Map<String, dynamic>>`.


## SharingSharesResource [#sharingsharesresource]

```dart
class SharingSharesResource
```

Shares given and received. Reached through `ovok.sharing.shares`.

### Constructors [#constructors-15]

#### SharingSharesResource.new [#sharingsharesresourcenew]

```dart
SharingSharesResource(HttpClient _http)
```

Built by `Ovok`; use `ovok.sharing.shares` instead.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `_http` | `HttpClient` | positional |  |

### Methods [#methods-13]

#### SharingSharesResource.list [#sharingsharesresourcelist]

```dart
Future<JsonMap> list()
```

Lists the shares. Calls `GET v1/patient-sharing/shares`.

`practitioners`, `relatedPersons` and `received` are always lists, empty
when an older server leaves them out.

Returns `Future<Map<String, dynamic>>`.

#### SharingSharesResource.revoke [#sharingsharesresourcerevoke]

```dart
Future<void> revoke(String consentId)
```

Revokes the share recorded by `consentId`.

Calls `DELETE v1/patient-sharing/shares/{consentId}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `consentId` | `String` | positional |  |

Returns `Future<void>`.
