Skip to content

Commit

Permalink
links to stac-fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Schmidt committed Jan 3, 2024
1 parent 110acc1 commit 187f6d7
Showing 1 changed file with 66 additions and 2 deletions.
68 changes: 66 additions & 2 deletions openeo_fastapi/client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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=(
Expand All @@ -250,20 +258,32 @@ 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:
extra = Extra.allow


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"
host = "host"


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.",
Expand Down Expand Up @@ -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=(
Expand All @@ -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.
Expand All @@ -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=(
Expand All @@ -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=(
Expand All @@ -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=(
Expand All @@ -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.",
Expand All @@ -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=(
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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
"""

Expand Down

0 comments on commit 187f6d7

Please sign in to comment.