-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d0becc
commit f34bd91
Showing
24 changed files
with
1,035 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
76
python/geoengine_openapi_client/models/update_layer_collection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.