Skip to content

Commit

Permalink
Refine pydantic models
Browse files Browse the repository at this point in the history
  • Loading branch information
heisner-tillman committed Dec 15, 2023
1 parent c4abdfb commit 94053e5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/galaxy/schema/invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,28 @@ class WorkflowInvocationResponse(Model):
output_values: Dict[str, Any] = Field(
default=Required, title="Output values", description="Output values of the workflow invocation."
)
# TODO Use proper message type here.
messages: Optional[Any] = Field(default=None, title="Message", description="Message of the workflow invocation.")
messages: List[InvocationMessageResponseUnion] = Field(
default=Required,
title="Messages",
description="A list of messages about why the invocation did not succeed.",
)


class InvocationJobsSummaryBaseModel(Model):
id: EncodedDatabaseIdField = InvocationIdField
states: Dict[str, int] # TODO add field description
populated_state: JobState # TODO add field description
states: Dict[JobState, int] = Field(
default=Required, title="States", description="The states of all the jobs related to the Invocation."
)
populated_state: JobState = Field(
default=Required,
title="Populated state",
description="The absolute state of all the jobs related to the Invocation.",
)


class InvocationJobsResponse(InvocationJobsSummaryBaseModel):
model: schema.INVOCATION_MODEL_CLASS = ModelClassField(schema.INVOCATION_MODEL_CLASS)


class InvocationStepJobsResponse(InvocationJobsSummaryBaseModel):
model: Any # TODO choose appropriate model class
model: schema.INVOCATION_STEP_MODEL_CLASS = ModelClassField(schema.INVOCATION_STEP_MODEL_CLASS)

0 comments on commit 94053e5

Please sign in to comment.