ProjectsResource

Lists projects and manages the current project's members, features and settings.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public final class ProjectsResource

Lists projects and manages the current project's members, features and settings. Get it from Ovok.projects().

Methods

members

public ProjectsResource.Members members()

Returns the current project's member routes.

Returns: the members resource

features

public ProjectsResource.Features features()

Returns the current project's feature routes.

Returns: the features resource

settings

public ProjectsResource.Settings settings()

Returns the current project's settings routes.

Returns: the settings resource

list

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

public static final class Members

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

Members.list

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

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

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

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

public static final class Features

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

Features.retrieve

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

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

public static final class Settings

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

Settings.retrieve

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

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

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

Last updated on

On this page