Skip to content

Projects.API

Phips Peter edited this page Oct 22, 2014 · 5 revisions

Class: Projects

Projects

A wrapper for the Projects resource

new Projects(dispatcher)

Constructs a resource accessor for Projects that will use the dispatcher for all requests to the API

Parameters:
Name Type Description
dispatcher Dispatcher

The API dispatcher

Source:

Members

dispatcher :Dispatcher

An instance of the dispatcher. This is usually passed from the client.

Type:
Source:

Methods

create(data) → {Promise}

Dispatches a POST request to /projects of the API to create a new project.

Parameters:
Name Type Description
data Object

The data for the project

Source:
Returns:

The result of the API call

Type
Promise

createInWorkspace(workspaceId, data) → {Promise}

Dispatches a POST request to /workspaces/:workspaceId/projects of the API to create a new project within the workspace.

Parameters:
Name Type Description
workspaceId Number

The workspace id

data Object

The data for the project

Source:
Returns:

The result of the API call

Type
Promise

delete(projectId) → {Promise}

Dispatches a DELETE requte to /projects/:projectId to delete the project.

Parameters:
Name Type Description
projectId Number

The project id

Source:
Returns:

The result of the API call

Type
Promise

findAll(params) → {Promise}

Dispatches a GET request to /projects of the API to get information about all projects that the dispatcher as access to.

Parameters:
Name Type Argument Description
params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

findById(projectId, params) → {Promise}

Dispatches a GET request to /projects/:projectId of the API to get information about the project.

Parameters:
Name Type Argument Description
projectId Number

The project id

params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

findByWorkspace(workspaceId, params) → {Promise}

Dispatches a GET request to /workspaces/:workspaceId/projects to get all the projects associated with the workspace.

Parameters:
Name Type Argument Description
workspaceId Number

The workspace id

params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

update(projectId, data) → {Promise}

Dispatches a PUT request to /projects/:projectId to update the project.

Parameters:
Name Type Description
projectId Number

The project id

data Object

The data to be sent to the workspace

Source:
Returns:

The result of the API call

Type
Promise

Generated with wicked.