# PoliciesResource

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

```java
public final class PoliciesResource
```

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

## Methods [#methods]

### list [#list]

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

Lists access policies (`GET /v1/slim/policy`).

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

### retrieve [#retrieve]

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

Gets one access policy (`GET /v1/slim/policy/{id}`).

**Parameters:**

- `id`: the access policy 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 an access policy (`POST /v1/slim/policy`).

**Parameters:**

- `body`: the access policy 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 an access policy (`PUT /v1/slim/policy/{id}`).

**Parameters:**

- `id`: the access policy ID
- `body`: the full access policy
- `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 an access policy (`DELETE /v1/slim/policy/{id}`).

**Parameters:**

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