-
Notifications
You must be signed in to change notification settings - Fork 100
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
- Loading branch information
1 parent
f311dc6
commit b4951d4
Showing
3 changed files
with
38 additions
and
2 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
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