deseasion.backend.resources.project module

class deseasion.backend.resources.project.ProjectAPI

Bases: Resource

delete(project_id)

Delete the project.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 400:

The project is referenced by other objects and cannot be deleted.

Status 403:

The user is not allowed to delete this project.

Status 404:

The project doesn’t exist.

endpoint = 'projectapi'
get(project_id)

Return the project details for a given id.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to access this project.

Status 404:

The project doesn’t exist.

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'DELETE', 'GET', 'PUT'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

put(project_id)

Update the project details.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to modify this project.

Status 404:

The project doesn’t exist.

class deseasion.backend.resources.project.ProjectListAPI

Bases: Resource

endpoint = 'projectlistapi'
get()

Return the full list of projects accessible by the user.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post()

Create a new project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to create projects.

class deseasion.backend.resources.project.ProjectPermissionsAPI

Bases: Resource

endpoint = 'projectpermissionsapi'
get(project_id)

Allow the project manager to get the list of permissions.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not the manager of this project.

Status 404:

The project doesn’t exist.

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'PUT'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

put(project_id)

Allow to modify the list of permissions for the project.

Only the project manager is allowed to modify the permissions. The project manager is always added to the list of authorized users.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not the manager of this project.

Status 404:

The project doesn’t exist.

class deseasion.backend.resources.project.ProjectReplaceInputAttributesAPI

Bases: Resource

endpoint = 'projectreplaceinputattributesapi'
mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post(project_id)

Replace project data attributes usage.

It replaces usage of old attributes given by new attributes given, assuming the old attributes given are attributes of this project’s data and that the new attributes given are not already used as inputs alongside some of the old attributes.

Its main usage is threfore to replace whole project data (all their attributes) by completely unused other project data.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 400:

Remapping could not proceed with given arguments.

Status 403:

The user is not allowed to access this project, or a data

Status 404:

The project or a data doesn’t exist.

class deseasion.backend.resources.project.ProjectSharedDataListAPI

Bases: Resource

endpoint = 'projectshareddatalistapi'
get(project_id)

Return the list of project data in the project.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to access this project.

Status 404:

The project doesn’t exist.

load_content()

Loads the content and the data_type from the request body

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post(project_id)

Create a new project data in the project.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 400:

There is an error in the json schema for the data, or the data/stream already exists in the project.

Status 403:

The user is not allowed to access this project, the data or the stream.

Status 404:

The project doesn’t exist.

class deseasion.backend.resources.project.ProjectTemplateAPI

Bases: Resource

endpoint = 'projecttemplateapi'
mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post(project_id)

Create a template from a project.

Parameters:

project_id (int) – The id of the project.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to access the project.

Status 404:

The project doesn’t exist.

class deseasion.backend.resources.project.TemplateAPI

Bases: Resource

delete(template_id)

Delete a project template.

Parameters:

template_id (int) – The id of the project template.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to delete the template.

Status 404:

The template doesn’t exist.

endpoint = 'templateapi'
mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'DELETE', 'PUT'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

put(template_id)

Modify a project template.

Parameters:

template_id (int) – The id of the project template.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not allowed to access the template.

Status 404:

The template doesn’t exist.

class deseasion.backend.resources.project.TemplateListAPI

Bases: Resource

endpoint = 'templatelistapi'
get()

Return the list of templates of the user.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'GET'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

class deseasion.backend.resources.project.TemplatePermissionsAPI

Bases: Resource

endpoint = 'templatepermissionsapi'
get(template_id)

Allow the template manager to get the list of permissions.

Parameters:

template_id (int) – The id of the template.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not the manager of this template.

Status 404:

The template doesn’t exist.

mediatypes()
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'PUT'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

put(template_id)

Allow to modify the list of permissions for the template.

Only the template manager is allowed to modify the permissions. The template manager is always added to the list of authorized users.

Parameters:

template_id (int) – The id of the template.

Reqheader Authorization:

JSON Web Token with Bearer scheme (Authorization: Bearer <token>).

Status 403:

The user is not the manager of this template.

Status 404:

The template doesn’t exist.