From 3270ff0a6aed0c8efc3d19ec713a1cc58b1c7569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lipovsk=C3=BD?= Date: Wed, 18 Oct 2023 09:40:38 +0200 Subject: [PATCH] Use Literal for graph_mode_update in AddRequestResponse --- iib/web/iib_static_types.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iib/web/iib_static_types.py b/iib/web/iib_static_types.py index 3827259c1..a1246e25a 100644 --- a/iib/web/iib_static_types.py +++ b/iib/web/iib_static_types.py @@ -5,6 +5,7 @@ from proton._message import Message IIB_BINARY_IMAGE_CONFIG_TYPE = Dict[str, Dict[str, str]] +GRAPH_MODE_LITERAL = Literal['replaces', 'semver', 'semver-skippatch'] class PaginationMetadata(TypedDict): @@ -95,7 +96,7 @@ class AddRequestPayload(TypedDict): distribution_scope: NotRequired[str] force_backport: NotRequired[bool] from_index: NotRequired[str] - graph_update_mode: NotRequired[str] + graph_update_mode: NotRequired[GRAPH_MODE_LITERAL] organization: NotRequired[str] overwrite_from_index: NotRequired[bool] overwrite_from_index_token: NotRequired[str] @@ -161,6 +162,7 @@ class MergeIndexImagesPayload(TypedDict): build_tags: NotRequired[List[str]] deprecation_list: NotRequired[List[str]] distribution_scope: NotRequired[str] + graph_update_mode: NotRequired[str] overwrite_target_index: NotRequired[bool] overwrite_target_index_token: NotRequired[str] source_from_index: str @@ -350,7 +352,7 @@ class AddRequestResponse(AddRmRequestResponseBase): """Datastructure of the response to request from /builds/add API point.""" check_related_images: bool - graph_update_mode: str + graph_update_mode: GRAPH_MODE_LITERAL omps_operator_version: Dict[str, Any] @@ -388,6 +390,7 @@ class MergeIndexImageRequestResponse(APIPartImageBuildRequestResponse): build_tags: List[str] deprecation_list: List[str] distribution_scope: str + graph_update_mode: Literal['replaces', 'semver', 'semver-skippatch'] index_image: Optional[str] source_from_index: str source_from_index_resolved: Optional[str]