# Consent resource

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

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

## ConsentKindResource [#consentkindresource]

```dart
class ConsentKindResource
```

One kind of consent the signed-in user gives or withdraws.

Reached through `ovok.consent.legal` and `ovok.consent.medical`.

### Constructors [#constructors]

#### ConsentKindResource.new [#consentkindresourcenew]

```dart
ConsentKindResource(
  HttpClient _http,
  String _path,
  String _acceptedField,
)
```

Built by `Ovok`; use `ovok.consent.legal` or `ovok.consent.medical` instead.

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

### Methods [#methods]

#### ConsentKindResource.retrieve [#consentkindresourceretrieve]

```dart
Future<Map<String, dynamic>> retrieve()
```

Retrieves the consent. Calls `GET v1/me/consent/{kind}`.

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

#### ConsentKindResource.set [#consentkindresourceset]

```dart
Future<Map<String, dynamic>> set({required bool accepted})
```

Gives the consent, or withdraws it when `accepted` is false.

Calls `POST v1/me/consent/{kind}`.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `accepted` | `bool` | required named |  |

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


## ConsentResource [#consentresource]

```dart
class ConsentResource
```

The signed-in user's consents. Reached through `ovok.consent`.

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

### Constructors [#constructors-1]

#### ConsentResource.new [#consentresourcenew]

```dart
ConsentResource(HttpClient _http)
```

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

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

### Properties [#properties]

#### ConsentResource.legal [#consentresourcelegal]

```dart
final ConsentKindResource legal
```

Consent to the terms and conditions, at `v1/me/consent/legal`.

#### ConsentResource.medical [#consentresourcemedical]

```dart
final ConsentKindResource medical
```

Consent to medical settings notifications, at `v1/me/consent/medical`.

### Methods [#methods-1]

#### ConsentResource.requestSignature [#consentresourcerequestsignature]

```dart
Future<Map<String, dynamic>> requestSignature(String consentId)
```

Requests a signature for the consent `consentId`.

Calls `POST consent/signature/{consentId}`.

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

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