Class: Contributors

repositories.Contributors

Contributors repository.

The Contributors class allows the user to manage contributors.

Hierarchy

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new Contributors(agent)

Creates an instance of Repository.

Parameters

Name Type
agent PeerAgent

Inherited from

Repository .constructor

Methods

create

create(payload): Promise<SDKContributor>

Adds a contributor to the project.

Example

Copy
Copied
const contributor = await dl.contributors.create({
    email: 'user@dataloop.ai',
    role: 'annotator'
})

Parameters

Name Type Description
payload Object The payload of the contributor to be added.
payload.email string The email of the contributor to be added.
payload.role string The role of the contributor to be added.

Returns

Promise<SDKContributor>

  • A promise that resolves to the added contributor.

delete

delete(id): Promise<void>

Removes a contributor from the project.

Example

Copy
Copied
await dl.contributors.delete('user@dataloop.ai')

Parameters

Name Type Description
id string The id (email) of the contributor to be removed.

Returns

Promise<void>


get

get(contributorId?): Promise<SDKContributor>

Retrieves a contributor.

Example

Copy
Copied
const contributor = await dl.contributors.get('user@dataloop.ai')

Parameters

Name Type Description
contributorId? string The id (email) of the contributor to be retrieved.

Returns

Promise<SDKContributor>

  • A promise that resolves to the retrieved contributor.

query

query(payload?): Promise<IPagedResponse<SDKContributor>>

Lists all the contributors of the active project.

Example

Copy
Copied
const pagedResponse = await dl.contributors.query()
const contributors = pagedResponse.items

Parameters

Name Type
payload? any

Returns

Promise<IPagedResponse<SDKContributor>>

Returns a Promise that resolves to a paged response object of contributors.