Skip to content

Commit

Permalink
Type outputs field in model ToolResponse with extended HDA models
Browse files Browse the repository at this point in the history
  • Loading branch information
heisner-tillman committed Apr 4, 2024
1 parent 4734d14 commit c7738d8
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions lib/galaxy/schema/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
ShowFullJobResponse,
)
from galaxy.schema.schema import (
HDACustom,
HDADetailed,
HDASummary,
HDCADetailed,
HDCASummary,
JobSummary,
Expand Down Expand Up @@ -108,24 +111,39 @@ def inputs_string_to_json(cls, v):
model_config = ConfigDict(extra="allow")


class ExtendedHDCASummary(HDCASummary):
class HDACustomWithOutputName(HDACustom):
output_name: ToolOutputName


class ExtendedHDCADetailed(HDCADetailed):
class HDADetailedWithOutputName(HDADetailed):
output_name: ToolOutputName


ExtendedAnyHDCA = Union[ExtendedHDCADetailed, ExtendedHDCASummary]
class HDASummaryWithOutputName(HDASummary):
output_name: ToolOutputName


AnyHDAWithOutputName = Union[HDACustomWithOutputName, HDADetailedWithOutputName, HDASummaryWithOutputName]


class HDCASummaryWithOutputName(HDCASummary):
output_name: ToolOutputName


class HDCADetailedWithOutputName(HDCADetailed):
output_name: ToolOutputName


AnyHDCAWithOutputName = Union[HDCADetailedWithOutputName, HDCASummaryWithOutputName]


class ToolResponse(Model):
outputs: List[Dict[str, Any]] = Field(
outputs: List[AnyHDAWithOutputName] = Field(
default=[],
title="Outputs",
description="The outputs of the tool.",
)
output_collections: List[ExtendedAnyHDCA] = Field(
output_collections: List[AnyHDCAWithOutputName] = Field(
default=[],
title="Output Collections",
description="The output dataset collections of the tool.",
Expand All @@ -135,7 +153,7 @@ class ToolResponse(Model):
title="Jobs",
description="The jobs of the tool.",
)
implicit_collections: List[ExtendedAnyHDCA] = Field(
implicit_collections: List[AnyHDCAWithOutputName] = Field(
default=[],
title="Implicit Collections",
description="The implicit dataset collections of the tool.",
Expand Down

0 comments on commit c7738d8

Please sign in to comment.