# LocationsResource

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

```java
public final class LocationsResource
```

Manages locations through the slim API. Get it from [`SlimResource.locations()`](/java-sdk/reference/slim-resource#locations).

## Methods [#methods]

### list [#list]

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

Lists locations (`GET /v1/slim/location`).

**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 location (`GET /v1/slim/location/{id}`).

**Parameters:**

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

### create [#create]

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

Creates a location (`POST /v1/slim/location`).

**Parameters:**

- `body`: the location to create
- `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

### update [#update]

```java
public JsonNode update(
        String id,
        Object body,
        RequestOptions options) throws IOException, InterruptedException
```

Replaces a location (`PUT /v1/slim/location/{id}`).

**Parameters:**

- `id`: the location ID
- `body`: the full location
- `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

### delete [#delete]

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

Deletes a location (`DELETE /v1/slim/location/{id}`).

**Parameters:**

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