Skip to content

Commit

Permalink
Create a named union for InvocationMessageResponseUnion
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Aug 27, 2024
1 parent 2087397 commit 8488ee6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion client/src/api/invocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type WorkflowInvocationElementView = components["schemas"]["WorkflowInvoc
export type WorkflowInvocationCollectionView = components["schemas"]["WorkflowInvocationCollectionView"];
export type InvocationJobsSummary = components["schemas"]["InvocationJobsResponse"];
export type InvocationStep = components["schemas"]["InvocationStep"];
export type InvocationMessage = components["schemas"]["WorkflowInvocationElementView"]["messages"][0];
export type InvocationMessage = components["schemas"]["InvocationMessageResponseUnion"];

export type StepJobSummary =
| components["schemas"]["InvocationStepJobsResponseStepModel"]
Expand Down
26 changes: 13 additions & 13 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8049,6 +8049,18 @@ export interface components {
[key: string]: number | undefined;
};
};
InvocationMessageResponseUnion:
| components["schemas"]["InvocationCancellationReviewFailedResponse"]
| components["schemas"]["InvocationCancellationHistoryDeletedResponse"]
| components["schemas"]["InvocationCancellationUserRequestResponse"]
| components["schemas"]["InvocationFailureDatasetFailedResponse"]
| components["schemas"]["InvocationFailureCollectionFailedResponse"]
| components["schemas"]["InvocationFailureJobFailedResponse"]
| components["schemas"]["InvocationFailureOutputNotFoundResponse"]
| components["schemas"]["InvocationFailureExpressionEvaluationFailedResponse"]
| components["schemas"]["InvocationFailureWhenNotBooleanResponse"]
| components["schemas"]["InvocationUnexpectedFailureResponse"]
| components["schemas"]["InvocationEvaluationWarningWorkflowOutputNotFoundResponse"];
/** InvocationOutput */
InvocationOutput: {
/**
Expand Down Expand Up @@ -13316,19 +13328,7 @@ export interface components {
* Messages
* @description A list of messages about why the invocation did not succeed.
*/
messages: (
| components["schemas"]["InvocationCancellationReviewFailedResponse"]
| components["schemas"]["InvocationCancellationHistoryDeletedResponse"]
| components["schemas"]["InvocationCancellationUserRequestResponse"]
| components["schemas"]["InvocationFailureDatasetFailedResponse"]
| components["schemas"]["InvocationFailureCollectionFailedResponse"]
| components["schemas"]["InvocationFailureJobFailedResponse"]
| components["schemas"]["InvocationFailureOutputNotFoundResponse"]
| components["schemas"]["InvocationFailureExpressionEvaluationFailedResponse"]
| components["schemas"]["InvocationFailureWhenNotBooleanResponse"]
| components["schemas"]["InvocationUnexpectedFailureResponse"]
| components["schemas"]["InvocationEvaluationWarningWorkflowOutputNotFoundResponse"]
)[];
messages: components["schemas"]["InvocationMessageResponseUnion"][];
/**
* Model class
* @description The name of the database model class.
Expand Down
5 changes: 4 additions & 1 deletion lib/galaxy/schema/invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing_extensions import (
Annotated,
Literal,
TypeAliasType,
)

from galaxy.schema import schema
Expand Down Expand Up @@ -253,7 +254,7 @@ class GenericInvocationEvaluationWarningWorkflowOutputNotFound(
EncodedDatabaseIdField
]

InvocationMessageResponseUnion = Annotated[
_InvocationMessageResponseUnion = Annotated[
Union[
InvocationCancellationReviewFailedResponseModel,
InvocationCancellationHistoryDeletedResponseModel,
Expand All @@ -270,6 +271,8 @@ class GenericInvocationEvaluationWarningWorkflowOutputNotFound(
Field(discriminator="reason"),
]

InvocationMessageResponseUnion = TypeAliasType("InvocationMessageResponseUnion", _InvocationMessageResponseUnion)


class InvocationMessageResponseModel(RootModel):
root: InvocationMessageResponseUnion
Expand Down

0 comments on commit 8488ee6

Please sign in to comment.