# ProjectsResource

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

```java
public final class ProjectsResource
```

Lists projects and manages the current project's members, features and settings. Get it from [`Ovok.projects()`](/java-sdk/reference/ovok#projects).

## Methods [#methods]

### members [#members]

```java
public ProjectsResource.Members members()
```

Returns the current project's member routes.

**Returns:** the members resource

### features [#features]

```java
public ProjectsResource.Features features()
```

Returns the current project's feature routes.

**Returns:** the features resource

### settings [#settings]

```java
public ProjectsResource.Settings settings()
```

Returns the current project's settings routes.

**Returns:** the settings resource

### list [#list]

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

Lists the projects the caller can see (`GET /v1/projects`).

**Parameters:**

- `query`: query parameters, such as the page number
- `options`: per-request options, such as the timeout

**Returns:** the first page of projects; 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

## ProjectsResource.Members [#projectsresourcemembers]

```java
public static final class Members
```

Manages the current project's members (`/v1/projects/me/members`).

### Members.list [#memberslist]

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

Lists the current project's members (`GET /v1/projects/me/members`).

**Parameters:**

- `query`: query parameters, such as the page number
- `options`: per-request options, such as the timeout

**Returns:** the first page of members; 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

### Members.invite [#membersinvite]

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

Invites a member to the current project (`POST /v1/projects/me/members`).

**Parameters:**

- `body`: the invitation, serialized as JSON
- `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

### Members.update [#membersupdate]

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

Updates a membership (`PATCH /v1/projects/me/members/{membershipId}`).

**Parameters:**

- `membershipId`: the membership id
- `body`: the fields to change, serialized as JSON
- `options`: per-request options, such as the timeout

**Returns:** the updated membership

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

### Members.remove [#membersremove]

```java
public JsonNode remove(
        String membershipId,
        RequestOptions options) throws IOException, InterruptedException
```

Removes a member from the current project (`DELETE /v1/projects/me/members/{membershipId}`).

**Parameters:**

- `membershipId`: the membership id
- `options`: per-request options, such as the timeout

**Returns:** the response body, or `null` when it is empty

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

## ProjectsResource.Features [#projectsresourcefeatures]

```java
public static final class Features
```

Reads and changes the current project's features (`/v1/projects/me/features`).

### Features.retrieve [#featuresretrieve]

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

Reads the current project's features (`GET /v1/projects/me/features`).

**Parameters:**

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

**Returns:** the features

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

### Features.update [#featuresupdate]

```java
public JsonNode update(
        Object features,
        RequestOptions options) throws IOException, InterruptedException
```

Replaces the current project's features (`PATCH /v1/projects/me/features`).

**Parameters:**

- `features`: the features, sent as the `features` field
- `options`: per-request options, such as the timeout

**Returns:** the updated features

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

## ProjectsResource.Settings [#projectsresourcesettings]

```java
public static final class Settings
```

Reads and changes the current project's settings (`/v1/project/settings`).

### Settings.retrieve [#settingsretrieve]

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

Reads the current project's settings (`GET /v1/project/settings`).

**Parameters:**

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

**Returns:** the settings

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

### Settings.update [#settingsupdate]

```java
public JsonNode update(
        String key,
        boolean enabled,
        RequestOptions options) throws IOException, InterruptedException
```

Turns a boolean setting on or off (`PUT /v1/project/settings/{key}`).

**Parameters:**

- `key`: the setting key
- `enabled`: whether the setting is on
- `options`: per-request options, such as the timeout

**Returns:** the response body, or `null` when it is empty

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

### Settings.updateText [#settingsupdatetext]

```java
public JsonNode updateText(
        String key,
        String value,
        RequestOptions options) throws IOException, InterruptedException
```

Sets a text setting's value (`PUT /v1/project/settings/values/{key}`).

**Parameters:**

- `key`: the setting key
- `value`: the new value, or `null` to clear it
- `options`: per-request options, such as the timeout

**Returns:** the response body, or `null` when it is empty

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