Skip to content

Commit

Permalink
add LibraryFolderDatabaseIdField Model for library_id
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Sep 27, 2024
1 parent 5f323a5 commit 912ba9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 9 additions & 6 deletions lib/galaxy/webapps/galaxy/api/library_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
ProvidesHistoryContext,
ProvidesUserContext,
)
from galaxy.schema.fields import DecodedDatabaseIdField
from galaxy.schema.fields import (
DecodedDatabaseIdField,
LibraryFolderDatabaseIdField,
)
from galaxy.schema.library_contents import (
LibraryContentsCollectionCreatePayload,
LibraryContentsCreateDatasetCollectionResponse,
Expand Down Expand Up @@ -55,7 +58,7 @@ class FastAPILibraryContents:
)
def index(
self,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
trans: ProvidesUserContext = DependsOnTrans,
) -> LibraryContentsIndexListResponse:
"""
Expand All @@ -71,7 +74,7 @@ def index(
)
def show(
self,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
id: MaybeLibraryFolderOrDatasetID,
trans: ProvidesUserContext = DependsOnTrans,
) -> Union[
Expand All @@ -90,7 +93,7 @@ def show(
)
def create(
self,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
payload: Union[
LibraryContentsFolderCreatePayload, LibraryContentsFileCreatePayload, LibraryContentsCollectionCreatePayload
],
Expand All @@ -113,7 +116,7 @@ def create(
)
def update(
self,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
id: DecodedDatabaseIdField,
payload,
trans: ProvidesUserContext = DependsOnTrans,
Expand All @@ -130,7 +133,7 @@ def update(
)
def delete(
self,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
id: DecodedDatabaseIdField,
payload: Optional[LibraryContentsDeletePayload] = Body(None),
trans: ProvidesHistoryContext = DependsOnTrans,
Expand Down
9 changes: 6 additions & 3 deletions lib/galaxy/webapps/galaxy/services/library_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
tags,
)
from galaxy.model.base import transaction
from galaxy.schema.fields import DecodedDatabaseIdField
from galaxy.schema.fields import (
DecodedDatabaseIdField,
LibraryFolderDatabaseIdField,
)
from galaxy.schema.library_contents import (
LibraryContentsCollectionCreatePayload,
LibraryContentsCreateDatasetCollectionResponse,
Expand Down Expand Up @@ -80,7 +83,7 @@ def __init__(
def index(
self,
trans: ProvidesUserContext,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
) -> LibraryContentsIndexListResponse:
"""Return a list of library files and folders."""
rval: List[Union[LibraryContentsIndexFolderResponse, LibraryContentsIndexDatasetResponse]] = []
Expand Down Expand Up @@ -129,7 +132,7 @@ def show(
def create(
self,
trans: ProvidesHistoryContext,
library_id: DecodedDatabaseIdField,
library_id: Union[DecodedDatabaseIdField, LibraryFolderDatabaseIdField],
payload: Union[
LibraryContentsFolderCreatePayload, LibraryContentsFileCreatePayload, LibraryContentsCollectionCreatePayload
],
Expand Down

0 comments on commit 912ba9b

Please sign in to comment.