# Wearables resource

Canonical page: https://docs.ovok.com/flutter-sdk/reference/ovok_sdk/wearables-resource

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

## WearableConnectionsResource [#wearableconnectionsresource]

```dart
class WearableConnectionsResource
```

Connections to wearable providers. Reached through `ovok.wearables.connections`.

### Constructors [#constructors]

#### WearableConnectionsResource.new [#wearableconnectionsresourcenew]

```dart
WearableConnectionsResource(HttpClient _wearables)
```

Built by `Ovok`; use `ovok.wearables.connections` instead.

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

### Methods [#methods]

#### WearableConnectionsResource.list [#wearableconnectionsresourcelist]

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

Lists the connections. Calls `GET v1/wearables/connections`.

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

#### WearableConnectionsResource.authorize [#wearableconnectionsresourceauthorize]

```dart
Future<JsonMap> authorize(String provider)
```

Starts a connection to `provider`.

Calls `POST v1/wearables/connections/{provider}/authorize`. The answer
carries the provider's one-time consent page, where the patient grants access.

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

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

#### WearableConnectionsResource.sync [#wearableconnectionsresourcesync]

```dart
Future<JsonMap> sync(String provider)
```

Syncs the data of `provider`.

Calls `POST v1/wearables/connections/{provider}/sync`.

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

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

#### WearableConnectionsResource.delete [#wearableconnectionsresourcedelete]

```dart
Future<void> delete(String provider)
```

Disconnects `provider`. Calls `DELETE v1/wearables/connections/{provider}`.

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

Returns `Future<void>`.


## WearableProvidersResource [#wearableprovidersresource]

```dart
class WearableProvidersResource
```

Wearable providers. Reached through `ovok.wearables.providers`.

### Constructors [#constructors-1]

#### WearableProvidersResource.new [#wearableprovidersresourcenew]

```dart
WearableProvidersResource(HttpClient _wearables)
```

Built by `Ovok`; use `ovok.wearables.providers` instead.

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

### Methods [#methods-1]

#### WearableProvidersResource.list [#wearableprovidersresourcelist]

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

Lists the providers. Calls `GET v1/wearables/providers`.

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

#### WearableProvidersResource.retrieve [#wearableprovidersresourceretrieve]

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

Retrieves a provider. Calls `GET v1/wearables/providers/{provider}`.

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

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

#### WearableProvidersResource.create [#wearableprovidersresourcecreate]

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

Adds a provider. Calls `POST v1/wearables/providers`.

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

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

#### WearableProvidersResource.patch [#wearableprovidersresourcepatch]

```dart
Future<JsonMap> patch(String provider, JsonMap body)
```

Updates a provider. Calls `PATCH v1/wearables/providers/{provider}`.

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

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

#### WearableProvidersResource.delete [#wearableprovidersresourcedelete]

```dart
Future<void> delete(String provider)
```

Removes a provider. Calls `DELETE v1/wearables/providers/{provider}`.

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

Returns `Future<void>`.


## WearablesResource [#wearablesresource]

```dart
class WearablesResource
```

Wearable providers and the patient's connections to them.

Reached through `ovok.wearables`. Every route is under `v1/wearables`.

Every request throws an `OvokException` subclass when it fails.

### Constructors [#constructors-2]

#### WearablesResource.new [#wearablesresourcenew]

```dart
WearablesResource(HttpClient http)
```

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

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

### Properties [#properties]

#### WearablesResource.providers [#wearablesresourceproviders]

```dart
final WearableProvidersResource providers
```

The wearable providers the project offers.

#### WearablesResource.connections [#wearablesresourceconnections]

```dart
final WearableConnectionsResource connections
```

The signed-in patient's connections to providers.
