From 187f6d7711c87fdb5aba51f260dc9374b198ea79 Mon Sep 17 00:00:00 2001 From: Roman Schmidt Date: Wed, 3 Jan 2024 09:10:41 +0000 Subject: [PATCH] links to stac-fastapi --- openeo_fastapi/client/models.py | 68 ++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/openeo_fastapi/client/models.py b/openeo_fastapi/client/models.py index 036ace5..ef704bc 100644 --- a/openeo_fastapi/client/models.py +++ b/openeo_fastapi/client/models.py @@ -230,6 +230,10 @@ class Capabilities(BaseModel): class CollectionId(str): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + collection_id: constr(regex=rb"^[\w\-\.~\/]+$") = Field( ..., description="A unique identifier for the collection, which MUST match the specified pattern.", @@ -238,6 +242,10 @@ class CollectionId(str): class StacExtensions(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: list[Union[AnyUrl, str]] = Field( ..., description=( @@ -250,6 +258,10 @@ class StacExtensions(BaseModel): class StacAssets(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + pass class Config: @@ -257,6 +269,10 @@ class Config: class Role(Enum): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + producer = "producer" licensor = "licensor" processor = "processor" @@ -264,6 +280,10 @@ class Role(Enum): class StacProvider(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + name: str = Field( ..., description="The name of the organization or the individual.", @@ -301,6 +321,10 @@ class StacProvider(BaseModel): class StacProviders(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: list[StacProvider] = Field( ..., description=( @@ -312,6 +336,10 @@ class StacProviders(BaseModel): class Description(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: str = Field( ..., description="""Detailed description to explain the entity. @@ -320,11 +348,19 @@ class Description(BaseModel): class Dimension(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + type: Type2 = Field(..., description="Type of the dimension.") description: Optional[Description] = None class Spatial(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + bbox: Optional[list[list[float]]] = Field( None, description=( @@ -339,6 +375,10 @@ class Spatial(BaseModel): class IntervalItem(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: list[Any] = Field( ..., description=( @@ -350,6 +390,10 @@ class IntervalItem(BaseModel): class Temporal(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + interval: Optional[list[IntervalItem]] = Field( None, description=( @@ -364,6 +408,10 @@ class Temporal(BaseModel): class Extent(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + spatial: Spatial = Field( ..., description="The *potential* spatial extents of the features in the collection.", @@ -377,11 +425,19 @@ class Extent(BaseModel): class CollectionSummaryStats(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + min: Union[str, float] = Field(alias="minimum") max: Union[str, float] = Field(alias="maximum") class StacLicense(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: str = Field( ..., description=( @@ -398,6 +454,10 @@ class StacLicense(BaseModel): class Collection(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + stac_version: StacVersion stac_extensions: Optional[StacExtensions] = None type: Optional[Type1] = Field( @@ -517,6 +577,10 @@ class Config: class LinksPagination(BaseModel): + """ + Based on https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types/stac_fastapi/types + """ + __root__: list[Link] = Field( ..., description="""Links related to this list of resources, for example links for pagination\nor @@ -531,8 +595,8 @@ class LinksPagination(BaseModel): class Collections(TypedDict, total=False): - """All collections endpoint. - + """ + All collections endpoint. https://github.com/radiantearth/stac-api-spec/tree/master/collections """