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 29, 2024
1 parent 9d0becc commit f34bd91
Show file tree
Hide file tree
Showing 24 changed files with 1,035 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .generation/input/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9026,6 +9026,72 @@
}
}
},
"UpdateLayer": {
"type": "object",
"required": [
"name",
"description",
"workflow"
],
"properties": {
"description": {
"type": "string",
"example": "Example layer description"
},
"metadata": {
"type": "object",
"description": "metadata used for loading the data",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string",
"example": "Example Layer"
},
"properties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Property"
},
"description": "properties, for instance, to be rendered in the UI"
},
"symbology": {
"allOf": [
{
"$ref": "#/components/schemas/Symbology"
}
],
"nullable": true
},
"workflow": {
"$ref": "#/components/schemas/Workflow"
}
}
},
"UpdateLayerCollection": {
"type": "object",
"required": [
"name",
"description"
],
"properties": {
"description": {
"type": "string",
"example": "A description for an example collection"
},
"name": {
"type": "string",
"example": "Example Collection"
},
"properties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Property"
}
}
}
},
"UpdateProject": {
"type": "object",
"required": [
Expand Down
6 changes: 6 additions & 0 deletions python/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ docs/TypedVectorResultDescriptor.md
docs/UnitlessMeasurement.md
docs/UnixTimeStampType.md
docs/UpdateDataset.md
docs/UpdateLayer.md
docs/UpdateLayerCollection.md
docs/UpdateProject.md
docs/UpdateQuota.md
docs/UploadFileLayersResponse.md
Expand Down Expand Up @@ -449,6 +451,8 @@ geoengine_openapi_client/models/typed_vector_result_descriptor.py
geoengine_openapi_client/models/unitless_measurement.py
geoengine_openapi_client/models/unix_time_stamp_type.py
geoengine_openapi_client/models/update_dataset.py
geoengine_openapi_client/models/update_layer.py
geoengine_openapi_client/models/update_layer_collection.py
geoengine_openapi_client/models/update_project.py
geoengine_openapi_client/models/update_quota.py
geoengine_openapi_client/models/upload_file_layers_response.py
Expand Down Expand Up @@ -686,6 +690,8 @@ test/test_typed_vector_result_descriptor.py
test/test_unitless_measurement.py
test/test_unix_time_stamp_type.py
test/test_update_dataset.py
test/test_update_layer.py
test/test_update_layer_collection.py
test/test_update_project.py
test/test_update_quota.py
test/test_upload_file_layers_response.py
Expand Down
2 changes: 2 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ Class | Method | HTTP request | Description
- [UnitlessMeasurement](docs/UnitlessMeasurement.md)
- [UnixTimeStampType](docs/UnixTimeStampType.md)
- [UpdateDataset](docs/UpdateDataset.md)
- [UpdateLayer](docs/UpdateLayer.md)
- [UpdateLayerCollection](docs/UpdateLayerCollection.md)
- [UpdateProject](docs/UpdateProject.md)
- [UpdateQuota](docs/UpdateQuota.md)
- [UploadFileLayersResponse](docs/UploadFileLayersResponse.md)
Expand Down
2 changes: 2 additions & 0 deletions python/geoengine_openapi_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
from geoengine_openapi_client.models.unitless_measurement import UnitlessMeasurement
from geoengine_openapi_client.models.unix_time_stamp_type import UnixTimeStampType
from geoengine_openapi_client.models.update_dataset import UpdateDataset
from geoengine_openapi_client.models.update_layer import UpdateLayer
from geoengine_openapi_client.models.update_layer_collection import UpdateLayerCollection
from geoengine_openapi_client.models.update_project import UpdateProject
from geoengine_openapi_client.models.update_quota import UpdateQuota
from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse
Expand Down
2 changes: 2 additions & 0 deletions python/geoengine_openapi_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@
from geoengine_openapi_client.models.unitless_measurement import UnitlessMeasurement
from geoengine_openapi_client.models.unix_time_stamp_type import UnixTimeStampType
from geoengine_openapi_client.models.update_dataset import UpdateDataset
from geoengine_openapi_client.models.update_layer import UpdateLayer
from geoengine_openapi_client.models.update_layer_collection import UpdateLayerCollection
from geoengine_openapi_client.models.update_project import UpdateProject
from geoengine_openapi_client.models.update_quota import UpdateQuota
from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse
Expand Down
95 changes: 95 additions & 0 deletions python/geoengine_openapi_client/models/update_layer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# coding: utf-8

"""
Geo Engine Pro API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 0.8.0
Contact: [email protected]
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 typing import Dict, List, Optional
from pydantic import BaseModel, Field, StrictStr, conlist
from geoengine_openapi_client.models.symbology import Symbology
from geoengine_openapi_client.models.workflow import Workflow

class UpdateLayer(BaseModel):
"""
UpdateLayer
"""
description: StrictStr = Field(...)
metadata: Optional[Dict[str, StrictStr]] = Field(None, description="metadata used for loading the data")
name: StrictStr = Field(...)
properties: Optional[conlist(conlist(StrictStr, max_items=2, min_items=2))] = Field(None, description="properties, for instance, to be rendered in the UI")
symbology: Optional[Symbology] = None
workflow: Workflow = Field(...)
__properties = ["description", "metadata", "name", "properties", "symbology", "workflow"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True

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

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())

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

def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of symbology
if self.symbology:
_dict['symbology'] = self.symbology.to_dict()
# override the default output from pydantic by calling `to_dict()` of workflow
if self.workflow:
_dict['workflow'] = self.workflow.to_dict()
# set to None if symbology (nullable) is None
# and __fields_set__ contains the field
if self.symbology is None and "symbology" in self.__fields_set__:
_dict['symbology'] = None

return _dict

@classmethod
def from_dict(cls, obj: dict) -> UpdateLayer:
"""Create an instance of UpdateLayer from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return UpdateLayer.parse_obj(obj)

_obj = UpdateLayer.parse_obj({
"description": obj.get("description"),
"metadata": obj.get("metadata"),
"name": obj.get("name"),
"properties": obj.get("properties"),
"symbology": Symbology.from_dict(obj.get("symbology")) if obj.get("symbology") is not None else None,
"workflow": Workflow.from_dict(obj.get("workflow")) if obj.get("workflow") is not None else None
})
return _obj


76 changes: 76 additions & 0 deletions python/geoengine_openapi_client/models/update_layer_collection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding: utf-8

"""
Geo Engine Pro API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 0.8.0
Contact: [email protected]
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 typing import List, Optional
from pydantic import BaseModel, Field, StrictStr, conlist

class UpdateLayerCollection(BaseModel):
"""
UpdateLayerCollection
"""
description: StrictStr = Field(...)
name: StrictStr = Field(...)
properties: Optional[conlist(conlist(StrictStr, max_items=2, min_items=2))] = None
__properties = ["description", "name", "properties"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True

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

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())

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

def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
return _dict

@classmethod
def from_dict(cls, obj: dict) -> UpdateLayerCollection:
"""Create an instance of UpdateLayerCollection from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return UpdateLayerCollection.parse_obj(obj)

_obj = UpdateLayerCollection.parse_obj({
"description": obj.get("description"),
"name": obj.get("name"),
"properties": obj.get("properties")
})
return _obj


67 changes: 67 additions & 0 deletions python/test/test_update_layer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding: utf-8

"""
Geo Engine Pro API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 0.8.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


import unittest
import datetime

from geoengine_openapi_client.models.update_layer import UpdateLayer # noqa: E501

class TestUpdateLayer(unittest.TestCase):
"""UpdateLayer unit test stubs"""

def setUp(self):
pass

def tearDown(self):
pass

def make_instance(self, include_optional) -> UpdateLayer:
"""Test UpdateLayer
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `UpdateLayer`
"""
model = UpdateLayer() # noqa: E501
if include_optional:
return UpdateLayer(
description = 'Example layer description',
metadata = {
'key' : ''
},
name = 'Example Layer',
properties = [
[
''
]
],
symbology = None,
workflow = None
)
else:
return UpdateLayer(
description = 'Example layer description',
name = 'Example Layer',
workflow = None,
)
"""

def testUpdateLayer(self):
"""Test UpdateLayer"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)

if __name__ == '__main__':
unittest.main()
Loading

0 comments on commit f34bd91

Please sign in to comment.