# ZonesResource

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

```java
public final class ZonesResource
```

Reads zones. Get it from [`SlimResource.zones()`](/java-sdk/reference/slim-resource#zones).

## Methods [#methods]

### list [#list]

```java
public Page<JsonNode> list(
        Map<String, ?> query,
        RequestOptions options) throws IOException, InterruptedException
```

Lists zones (`GET /v1/slim/zones`).

**Parameters:**

- `query`: query parameters; `null` values are skipped
- `options`: per-request options, such as the timeout

**Returns:** the first page; iterating it loads the next pages

**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

### retrieve [#retrieve]

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

Gets one zone (`GET /v1/slim/zones/{id}`).

**Parameters:**

- `id`: the zone ID
- `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

### deviceCounts [#devicecounts]

```java
public JsonNode deviceCounts(
        Map<String, ?> query,
        RequestOptions options) throws IOException, InterruptedException
```

Counts devices per zone (`GET /v1/slim/zones/device-counts`).

**Parameters:**

- `query`: query parameters; `null` values are skipped
- `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
