Skip to content

Commit

Permalink
update openapi-client
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmattig committed Oct 15, 2024
1 parent dcb1abb commit f9ab4a6
Show file tree
Hide file tree
Showing 54 changed files with 101 additions and 243 deletions.
28 changes: 7 additions & 21 deletions .generation/input/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5636,23 +5636,7 @@
}
},
"DateTimeParseFormat": {
"type": "object",
"required": [
"fmt",
"has_tz",
"has_time"
],
"properties": {
"fmt": {
"type": "string"
},
"has_time": {
"type": "boolean"
},
"has_tz": {
"type": "boolean"
}
}
"type": "string"
},
"DerivedColor": {
"type": "object",
Expand Down Expand Up @@ -6894,8 +6878,8 @@
"mapping": {
"none": "#/components/schemas/OgrSourceDatasetTimeTypeNone",
"start": "#/components/schemas/OgrSourceDatasetTimeTypeStart",
"startDuration": "#/components/schemas/OgrSourceDatasetTimeTypeStartDuration",
"startEnd": "#/components/schemas/OgrSourceDatasetTimeTypeStartEnd"
"start+duration": "#/components/schemas/OgrSourceDatasetTimeTypeStartDuration",
"start+end": "#/components/schemas/OgrSourceDatasetTimeTypeStartEnd"
}
}
},
Expand Down Expand Up @@ -6941,6 +6925,7 @@
},
"OgrSourceDatasetTimeTypeStartDuration": {
"type": "object",
"title": "OgrSourceDatasetTimeTypeStartDuration",
"required": [
"startField",
"startFormat",
Expand All @@ -6960,13 +6945,14 @@
"type": {
"type": "string",
"enum": [
"startDuration"
"start+duration"
]
}
}
},
"OgrSourceDatasetTimeTypeStartEnd": {
"type": "object",
"title": "OgrSourceDatasetTimeTypeStartEnd",
"required": [
"startField",
"startFormat",
Expand All @@ -6990,7 +6976,7 @@
"type": {
"type": "string",
"enum": [
"startEnd"
"start+end"
]
}
}
Expand Down
3 changes: 0 additions & 3 deletions python/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ docs/DatasetListing.md
docs/DatasetResource.md
docs/DatasetsApi.md
docs/DateTime.md
docs/DateTimeParseFormat.md
docs/DerivedColor.md
docs/DerivedNumber.md
docs/DescribeCoverageRequest.md
Expand Down Expand Up @@ -289,7 +288,6 @@ geoengine_openapi_client/models/dataset_definition.py
geoengine_openapi_client/models/dataset_listing.py
geoengine_openapi_client/models/dataset_resource.py
geoengine_openapi_client/models/date_time.py
geoengine_openapi_client/models/date_time_parse_format.py
geoengine_openapi_client/models/derived_color.py
geoengine_openapi_client/models/derived_number.py
geoengine_openapi_client/models/describe_coverage_request.py
Expand Down Expand Up @@ -514,7 +512,6 @@ test/test_dataset_listing.py
test/test_dataset_resource.py
test/test_datasets_api.py
test/test_date_time.py
test/test_date_time_parse_format.py
test/test_derived_color.py
test/test_derived_number.py
test/test_describe_coverage_request.py
Expand Down
1 change: 0 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ Class | Method | HTTP request | Description
- [DatasetListing](docs/DatasetListing.md)
- [DatasetResource](docs/DatasetResource.md)
- [DateTime](docs/DateTime.md)
- [DateTimeParseFormat](docs/DateTimeParseFormat.md)
- [DerivedColor](docs/DerivedColor.md)
- [DerivedNumber](docs/DerivedNumber.md)
- [DescribeCoverageRequest](docs/DescribeCoverageRequest.md)
Expand Down
1 change: 0 additions & 1 deletion python/geoengine_openapi_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
from geoengine_openapi_client.models.dataset_listing import DatasetListing
from geoengine_openapi_client.models.dataset_resource import DatasetResource
from geoengine_openapi_client.models.date_time import DateTime
from geoengine_openapi_client.models.date_time_parse_format import DateTimeParseFormat
from geoengine_openapi_client.models.derived_color import DerivedColor
from geoengine_openapi_client.models.derived_number import DerivedNumber
from geoengine_openapi_client.models.describe_coverage_request import DescribeCoverageRequest
Expand Down
1 change: 0 additions & 1 deletion python/geoengine_openapi_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
from geoengine_openapi_client.models.dataset_listing import DatasetListing
from geoengine_openapi_client.models.dataset_resource import DatasetResource
from geoengine_openapi_client.models.date_time import DateTime
from geoengine_openapi_client.models.date_time_parse_format import DateTimeParseFormat
from geoengine_openapi_client.models.derived_color import DerivedColor
from geoengine_openapi_client.models.derived_number import DerivedNumber
from geoengine_openapi_client.models.describe_coverage_request import DescribeCoverageRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@



from pydantic import BaseModel, Field
from geoengine_openapi_client.models.date_time_parse_format import DateTimeParseFormat
from pydantic import BaseModel, Field, StrictStr
from geoengine_openapi_client.models.time_reference import TimeReference

class GdalSourceTimePlaceholder(BaseModel):
"""
GdalSourceTimePlaceholder
"""
format: DateTimeParseFormat = Field(...)
format: StrictStr = Field(...)
reference: TimeReference = Field(...)
__properties = ["format", "reference"]

Expand Down Expand Up @@ -56,9 +55,6 @@ def to_dict(self):
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of format
if self.format:
_dict['format'] = self.format.to_dict()
return _dict

@classmethod
Expand All @@ -71,7 +67,7 @@ def from_dict(cls, obj: dict) -> GdalSourceTimePlaceholder:
return GdalSourceTimePlaceholder.parse_obj(obj)

_obj = GdalSourceTimePlaceholder.parse_obj({
"format": DateTimeParseFormat.from_dict(obj.get("format")) if obj.get("format") is not None else None,
"format": obj.get("format"),
"reference": obj.get("reference")
})
return _obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ def from_json(cls, json_str: str) -> OgrSourceDatasetTimeType:
return instance

# check if data type is `OgrSourceDatasetTimeTypeStartDuration`
if _data_type == "startDuration":
if _data_type == "start+duration":
instance.actual_instance = OgrSourceDatasetTimeTypeStartDuration.from_json(json_str)
return instance

# check if data type is `OgrSourceDatasetTimeTypeStartEnd`
if _data_type == "startEnd":
if _data_type == "start+end":
instance.actual_instance = OgrSourceDatasetTimeTypeStartEnd.from_json(json_str)
return instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class OgrSourceDatasetTimeTypeNone(BaseModel):
@validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in ('none', 'start', 'startEnd', 'startDuration'):
raise ValueError("must be one of enum values ('none', 'start', 'startEnd', 'startDuration')")
if value not in ('none', 'start', 'start+end', 'start+duration'):
raise ValueError("must be one of enum values ('none', 'start', 'start+end', 'start+duration')")
return value

class Config:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class OgrSourceDatasetTimeTypeStartDuration(BaseModel):
@validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in ('startDuration'):
raise ValueError("must be one of enum values ('startDuration')")
if value not in ('start+duration'):
raise ValueError("must be one of enum values ('start+duration')")
return value

class Config:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class OgrSourceDatasetTimeTypeStartEnd(BaseModel):
@validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in ('startEnd'):
raise ValueError("must be one of enum values ('startEnd')")
if value not in ('start+end'):
raise ValueError("must be one of enum values ('start+end')")
return value

class Config:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@


from pydantic import BaseModel, Field, StrictStr, validator
from geoengine_openapi_client.models.date_time_parse_format import DateTimeParseFormat

class OgrSourceTimeFormatCustom(BaseModel):
"""
OgrSourceTimeFormatCustom
"""
custom_format: DateTimeParseFormat = Field(..., alias="customFormat")
custom_format: StrictStr = Field(..., alias="customFormat")
format: StrictStr = Field(...)
__properties = ["customFormat", "format"]

Expand Down Expand Up @@ -62,9 +61,6 @@ def to_dict(self):
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of custom_format
if self.custom_format:
_dict['customFormat'] = self.custom_format.to_dict()
return _dict

@classmethod
Expand All @@ -77,7 +73,7 @@ def from_dict(cls, obj: dict) -> OgrSourceTimeFormatCustom:
return OgrSourceTimeFormatCustom.parse_obj(obj)

_obj = OgrSourceTimeFormatCustom.parse_obj({
"custom_format": DateTimeParseFormat.from_dict(obj.get("customFormat")) if obj.get("customFormat") is not None else None,
"custom_format": obj.get("customFormat"),
"format": obj.get("format")
})
return _obj
Expand Down
58 changes: 0 additions & 58 deletions python/test/test_date_time_parse_format.py

This file was deleted.

10 changes: 2 additions & 8 deletions python/test/test_gdal_meta_data_regular.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ def make_instance(self, include_optional) -> GdalMetaDataRegular:
step = 0, ),
time_placeholders = {
'key' : geoengine_openapi_client.models.gdal_source_time_placeholder.GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start', )
},
type = 'GdalMetaDataRegular'
Expand Down Expand Up @@ -150,10 +147,7 @@ def make_instance(self, include_optional) -> GdalMetaDataRegular:
step = 0, ),
time_placeholders = {
'key' : geoengine_openapi_client.models.gdal_source_time_placeholder.GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start', )
},
type = 'GdalMetaDataRegular',
Expand Down
10 changes: 2 additions & 8 deletions python/test/test_gdal_source_time_placeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ def make_instance(self, include_optional) -> GdalSourceTimePlaceholder:
model = GdalSourceTimePlaceholder() # noqa: E501
if include_optional:
return GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start'
)
else:
return GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start',
)
"""
Expand Down
10 changes: 2 additions & 8 deletions python/test/test_meta_data_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ def make_instance(self, include_optional) -> MetaDataDefinition:
step = 0, ),
time_placeholders = {
'key' : geoengine_openapi_client.models.gdal_source_time_placeholder.GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start', )
},
time = geoengine_openapi_client.models.time_interval.TimeInterval(
Expand Down Expand Up @@ -133,10 +130,7 @@ def make_instance(self, include_optional) -> MetaDataDefinition:
step = 0, ),
time_placeholders = {
'key' : geoengine_openapi_client.models.gdal_source_time_placeholder.GdalSourceTimePlaceholder(
format = geoengine_openapi_client.models.date_time_parse_format.DateTimeParseFormat(
fmt = '',
has_time = True,
has_tz = True, ),
format = '',
reference = 'start', )
},
band_offset = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeStartDurati
duration_field = '',
start_field = '',
start_format = None,
type = 'startDuration'
type = 'start+duration'
)
else:
return OgrSourceDatasetTimeTypeStartDuration(
duration_field = '',
start_field = '',
start_format = None,
type = 'startDuration',
type = 'start+duration',
)
"""

Expand Down
4 changes: 2 additions & 2 deletions python/test/test_ogr_source_dataset_time_type_start_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeStartEnd:
end_format = None,
start_field = '',
start_format = None,
type = 'startEnd'
type = 'start+end'
)
else:
return OgrSourceDatasetTimeTypeStartEnd(
end_field = '',
end_format = None,
start_field = '',
start_format = None,
type = 'startEnd',
type = 'start+end',
)
"""

Expand Down
Loading

0 comments on commit f9ab4a6

Please sign in to comment.