Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api-clients/python/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ docs/SpatialReferenceSpecification.md
docs/SpatialReferencesApi.md
docs/SpatialResolution.md
docs/StacApiRetries.md
docs/StacAssetBand.md
docs/StacDataProviderDefinition.md
docs/StacProviderAuthentication.md
docs/StacProviderDataset.md
docs/StacProviderDatasetBand.md
docs/StacProviderS3Config.md
Expand Down Expand Up @@ -664,7 +666,9 @@ geoengine_api_client/models/spatial_reference_specification.py
geoengine_api_client/models/spatial_resolution.py
geoengine_api_client/models/st_rectangle.py
geoengine_api_client/models/stac_api_retries.py
geoengine_api_client/models/stac_asset_band.py
geoengine_api_client/models/stac_data_provider_definition.py
geoengine_api_client/models/stac_provider_authentication.py
geoengine_api_client/models/stac_provider_dataset.py
geoengine_api_client/models/stac_provider_dataset_band.py
geoengine_api_client/models/stac_provider_s3_config.py
Expand Down Expand Up @@ -1046,7 +1050,9 @@ test/test_spatial_references_api.py
test/test_spatial_resolution.py
test/test_st_rectangle.py
test/test_stac_api_retries.py
test/test_stac_asset_band.py
test/test_stac_data_provider_definition.py
test/test_stac_provider_authentication.py
test/test_stac_provider_dataset.py
test/test_stac_provider_dataset_band.py
test/test_stac_provider_s3_config.py
Expand Down
2 changes: 2 additions & 0 deletions api-clients/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ Class | Method | HTTP request | Description
- [SpatialReferenceSpecification](docs/SpatialReferenceSpecification.md)
- [SpatialResolution](docs/SpatialResolution.md)
- [StacApiRetries](docs/StacApiRetries.md)
- [StacAssetBand](docs/StacAssetBand.md)
- [StacDataProviderDefinition](docs/StacDataProviderDefinition.md)
- [StacProviderAuthentication](docs/StacProviderAuthentication.md)
- [StacProviderDataset](docs/StacProviderDataset.md)
- [StacProviderDatasetBand](docs/StacProviderDatasetBand.md)
- [StacProviderS3Config](docs/StacProviderS3Config.md)
Expand Down
4 changes: 4 additions & 0 deletions api-clients/python/geoengine_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@
"SpatialReferenceSpecification",
"SpatialResolution",
"StacApiRetries",
"StacAssetBand",
"StacDataProviderDefinition",
"StacProviderAuthentication",
"StacProviderDataset",
"StacProviderDatasetBand",
"StacProviderS3Config",
Expand Down Expand Up @@ -697,7 +699,9 @@
from geoengine_api_client.models.spatial_reference_specification import SpatialReferenceSpecification as SpatialReferenceSpecification
from geoengine_api_client.models.spatial_resolution import SpatialResolution as SpatialResolution
from geoengine_api_client.models.stac_api_retries import StacApiRetries as StacApiRetries
from geoengine_api_client.models.stac_asset_band import StacAssetBand as StacAssetBand
from geoengine_api_client.models.stac_data_provider_definition import StacDataProviderDefinition as StacDataProviderDefinition
from geoengine_api_client.models.stac_provider_authentication import StacProviderAuthentication as StacProviderAuthentication
from geoengine_api_client.models.stac_provider_dataset import StacProviderDataset as StacProviderDataset
from geoengine_api_client.models.stac_provider_dataset_band import StacProviderDatasetBand as StacProviderDatasetBand
from geoengine_api_client.models.stac_provider_s3_config import StacProviderS3Config as StacProviderS3Config
Expand Down
2 changes: 2 additions & 0 deletions api-clients/python/geoengine_api_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@
from geoengine_api_client.models.spatial_reference_specification import SpatialReferenceSpecification
from geoengine_api_client.models.spatial_resolution import SpatialResolution
from geoengine_api_client.models.stac_api_retries import StacApiRetries
from geoengine_api_client.models.stac_asset_band import StacAssetBand
from geoengine_api_client.models.stac_data_provider_definition import StacDataProviderDefinition
from geoengine_api_client.models.stac_provider_authentication import StacProviderAuthentication
from geoengine_api_client.models.stac_provider_dataset import StacProviderDataset
from geoengine_api_client.models.stac_provider_dataset_band import StacProviderDatasetBand
from geoengine_api_client.models.stac_provider_s3_config import StacProviderS3Config
Expand Down
94 changes: 94 additions & 0 deletions api-clients/python/geoengine_api_client/models/stac_asset_band.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# coding: utf-8

"""
Geo Engine API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Contact: dev@geoengine.de
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class StacAssetBand(BaseModel):
"""
StacAssetBand
""" # noqa: E501
asset_title: StrictStr = Field(alias="assetTitle")
band_name: Optional[StrictStr] = Field(default=None, alias="bandName")
__properties: ClassVar[List[str]] = ["assetTitle", "bandName"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of StacAssetBand from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# set to None if band_name (nullable) is None
# and model_fields_set contains the field
if self.band_name is None and "band_name" in self.model_fields_set:
_dict['bandName'] = None

return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of StacAssetBand from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"assetTitle": obj.get("assetTitle"),
"bandName": obj.get("bandName")
})
return _obj


Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from geoengine_api_client.models.stac_provider_authentication import StacProviderAuthentication
from geoengine_api_client.models.stac_provider_dataset import StacProviderDataset
from geoengine_api_client.models.stac_provider_s3_config import StacProviderS3Config
from geoengine_api_client.models.time_dimension import TimeDimension
Expand All @@ -38,10 +39,12 @@ class StacDataProviderDefinition(BaseModel):
api_url: StrictStr = Field(alias="apiUrl")
collection_name: StrictStr = Field(alias="collectionName")
s3_config: Optional[StacProviderS3Config] = Field(default=None, alias="s3Config")
authentication: Optional[StacProviderAuthentication] = None
time_dimension: TimeDimension = Field(alias="timeDimension")
datasets: List[StacProviderDataset]
query_timeout_secs: Optional[StrictInt] = Field(default=None, description="Timeout in seconds for outgoing STAC API HTTP requests.", alias="queryTimeoutSecs")
__properties: ClassVar[List[str]] = ["type", "name", "id", "description", "priority", "apiUrl", "collectionName", "s3Config", "timeDimension", "datasets", "queryTimeoutSecs"]
page_limit: Optional[StrictInt] = Field(default=None, alias="pageLimit")
__properties: ClassVar[List[str]] = ["type", "name", "id", "description", "priority", "apiUrl", "collectionName", "s3Config", "authentication", "timeDimension", "datasets", "queryTimeoutSecs", "pageLimit"]

@field_validator('type')
def type_validate_enum(cls, value):
Expand Down Expand Up @@ -92,6 +95,9 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of s3_config
if self.s3_config:
_dict['s3Config'] = self.s3_config.to_dict()
# override the default output from pydantic by calling `to_dict()` of authentication
if self.authentication:
_dict['authentication'] = self.authentication.to_dict()
# override the default output from pydantic by calling `to_dict()` of time_dimension
if self.time_dimension:
_dict['timeDimension'] = self.time_dimension.to_dict()
Expand All @@ -112,6 +118,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.s3_config is None and "s3_config" in self.model_fields_set:
_dict['s3Config'] = None

# set to None if authentication (nullable) is None
# and model_fields_set contains the field
if self.authentication is None and "authentication" in self.model_fields_set:
_dict['authentication'] = None

return _dict

@classmethod
Expand All @@ -132,9 +143,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"apiUrl": obj.get("apiUrl"),
"collectionName": obj.get("collectionName"),
"s3Config": StacProviderS3Config.from_dict(obj["s3Config"]) if obj.get("s3Config") is not None else None,
"authentication": StacProviderAuthentication.from_dict(obj["authentication"]) if obj.get("authentication") is not None else None,
"timeDimension": TimeDimension.from_dict(obj["timeDimension"]) if obj.get("timeDimension") is not None else None,
"datasets": [StacProviderDataset.from_dict(_item) for _item in obj["datasets"]] if obj.get("datasets") is not None else None,
"queryTimeoutSecs": obj.get("queryTimeoutSecs")
"queryTimeoutSecs": obj.get("queryTimeoutSecs"),
"pageLimit": obj.get("pageLimit")
})
return _obj

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# coding: utf-8

"""
Geo Engine API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Contact: dev@geoengine.de
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self

class StacProviderAuthentication(BaseModel):
"""
StacProviderAuthentication
""" # noqa: E501
endpoint: StrictStr
username: StrictStr
password: StrictStr = Field(description="A wrapper type that serializes to \"*****\" and can be deserialized from any string. If the inner value is \"*****\", it is considered unknown and `as_option` returns `None`. This is useful for secrets that should not be exposed in API responses, but can be set in API requests.")
__properties: ClassVar[List[str]] = ["endpoint", "username", "password"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of StacProviderAuthentication from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of StacProviderAuthentication from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"endpoint": obj.get("endpoint"),
"username": obj.get("username"),
"password": obj.get("password")
})
return _obj


Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from geoengine_api_client.models.raster_band_descriptor import RasterBandDescriptor
from geoengine_api_client.models.stac_asset_band import StacAssetBand
from typing import Optional, Set
from typing_extensions import Self

class StacProviderDatasetBand(BaseModel):
"""
StacProviderDatasetBand
""" # noqa: E501
asset_title: StrictStr = Field(alias="assetTitle")
band_name: Optional[StrictStr] = Field(default=None, alias="bandName")
__properties: ClassVar[List[str]] = ["assetTitle", "bandName"]
asset_band: StacAssetBand = Field(description="The band inside the STAC asset that this dataset band reads from (addressing: which asset file + which raster channel within it).", alias="assetBand")
band_descriptor: RasterBandDescriptor = Field(description="The band descriptor of the resulting geo engine dataset layer.", alias="bandDescriptor")
__properties: ClassVar[List[str]] = ["assetBand", "bandDescriptor"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -69,11 +71,12 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if band_name (nullable) is None
# and model_fields_set contains the field
if self.band_name is None and "band_name" in self.model_fields_set:
_dict['bandName'] = None

# override the default output from pydantic by calling `to_dict()` of asset_band
if self.asset_band:
_dict['assetBand'] = self.asset_band.to_dict()
# override the default output from pydantic by calling `to_dict()` of band_descriptor
if self.band_descriptor:
_dict['bandDescriptor'] = self.band_descriptor.to_dict()
return _dict

@classmethod
Expand All @@ -86,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"assetTitle": obj.get("assetTitle"),
"bandName": obj.get("bandName")
"assetBand": StacAssetBand.from_dict(obj["assetBand"]) if obj.get("assetBand") is not None else None,
"bandDescriptor": RasterBandDescriptor.from_dict(obj["bandDescriptor"]) if obj.get("bandDescriptor") is not None else None
})
return _obj

Expand Down
Loading
Loading