Buckets:

download
raw
2.02 kB
from abc import ABC, abstractmethod
from typing import List
from docknet.schema import AccessLevel, Project, ProjectCreation, ProjectInput
from docknet.schema.auth import UserPermission
class ProjectOperations(ABC):
@abstractmethod
def list_projects(self) -> List[Project]:
"""Returns all projects visible to the authenticated user."""
pass
@abstractmethod
def create_project(
self, project_input: ProjectCreation, technical_project: bool = False
) -> Project:
pass
@abstractmethod
def get_project(self, project_id: str) -> Project:
pass
@abstractmethod
def update_project(self, project_id: str, project_input: ProjectInput) -> Project:
pass
@abstractmethod
def suggest_project_id(self, display_name: str) -> str:
pass
@abstractmethod
def delete_project(self, project_id: str) -> None:
pass
@abstractmethod
def list_project_members(self, project_id: str) -> List[UserPermission]:
pass
@abstractmethod
def add_project_member(
self,
project_id: str,
user_id: str,
access_level: AccessLevel,
) -> List[UserPermission]:
pass
@abstractmethod
def remove_project_member(
self, project_id: str, user_id: str
) -> List[UserPermission]:
pass
@abstractmethod
def get_project_token(
self, project_id: str, access_level: AccessLevel = AccessLevel.WRITE
) -> str:
"""Create project token with permission to access all resources of the project.
If a token for the specified project and access level already exists in the DB, it is returned instead of creating
a new project token.
Args:
project_id: Id of the user for which the token should be created
access_level: The access level of the user token (defaults to "write")
Returns:
User token for specified user id and access level.
"""
pass

Xet Storage Details

Size:
2.02 kB
·
Xet hash:
5cb7a4b00232feb39cbdbba26b15f726b1fe958c32cf26ca969fef71a7c67f62

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.