-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move pagination models to extensions submodule (#717)
* move pagination models to extensions submodule * remove models from api * update changelog * update changelog --------- Co-authored-by: Jonathan Healy <[email protected]>
- Loading branch information
1 parent
1916d44
commit 270e03d
Showing
5 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
stac_fastapi/extensions/stac_fastapi/extensions/core/pagination/request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Pagination extension request models.""" | ||
|
||
from typing import Optional | ||
|
||
import attr | ||
from pydantic import BaseModel | ||
|
||
from stac_fastapi.types.search import APIRequest | ||
|
||
|
||
@attr.s | ||
class GETTokenPagination(APIRequest): | ||
"""Token pagination for GET requests.""" | ||
|
||
token: Optional[str] = attr.ib(default=None) | ||
|
||
|
||
class POSTTokenPagination(BaseModel): | ||
"""Token pagination model for POST requests.""" | ||
|
||
token: Optional[str] = None | ||
|
||
|
||
@attr.s | ||
class GETPagination(APIRequest): | ||
"""Page based pagination for GET requests.""" | ||
|
||
page: Optional[str] = attr.ib(default=None) | ||
|
||
|
||
class POSTPagination(BaseModel): | ||
"""Page based pagination for POST requests.""" | ||
|
||
page: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters