Skip to content

Commit

Permalink
Revert "fix: dont hide kind const field to UI"
Browse files Browse the repository at this point in the history
This reverts commit 6334082.
  • Loading branch information
julien-pinchelimouroux committed Oct 23, 2024
1 parent 6334082 commit eed0531
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions toucan_connectors/http_api/pagination_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class NoopPaginationConfig(PaginationConfig):
Useful for connectors that can return all results at once.
"""

kind: Literal["NoopPaginationConfig"] = Field("NoopPaginationConfig", **UI_HIDDEN)

def apply_pagination_to_data_source(self, data_source: HttpAPIDataSource) -> HttpAPIDataSource:
return data_source

Expand All @@ -52,7 +54,7 @@ def get_error_status_whitelist(self) -> list[str] | None:


class OffsetLimitPaginationConfig(PaginationConfig):
kind: Literal["OffsetLimitPaginationConfig"] = "OffsetLimitPaginationConfig"
kind: Literal["OffsetLimitPaginationConfig"] = Field("OffsetLimitPaginationConfig", **UI_HIDDEN)
offset_name: str = "offset"
offset: int = Field(0, **UI_HIDDEN)
limit_name: str = "limit"
Expand Down Expand Up @@ -82,7 +84,7 @@ def get_pagination_info_filter(self) -> str | None:


class PageBasedPaginationConfig(PaginationConfig):
kind: Literal["PageBasedPaginationConfig"] = "PageBasedPaginationConfig"
kind: Literal["PageBasedPaginationConfig"] = Field("PageBasedPaginationConfig", **UI_HIDDEN)
page_name: str = "page"
page: int = 0
per_page_name: str | None = None
Expand Down Expand Up @@ -129,7 +131,7 @@ def get_error_status_whitelist(self) -> list[int] | None:


class CursorBasedPaginationConfig(PaginationConfig):
kind: Literal["CursorBasedPaginationConfig"] = "CursorBasedPaginationConfig"
kind: Literal["CursorBasedPaginationConfig"] = Field("CursorBasedPaginationConfig", **UI_HIDDEN)
cursor_name: str = "cursor"
cursor: str | None = Field(None, **UI_HIDDEN)
cursor_filter: str = Field(..., description=FilterSchemaDescription)
Expand Down Expand Up @@ -163,7 +165,7 @@ def get_error_status_whitelist(self) -> list[str] | None:


class HyperMediaPaginationConfig(PaginationConfig):
kind: Literal["HyperMediaPaginationConfig"] = "HyperMediaPaginationConfig"
kind: Literal["HyperMediaPaginationConfig"] = Field("HyperMediaPaginationConfig", **UI_HIDDEN)
next_link_filter: str = Field(..., description=FilterSchemaDescription)
next_link: str | None = None

Expand Down

0 comments on commit eed0531

Please sign in to comment.