# WearablesResource

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

```java
public final class WearablesResource
```

Manages wearable providers and connections under `/v1/wearables`. Get it from [`Ovok.wearables()`](/java-sdk/reference/ovok#wearables).

## Methods [#methods]

### providers [#providers]

```java
public WearablesResource.ProvidersResource providers()
```

Returns the wearable provider settings.

**Returns:** the providers resource

### connections [#connections]

```java
public WearablesResource.ConnectionsResource connections()
```

Returns the caller's wearable connections.

**Returns:** the connections resource

## WearablesResource.ProvidersResource [#wearablesresourceprovidersresource]

```java
public static final class ProvidersResource
```

Wearable provider settings under `/v1/wearables/providers`.

### ProvidersResource.list [#providersresourcelist]

```java
public JsonNode list() throws IOException, InterruptedException
```

Lists the configured providers (`GET /v1/wearables/providers`).

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode list(RequestOptions options) throws IOException, InterruptedException
```

Lists the configured providers (`GET /v1/wearables/providers`).

**Parameters:**

- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ProvidersResource.retrieve [#providersresourceretrieve]

```java
public JsonNode retrieve(String provider) throws IOException, InterruptedException
```

Reads a provider (`GET /v1/wearables/providers/{provider}`).

**Parameters:**

- `provider`: the provider name

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode retrieve(
        String provider,
        RequestOptions options) throws IOException, InterruptedException
```

Reads a provider (`GET /v1/wearables/providers/{provider}`).

**Parameters:**

- `provider`: the provider name
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ProvidersResource.create [#providersresourcecreate]

```java
public JsonNode create(Object body) throws IOException, InterruptedException
```

Configures a provider (`POST /v1/wearables/providers`).

**Parameters:**

- `body`: the provider settings

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode create(Object body, RequestOptions options) throws IOException, InterruptedException
```

Configures a provider (`POST /v1/wearables/providers`).

**Parameters:**

- `body`: the provider settings
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ProvidersResource.patch [#providersresourcepatch]

```java
public JsonNode patch(String provider, Object body) throws IOException, InterruptedException
```

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

**Parameters:**

- `provider`: the provider name
- `body`: the fields to change

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode patch(
        String provider,
        Object body,
        RequestOptions options) throws IOException, InterruptedException
```

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

**Parameters:**

- `provider`: the provider name
- `body`: the fields to change
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ProvidersResource.delete [#providersresourcedelete]

```java
public void delete(String provider) throws IOException, InterruptedException
```

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

**Parameters:**

- `provider`: the provider name

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public void delete(String provider, RequestOptions options) throws IOException, InterruptedException
```

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

**Parameters:**

- `provider`: the provider name
- `options`: per-request options, such as the timeout

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

## WearablesResource.ConnectionsResource [#wearablesresourceconnectionsresource]

```java
public static final class ConnectionsResource
```

The caller's wearable connections under `/v1/wearables/connections`.

### ConnectionsResource.list [#connectionsresourcelist]

```java
public JsonNode list() throws IOException, InterruptedException
```

Lists the caller's connections (`GET /v1/wearables/connections`).

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode list(RequestOptions options) throws IOException, InterruptedException
```

Lists the caller's connections (`GET /v1/wearables/connections`).

**Parameters:**

- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ConnectionsResource.authorize [#connectionsresourceauthorize]

```java
public JsonNode authorize(String provider) throws IOException, InterruptedException
```

Starts connecting a provider (`POST /v1/wearables/connections/{provider}/authorize`).

**Parameters:**

- `provider`: the provider name

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode authorize(
        String provider,
        RequestOptions options) throws IOException, InterruptedException
```

Starts connecting a provider (`POST /v1/wearables/connections/{provider}/authorize`).

**Parameters:**

- `provider`: the provider name
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ConnectionsResource.sync [#connectionsresourcesync]

```java
public JsonNode sync(String provider) throws IOException, InterruptedException
```

Syncs data from a provider (`POST /v1/wearables/connections/{provider}/sync`).

**Parameters:**

- `provider`: the provider name

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode sync(
        String provider,
        RequestOptions options) throws IOException, InterruptedException
```

Syncs data from a provider (`POST /v1/wearables/connections/{provider}/sync`).

**Parameters:**

- `provider`: the provider name
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### ConnectionsResource.delete [#connectionsresourcedelete]

```java
public void delete(String provider) throws IOException, InterruptedException
```

Disconnects a provider (`DELETE /v1/wearables/connections/{provider}`).

**Parameters:**

- `provider`: the provider name

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public void delete(String provider, RequestOptions options) throws IOException, InterruptedException
```

Disconnects a provider (`DELETE /v1/wearables/connections/{provider}`).

**Parameters:**

- `provider`: the provider name
- `options`: per-request options, such as the timeout

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response
